Fallout 2 mod FO2 Engine Tweaks (Sfall)

Hello!

Can Perks.ini be used to change more than one stat when modifying an existing perk? I'm trying to change the Power Armor perks (62,68,69) to instead of giving just (for example) 3 Strength, to be 1 Strength, 1 Perception, 1 Endurance.

This:
[62]
Stat=0
StatMag=-2

...reduces the Strength gain to 1 (lowers 3 by 2).

This:
[62]
Stat=0
StatMag=-2
Stat=1
StatMag=1
Stat=2
StatMag=1

...does the same. So does this:

[62]
Stat=0|1|2
StatMag=-2|1|1

So it looks like once I change the first stat (Strength) the others are ignored. Is that correct? Do I need to use a script?

If so... I don't see in the docs how to test for armor being worn vs. being in the inventory. Is there a way to do that?

Thanks.
 
@Kamehameha

Try with only this:

[62]
STR=1
PER=1
END=1

As for the code, maybe something like this?
Code:
variable worn;

  if (critter_inven_obj(dude_obj, 0) != 0) then begin
     worn := obj_pid(critter_inven_obj(dude_obj, 0));
   end
   if ((worn == 3) or (worn == 232)) then begin
 
Sfall int2ssl (version 3.6/3.7), can not decompile the code below, which was compiled BIS compiler.
At the same time, int2ssl version 3.5 is able to decompile.
Code:
    if temp then begin
        critter_heal(dude_obj, 1);
    end else critter_heal(dude_obj, 1);
script file for test.
 

Attachments

Weird, if I use 3.5's int2ssl to decompile the script and re-compile the SSL with 3.7's sslc (compile.exe), the new sfalltst.int (which is 4 bytes larger) can be decompiled with 3.7's int2ssl. Both generated SSL files are identical.
 
Can I ask for an additional option for the unlimited amount of party members in the tweaks pack? Instead of making it unlimited, give us an option for it to be capped at 6. Why at 6? Normally, the game caps the party limit at five, which is the maximum cap of charisma divided by two and rounded down. Which is wrong. Why? Because of the Magnetic Personality perk, which raises it plus one, and can be taken only if you have less than 10 charisma. So if you take the perk at charisma 9 and then raise it (the glasses for example), the party limit should be 5+1=6! I.e. I wish that the perk was included in the math for the party cap (5 without the perk at max charisma, 6 if the character object has the perk and charisma at 10).

Also I haven't been here (on NMA) for six years (I don't even know how to set the forum to sent me email notices, etc. and it is 1:30 AM here in Czech Republic), if you do decide to add this non-cheating, logical option to the tweaks, could you please notify me by sending me an email to templayerATseznamDOTcz ? So that I would know to redownload it? I'm preparing for a 100% LP of Fallout 1+2 (making my notes for about a second week now, making sure I can pass any check in-game, etc. and all that without cheating), there is no rush in the case taht you do want to add that option, I won't start the LP for a few years any way. Without the change, I wouldn't be able to hire Kitsune (= experience Killap's new NPC), however I do have a backup plan - using the unlimited party size tweak of yours and then simulating the charisma checks in-game (not hiring the NPCs until I have enough charisma, and taking the magnetic personality perk into consideration).

Also excuse my english, it's my third language. (with Czech and German being the first two) AND it's almost two hours after midnight, so I might have made some terrible typos in my text.

EDIT DURING PREVIEW: Aaaand I just found out how to get the email notifications. However I have no idea what email is this account of mine registered to. xD
 
Last edited:
Yes, I know it is an easy change, however it would be better for everybody to have the option to have this, due to what I said (magnetic personality perk and then raising charisma to 10).

I.E. I'm too lazy. :P
 
Yes, I know it is an easy change, however it would be better for everybody to have the option to have this, due to what I said (magnetic personality perk and then raising charisma to 10).
Everybody already has the option to have any number of companions.
 
Everybody already has the option to have any number of companions.

YES, BUT SOME PEOPLE ACTUALLY HATE CHEATING!

SOME PEOPLE LIKE TO PLAY LEGIT.

Having Magnetic personality and raising charisma to 10 should have put the party limit cap at 6, not 5.
10/2+1 != 5 ; = 6

