Fallout 2 mod FO2 Engine Tweaks (Sfall)

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

  1. Cyrus

    Cyrus It Wandered In From the Wastes

    107
    Nov 5, 2015
    Ok, I spent a few hours trying to to find the defines for some of the values but I just couldn't find them.

    In criticals.cpp

    I can see this:
    #define SetEntry(critter, bodypart, effect, param, value)

    and then looking at this
    SetEntry(18, 0, 0, 5, 5001);

    I can understand first value is critter (horigan), second is bodypart (0-7), third seems to be the critical lever (0-5)...

    But the 4th and 5th value, I'm not understanding well. I think (but not sure) "param" decides which field (element) within the level to change (critical mult, critical flag, stat check, message, etc) , and the 5th sets the value of the field.


    But I'm not clear how the param works. is it from 0-6 for each field from left to right as ordered according to the critical table posted on fandom?

    And the values for the "VALUE" field I suppose should be different according what the param field number is. Have I got this right?

    Is the "VALUE" field a decimal number representing the equivalent hex value?
     
    Last edited: Sep 5, 2020
  2. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    They are the same as the arguments of set_critical_table script function.
    4th: element/value type, 0-6 correspond to the columns in the critical hit tables. (0 - damage multiplier, 1 - effects, etc.)
    5th: the value for the element, so it can be multiplier values, effects (DAM_* defines in Define.h header), SPECIAL stats (STAT_* in Define.h), or message numbers (in combat.msg)
     
    Last edited: Sep 5, 2020
  3. Cyrus

    Cyrus It Wandered In From the Wastes

    107
    Nov 5, 2015
    Ok, Thanks so much man.
     
  4. gustarballs1983

    gustarballs1983 A Smooth-Skin

    687
    Oct 28, 2009
    Are You sure, that You've configured ddraw.ini properly for the playback (and *indeed* playback the upscaled .avi videos insted of .mve) or do you just want to 'troll' me from a "NVIDIA card owner's" position? :p
    i don't think the videos are alright at all. No matter what settings i use to cut them they always end up without sound and in turbo display mode ingame. My codecs must be ok since external aplication (i use Allplayer) plays back the video just fine.

    Although the upscale AI I've installed for testing purposes did come with some codecs of it's own FFdd if i remember correctly. they're not installed separately in the system, however FFdd also come with CCCP codec pack which i do have installed.
     
    Last edited: Sep 5, 2020
  5. Cyrus

    Cyrus It Wandered In From the Wastes

    107
    Nov 5, 2015
    NovaRain I read through criticals.cpp and noticed something which I think might be an error but I could be wrong. Wanna get clarification.

    At line 168 the entry is:
    Code:
    SetEntry(4, 0, 4, 2, -1);
    This translates to:
    SetEntry(Ghouls, Head, 5th Crit_lvl, stat_check, value =-1)

    This field sets which SPECIAL to be checked. Its endurance which should technically be checked.

    The above line is saying -1 should be checked. My guess is Endurance Can't be -1.

    I suppose stats should be from 0 to 6. ST, PE, EN, etc... 0, 1, 2, etc.

    Am I mistaken about something? cause if not then my guess is that the value "-1" was probably intended for the "Modifier check" field and not the STAT check field.
    And even if the value of this field is correct, then the next field (modifier check field) should technically hold a value, which it doesn't.

    If I caught this right and I'm not mistaken, then the following line 170 has the same error.

    Please confirm.
     
  6. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    -1 means "no stat". If you read the notes at the button of the table on fandom you'd know why.
     
  7. Mr.Stalin

    Mr.Stalin Agent of Enclave Modder

    377
    Oct 29, 2015
    Of course right. I'm using these videos for further tests.
     
  8. Cyrus

    Cyrus It Wandered In From the Wastes

    107
    Nov 5, 2015
    Oh yes. sorry about that. I have read that page so many times that I don't read those parts anymore, and had forgotten that note. my mistake.
     
  9. gustarballs1983

    gustarballs1983 A Smooth-Skin

    687
    Oct 28, 2009
    Guess I'll wait for the results..

    Anyway do you want the rest of those Fo1 upscaled videos? The rest didn't had to go through bandicut and I downloaded them with conversion through "Any Viideo Downloader". The rest of the videos I speak of seem to work fine for me, although Lexx said they work 'wonky' or something, whatever that was about.
    Anyways whenever ending a playback of .avi videos in pipboy the game turns interface to black color. Simply refreshing the interface returns it to normal (although not the leather/metal sidebar art). This might be looked into as well.
    If there are blue sidebars during playback, then there are no <moviename>.cfg files present.
    Simply setting a fade in/out effect with colors set to 0,0,0 for "0" frame fixes this.
     
  10. Cyrus

    Cyrus It Wandered In From the Wastes

    107
    Nov 5, 2015
    EDIT** shortening and updating.**


    So the question was: when needing persistent arrays,

    1. Where is best to create them within the script, and,
    2. how to call them from other scripts.


    Documentation says that permanent arrays (created, or fixed) can be accessed by any script



    ** Answer to first part is, Doesn't matter where you create them. Arrays are global. but the variable that holds its ID is local.

    Still no answer for the second part. I'll update if I figure out.
     
    Last edited: Sep 24, 2020
  11. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    sfall 4.2.8 and 3.8.28 are released on SourceForge, along with their respective modders packs.
     
    Last edited: Oct 19, 2020 at 12:44 PM
    • [Rad] [Rad] x 3
  12. Cyrus

    Cyrus It Wandered In From the Wastes

    107
    Nov 5, 2015
    That's awesome!

    Just in time. I finished the other components and was just ready to work on tohit.

    This release means a lot to me.


    Regarding the new argument for COMBATDAMAGE, I suppose you can't use the normal "get_sfall_arg" on it, can you? what would it return?

    Doc says use get/set_object_data. from anywhere?

    What would be some use case examples of this argument? how can we use it to our advantage?
     
    Last edited: Oct 20, 2020 at 11:38 AM
  13. NovaRain

    NovaRain Casual Modder Modder

    Mar 10, 2007
    You can get it with normal get_sfall_arg just like other arguments. Don't know why you think it's different from others.
    It's exactly the same as what the new "combat_data" returns: the pointer to the combat data.
    Here's a simple example that replaces all player's critical hit messages with line 6500 from combat.msg.
    Code:
    #include ".\headers\define.h"
    #include ".\headers\sfall\sfall.h"
    #include ".\headers\sfall\define_extra.h"
    
    procedure start;
    procedure CombatDamageHandler;
    
    procedure start begin
       if game_loaded then begin
          register_hook_proc(HOOK_COMBATDAMAGE, CombatDamageHandler);
       end
    end
    
    procedure CombatDamageHandler begin
       variable
          attacker        := get_sfall_arg_at(1),
          attackerResults := get_sfall_arg_at(5),
          combatData      := get_sfall_arg_at(12);
    
       if (attacker == dude_obj) and (attackerResults bwand DAM_CRITICAL) then begin
          set_object_data(combatData, C_ATTACK_MESSAGE, 6500);
       end
    end
    
     
    Last edited: Oct 20, 2020 at 12:38 PM
  14. Cyrus

    Cyrus It Wandered In From the Wastes

    107
    Nov 5, 2015
    Ok I see. I forgot that there is a whole new function called combat data. I'll read the documentation on it first.