Fallout 2 mod FO2 Engine Tweaks (Sfall)

Discussion in 'Fallout General Modding' started by Dude101, Jul 30, 2007.

  1. Timeslip

    Timeslip Water Chip? Been There, Done That

    Aug 15, 2007
    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.

    Indeed. It's certainly far better than my russian. :P
  2. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    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.
  3. Alray

    Alray First time out of the vault

    May 10, 2007
    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
  4. Timeslip

    Timeslip Water Chip? Been There, Done That

    Aug 15, 2007
    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.

    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.
  5. Jordan

    Jordan It Wandered In From the Wastes

    May 8, 2008

    Thank you very much!


    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?
  6. Timeslip

    Timeslip Water Chip? Been There, Done That

    Aug 15, 2007
    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.

    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.
  7. Jordan

    Jordan It Wandered In From the Wastes

    May 8, 2008
    I use compile.exe 1.41b.


    procedure start;

    procedure start begin

    if (get_active_hand == 0) then begin



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


    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)

  8. Timeslip

    Timeslip Water Chip? Been There, Done That

    Aug 15, 2007
    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.
  9. Josan12

    Josan12 Vault Senior Citizen

    Oct 15, 2007
    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 :(
  10. chazhung

    chazhung First time out of the vault

    Feb 21, 2009
    DDraw Speed Modifier Doesn't work

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

    ;Set to 0 to disable everything in this section

    ;The speeds corrisponding to each slot in percent. (i.e. 100 is normal speed)

    ;The initial speed at game startup

    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
  11. Timeslip

    Timeslip Water Chip? Been There, Done That

    Aug 15, 2007
    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.

    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.
  12. Jordan

    Jordan It Wandered In From the Wastes

    May 8, 2008

    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.
  13. Josan12

    Josan12 Vault Senior Citizen

    Oct 15, 2007
    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?:


    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??
  14. Timeslip

    Timeslip Water Chip? Been There, Done That

    Aug 15, 2007
    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.

    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.
  15. Josan12

    Josan12 Vault Senior Citizen

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

    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");
    		end else begin
    			//new_pe:=create_object_sid(125, 0, 0, -1);
    			//add_mult_objs_to_inven(dude_obj, new_pe, 10);
    			boozes:=obj_is_carrying_obj_pid(dude_obj, 125);
    			//display_msg("Init: " + perception + ", " + boozes);
    	end else begin
    		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?
  16. Timeslip

    Timeslip Water Chip? Been There, Done That

    Aug 15, 2007
    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.

    Inside the 'if ( (perception > new_pe) and (boozes > new_booze) ) then begin' block.

    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.)
  17. Timeslip

    Timeslip Water Chip? Been There, Done That

    Aug 15, 2007
    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...
  18. Jordan

    Jordan It Wandered In From the Wastes

    May 8, 2008

    Elevators with the signatures do not work correctly.


    Image=143 - The main type of 
    You need to add
    Caption=150 - The captions to the buttons

    Description lifts

    My patcher

    Main_Frm_Number=143 The main type of
    Left_Frm_Number=150 The captions to the buttons


  19. Josan12

    Josan12 Vault Senior Citizen

    Oct 15, 2007
    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?
  20. Alray

    Alray First time out of the vault

    May 10, 2007
    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 :)

    original: 000F85A500
    new: FF7400EB02
    • [Like] [Like] x 1