Fallout 2 mod FO2 Engine Tweaks (Sfall)

Alray said:
Hi, Timeslip.

I wrote some new stuff for sfall. Maybe you know, that Fallout load his files for some order: first of all look for files patch%3.dat (from patch000.dat till patch999.dat), then master_patches (critter) and master_dat(critter). This work well, but we have one trouble - in original when fallout find first patch%3.dat it stop looking for another one. This is very bad for modders. When they write some mods they must place patches to data folder (and this can give a lot of bugs). If just we can fix this - all mods can be easier to "distribute". Mod will distributing like: patch000.dat, patch001.dat and so on.
And I finally fix this problem (I work on it for a long time :) ) Also I change range wich Fallout looking for patch file (not 000-999, new range in misc section in ini - number_patch_loop=15). And also I change step of this loop.
Thanks. I had no idea how to do that when Cubik2k asked for it. It'll certainly make mod patches easier. :)

One question though; if it looks for patchxxx.dat before the master files, then presumably files read first have priority over files read later? In that case, for patch001.dat to be a patch for a mod contained in patch000.dat, would the loop need to be reversed to start at path999.dat (or whatever number_patch_loop was set to) and work down to 000? I've never modified .dat files before, so I'm not sure what overrides what, so sorry if that's a silly question.

Lexx said:
Alray, your english is pretty good. ;)
Indeed. It's certainly far better than my russian. :P
 
Normally it should be the higher number overwrites the number before. That means, patch002.dat overwrites the stuff in the patch001.dat, patch003.dat overwrites the stuff in the patch001.dat and patch002.dat and so on.
 
Yes, maybe I said wrong. First of all fallout look at master_dat. Then master_patches and finally at patch%3.dat. In this way if same patches had the same files - game use the last one patch. If we have file acklint.int in patch000.dat and patch001.dat game will use it from patch001.dat
 
Since no-ones complained about 1.41 being horribly broken, it's replaced 1.40 as the latest version. All the normal downloads are now for 1.41c.

Alray said:
Yes, maybe I said wrong. First of all fallout look at master_dat. Then master_patches and finally at patch%3.dat. In this way if same patches had the same files - game use the last one patch. If we have file acklint.int in patch000.dat and patch001.dat game will use it from patch001.dat
ok, just me misunderstanding then. I've added it to 1.41. Thanks again. :)

I only made one small change; I've switched the name of the ini option to NumberPatchLoop to match the naming scheme of the rest of the ini. I've put it under the PatchFile line, since the two are related.
 
Timeslip

ok. It's included in the new 1.41b I just posted. Smile

Thank you very much!

Functions

set_sfall_global (string varname, int/float value)
get_sfall_global_int (string varname)
get_sfall_global_float (string varname)
get_ini_setting (char* setting)
get_ini_string (char* setting)

Support a word from 8 letters. Whether probably to increase quantity of letters?
 
Edit: Are there any maths scripting functions? I want to use a square root, but can't see how to do it...
Edit2: Looks like not. Ah well, easy enough to add some to sfall.

Jordan said:
Functions

set_sfall_global (string varname, int/float value)
get_sfall_global_int (string varname)
get_sfall_global_float (string varname)
get_ini_setting (char* setting)
get_ini_string (char* setting)

Support a word from 8 letters. Whether probably to increase quantity of letters?
The xxx_sfall_globall_xxx functions require a 8 letter string as the varname because internally it gets treated as a 64 bit integer to make lookups faster. I'd have to use a hash dictionary otherwise, which I couldn't do in the win9x version.

