Fallout 2 mod FO2 Engine Tweaks (Sfall)

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

  1. zenbitz

    zenbitz First time out of the vault

    84
    Dec 18, 2008
    A quick and dirty way to do this might be to just double the AP requirements for aimed shots. And cap the small guns skill at 100.
     
  2. SkynetV4

    SkynetV4 Mildly Dipped

    589
    Jan 25, 2005
    I have a question regarding the Engine Tweaks. I'm using version 1.37 with the Megamod 1.34. Its running almost perfectly at 1680 x 1050. The only problem is that some weather effects appear as yellow square rectangles (rain) or as a constant, semi-transparent grid of black and white squares.

    I'm using the Global.fx file from the Megamod Wiki.

    I would like either to disable weather effects if I can't get them to render properly or get them to render properly.

    I know its the weather efffects and not something else because the problem can be fixed by quicksaving and quickloading the same map (which resets the weather variables, I guess).

    Any help would be greatly appreciated.
     
  3. Glovz

    Glovz Vault Dweller
    Modder

    736
    Sep 16, 2005
    Any thoughts Timeslip?
     
  4. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    Yup, I managed to find that one. I've just uploaded 1.40, and it lets you set the hit modifiers in the ini. There's also get_bodypart_hit_modifier and set_bodypart_hit_modifier script functions if you want to make a perk that increases your chance of scoring headshots or something.

    I don't really have any suggestions for why it's not working, but if you want to disable it just find and remove the relevant script from fallouts script folder. In my original weather mod it was called 'gltsrain.int', but it may well have been changed in the megamod.

    I've got more chance of being able to play with that than being able to fix corpses blocking weapons fire. (I really wish I could fix corpses... It seriously annoys me too. :() I know where the critical hit code lives, and where fallout stores which bodypart was hit. Going from that to causing a specific effect will be the hard bit...

    And one from falloutnow.de since I don't have an account over there.
    Not sure where that came from... What'd I do to deserve personal attacks? :o
     
  5. Luigibacsi

    Luigibacsi First time out of the vault

    12
    Jan 18, 2009
    Hi Timeslip!
    Would it be possible to fix the "sound or endings problem" with your patch?
     
  6. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    The usual fix is to turn sound hardware acceleration off, but I'm not aware of any way to do that from inside the application using sound.

    Depending on what causes it, turning eax on might help. (Or it might make it worse, or more likely wont do anything.) Leave the default environment at 1 so that it doesn't have any effect on the sound.
     
  7. Josan12

    Josan12 Vault Senior Citizen

    Oct 15, 2007
    How do you do it, Timeslip!? :clap: You are the man/woman! I thought we'd lost your skills to FO3 modding for good :)
     
  8. Dude101

    Dude101 Vault Fossil
    Modder

    Aug 3, 2005
  9. Alray

    Alray First time out of the vault

    50
    May 10, 2007
    >>The possibility to link World Map travel speed and Current inventory weight

    This is quite easy :) But just like mod to F2.
     
  10. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    IMO the only thing that still needs to be done is making worldmap travelspeed independent of processor speed. Or is this already done/ not possible to do?
     
  11. Alray

    Alray First time out of the vault

    50
    May 10, 2007
    I'm working on this. I'll totaly rewrite slow-down code.

    P.S. And sorry for my bad English :?
     
  12. Josan12

    Josan12 Vault Senior Citizen

    Oct 15, 2007
    This is something i've always wanted !!! - but i don't understand - are you saying you've made it possible? If so, please tell me how!
     
  13. Helios

    Helios First time out of the vault

    41
    Apr 2, 2003
  14. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    Right, lets work my way through some of them.

    sfall for fallout 1 doesn't do anything beyond the speed thing, mouse wheel and graphics mode, so that's out. For fallout 2 sfall has been able to do that since 1.38; look at the set_hp_per_level_mod script function.

    Is that not possible with regular scripting? Using set_critter_extra_stat to alter base AC when you wear/remove armour should be sufficient.

    I don't normally say that I'll do things before I've done them in case they turn out to not be possible, but that's one case where I think I can say with some certainty that I can do it. Will try and squeeze it into 1.41.

    Edit: Done, tested and working. :)

    Done, tested and working. Will be in 1.41. Two cavets; you're limited to 22 critter types, so any unique tables will take some fancy scripting. (No reason why you can't do it; you just need to recycle the table of a critter type that doesn't exist on the same map, and reset it again when the player leaves.) Secondly, I haven't fixed the dropped weapon effect. I'll take another look at it before 1.41, but don't hold your breath.

    sfall expects bits of code and data to be in specific places in memory, so it requires a specific version of the exe. If the teamx patch doesn't work with the exe that sfall works with, it'll be a lot of work to port it. (Although not anywhere near as much work as it would be to port the fallout 2 version, at least.) Is there any reason why the patch needs a different exe?


    And the rest I either have no clue how to do yet. They may happen at some point in the future, but like usual no promises until after I've done them. :P

    oh, I kind of skipped those pages because of the flame war. Didn't realise there was something useful there. :oops: Will go back and reread.
     
  15. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    A 1.41 beta is up. (Along with sslc here.) Three new features this time.

    Critical tables
    Can be overridden either by script using the new set/get/reset_critical_table functions, and/or by supplying a CriticalOverrides.ini file. In either case OverrideCriticalTable in ddraw.ini needs to be set to 1. (Off by default because it noticeably lengthens loading times.)

    If you're using an ini to override, the syntax is to have one section for each critter/bodypart/critical level block, in the format [c_<critter id>_<bodypart>_<critical level>] (e.g. [c_00_0_0] for the lowest level of critical on a male targeted at the head.) That section can contain any of 'DamageMultiplier', 'EffectFlags', 'StatCheck', 'StatMod', 'FailureEffect', 'Message' or 'FailMessage' keys. Any not present just use the default values.

    e.g. a file containing
    Code:
    [c_01_0_0]
    DamageMultiplier=100
    [c_01_0_1]
    DamageMultiplier=100
    [c_01_0_2]
    DamageMultiplier=100
    [c_01_0_3]
    DamageMultiplier=100
    [c_01_0_4]
    DamageMultiplier=100
    [c_01_0_5]
    DamageMultiplier=100
    Would cause all critical hits to the head of a female to do silly amounts of damage.

    ac bonus from unspent ap
    The bonuses are controlled by script, and the bonuses can be set for regular ap and h2h evade separately, in fractions of 1/4. In addition, the h2h evade hardcoded effect is modified to support multiple levels. (The perk itself still limits you to 1 level, but if a mod changes that then it'll now work, rather than extra levels above 1 having no effect.)

    e.g. if you used 'set_unspent_ap_bonus(6); set_unspent_ap_perk_bonus(2);', and the player ended the turn with 2 ap left, they would get 3 extra ac without any levels of h2h evade, 4 with 1 level and 5 with 2.

    The default values are 4 for both, i.e. 1 point of ac for each spare point of ap, doubled if you have h2h evade.

    hook scripts
    This is the reason it's beta; there's a lot of potential for me to have broken something here. I'll quote the readme to save typing it out again:

    The only one in there atm is for the hit chance, which would enable you to write a script that did something like scaling how the hit chance drops with distance so that eye's get harder to hit faster than the torso, or something similar.

    As a quick example script, compiling this and saving it as hs_tohit.int will simply increase the chances of everything hitting anything by 20%
    Code:
    procedure start;
    
    procedure start begin
    	if(init_hook) then begin
    
    	end else begin
    		set_sfall_return(get_sfall_arg + 20);
    	end
    end
    Not actually a very good script, because it can result in chances over 100; the script is run after the normal hit chance is capped at 95.

    I'll get some extras in for 1.41 proper, if anyone has any suggestions for hardcoded sfall effects they'd like to be able to script.
     
  16. Jordan

    Jordan It Wandered In From the Wastes

    106
    May 8, 2008
    Hi Timeslip

    get_ini_setting(char* setting)

    Sample

    get_ini_setting("config.ini|acklint|item")

    [ACKLINT]
    Item=6

    Code

    add_obj_to_inven(dude_obj, create_object_sid(get_ini_setting("config.ini|ACKLINT|Item"), -1, -1, -1));

    This works

    You can add one function?

    get_ini_string(char* setting)
    Sample

    get_ini_string("config.ini|Dlg|WinImg")

    [Dlg]
    WinImg=pcx/win_dlg.pcx

    call Proc_Create_Window("Win_Dlg", 130, 0, 414, 480, get_ini_string("config.ini|Dlg|WinImg"));
     
  17. Timeslip

    Timeslip Water Chip? Been There, Done That
    Modder

    921
    Aug 15, 2007
    I've just updated the 1.41 beta. There's now a new hook script that gets fired after fallout has decided if an attack hits, but before it does anything about it, and lets you override if the attack is successful, the bodypart that gets hit and the target. If you want to make a mod that makes attacks occasionally hit the wrong bodypart or similar, that's the place to do it.

    As a couple more examples, save these as hs_afterhitroll.int

    Code:
    //With this, no attack will ever hit
    procedure start;
    
    procedure start begin
    	if(init_hook) then begin
    	end else begin
    		set_sfall_return(1);
    	end
    end
    Code:
    //All attacks will hit the head, regardless of where they're aimed
    procedure start;
    
    procedure start begin
    	if(init_hook) then begin
    	end else begin
    		set_sfall_return(get_sfall_arg);
    		set_sfall_return(0);
    	end
    end
    ok. It's included in the new 1.41b I just posted. :)
     
  18. Alray

    Alray First time out of the vault

    50
    May 10, 2007
    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.
    I hope you understand my broken English :D

    Code:
    	int number_patch_loop=GetPrivateProfileInt("Misc", "number_patch_loop", -1, ini);
    	if(number_patch_loop>-1) {		
    		// Disable check
    		SafeWrite8(0x0444363, 0xE9);
    	    SafeWrite32(0x0444364, 0xFFFFFFB9);
    		// New loop count
            SafeWrite32(0x0444357, number_patch_loop);
    		// Change step from 2 to 1
    		SafeWrite8(0x0444354, 0x90);
    		
    	}
    
     
  19. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    Alray, your english is pretty good. ;)

    I got this idea too a while ago but I thought it wasn't possible to realize.
     
  20. Alray

    Alray First time out of the vault

    50
    May 10, 2007
    I also think so :) But I test everything and it work fine :) But i made not enought tests. Maybe 30 or so... Can you test this?

    http://outlive.alfamoon.com/top_secret.html

    Here an old version of sfall but with new function