Fallout 2 mod FO2 Engine Tweaks (Sfall)

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

  1. NovaRain

    NovaRain Casual Modder Modder Moderator

    Mar 10, 2007
    My unofficial sfall compiles updated to SVN r278 (3.3.1.278): (removed due to newer updates)

    Please see phobos2077's post above for newly added features and functions. For more details on ComputeSprayMod, please refer to this post.
    3.4 will be released when phobos2077 finishes his current to-do list.

    The archive includes four DLLs:
    • the one in the root directory of the archive - normal sfall for WinXP SP3 or later.
    • trace - the debugging version.
    • win2k - for Win2000 and WinXP RTM/SP1/SP2.
    • win2k_trace - the debugging version for modders on older OSes.
    The included ddraw_adv.ini has almost all settings recognized by sfall. The only settings not included are debugging settings (they only work with debugging DLLs), main menu offsets (currently only useful for FO1 to FO2 conversion) and NPC combat controls.

    And my sslc compiles with the bug fixes by phobos2077: (removed due to newer updates)

    There's no change for sslc from the last time. It doesn't support new scripting functions yet. I only separate sslc files from the previous sfall archive, because the total file size was a bit too large.
    3.4 modders pack will have the updated sslc, script editor, scripting library and documents.

    The archive includes two versions of sslc (compile.exe):
    • sslc_xp - compiled with VS2012-WinXP toolset (v110_xp), supports WinXP SP3 or later.
    • sslc_win2k - compiled with VS2008 toolset (v90), supports Win2000 and WinXP RTM/SP1/SP2.
     
    Last edited: Sep 16, 2014
    • [Like] [Like] x 1
  2. Felipefpl

    Felipefpl Look, Ma! Two Heads!

    396
    Jun 17, 2010
    NovaRain - instead of sending your stuff to mediafire or other services i suggest 4shared in my signature's link for you, you can keep your files stored for 90 days just changing one option in the settings and you can decide what you'll share or not.
     
  3. phobos2077

    phobos2077 A Smooth-Skin
    Modder

    657
    Apr 24, 2010
    So I've been busy adding new stuff to sfall recently. Want to make a brief introduction.

    1) Arrays as described in this thread are fully working. You will need new sslc version of course. Hopefully, NovaRain will provide it in coming 3.4 release.

    2) Changed previous (optional) combat lighting fix. Now there should be less permanent light artifacts on the ground. However, some other side effect are in place (light stays while people getting knocked back by explosions). Other than that - should be no pitch black explosions (and flying rockets, plasma balls, molotovs) anymore! Need to adjust light radiuses for projectiles for better effect.
    Also made it so burning guy animation also emit light. Will try to add light to flamer attack in future.

    3) Added a bunch of new functions in "reg_anim_" family. There are a lot of them now, but I made it this way because it fits original set and uses exactly the same family of engine functions (I basically made more of the reg_anim functions exposed to scripting). Also there is an option to remove combat check for all of this functions, which will allow to use them during combat.
    If some boring animation functions doesn't sound exciting, here's a short video example of how you can use reg_anim_animate_and_hide function:
    Code:
          obj := create_object(PID_EXPLOSION_EMP_1, tile_under_cursor, elevation(dude_obj));
          reg_anim_begin();
          reg_anim_animate_and_hide(obj, 0, -1);
          reg_anim_destroy(obj);
          reg_anim_end();
    
    This is exactly the same mechanism the engine uses for hard-coded explosions (grenades, dynamite, etc). It allows to make effects that disappear exactly at the moment when their animation is finished, allowing for some nice effects.
    reg_anim_light allows, for example, to make strobing light.
    reg_anim_take_out plays "take out weapon" animation by given weapon holding frame ID (even if there is no such weapon in inventory).
    Others should be obvious.

    4) Added new hook script hs_ammocost which allows to change how much ammo is reduced when firing weapon.
    Also added INI option MISC.CheckWeaponAmmoCost which will add proper checks if there is enough ammo to use weapon (originally it checked if at least 1 round left) and also when calculating burst size (for example, if you set ammo cost to 2, have 7 bullets in your magazine and burst size is 4: it requires 4*2 = 8 bullets, but you only have 7, so you will get 7/2 = 3 shots which will spend 3*2=6 bullets with 1 left in chamber).

    5) More control over vanilla critter_dmg function:
    - it is now affected by set_target_knockback and remove_target_knockback functions
    - hs_deathanim2 hook script is now called for deaths caused by this operator



    This allows for some important features (basically did this for my traps system, like most of the other stuff).

    6) Added new "metarule" function (yes, I know, it's bad design, but the underlying code is too complex to make a proper hookscript and adding 4 functions for this seemed like an overkill) to change various aspects of explosions in combat:
    - force explosion for any damage type (for example, put DMG_fire here before using molotov: it will create explosion effect and inflict fire damage to primary and all secondary targets - wanamingos are in trouble!)
    - change radius (limited to something like 8-10, should be enough unless you are making portable nuke :D)
    - change explosions art FID (allows to add new explosion graphics)
    - change explosion effects pattern (allows to change how many effects are created - originally there are 7 of them; right now it just leaves only 1, but it doesn't look right yet)

    All changed parameters are effective until current "attack" action is finished. This is useful in conjunction with itemdamage hook script:
    - use global script to attach to HOOK_ITEMDAMAGE
    - calculate explosion parameters based on weapon used, etc.
    - all of them will be reset after attack is finished, so you don't need to worry about resetting
     
    • [Like] [Like] x 1
  4. Ghoul [BB]

    Ghoul [BB] First time out of the vault

    47
    Aug 3, 2014
    phobos2077 , is it possible to change damage radius and explosion effect for different ammo types? (for example, if dude will launch nuclear rocket from Bazooka, radius and effect should be differ from ordinary high explosive rocket)
     
  5. phobos2077

    phobos2077 A Smooth-Skin
    Modder

    657
    Apr 24, 2010
    Yes.

    Changed "single" explosion pattern to 3 "splashes" (one in the middle and two to the bottom), which looks ok now. I will use it for everything weaker than rocket launcher in my mod.
     
  6. Ghoul [BB]

    Ghoul [BB] First time out of the vault

    47
    Aug 3, 2014
    Oh, my god!
    Impressive!
     
  7. phobos2077

    phobos2077 A Smooth-Skin
    Modder

    657
    Apr 24, 2010
    A couple of changes in sslc compiler:

    1) Fixed FOR loops crashing compiler (not 100% sure this bug is gone for good)

    2) Last semicolon in FOR is not required when you are using parentheses. This allows for more conventional C-like syntax:
    Code:
    for (i:=0; i<45; i++)
          ar[i] := 1;
    
    When you are not using parentheses, you will still be required to add semicolon at the end:
    Code:
    for i:=0; i<45; i++;
          ar[i] := 1;
    
    3) Improved FOREACH loop more by introducing "while" condition. The problem is, there is no "break" operator in SSL, which is very useful sometimes. With FOR and WHILE loops you could at least add some additional condition to break out of the loop when you want, but you couldn't do such thing for FOREACH (it would always iterate for every array element).
    So now you can add additional condition like this:
    Code:
       foreach k: v in [1,2,3] while (i < 0) begin
          // some code
       end
    
    Which will be translated into this:
    Code:
        LVar4 := temp_array(0, 0) + arrayexpr(0, 1) + arrayexpr(1, 2) + arrayexpr(2, 3);
        LVar6 := 0;
        LVar5 := len_array(LVar4);
        while((LVar6 < LVar5) and (LVar1 < 0)) do begin
            LVar2 := get_array_key(LVar4, LVar6);
            LVar3 := get_array(LVar4, LVar2);
            // some code
            LVar6 := LVar6 + 1;
        end
    
    So now you can break from FOREACH loop when you want it.
     
  8. Ghoul [BB]

    Ghoul [BB] First time out of the vault

    47
    Aug 3, 2014
    ;Set to 1 to make explosions and projectiles emit light
    ExplosionsEmitLight=1

    Looks great, but... Some light does not dissapear after explosion:
    scr00000 copy.gif
     
  9. phobos2077

    phobos2077 A Smooth-Skin
    Modder

    657
    Apr 24, 2010
    Read previous post, I already mentioned this bug. Check again when 3.4 build will come out.

    Edit: more features:
    1) Changed how sfall accesses global scripts. Now it can execute specific procedure by ID or by name.
    Using this I've made changes:
    a) "start" proc now can be anywhere in the script and still work (previously it was required to be first procedure in script).
    b) "map_enter_p_proc", "map_exit_p_proc" and "map_update_p_proc" will all be executed for all global scripts, which have them.

    2) Fixed negate, multiply and divide SSL operators working incorrectly with float values (this was vanilla bug!).
    Code:
    display_msg("" + (-1.0));
    
    was previously given something like "1085738973", now it will be correct float.
    Code:
    display_msg("" + ((-2)*1.0));
    
    was also returning some crazy number. Should work as expected now.

    If some code was depending on incorrect behavior of this functions, it might not work. But still this is an obvious bug.

    3) now you can access individual characters in a string using array syntax:
    Code:
    str := "Hello";
    display_msg(str[4]);  // will print "o"
    
     
    Last edited: Sep 11, 2014
  10. phobos2077

    phobos2077 A Smooth-Skin
    Modder

    657
    Apr 24, 2010
    This actually broken imported procedures... Game crashes if this patch is enabled (tried almost every sfall version starting from 2.1). This patch must be at least optional..

    Ok, figured it out. That patch is correct but Timeslip applied at the wrong offset. I corrected it and now imported procedures with 0, 1 & 2 arguments work. Nice. We can make library with all kind of useful functions and place it inside one global script, to be used in all other scripts :)
     
    Last edited: Sep 11, 2014
  11. NovaRain

    NovaRain Casual Modder Modder Moderator

    Mar 10, 2007
    sfall 3.4 is released on SourceForge, along with the modders pack and win2k version.

     
  12. Ghoul [BB]

    Ghoul [BB] First time out of the vault

    47
    Aug 3, 2014
    ;Uncomment these lines to change explosives damage. DmgMax can be set to 9999 at max, and DmgMin is capped at DmgMax
    Dynamite_DmgMin=30
    Dynamite_DmgMax=50
    PlasticExplosive_DmgMin=40
    PlasticExplosive_DmgMax=80

    is this removed in 3.4 ?

    I did not find any variables related to projectile explosion radius :(
     
  13. NovaRain

    NovaRain Casual Modder Modder Moderator

    Mar 10, 2007
    The settings are removed from the "player version" of ddraw.ini, but they're still recognised by sfall if you add the lines back.
    You can also check the ddraw_adv.ini in the modders pack for more settings.
     
    Last edited: Sep 12, 2014
  14. phobos2077

    phobos2077 A Smooth-Skin
    Modder

    657
    Apr 24, 2010
    Explosion radius have to be changed using hook scripts for each attack. I see no point having explosion radius changeable through INI.
     
  15. killap

    killap Bear Dude Moderator Modder

    May 16, 2005
    Man, I go away for 2 months and @Timeslip gets married. Congrats! A new release of sfall too! Very cool. Guess I will have to dig into another RP update.
     
    Last edited by a moderator: Jan 9, 2016
    • [Like] [Like] x 3
  16. JimTheDinosaur

    JimTheDinosaur Vault Dweller
    Modder

    736
    Mar 17, 2013
    Yeah, congrats @Timeslip! Also for filling one of my requests as one of your last sfall-related activities, makes me feel all warm and fuzzy inside.

    @phobos2077, I've decided to finally start back on my mod, lot's of amazing changes your making man. I was wonder though, I have lots of arrays in the "old" style in my mod, are those still compatible with the new sfall?
     
  17. phobos2077

    phobos2077 A Smooth-Skin
    Modder

    657
    Apr 24, 2010
    Yes, read notes at the end of this post.
     
    • [Like] [Like] x 1
  18. JimTheDinosaur

    JimTheDinosaur Vault Dweller
    Modder

    736
    Mar 17, 2013
    @phobos2077, the burst path options you added are cool, but is there a way to let them be changed through scripts as well? It would be really cool to introduce the option to switch between wide and narrow spread manually.

    edit:

    I also can't seem to get the molotov fix to work, I've tried adding these to hs_afterhitroll.int:


    if weapon == PID_MOLOTOV_COCKTAIL then begin
    metarule2_explosions(4, DMG_fire, 0);
    end

    but that just resulted in the molotov cocktail becoming a regular thrown object without an explosion (or fire damage).

    I also couldn't get the shortcut set_attack_is_explosion_fire to compile, so maybe that has to do with the problem.
     
    Last edited: Oct 7, 2014
  19. phobos2077

    phobos2077 A Smooth-Skin
    Modder

    657
    Apr 24, 2010
    @Jim:
    try adding this to hs_itemdamage instead.

    In what cases you want to change burst distribution dynamically?
     
    Last edited by a moderator: Jan 9, 2016
  20. JimTheDinosaur

    JimTheDinosaur Vault Dweller
    Modder

    736
    Mar 17, 2013
    Has the same effect for me (just like hs_tohit as well).

    I was thinking about giving the player a toggle between spreads, but with the option for the narrower ones only being unlocked with higher skill levels, e.g.:

    >0% relevant weapon skill: 33,33,33
    >60%: 25,50,25
    >120%: 17,66,17
    >180%: 0,100,0

    High skilled players would then be able to use the narrow spreads against tough enemies and the wide ones against packs of rats or whatever.