The get_ini_xxx functions are limited to 63 characters, not 8, (Unless fallout's scripting language creates any lower limits, anyway.) but I can easily increase that if needed. There's also an 18 char limit on the file name and 8 char limit on the section name, which I suppose seem rather low... I'll increase those two for next time.
 
I use compile.exe 1.41b.

Script

procedure start;


procedure start begin

if (get_active_hand == 0) then begin
end

end


Log

Microsoft Windows XP [Версия 5.1.2600]
(С) Корпорация Майкрософт, 1985-2001.

E:\CD\Евгений\fallout\int2ssl\7>1

E:\CD\Евгений\fallout\int2ssl\7>for %f in (*.ssl) do compile.exe %f

E:\CD\Евгений\fallout\int2ssl\7>compile.exe 1.ssl
Startreck scripting language compiler (Fallout 2 edition)

Compiling 1.ssl
1.ssl(6): Error! Undefined symbol get_active_hand


*** THERE WERE ERRORS (1 of them)

E:\CD\Евгений\fallout\int2ssl\7>[/quote]
 
Jordan said:
Compiling 1.ssl
1.ssl(6): Error! Undefined symbol get_active_hand
Oh, that's annoying... Because in Ray's original version it was called active_hand rather than get_active_hand I included both names in sslc to try and keep compatibility with any mods that had been written before I included it in sfall. It seems that sslc didn't like that though, and the second name overwrote the first one, so only active_hand works.

Use active_hand instead of get_active_hand; since that's the name that's been working all this time there's no point in changing it now. I'll change the readme to match for next version.
 
I wish i understood any of what you guys are talking about 'cos it sounds great!

*goes back to scripting 101*

@ Timeslip: I would still really really really love to hear weather SFX. Would it be possible to add some kind of reference in the weather mod that allows a .wav to be 'plugged in' somehow?? (so that a programmin retard like me can do it?)

Also - the storm shader really needs to be worked on (it looks awful) but i don't know how :(
 
DDraw Speed Modifier Doesn't work

Does anyone have any problems with the speed modifier? I have these settings:

[Speed]
;Set to 0 to disable everything in this section
Enable=1

;The speeds corrisponding to each slot in percent. (i.e. 100 is normal speed)
SpeedMulti0=50
SpeedMulti1=100
SpeedMulti2=150
SpeedMulti3=200
SpeedMulti4=300
SpeedMulti5=500
SpeedMulti6=1000
SpeedMulti7=100
SpeedMulti8=100
SpeedMulti9=100

;The initial speed at game startup
SpeedMultiInitial=500

I am running the Fallout Restoration Project with the new DDraw and I have made the changes to get Fallout to run, but the speed settings don't seem to make a difference.

Any thoughts? Not sure what otehr configuration settings I need to post. Thanks
 
Josan12 said:
I would still really really really love to hear weather SFX. Would it be possible to add some kind of reference in the weather mod that allows a .wav to be 'plugged in' somehow?? (so that a programmin retard like me can do it?)

Also - the storm shader really needs to be worked on (it looks awful) but i don't know how :(
For sfx, just add them in like normal and play_sfx them as appropriate. There's no need to do anything special there, except maybe to increase the number of allowed concurrent sfx option in ddraw.ini.

Not sure what you can do about the shaders; as you can tell from the originals, it's not exactly my strong point either. :P

Isn't there a weather mod included in the megamod? I very much doubt anyone used mine as unfinished as it was, so it might be worth looking at what changes were made there, assuming it was my weather mod that was included in the first place.

chazhung said:
Does anyone have any problems with the speed modifier? I have these settings:

<snip>
Those settings work fine here with 1.41. Are you fps limited? (i.e. if you're using the high resolution patch and have ddraw in dx9 mode it's going to struggle to go any faster.) If you're using dx9 mode and have vwait forced on in the driver control panel it could have a similar effect.
 
Timeslip

And whether it is possible to increase the length of the file name? The maximum length of 8 characters. I would particularly like to enlarge the names of scripts.
 
Timeslip said:
For sfx, just add them in like normal and play_sfx them as appropriate. There's no need to do anything special there, except maybe to increase the number of allowed concurrent sfx option in ddraw.ini.

Ok, thanks - i will give this a try and take a look at what MIB88 did with it for the MM.

Can i make another request? :)

Did you see this thread?:

http://www.nma-fallout.com/forum/viewtopic.php?t=49418

I would like to make 'drinking animations' for Nuka-cola, booze etc, but it seems drugs (all drink items are drugs) can't use scripts due to the fact that they are set only to use the 'use on' flag. Therefore it doesn't seem to be possible to activate the animations and SFX via script. Can you remedy this??
 
Jordan said:
And whether it is possible to increase the length of the file name? The maximum length of 8 characters. I would particularly like to enlarge the names of scripts.
Not on any normal scripts or other data files. I don't know where the limits are enforced.

The only exception is sfall global scripts, which don't really have a limit on their file name.

Josan12 said:
I would like to make 'drinking animations' for Nuka-cola, booze etc, but it seems drugs (all drink items are drugs) can't use scripts due to the fact that they are set only to use the 'use on' flag. Therefore it doesn't seem to be possible to activate the animations and SFX via script. Can you remedy this??
You can look up my get drunk mod; that had a rather messy way of scripting drink, although it was really only targeted at the player. Not sure how you could extend that to all npcs, unless there's some way of looping over all npcs on a map.
 
Timeslip said:
You can look up my get drunk mod; that had a rather messy way of scripting drink, although it was really only targeted at the player. Not sure how you could extend that to all npcs, unless there's some way of looping over all npcs on a map.

Well, here's part of the glbooze.ssl you wrote. As usual i don't understand at least half of the script:

Code:
procedure start begin
	variable new_pe;
	variable new_booze;
	variable drunk_count;
	if (metarule(22,0)) then return;
	if (game_loaded) then begin
		if(not graphics_funcs_available) then begin
			display_msg("ERROR: You must set sfall to use graphics mode 4 or 5 to use this mod");
			return;
		end else begin
			//new_pe:=create_object_sid(125, 0, 0, -1);
			//add_mult_objs_to_inven(dude_obj, new_pe, 10);
			perception:=get_pc_extra_stat(1);
			boozes:=obj_is_carrying_obj_pid(dude_obj, 125);
			set_global_script_repeat(25);
			set_global_script_repeat(-1);
			shader1:=load_shader("booze1.fx");
			shader2:=load_shader("booze2.fx");
			shader3:=load_shader("booze3.fx");
			shader4:=load_shader("booze4.fx");
			drunk_level:=0;
			next_reduction:=0;
			//display_msg("Init: " + perception + ", " + boozes);
		end
	end else begin
		new_pe:=get_pc_extra_stat(1);
		new_booze:=obj_is_carrying_obj_pid(dude_obj, 125);
		if( (perception != new_pe) or (boozes != new_booze) ) then begin
			//display_msg("var change: " + perception + ", " + boozes + " -> " + new_pe + ", " + new_booze);
			if ( (perception > new_pe) and (boozes > new_booze) ) then begin
				if ( (perception - new_pe) < (boozes - new_booze) ) then begin
					drunk_count:=perception - new_pe;
				end else begin
					drunk_count:=boozes - new_booze;

