Fallout 2 mod FO2 Engine Tweaks (Sfall)

Who will write this script replacing this formula? Ты?)
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 замусорен еще сильнее :)
 
sfall 3.8.3 is released on SourceForge, along with modders pack and win2k version.
Changelog said:
v3.8.3
>Fixed a crash when pressing reload weapon key while in the main menu
>Fixed metarule2_explosions not being reset properly
>Fixed global scripts not running on the world map when disabling the world map speed patch
>Fixed inconsistent behavior of motion sensor flag 2
>Added 3 new arguments to hs_tohit hook script
>Added a fix for the bag/backpack exploit that lets you keep items that are supposed to be removed from inventory
>Added a fix for the original engine issue that caused Sequence stat value to not be printed correctly when using "print to file" option
>Improved the functionality of ScrollMod
>Improved the functionality of ExplosionsEmitLight. Now it will check if an item was lit prior to being thrown/shot
>Changed SkipSizeCheck and ExtraCRC to not require enabling sfall debugging mode
>Removed the obsolete WorldMapFPS, ForceLowResolutionTimer, and WorldMapDelay

Original engine bug fixes and various features based on the work by Crafty:
>Added a fix for a crash when clicking on empty space in the inventory list opened by 'Use Inventory Item On' (backpack) action icon
>Added a fix for negative SPECIAL values in character creation
>Added a fix for the game hanging in an endless loop in combat mode when using reg_anim_animate inside damage_p_proc
>Added 3 new arguments to hs_barterprice hook script
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:
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.
 
About the ControlCombat mod, would it be possible to somehow mark the current active party member? I am thinking of something like this:

B0gv3Q.png


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:
Z4wIYk.png


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:
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...

but I can't find any DIK code for the mouse, so I guess there aren't any?
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:
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?
 
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.
 
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:
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.

/edit: Ok, just checked out the script- it's only about item highlighting. That combat outline thingy isn't in yet. :>
Because it's not implemented :) I just mentioned that it's possible to do, given that the gl_partycontrol.ssl is available for customization.

/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.
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.

/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
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.

/edit3: Did something change with the elevator code? My custom sfall elevators aren't working anymore with this build.
It's a bug. Will be fixed soon.

Edit: fixed
 
Last edited:
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.
 
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.
Have you tried get/set_proto_data() and PROTO_CN_MAX_SIZE (from define_extra.h) ?
 
Have you tried get/set_proto_data() and PROTO_CN_MAX_SIZE (from define_extra.h) ?
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.
 
Yes, this works. Thanks!

Code:
set_proto_data(obj_pid(self_obj),PROTO_CN_MAX_SIZE,40);
etc.
 
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.
 
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.

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.
 
Is there an easy way to figure out the correct FID? The wiki page about FIDs is driving me nuts.

/Edit: I used "obj_art_fid(x)" to fetch me the FIDs, but "reg_anim_change_fid" doesn't play animations. I've workarounded this with instead switching to the stand-with-weapon FID, then calling a normal weapon attack animation. It's not the same as playing the animation directly, but oh well.

Problem with this is, I would need to check for every armor and then pick the FID accordingly. That's not a very pretty approach, imo.
 
Last edited:
Out of curiosity - did anything change with the hero appearance mod at some point? I'm not sure if it's related to my mod (and if it is, then I don't know why), but whenever I start a game as e.g. bald head dude, save the game, then load, I'll find myself as normal dude. Same with the female: I start with green hair, save, load, and I am back to normal.

I'm posting this in here because the only thing I can imagine right now is that it's an Sfall issue.
 
Last edited:
Back
Top