Fallout 2 mod FO2 Engine Tweaks (Sfall)

Code:
critter_list := list_begin(LIST_CRITTERS);
I do not quite understand, do you give perks for each the critters on the map?
Maybe you need to use function party_member_list_critters?
Well, that's just in case some people using party control on critters other than party members. (controlMode=1)
this code will check the perks only when starting or loading the game)
Yes, I already mentioned that under the code.
 
Last edited:
sfall 4.0 and 3.8.5 are released on SourceForge, along with their respective modders packs and win2k version (3.8.5 only).
Changelog said:
v4.0
>The build environment is now Visual Studio 2015, and Win XP SP2 and Win 2000 are no longer supported
>Extensive code reorganizing/rewrite was made in the effort to tidy up sfall code base accumulated over the years and make it easier to read, understand, and extend. Main code was split into separate "modules". Code for interacting with Fallout 2 engine was moved and expanded to allow for engine manipulations without using too much Assembly code
>Fixed an issue with the game being rendered before the hero appearance mod is loaded
>Item highlighting mod was moved from sfall into a separate script (gl_highlighting.int) and extended with new options
>NPC combat control mod was moved from sfall into a separate script (gl_partycontrol.int)
>Related options of item highlighting and NPC combat control mods were moved from ddraw.ini into a separate sfall-mods.ini
>A new version of NPC armor appearance mod was implemented as a separate script (gl_npcarmor.int in the modders pack). It can be configured and made compatible with any Fallout 2 mod
>Improved compatibility between hero appearance, NPC combat control, and NPC armor appearance mods
>A bunch of hooks and script functions were added to allow implementing multiple vehicles in the game
>New script functions: get/set_outline, get/set_flags, tile_refresh_display, outlined_object, set_dude_obj, get_ini_sections, get_ini_section, car_gas_amount, set_car_intface_art, get/set_cursor_mode
>New hook scripts: hs_adjustfid, hs_combatturn, hs_cartravel
>Added the ability to load global scripts from different paths
>Included chinese and russian translations

Original engine bug fixes and various features based on the work by Crafty:
>Added a fix for an exploit that Bonus Move APs are replenished when you save and load the game in combat
>Added a fix for the displayed message when the attack randomly hits a target that is not a critter and has a script attached
>Added a fix for damage_p_proc being called for misses if the target is not a critter
>Added a fix for the double damage effect of Silent Death perk not being applied to critical hits
>Implemented standard script procedures: combat_is_starting_p_proc (called when a combat starts, but does not mean that the critter is in combat) and combat_is_over_p_proc (called when a combat ends)
>Added new modes for get_game_mode function: INTFACEUSE, INTFACELOOT, BARTER, HEROWIN
>Added a new argument to hs_combatdamage hook script
>Added an option to prevent the player from running while sneaking without Silent Running perk

I marked some of the biggest changes in sfall 4.0 in bold. Now you need to extract 'ddraw.dll', 'sfall-mods.ini', and 'data' folder from the archive if you want to update your pre-4.0 sfall, or you won't be able to use item highlighting and NPC combat control features.

sfall 3.8.5 is the last maintenance release of 3.x branch, with some more bug fixes, plus a couple of minor features backported from 4.0 if feasible, but lacks the scripting features/flexibility of 4.0. Generally, people should use the new 4.0 instead of 3.8.x. Here's the changelog:
v3.8.5
>Fixed an issue with the game being rendered before the hero appearance mod is loaded
>Included chinese and russian translations

Original engine bug fixes and various features based on the work by Crafty:
>Added a fix for an exploit that Bonus Move APs are replenished when you save and load the game in combat
>Added a fix for the displayed message when the attack randomly hits a target that is not a critter and has a script attached
>Added a fix for damage_p_proc being called for misses if the target is not a critter
>Added a fix for the double damage effect of Silent Death perk not being applied to critical hits
>Implemented standard script procedures: combat_is_starting_p_proc (called when a combat starts, but does not mean that the critter is in combat) and combat_is_over_p_proc (called when a combat ends)
>Added a new argument to hs_combatdamage hook script
>Added an option to prevent the player from running while sneaking without Silent Running perk

Both modders packs now also include Mr.Stalin's script editor.
 
Last edited:
@NovaRain
Got couple of questions regarding v4.0 armor change addon...
- I assume it will work only with Fo2 without specific tweaks to ini file (no plug&play version for resurrection) so the question is will resurrection based armor change still work if i use Sfall v4.0 without this mod?

-animation pid list numbers don't seem to high, does it actually use those custom made animations for RP, or only basic vanilla animations?

- I assume Marcus's metal armor would have to be added manually?

- do animations that are set for all (PA;APA;robes) are for all party npc's or only for those that are on the list?

