Restoration Project and SFall script problems.

Discussion in 'Fallout General Modding' started by Mulligun, Jun 17, 2023.

  1. Mulligun

    Mulligun Still Mildly Glowing

    264
    Dec 14, 2006
    I've just installed the F2 Restoration Project (2.3.3) which ALSO includes (as far as i know) the SFall. I've created a super simple script like so:
    Code:
    procedure my_item_desc begin
      display_msg("Item new desc");
    end
    ...
    procedure start begin
       variable who, cur_dmg_thresh, cur_dmg_resist, color, msg, m;
    
       if(game_loaded) then begin
         register_hook_proc(HOOK_DESCRIPTIONOBJ, my_item_desc);
       end
    ...
    end
    The problem is that the HOOK_DESCRIPTIONOBJ DOEN NOT WORK with the RP!. I've tested it with SFall v4.3.8 and it DO WORKS!

    What can be the problem here?
    What the SFall version is embedded in RP 2.3.3?
     
    Last edited: Jun 17, 2023
  2. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    Read the hook description again, you are using it wrong. It needs a return value.

    Example for specific item:
    Code:
    procedure DescriptionObj_handler begin
       variable
          item := obj_pid(get_sfall_arg),
          description;
    
       if (item == PID_FARM_PARTS) then begin
          description := get_string_pointer(message_str(SCRIPT_FARMPART, 101));
          set_sfall_return(description);
       end
    end
     
  3. Mulligun

    Mulligun Still Mildly Glowing

    264
    Dec 14, 2006
    I've just installed the F2 Restoration Project (2.3.3) which ALSO includes the SFall. Unfortunately the SFall version there is very old (3.3) while there is v 4.3.8 as a separate download at least.
    My question is it possible to use a new, recent SFall version with the RP 2.3.3?
     
  4. Mulligun

    Mulligun Still Mildly Glowing

    264
    Dec 14, 2006
    Ok, Thx:-)
    But i think that the problem is that The RP I've installed (2.3.3) includes OLD SFall version 3.3, which seems DOESN'T implements the register_hook_proc function. So it is possible to use the newer SFall version (like 4.3.8 or so) with RP 2.3.3?
     
  5. Mulligun

    Mulligun Still Mildly Glowing

    264
    Dec 14, 2006
    Hello, Can i just replace old ddraw.dll (from SFall 3.3 from RP) with newer version from SFall 4.3.8 to make the RP work with the new SFall?
     
  6. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    You should use the RPU, which is newer and comes with a later version of Sfall by default.
     
    • [Rad] [Rad] x 2
  7. Mulligun

    Mulligun Still Mildly Glowing

    264
    Dec 14, 2006
    I've downloaded the latest Fallout2 Restoration Project (v.26) zip.
    1. How can intall it MANUALLY?
    2. How to configure SFall Script Editor to compile RPU scripts successfully? Do I have to have Modder Pack also installed? If so which version of MP i need?

    Thx. for help!
     
  8. Mulligun

    Mulligun Still Mildly Glowing

    264
    Dec 14, 2006
    I've downloaded the latest Fallout2 Restoration Project (v.26). Now when i try to compile a sample acklint.ssl script from scripts_src folder i get an error: "Assignment operator expected" inside upu.h file:
    Code:
    procedure check_filesystem_override begin
      variable fs_override := get_ini_setting("ddraw.ini|Misc|UseFileSystemOverride");
      if fs_override != 1 then begin
        ndebug("UseFileSystemOverride is disabled, enabling");
        set_ini_setting("ddraw.ini|Misc|UseFileSystemOverride", 1);
        float_msg(dude_obj, SCRIPT_REALNAME + ": filesystem override was disabled, some features failed to load. The setting is corrected. EXIT AND RE-LAUNCH THE GAME now.", FLOAT_MSG_WARNING);
        return false;
      end
      return true;
    end
    on line:
    Code:
    ndebug("UseFileSystemOverride is disabled, enabling");
    I'm using the SFall ScripEditor v4.1.5.0 which is configured like so:
    Location folder of headers files: "...\New F2 stuff\Fallout2_Restoration_Project-26\scripts_src\headers" and
    Location of Scripts.H file: "...\New F2 stuff\Fallout2_Restoration_Project-26\scripts_src\headers\scripts.h"
    with "New F2 stuff\Fallout2_Restoration_Project-26\scripts_src\sfall" folder content copied from "New F2 stuff\modderspack_4.3.3\scripting_docs\headers" (to source the sfall.h the compiler not to complain about)

    ANY help appreciated!
     
  9. Mulligun

    Mulligun Still Mildly Glowing

    264
    Dec 14, 2006
    How to get a pointer to the "dude" object (the player!:-) ) from another script (for e.g. acnagor.ssl)? Is there a function or sth. similar to do the task?

    Thx.
     
  10. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    dude_obj

    You should read the mapper manual which comes with script references. Also read and watch the tutorials that are linked here on the board.
     
    • [Rad] [Rad] x 2
  11. Mulligun

    Mulligun Still Mildly Glowing

    264
    Dec 14, 2006
    I'd like to display some info message any time the mouse pointer is over the game object like NPC or so. I know there is a look_at_p_proc for that purpose BUT the problem is that the procedure is called again ONLY when the mouse pointer is previously moved above another object. In other words it can't be called multiple times on the same object unless the mouse pointer "resets" by pointing sth else before.

    My questions are:

    1. How can I make the procedure be called ALWAYS when the mouse is over the object, no matter we pointed another object earlier or not.
    2. What is the purpose of script_overrides procedure?

    Thx for help.
     
  12. Femic

    Femic First time out of the vault

    70
    Nov 22, 2015
    I cannot answer the first question but as for the other one the purpose of script_overrides is to prevent the engine to overwrite your scripted statement.
    For example if you write something like:
    Code:
    procedure look_at_p_proc begin
               if (map_var(MVAR_Fixed_Well) == 0) then begin
                          display_msg(mstr(100));
               end
               else begin
                          display_msg(mstr(101));
               end
    end
    
    It can happen that the mst(100) and mstr(101) aren't shown because the engine overwrites this with the default mstr.
     
  13. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    Nah, the message shows always, it's just that it will also print the additional "you see nothing out of ordinary" etc. that is defined in the proto file. With script_overrides, you are overriding / preventing the default game action.
     
    • [Rad] [Rad] x 1
  14. Mulligun

    Mulligun Still Mildly Glowing

    264
    Dec 14, 2006
    What/where is the code/hook for displaying the "Talk" action cursor when the player hovers the mouse pointer over the entity like NPC?

    Thx. for help
     
  15. Mulligun

    Mulligun Still Mildly Glowing

    264
    Dec 14, 2006
    Sorry but i realized that the message "you see nothing out of ordinary" DOESN'T work anymore! It DOES NOT show up when hovering over anything general. (I'm using F2 v1.02)...
     
  16. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    Here are all available hooks. There is nothing else.
     
  17. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    No idea, must be something with your scripts.
     
  18. Mulligun

    Mulligun Still Mildly Glowing

    264
    Dec 14, 2006
    Is there a way to get programmatically the detailed prototype properties based on the PID/ObjectID? I'd like to get for. e.g. min and max damage of a weapon given by it's PID?

    Thx.
     
  19. Lexx

    Lexx Testament to the ghoul lifespan
    Moderator Modder

    Apr 24, 2005
    Last edited: Jul 5, 2023
    • [Rad] [Rad] x 1
  20. Mulligun

    Mulligun Still Mildly Glowing

    264
    Dec 14, 2006