Fallout 2 mod FO2 Engine Tweaks (Sfall)

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

  1. NovaRain

    NovaRain Casual Modder

    Mar 10, 2007
    Me. I still play/test nearly all mods with it. :P
     
  2. Mr.Stalin

    Mr.Stalin First time out of the vault

    Oct 29, 2015
    Who will write this script replacing this formula? Ты?)
     
  3. phobos2077

    phobos2077 Mildly Dipped
    Modder

    Apr 24, 2010
    I guess we will have to leave them be, until the author decides to re-make the formula in SSL :)

    Btw, do we really need different versions of Glovz mod? Does last version not make prior version redundant?

    PS: вот именно поэтому мне не нравятся моды в движке. Сначала их добавляют, потом когда выясняется что их легко заменить скриптом - уже поздно и sfall замусорен еще сильнее :)
     
  4. NovaRain

    NovaRain Casual Modder

    Mar 10, 2007
    sfall 3.8.3 is released on SourceForge, along with modders pack and win2k version.
    With the bug fixes in 3.8.2 and 3.8.3, the bag/backpack items should have much fewer bugs and exploits.
    BTW, I wonder if anyone have noticed the Sequence value issue in character text file. It's been there for nearly twenty years since FO1...
     
    Last edited: Mar 26, 2017
    • [Like] [Like] x 1
  5. phobos2077

    phobos2077 Mildly Dipped
    Modder

    Apr 24, 2010
    Just wanted to mention a couple of new mods/features in the upcoming sfall 4.0:

    - Item highlight mod was completely replaced with a script. Now everyone who can compile scripts can change it to their liking. INI settings were simplified as well and have more color options to choose from.
    - New scripting function set_dude_obj (among others) will allow to "switch bodies" at any time with any critter. It's a continuation of "ControlCombat" mod, which may be replaced with a script later as well.
    - New NPC Armor Appearance script was implemented to replace scripts that are currently included in RP. The benefit of this script is such that it can easily be adopted to any mod or TC without even changing the code (by means of INI file). Also it is designed to work well with current implementations of Hero Appearance mod and ControlCombat (proper figure will be displayed when using inventory while controlling NPC).

    There are other changes as well. This release will probably be "beta" for some time, because of huge amount of code being rewritten.
     
    • [Like] [Like] x 2
  6. Lexx

    Lexx Lived Through the Heat Death
    Moderator

    Apr 24, 2005
    About the ControlCombat mod, would it be possible to somehow mark the current active party member? I am thinking of something like this:



    Right now I often find it confusing to see who's turn it is and it's tedious to check the character screen over and over again. For my Fo2 mod I've added a simple text string in the message log that tells the player who's turn it is, but I don't find this solution to be very pretty.

    Having a visual marker in the active game window that disappears once the character moves or does any action, sounds way better to me. No idea how / if it's possible to more or less simply script this. Spawning a misc graphic under the active character is the easy part, but removing it again at any action... potentially not so. With my noob scripting skills, I probably would do something like attaching a script to it, which detects any kind of click (mouse or hotkeys) and then makes the graphic delete itself.. but that does sound kinda rough.

    /edit: I scrapped together a simple prototype:


    It's a global script that spawns a scenery object at the beginning of the turn on the position of the active critter. The object is removed as soon as a critter_tile != scenery_tile check kicks in. Sadly this only happens after the critter has finished his walking cycle, so from a visual point of view it looks kinda shitty. At first I wanted to check for key pressed (right click / left click), but I can't find any DIK code for the mouse, so I guess there aren't any? ... Anyway. Technically it works and improves the combat handling even though it isn't as pretty as it could be.

    /edit2: This is in my global script:
    Code:
    procedure CheckCombatPlayer begin
    variable critter := dude_obj;
       
       if (combat_is_initialized) and (party_size_sd3 > 0) then begin
           if (Marker_Ptr == 0) then begin
               Marker_Ptr := create_object(PID_CMB_MARKER,(tile_num(critter)),(elevation(critter)));
           end
           else  begin
               // Remove marker if critter moved:
               if (tile_num(Marker_Ptr) != (tile_num(critter))) then begin
                   destroy_object(Marker_Ptr);
                   Marker_Ptr := 0;
                   
                   // Create new marker right away.
                   // Basically we just refresh its position:
                   Marker_Ptr := create_object(PID_CMB_MARKER,(tile_num(critter)),(elevation(critter)));
               end
           end
       end
       else begin
           if (Marker_Ptr != 0) then begin
               destroy_object(Marker_Ptr);
               Marker_Ptr := 0;
           end
       end
    end
     
    Last edited: Apr 2, 2017
    • [Like] [Like] x 1
  7. phobos2077

    phobos2077 Mildly Dipped
    Modder

    Apr 24, 2010
    Thanks, I was thinking exactly the same about marking current critter. Though my thought was to just use blinking green outline for a second or two, so that the player can see who is now under control (the outline solution has the benefit that you don't need to have specific prototype for "green hex", etc. - meaning compatibility with any mod). Considering that I just removed Party Control mod altogether from sfall into a script - you can customize this how you want.

    Also I've added "Combat turn" hook script to make this possible. I can think of many other uses for this hook script...

    There is a HOOK_MOUSECLICK that should help you.

    PS: I strongly advise to use hook scripts instead of running checks in your global script for every frame. We have a hook for keypress, mouseclick, etc. Also planning to add hooks whenever "game state" is changed (that is, the result of "get_game_mode" function). This should allow to get rid of such "main loop checking" in most cases.

    A lot of scripts that use "set_global_script_repeat" can make game laggy.

    Btw, what mod is this on screenshot? And what are those buttons on top?
     
    Last edited: Apr 2, 2017
  8. Lexx

    Lexx Lived Through the Heat Death
    Moderator

    Apr 24, 2005
    Yeh, I tried the mouseclick hookscript, but it didn't worked well- visually it looks worse than my global script (you click somewhere, character moves and THEN the hookscript kicks in.. basically like my global script version, with the difference that it only runs on mouse click). Moving this into a "combat turn" hookscript seems like the better solution.

    Using a colored outline around the character sounds good too.

    Screenshot is from my wip Fo2 mod. The buttons at the top are the cheat / debug menu made by Vennor for Mutants Rising. It's unreleased right now, afaik.

    PS: Is there already a public release for the new Sfall version?
     
  9. phobos2077

    phobos2077 Mildly Dipped
    Modder

    Apr 24, 2010
    Not yet, but I can make a binary just for you if you interested. It's practically beta, but aimed at modders to start using/testing it.
     
  10. Lexx

    Lexx Lived Through the Heat Death
    Moderator

    Apr 24, 2005
    Sure, I'll update my stuff then. Hope it's not too many things I have to change, though... :>

    While I am at it-- is there any chance to "hack" into the pipboy resting function?

    Back in the days I had a custom Sfall version made by someone who added a hookscript for the pipboy "sleep" button. I used this to disable the sleep button and adding my own sleep menu in script, which allowed me to do whatever I wanted. By now I scrapped all that stuff, because I found the gameplay effect to be marginal... Still, being able to track the time a player is waiting and allowing this to cancel while it's going on seems like a useful thing to have.
     
  11. phobos2077

    phobos2077 Mildly Dipped
    Modder

    Apr 24, 2010
    Here is the DLL. Be sure to grab the externalized mods from this folder (if you need them) and this sfall-mods.ini.

    Need to think about the rest function. Not sure if we need actual hook script (can't imagine much you can do with it).
     
    Last edited: Apr 4, 2017
  12. Lexx

    Lexx Lived Through the Heat Death
    Moderator

    Apr 24, 2005
    Alright, did I quick test and compiled my own versions. I haven't tried the NPC armor script yet.. will have to disable my version first.

    Item highlight works and feels great.

    Combat marker don't work at all. I can take control of the party member, but there is no outline visible. Now I am not sure if I missed something or if my stuff is conflicting with it. I disabled my own combat marker, but it still does nothing. Everything else seems to work, though- stats, perks, character sprite in the inventory, etc.. Awesome.
    /edit: Ok, just checked out the script- it's only about item highlighting. That combat outline thingy isn't in yet. :>

    /edit1: About the rest function, maybe it's possible to "fetch" the option chosen by the player and return the time value, then modify it and call another script / procedure once done?
    For example, if I click "rest 1 hour", I get the value of 60 minutes back, which I then modify to 30. After the 30 mins, the pipboy will close + the next script call happens?

    It's not a super important feature, but there still might be situations where it might be useful.

    /edit2: Here is another feature request... Is refueling the car hardcoded? I can't find anything about how to get the currently available fuel in a car. The only thing of interest is "car_give_gas(x)" which allows to refill the car via script. Now I tried to make my own car refueling, which is pretty much this:
    Code:
               if (obj_pid(obj_being_used_with) == PID_MICRO_FUSION_CELL) then begin
                   remove_pid_qty(dude_obj, PID_MICRO_FUSION_CELL, 1)
                   car_give_gas(40000);
               end
               else begin
                   remove_pid_qty(dude_obj, PID_SMALL_ENERGY_CELL, 1)
                   car_give_gas(16000);
               end
    Problem with this is... I am using up 1 ammo stack, no matter what. Even if the car is 90% full, I will remove 1 full stack from the player, which can be 50 single "bullets". Also this makes me wonder--- what if the player only has 1 "bullet" of a 50-stack left and tries to refuel the car? In theory, this should have exactly the same effect as a full stack, which is pretty game breaking, imo. Don't know how to workaround this.


    /edit3: Did something change with the elevator code? My custom sfall elevators aren't working anymore with this build.
     
    Last edited: Apr 3, 2017
  13. phobos2077

    phobos2077 Mildly Dipped
    Modder

    Apr 24, 2010
    Because it's not implemented :) I just mentioned that it's possible to do, given that the gl_partycontrol.ssl is available for customization.

    Add this as issue on github. But I'm not sure I will be the one who implements it. There are other, more exciting features pending implementation.

    Add this to github as well. Need to check what scripting is available for this and what can be added. I think Crafty
    did some work in this direction, but I don't remember what exactly.

    It's a bug. Will be fixed soon.

    Edit: fixed
     
    Last edited: Apr 4, 2017
  14. Lexx

    Lexx Lived Through the Heat Death
    Moderator

    Apr 24, 2005
  15. Lexx

    Lexx Lived Through the Heat Death
    Moderator

    Apr 24, 2005
    New question: Is it already possible to change the container size via script? Like, container proto has a capacity of 50, then we use a script command to increase the capacity to 100?

    I have found commands to influence the size of an item, but that's all.
     
  16. NovaRain

    NovaRain Casual Modder

    Mar 10, 2007
    Have you tried get/set_proto_data() and PROTO_CN_MAX_SIZE (from define_extra.h) ?
     
  17. phobos2077

    phobos2077 Mildly Dipped
    Modder

    Apr 24, 2010
    Yeah, I think changing proto via these functions should most certainly work. Game engine uses either those values, or cached values in game object itself, but I don't think there is a field for size.
     
  18. Lexx

    Lexx Lived Through the Heat Death
    Moderator

    Apr 24, 2005
    Yes, this works. Thanks!

    Code:
    set_proto_data(obj_pid(self_obj),PROTO_CN_MAX_SIZE,40);
    etc.
     
  19. Lexx

    Lexx Lived Through the Heat Death
    Moderator

    Apr 24, 2005
    Do we have the ability to force-play a certain set of animations? I'd like to force dude_obj to do the hammer swing, even if no hammer has been equipped.

    I've tried to workaround this with equipping a hammer via "wield_obj_critter(x,y)" and then play the normal attack animation, but this doesn't work. After using wield_obj_critter, dude_obj is still not refreshed until I open the inventory at least once.
     
  20. phobos2077

    phobos2077 Mildly Dipped
    Modder

    Apr 24, 2010
    Try playing around with reg_anim_take_out and reg_anim_change_fid functions (remember - critter FID reflects critter/armor base FID + equipped weapon + animation code). Those are new, you can find description on modderspack.