- would it be possible to add Lenny to the list with robes PA & APA default animations only? it always was driving me crazy having lenny to lag behind when running across the map and him looking like a looser while everyone else in the party wears some sort of power armor (seriously i farm loot and exchange it for PA's in san fran for all party members who can wear them.
I assume that Dex should be the same case. I mean his suit looks pretty nice however it looks silly when enclave trooper hits him with gatling laser and he withstands the shot in that black suit and a bowtie, it looks pretty damn silly...
 
Last edited:
@NovaRain
Got couple of questions regarding v4.0 armor change addon...
- I assume it will work only with Fo2 without specific tweaks to ini file (no plug&play version for resurrection) so the question is will resurrection based armor change still work if i use Sfall v4.0 without this mod?

-animation pid list numbers don't seem to high, does it actually use those custom made animations for RP, or only basic vanilla animations?

- I assume Marcus's metal armor would have to be added manually?

- do animations that are set for all (PA;APA;robes) are for all party npc's or only for those that are on the list?

- would it be possible to add Lenny to the list with robes PA & APA default animations only? it always was driving me crazy having lenny to lag behind when running across the map and him looking like a looser while everyone else in the party wears some sort of power armor (seriously i farm loot and exchange it for PA's in san fran for all party members who can wear them.
I assume that Dex should be the same case. I mean his suit looks pretty nice however it looks silly when enclave trooper hits him with gatling laser and he withstands the shot in that black suit and a bowtie, it looks pretty damn silly...

The NPC armor appearance mod is NOT included in sfall 4.0 archive, only in the modderspack. The mod by default works on Sulik, Vic, Cassidy, Myron, Cat Jules, and Kitsune. It's been designed to replace the current appearance mod in RP that the code is scattered in multiple NPC scripts, and can work on UP provided you copy all required FRMs from RP. It's also a framework and a demo that shows how modders can make their own NPC appearance mod for their TCs.

If you want to add more NPCs, feel free to modify the script/ini. For Marcus his armor changing is done in a slightly different way from other normal NPCs that can wear their armors in combat preference panel.
 
Last edited:
Oh ok so I take it as it's a work in progress feature that didn't make it yet to main sfall's release. perhaps one day it will be available as a separate download with all those fancy new animations (black guy, punk girl, lou, bald dude, long hair dude etc.)

anyways was writing this below when @NovaRain replied...

I figured that now when party members don't share perks with the player, could it be possible for them to actually gain perks via sfall?
I mean player could choose a perk for them every time they level-up, via their character sheet, wich is available in combat mode when switching to npc's turn (old CombatControl=2) this customization would greatly increase replayability *even further* as they could choose different perks than the player since they each have different stats and skill levels.
Since Fo2 engine does not provide nor can track such feature it would probably be the first thing wich would have to be saved by the sfall savefile function.

What do You guys think about this idea?

Edit:
as for marcus.. by saying it's not equipped by combat panel, do You mean that this script is related somehow to pressing use best armor function and not to npc's slot "X" ? ...
this may cause troubles for mods such as resurrection wich have that buton disabled and equip the armors by dialogue.. marcus also actually equips his metal armor to slot "X" only the armor has invisible graphics. (can't remember however what happens when player deequips that armor from marcus's inventory and puts it on himself :p )

edit i remembered when removing the armor from marcus's armor slot in his inventory he still had lou graphics so i guess tis is heavily scripted and as You've said it would not work.
the only option to change this is to set the armor to act like regular armor (change appearance when equipped but restrict it to supermutant "race" + change marcus "race" to supermutant :p

As i recall there was some work done on "race" option on the char screen however i'm not sure how it ended up...
 
Last edited:
- do animations that are set for all (PA;APA;robes) are for all party npc's or only for those that are on the list?
Yes, if you look at the ini file, there is a Default section specifically for this.

-animation pid list numbers don't seem to high, does it actually use those custom made animations for RP, or only basic vanilla animations?
Not sure what PID list number you refer to, but all values were taken directly from armor appearance mod included in latest Restoration Project (from the scripts of NPCs).

- I assume it will work only with Fo2 without specific tweaks to ini file (no plug&play version for resurrection) so the question is will resurrection based armor change still work if i use Sfall v4.0 without this mod?
To use this mod with ANY FO2 game, you need to just install the appropriate hero appearance graphics files, without any script changes. Then copy .int file into your data/scripts folder and .ini file in the game root folder and just configure the INI files according to your mod.

For Resurrection (or any other mod without standard NPC companions), you can try just adding sections [1], [2], etc and add only PID for each one (use Cubik's or Mr.Stalin tools to check PID for each party member NPC). In this case, default graphics for Robes and Power Armor will be used.
Also make sure to add all armor item PIDs to the first section, if this mod introduces new armor. Also note that you are not limited to pre-defined set of armor types: Leather, Metal, Power, etc. You can add as many mapping as you want, in case that your mod adds whole new types of armor. This mod was designed to be usable anywhere.

Since Fo2 engine does not provide nor can track such feature it would probably be the first thing wich would have to be saved by the sfall savefile function.
No need for savefile. You can use save_array/load_array functions to store perks for each NPC. The tricky part is how to implement allowing player to select perks whenever NPC is leveling up...
If you can find the way to do it, then just modify the party control script accordingly. The engine support for this mod is pretty basic - it just switches the currently controlled critter to whatever you choose and transfers all stats/skills/etc.
 
Last edited:
Yes, if you look at the ini file, there is a Default section specifically for this.

So You basically say that when i eqiup marcus or goris with Power Armor (through inventory during their turn [CombatControl=2]) they will look like power armored critters?

I thinkt this would need to be adressed. I thought maybe a .ini file that is able to restrict wich PID can't equip what armor. So marcus, goris, all brainbots , all dogs and all other non human companions can't wear standard armors *and* everyone besides marcus can't wear marcus's metal armor. + set inventory image and armor animation (Fo1 Lou) for marcus's metal armor.(same can be done with dogmeat armor, although i don't think it's nessecary). This way it could bypass race restrictions and merge it with the current iteration of armor-appearance mod. ( that is *if* it is doable in the first place, as I only gave an idea for it, and have no knowledge how to make / implement it) it could prevent a lot of cheating / abusing of buged game mechanic, because as of now it's just a mater of setting ControlCombat=2, transfering the armor to the npc, turning combat on, switching to that npc's turn, opening their inventory, and equipping *any* armor. so i think some logical restrictions should be set in place. This also opens up a way for goris and brainbot armor (ie. thick leather rags and robot planting).




No need for savefile. You can use save_array/load_array functions to store perks for each NPC. The tricky part is how to implement allowing player to select perks whenever NPC is leveling up...
If you can find the way to do it, then just modify the party control script accordingly. The engine support for this mod is pretty basic - it just switches the currently controlled critter to whatever you choose and transfers all stats/skills/etc.

Now that's a bummer i thought it could be easily done, however if You put it that way than it's best to just forget those perks for npc's.
 
Hey guys. I've problem here with CombatControl (I think). Prob is... in arroyo when I do quest rescue smoke in the wild, I get CTD after attacking gecko (I hit then run about few hexes and after the gecko chasing me it will CTD). This crash happen only if CombatControl=2 and smoke few meter away from the battle.

I install RP+ECCO (sfall 4.0 with modified draw.ini)
 
Hey guys. I've problem here with CombatControl (I think). Prob is... in arroyo when I do quest rescue smoke in the wild, I get CTD after attacking gecko (I hit then run about few hexes and after the gecko chasing me it will CTD). This crash happen only if CombatControl=2 and smoke few meter away from the battle.

I install RP+ECCO (sfall 4.0 with modified draw.ini)
1. Please provide more details about "CTD". If there is any window showing up during CTD, give the full message.
2. Also does this crash happen every time?
3. Upload your savegame just before the crash, so we can also test it.
 
1. Please provide more details about "CTD". If there is any window showing up during CTD, give the full message.
2. Also does this crash happen every time?
3. Upload your savegame just before the crash, so we can also test it.
Actually the game will just crash if Smoke is following the player, and player starts combat and passes his own turn. The crash happens when the game is trying to control Smoke. No matter ControlCombat is 1 or 2.

error message is:
The instruction at 00496042 referenced memory at 4c350e20
The memory could not be read from

EDIT: OK it's fixed. There's a bug in the engine function. We'll release it as a hot fix tonight (UTC +8)
 
Last edited:
sfall 4.0.1 and 3.8.6 are released on SourceForge as the hotfix for previous 4.0 and 3.8.5.
Changelog said:
v4.0.1
>Fixed a crash bug in NPC combat control when trying to control a temporary party member that has no data in party.txt
Smoke is added as a temporary party member by party_add() function in his script while he's following the player, but there's no data for him in party.txt. When NPC combat control calls partyMemberGetCurLevel_ engine function on Smoke to get his level, there's an index register not properly initialized in the engine function, so the game will try to load data from an incorrect memory address and crash.
 
Is it possible to use a sfall 4.0.x with killap's unofficial patch? I tried the following on Linux:
1. `WINEARCH=win32 WINEPREFIX=/opt/disk/wine/fallout2 WINEDEBUG=-all /opt/wine-staging/bin/winecfg` and set OS to Win98 and DLL Override to ddraw (native, builtin).
2. Install a fresh fallout2 humongous to c:\games\Fallout2.
3. Install killap's unofficial patch version 1.02.31 (JULY/05/2014) via the installer, with "latest" version (not legacy).
4. Extract the ddraw.dll and data/scripts/* from sfall 4.0.1.

But I get this error:
You're trying to use sfall with an incompatible version of fallout
Was expecting 'Fallout 2 v1.02 US'

fallout2.exe had an unexpected crc. Expected 0xe1680293 but got 0xe465f9aa
Don't know if it matters, but after killap's patch there was no ddraw.dll. Instead there was an sfall.dll.
 
Don't know if it matters, but after killap's patch there was no ddraw.dll. Instead there was an sfall.dll.
It's because you installed win9x version of the patch, which has a modified fallout2.exe that newer non-win9x sfall builds don't think it has correct CRC.
I don't use Linux or Wine, so I don't know why the unofficial patch thinks it getting installed in a win9x environment. You might try to overwrite the fallout2.exe with the one from US 1.02d patch.
 
Last edited:
It's because you installed win9x version of the patch, which has a modified fallout2.exe that newer non-win9x sfall builds don't think it has correct CRC.
I don't use Linux or Wine, so I don't know why the unofficial patch thinks it getting installed in a win9x environment.
Doh! Stupid me. I had set wine's config to Win 98 for some stupid reason. Wiping clean and re-installing with the default of Win 7 fixed it. Thanks for the immediate help!

Now plain unofficial patch works fine, but when I install sfall 4.0.1 the resolution is way blown up, so all I can see on the menu screen is the first four options (not even exit). So I think I'll just give up on this for now.
 
sfall 4.0.2 and 3.8.7 are released on SourceForge, along with their respective modders packs and win2k version (3.8.7 only).
Changelog said:
v4.0.2
>Fixed sneak_success script function not checking if the player is currently sneaking
>Added a fix for player's base EMP DR not being properly initialized when creating a new character and then starting the game
>New script function: display_stats
>Improved the functionality of UseScrollWheel. Now you can scroll through items in barter and loot screens, and messages in the display monitor (From Crafty)
There's an bug about player's base EMP DR: if you create a new character and then start the game, your base EMP DR won't be initialized correctly, leaving it only 0%, which means you will certainly get killed by pulse grenades if you don't wear any armor. But if you choose a premade character or load a GCD file to start a new game, you base EMP DR will be set to 100%. This bug existed since FO1.

The functionality of UseScrollWheel now basically equals to ALT_MOUSE_INPUT=1 + SCROLLWHEEL_FOCUS_PRIMARY_MENU=1 in HRP. Before you can only scroll your main inventory list with sfall's UseScrollWheel, but enabling HRP's ALT_MOUSE_INPUT makes new UI buttons scripted with sfall scripts unusable (like the ones in JimTheDinosaur's inventory sort buttons mod and Mr.Stalin's inventory filter mod). Now you can scroll other item lists in loot and barter screens when hovering cursor on them, and those new UI buttons work as they should.
 
@NovaRain there's a bug with gecko skinning perk with controlMode. As the battle ended, gecko skinning perk will raise up.

I'm not exactly sure how did You got the extra gecko skinning perks, however there is a bug with Economy and Combat rebalance mod. You see after purchasing the gecko skinning knowledge from a trapper in klamath's trapper town You can get second level of that skill when talking to Smiley after You rescue Him from toxic caves.

EDIT:
I actually thought this through and came to conlcusion that what You are reporting might be a separate bug, related to how party NPC's perks are handled in ControlCombat=2 or whatever it's called now.

You see sfall team managed to cut out all of player owned perks from NPC's character sheets but later on They've decided to reintroduce some back mainly Gecko Skinning and Awareness AFAIR. there might be other perks treated this way as well. the issue seemes to be related to not properly removing the bonus from character sheet whenever end turn/end combat is triggered thus adding the bonus to the list of player owned perks.

The way i see it NPC's shouldn't have the perk available, only the script for the Gecko Skinning perk itself should be modified so that when player character has the perk, any gecko killed should render a skin regardless of who killed it. Wether was it player, party member (controlled by player or not) or random npc killing the gecko shouldn't matter since player can always skin it after the fight (at least in theory). fixing that EcCo bug would also be welcome as well...

And maybe somebody will finally manage to stop the slowdowns when running Fo2 with sfall on an offline machine. game runs smooth when i have internet connected, however if i remove the plug from router and run the game, it ocasionally slow down to a crawl for a few moments the bigger party i have the slower it gets and longer it takes to return to smooth gaming. I'm running 1920x1080 with party control function + EcCo and Burn's Fo2 Tweaks but the slowdown happened since combat control function was first introduced. The only thing that helps a bit in this matter (litening the consequences) is ArtCacheSize= option in Fallout 2 config set to at least 64 ( but not higher than 256) (sfalls override function of art cache size only makes things worse when enabled) (last tested on 4.0).
 
Back
Top