So where would i put an animation and SFX sequence?

Also - just to avoid misunderstanding, i only want this to work for the player NOT npc's (cos then i'd have a shit-ton more animations to make). i simply want the game to display an animation and an SFX when the player uses a drug (via 'use-on', not 'use') And i also want it work for all drinks not just booze.

So - is it not possible to make the game call a standard script (rather than an sfall script) when using the 'use on' function? Is it hardcoded not to or something?
 
Josan12 said:
Well, here's part of the glbooze.ssl you wrote. As usual i don't understand at least half of the script:
It works by checking the number of boozes in the players inventory as well as their perception each frame. If the perception drops in the same frame that the number of boozes drops, the script concludes that the player has drunk it (rather than dropping/selling it) and increases the how-drunk-are-you counter. Like I said, it's messy, but it was the best way I could think of to do it without attaching a script to the booze itself. (Which I couldn't do at the time because for compatibility reasons with another mod I was playing through, rather than because I tried to script the booze itself and failed.)

You can use a similar setup for each drink type, but one problem with this method is that it's not going to work with nuka cola, which has no detectable effect on the player.

Josan12 said:
So where would i put an animation and SFX sequence?
Inside the 'if ( (perception > new_pe) and (boozes > new_booze) ) then begin' block.

Josan12 said:
So - is it not possible to make the game call a standard script (rather than an sfall script) when using the 'use on' function? Is it hardcoded not to or something?
No idea. I don't actually know much about standard scripting. I'm better at knowing what sfall can do. :P There may well be an easier way to do it without fiddling around with sfall, but I'm not the person to ask if so. (Like I said, I didn't even try to do it by scripting the booze.)
 
1.42 is half up; it's just a quick update, because I'm going to be heading off to fomm again so wont be around for a while and may as well release what I have. There's some new maths scripting functions, and I got another one of the wiki requests done in the way of a new hookscript that lets you alter any ap cost calculation. (Sort of; I haven't actually figured out which flags correspond to which actions yet, so it'll take a bit of trial and error to change anything specific. :oops:)

On the add_button/other bits of ui trickery front, is there anything that actually needs adding to sfall? The existing functions seem to have everything covered... The only thing I did add was a slightly stronger set_palette that immediately writes out the new palette, because the existing function tended to not take effect for a while depending on where you used it. I was playing around with an add_button variant that let you use the existing frm's rather than needing pcx's, but it seemed to be more trouble than it was worth...
 
Timeslip

Elevators with the signatures do not work correctly.

Sample.

Code:
[1]
Image=143 - The main type of 

ID1=13
Elevation1=0
Tile1=20502

ID2=14
Elevation2=0
Tile2=14912

You need to add
Caption=150 - The captions to the buttons

Description lifts
http://translate.google.ru/translate?u=http://teamx.ru/node/135&sl=ru&tl=en&hl=en&ie=UTF-8

My patcher

[Lift_Number_1]
Main_Frm_Number=143 The main type of
Left_Frm_Number=150 The captions to the buttons
Button_Count=2

Button1_Map=13
Button1_Elevation=0
Button1_Tile=20502

Button2_Map=14
Button2_Elevation=0
Button2_Tile=14912
 
Hey Timeslip,

I have another request for you if i may:

Did you ever notice how many of the game 'idle' animations show the player reloading his/her weapon?? Several folk here on NMA have commented that it seems a bit dumb that when the player reloads the game does nothing other than play an SFX, especially when a bunch of reload animations are already there, in-game and ready to use. So..... would it be possible for you to find the code that makes the game play the 'reload' sfx and make the game play those animations aswell?

In case you didn't already know the sfx file names are in this format:

Example: WR#1XXX1

WR (weapon reload) #(weapon sfx code from the proto) 1 (erm .. not sure what this means) XXX (blank) 1 (weapon atack type i think)

The reload animations are:

XXXXXXJA, IA, KA etc etc

But i'm sure you know all this already ;)

So to sum up - the intention is to get the game to play the weapon 'idle' animations when it plays the 'reload' sfx.

Whaddya think?
 
As you know, Fall load text-data from msg-files. But I saw, that engine load msg files ones per map. If we start game, talk with somebody, then from widows change current msg-file, fall will reload it just next time, when you enter the map. The same with msg from text\english\game folder. If you try work with game from outside (for example we trying write client-server for Fallout) you can import data to game by msg-files. With this small change fall will reload msg-files each time when they calls.
Oh, I hope you understand what I said :))) It's quite difficult to explain :)

0x96F8A
original: 000F85A500
new: FF7400EB02
 
Back
Top