Fallout 2 mod FO2 Engine Tweaks (Sfall)

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

  1. Darek

    Darek is currently unavailable

    Jan 7, 2008
    Oh that one. I was talking about it in the RP thread not so long ago, thinking it would never get fixed without Timeslip. So I'm happy to see this fix. Thanks.
     
  2. Felipefpl

    Felipefpl Look, Ma! Two Heads!

    374
    Jun 17, 2010
    Congrats for the relese NovaRain, the fixes of Crafty dont make a few bugs on wikia being marked as fixed? Or am i mistaken?
     
  3. Kamehameha

    Kamehameha First time out of the vault

    4
    Aug 17, 2016
    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.
     
  4. Darek

    Darek is currently unavailable

    Jan 7, 2008
    @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
    
     
  5. Kamehameha

    Kamehameha First time out of the vault

    4
    Aug 17, 2016
    Well all right, awesome. That works. I thought I'd read that those lines were for the requirements of the perk rather than the effects.

    Thanks.
     
  6. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    348
    Oct 29, 2015
    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.
     

    Attached Files:

  7. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    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.
     
  8. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    348
    Oct 29, 2015
    here is a difference in the structure .int file, which does not understand sfall 3.6+ decompiler
    search bug :)
     
  9. Templayer

    Templayer Dark Templar of the New Brotherhood of Steel

    45
    Jul 25, 2010
    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: Sep 14, 2016
  10. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    This can be done easily with scripting. You can check burn's FO2tweaks for examples.
     
  11. Templayer

    Templayer Dark Templar of the New Brotherhood of Steel

    45
    Jul 25, 2010
    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
     
  12. burn

    burn Mildly Dipped
    Modder

    557
    Apr 22, 2012
    Everybody already has the option to have any number of companions.
     
  13. Templayer

    Templayer Dark Templar of the New Brotherhood of Steel

    45
    Jul 25, 2010
    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).
     
  14. burn

    burn Mildly Dipped
    Modder

    557
    Apr 22, 2012
    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.
     
  15. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    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: Oct 11, 2016
  16. burn

    burn Mildly Dipped
    Modder

    557
    Apr 22, 2012
    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.
     
  17. Lexx

    Lexx Background Radiant
    Moderator Modder

    Apr 24, 2005
    :scratch: Sfall isn't the best mod. It's essential.
     
  18. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    sfall 3.7.4 is released on SourceForge along with win2k version, no update for modders pack.
    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: Oct 11, 2016
  19. phobos2077

    phobos2077 Mildly Dipped
    Modder

    596
    Apr 24, 2010
    (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: Oct 13, 2016
    • [Like] [Like] x 1
  20. Lexx

    Lexx Background Radiant
    Moderator Modder

    Apr 24, 2005
    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: Oct 14, 2016