For those of us who hate cheating (also I don't consider exploiting glitches as cheating, unless it adds unlimited amounts of something), this is an option that should've been incorporated in vanilla, not to mention some patch. Yet there is not a MOD that enables it! The developers gave the party limit to charisma for a reason. In Fallout 1, Charisma is basically a non-functional attribute - it doesn't affect dialogues with the exception of ONE charisma check, and it doesn't raise the limits of party members - the only thing it does is affect skills (speech and barter) and not even those that much. The number of followers in Fallout 2 is rather massive in comparison, so the developers made the logical decision to relegate a newly created limit to Charisma in order to make it more viable. Removing the cap entirely completely undermines what the developers were aiming for in every shape and form. The only reason why the cap is 5 and not 6 is because they forgot about the perk raising not only the limit of the followers, but also the maximum cap (which should be maximum charisma divided by two plus one from the perk).
 
YES, BUT SOME PEOPLE ACTUALLY HATE CHEATING!

SOME PEOPLE LIKE TO PLAY LEGIT.

Having Magnetic personality and raising charisma to 10 should have put the party limit cap at 6, not 5.
10/2+1 != 5 ; = 6

For those of us who hate cheating (also I don't consider exploiting glitches as cheating, unless it adds unlimited amounts of something), this is an option that should've been incorporated in vanilla, not to mention some patch. Yet there is not a MOD that enables it! The developers gave the party limit to charisma for a reason. In Fallout 1, Charisma is basically a non-functional attribute - it doesn't affect dialogues with the exception of ONE charisma check, and it doesn't raise the limits of party members - the only thing it does is affect skills (speech and barter) and not even those that much. The number of followers in Fallout 2 is rather massive in comparison, so the developers made the logical decision to relegate a newly created limit to Charisma in order to make it more viable. Removing the cap entirely completely undermines what the developers were aiming for in every shape and form. The only reason why the cap is 5 and not 6 is because they forgot about the perk raising not only the limit of the followers, but also the maximum cap (which should be maximum charisma divided by two plus one from the perk).
1. Developers didn't forget anything. It's specifically addressed in the description of the perk that "more than 5 is always a crowd". So your points about what should've been are invalid.
2. No one forces you to cheat. If you want 10 Cha and Magnetic personality and 6 followers you CAN HAZ that.
 
Just tested how vanilla FO2 loads patch###.dat and some interesting findings:
  • The valid range of patch numbers is 000 ~ 998. FO2 only loads the first patch file it can find.
  • The patch number must be even numbers. If there are patch001.dat and patch002.dat, FO2 only loads patch002.dat. patch001.dat won't get loaded even if it's the only patch file in the folder.
  • So basically, patch000.dat has the highest priority.
With sfall's NumberPatchLoop enabled, FO2 loads multiple patch files in ascending order, which is much more logical IMO. I'm planning to change NumberPatchLoop to a simpler MultiPatches (or maybe force enable it), which has on/off settings only with valid patch number range of 000 ~ 999. Sure, NumberPatchLoop allows even larger patch numbers, but seriously who would use patch9999.dat? :confused:

EDIT: silly me, red has already posted his findings 12 years ago:
http://www.nma-fallout.com/threads/how-the-fo2-engine-finds-its-data.156583/
 
Last edited:
Someone who is is absolutely sure that his mod is the bestest?
Please don't do force enablings. It's... forceful, even for "pure" bug fixes.
 
sfall 3.7.4 is released on SourceForge along with win2k version, no update for modders pack.
Changelog said:
v3.7.4
>Improved the functionality of DisableHorrigan
>Replaced NumberPatchLoop with a simpler MultiPatches toggle
>Added a new setting to PipBoyAvailableAtGameStart to make the pipboy available by only skipping the vault suit movie check
>Changed BodypartHitModX to BodyHit_(body parts) in ddraw.ini to make them easier to understand
>Removed BodyHit_Uncalled from ddraw.ini. Now body_torso and body_uncalled share the same modifier, and set_bodypart_hit_modifier function is also tweaked to match the change
>Removed CarryWeightLimit from ddraw.ini, because it can be scripted with set_stat_max function
>Removed GainStatPerkFix from ddraw.ini

Original engine bug fixes and various features based on the work by Crafty:
>Now sfall loads global scripts, hook scripts, shaders, 32-bit talking heads images, and avi movies from master_patches path in fallout2.cfg instead of the fixed "Data\"
>Added a partial fix for the original engine issue that caused incorrect positioning after exiting small locations (e.g. Ghost Farm)
>Added an option to use a modified data load order for the engine to find game data

Sorry I don't have enough knowledge and skill to solve the int2ssl issue posted by Mr.Stalin. The overhauled int2ssl (no MFC dependency, cross-platform) since 3.6 is based on falltergeist version and edited by phobos2077. He's been busy in real life recently, so for now if you can't decompile a script with int2ssl in the latest modders pack, please try the one in 3.5 modders pack.
 
Last edited:
Sfall int2ssl (version 3.6/3.7), can not decompile the code below, which was compiled BIS compiler.
At the same time, int2ssl version 3.5 is able to decompile.
Code:
    if temp then begin
        critter_heal(dude_obj, 1);
    end else critter_heal(dude_obj, 1);
script file for test.

(Better late than never :D) I've figured it out. While I can't use BIS compiler on my 64bit OS, I see there is a difference in how old and new compiler treated the critter_heal function. BIS compiler treats it as statement (and old docs say it has void return type - means no return value), but actually it's an expression. So basically it's a bug in vanilla compiler. You can say it's an expression if you look at the engine code for this opcode - at the end it pushes some value to the stack.

This issue happens because of how new conditional expression feature (X if A else Y) is implemented. It's not using any new opcodes (this way scripts using conditional expressions can work on any version of the game, even without sfall), but instead relies on whether there's a statement or expression used in IF and ELSE blocks. So basically INT2SSL treated this code as conditional expression and also there are values left in the stack which resulted in the decompile error.

Solutions:
- Don't use critter_heal with BIS compiler, because it's bugged. Your game may as well crash for the same reason (value left in stack).
- I can probably add some argument to int2ssl to ignore new SSL features, but it won't solve the issue because the INT file is still broken.


For reference, difference between BIS compiler and sfall compiler outputs:

SFALL:
Code:
0x0000009E: 0xC001 0x000000c2 - O_INTOP(0x000000c2)   // 194 (194)
0x000000A4: 0xC001 0x00000000 - O_INTOP(0x00000000)   // 0 (0)
0x000000AA: 0x8032            - O_FETCH
0x000000AC: 0x802F            - O_IF
0x000000AE: 0x80BF            - O_DUDE_OBJ
0x000000B0: 0xC001 0x00000001 - O_INTOP(0x00000001)   // 1 (1)
0x000000B6: 0x80E8            - O_CRITTER_HEAL
0x000000B8: 0x801A            - O_POP
0x000000BA: 0xC001 0x000000ce - O_INTOP(0x000000ce)   // 206 (206)
0x000000C0: 0x8004            - O_JMP
0x000000C2: 0x80BF            - O_DUDE_OBJ
0x000000C4: 0xC001 0x00000001 - O_INTOP(0x00000001)   // 1 (1)
0x000000CA: 0x80E8            - O_CRITTER_HEAL
0x000000CC: 0x801A            - O_POP
0x000000CE: 0xC001 0x00000000 - O_INTOP(0x00000000)   // 0 (0)

BIS:
Code:
0x0000021A: 0xC001 0x0000023c - O_INTOP(0x0000023c)  // 572 (572)
0x00000220: 0xC001 0x00000000 - O_INTOP(0x00000000)  // 0 (0)
0x00000226: 0x8032  - O_FETCH
0x00000228: 0x802F  - O_IF
0x0000022A: 0x80BF  - O_DUDE_OBJ
0x0000022C: 0xC001 0x00000001 - O_INTOP(0x00000001)  // 1 (1)
0x00000232: 0x80E8  - O_CRITTER_HEAL
0x00000234: 0xC001 0x00000246 - O_INTOP(0x00000246)  // 582 (582)
0x0000023A: 0x8004  - O_JMP
0x0000023C: 0x80BF  - O_DUDE_OBJ
0x0000023E: 0xC001 0x00000001 - O_INTOP(0x00000001)  // 1 (1)
0x00000244: 0x80E8  - O_CRITTER_HEAL
0x00000246: 0xC001 0x00000000 - O_INTOP(0x00000000)  // 0 (0)

As you can see there is no O_POP after O_CRITTER_HEAL - value left in stack.
 
Last edited:
Question tyme. Did we ever figure out if it's possible to close the inventory, pipboy, character screen with sfall scripting?

Maybe we can script a button click? Scripting a hit on the ESC key should already do the trick.
 
Last edited:
Question tyme. Did we ever figure out if it's possible to close the inventory, pipboy, character screen with sfall scripting?

Maybe we can script a button click? Scripting a hit on the ESC key should already do the trick.

Yes there is sfall function
Code:
void tap_key(int dxScancode)
 
Nice, thanks. Now the next dumb question--- is there a definition for "if any key is pressed"? :>
/Edit: Without having to define *every* key, of course.
/Edit: Figured it out. Sometimes I just have to ask a question to find the answer by myself.
 
Last edited:
Back
Top