Fallout 2 mod FO2 Engine Tweaks (Sfall)

I would like to help you on that matter, but I am just a shit programmer and wouldn't know where to use that stuff even if it'd hit me in the face. :p


Here is another question, though: As I've understood, it is possible to tell companions to never use the burst mode on a weapon. Now... is it possible to check what the NPC theoretically hit, once he'd fire his weapon? I mean, could it be possible to allow a companion to use the burst fire mode if neither the player nor player friendly units are even just remotely in his line of fire? Basically, make a check for all targets that possibly could be hit (no matter the % hit chance), and if there is anything green in it, force single fire?

This way we could keep them on burst, but don't risk getting sprayed as well.
 
Here is another question, though: As I've understood, it is possible to tell companions to never use the burst mode on a weapon. Now... is it possible to check what the NPC theoretically hit, once he'd fire his weapon? I mean, could it be possible to allow a companion to use the burst fire mode if neither the player nor player friendly units are even just remotely in his line of fire? Basically, make a check for all targets that possibly could be hit (no matter the % hit chance), and if there is anything green in it, force single fire?

This way we could keep them on burst, but don't risk getting sprayed as well.
You can use obj_blocking_line to duplicate engine behavior for calculating trajectories of bullets... If there is any friendly NPC on those lines of fire, then use set_critter_burst_disable. I didn't tried that myself, so that's just theory.
 
> ObjectPtr obj_blocking_line(ObjectPtr objFrom, int tileTo, int blockingType)
- returns first object which blocks direct linear path from objFrom to tileTo using selected blocking function (see BLOCKING_TYPE_* constants in sfall.h)
- if path is clear (no blocker was encountered by selected function) - returns 0
- objFrom is always excluded from calculations, but is required to be a valid object

It says, it only returns the first object. Basically it wouldn't work anymore if the player or another friend is *not* the first, but still in the possible target area?

I think this stuff is a tad too high for my skills already. :>

/Edit: Holy fuck, I think I got it to work. Needs more tests, though...

/Edit2: Nope, didn't. Sometimes it seems to work, sometimes it does not.

/Edit3: This is my test...
Code:
procedure combat_p_proc begin
variable get_target;
variable get_block;

   get_target := tile_num(target_obj);
   get_block := obj_blocking_line(self_obj,get_target, BLOCKING_TYPE_SHOOT);
   if (get_block == dude_obj) then begin
     debug("don't burst!");
     set_critter_burst_disable(self_obj,1);
   end
   else begin
     debug("burst????");
     set_critter_burst_disable(self_obj,0);
   end
   debug("get_block = " + get_block);
   debug("dude = " + dude_obj);
end

It *does* seem to work--- but the problem is, it first switches to get_burst == 0, then after bursting, it changes to get_burst == dude_obj... which of course is too late at that point.

I don't know where else I would put the code, though, if not combat_p_proc?

Also this only checks if the player is *between* the shooter and the target... what if the player is right *behind* or right *next to* the target? Then he still can die of burst.

/Edit4: Basically we would need to check if the player is between shooter and target, then check if the target is between player and shooter, then check the distance of the target to the player. Then decide if burst or not.

Can't this become a default Sfall feature? Seems useful even for generic ai. :>
 
Last edited:
Actually AI is already capable of doing what you're trying to do. It checks if it might hit friendlies and switches to single fire otherwise.. Does it not work in some cases?
If the feature is already there but doesn't work due to some bug, probably we can make fix for it. But otherwise complex AI behavior should be altered by scripts, because everyone may have different opinion on how AI should work for their mod (or different personalities of NPCs, etc.).

I was thinking about adding various hook scripts for altering AI behavior before...
 
Well, if it's already there- how come we are getting bursted so often? :p Maybe the ai checks by hit chance, which obviously means, he can still hit me... by chance?

I just recently started replaying Fo2 again (with the RP), and I am constantly getting bursted by Cassidy and his combat shotgun. I've also seen it in my mod- a companion who's combat control is set to "be careful not to hit me", but give him a 10mm SMG and he will fuck the shit out of me.

/Edit: This situation will 100% kill me by friendly burst fire:
3h9V0GN.png
 
/Edit: This situation will 100% kill me by friendly burst fire:

Can you enable debug.log in your game and check if you see this message "Friendly was in the way!" written to the log when your friendly kills you by burst fire?
The code is there, but I bet there is some mistake in logic (as it often the case with this piece of... code ;) ).
 
Actually AI is already capable of doing what you're trying to do. It checks if it might hit friendlies and switches to single fire otherwise.. Does it not work in some cases?
Do you mean AI burst setting (set by dialog), or something else? Because that setting certainly doesn't work as specified.

Well, if it's already there- how come we are getting bursted so often? :p Maybe the ai checks by hit chance, which obviously means, he can still hit me... by chance?

I just recently started replaying Fo2 again (with the RP), and I am constantly getting bursted by Cassidy and his combat shotgun. I've also seen it in my mod- a companion who's combat control is set to "be careful not to hit me", but give him a 10mm SMG and he will fuck the shit out of me.
Well, I prefer to disable party bursts altogether, which is why there's a component like that in my mod. There's also a shorter version by Novarain.

But if you want to go scripting ninja, and keep only safe burst, then it might be worth adding checks not only for PC, but also for party members and neutrals.
 
Well yeah, that's the plan. But if I can't even get it done for the PC, why bother with party members and stuff right now.

Thing is, if I disable burst by default, there is no real reason to ever give automatic weapons to my party members, imo.. and that's lame. And keeping them on do-burst is just too annoying right now, because I always have to run into a position where they (hopefully) won't hit me.
 
Sure there is... all mid-game rifles are automatic. Not using them, you're stuck with hunting rifle or such till end game.
But of course, if you manage to implement it for all critters, I'm all pro. (With PC only, I would probably still skip on burst, I as strive to play ironman)

Another idea I'm toying with is adding burst command switch to party orders, but I haven't got the time to try that yet.
 
Here's another thing: Wasn't it once possible to flip the main menu stuff to the right side, Fallout 1 style? I remember having seen something like that years ago, but I just can't find anything about it anymore.
 
Here's another thing: Wasn't it once possible to flip the main menu stuff to the right side, Fallout 1 style? I remember having seen something like that years ago, but I just can't find anything about it anymore.
MainMenuOffsetX/Y, there are five MainMenu* settings I didn't include in the INI. (three of them are somewhat useless.)
HRP has a similar MENU_BG_OFFSET_X/Y settings.
 
Last edited:
Thanks. I've searched NMA for the keywords and found this:
Code:
MainMenuCreditsOffsetX=-5
MainMenuCreditsOffsetY=0
MainMenuOffsetX=395
MainMenuOffsetY=27

Using this (or any other value I've tried) however, completely fucks up the menu. Now I see the button text twice in half way out of screen positions. Is there anything I am missing here?
 
I'd suggest not using MainMenuCreditsOffsetX/Y because they don't do much now (moving "Copyright(c) ..." string at the bottom without HRP; moving "SFALL ..." string but not the copyright with HRP). For my game your MainMenuOffsetX/Y values look like this:
fIma2zK.png


(HRP windowed mode, resolution 1024x768, with USE_HIRES_IMAGES=1)
 
Alright, seems it was related to me using some outdated version of the HighRes patch... Updated it, tweaked some stuff and now it works. Thanks!
 
Guys maybe we should create dedicated thread for discussing sfall itself? I know this thread was created originally for engine tweaks discussion, and sfall project emerged afterwards. But now it became something more. Basically now it consists of several related projects: original sfall, Crafty's sfall, sslc, int2ssl, Script Editor...
Also a place where we can maintain current status of project with all links, etc. would be nice.
 
sfall 3.8 is released on SourceForge, along with modders pack and win2k version.
Changelog said:
v3.8
>Improved npc combat control and fixed various issues with it
>Fixed bugs in set*_stat_min functions that set max values instead of min
>Unified the style of global/hook script log entries
>Added new universal opcodes sfall_funcX that allow to add new script functions without changing script compiler and/or decompiler
>Added new script functions: spatial_radius, critter_inven_obj2, intface_redraw, intface_hide, intface_show, intface_is_hidden, exec_map_update_scripts

Original engine bug fixes and various features based on the work by Crafty:
>sfall can now load global/hook scripts from dat files
>Improved the 'print to file' fix and added the ability to use long filenames in dat files
>Improved the functionality of ProcessorIdle

Please refer to the documents in modders pack for the details of new universal opcodes sfall_funcX and new script functions.
 
Here is a new request: Can we have a function to allow / disallow resting in a certain map? Would be useful for whe you dont want the player to rest in a certain situation.
 
Here is a new request: Can we have a function to allow / disallow resting in a certain map? Would be useful for whe you dont want the player to rest in a certain situation.
This is configured by vanilla map configs.
Code:
can_rest_here=No,No,No  ; All 3 elevations

Feel free to create issues on github for new requests. Link in my signature.
 
Last edited:
I know that it is done by vanilla map configs. Problem is, I can't change them ingame whenever I please ("allow_resting(MAP_X,TRUE);" or something). Also I have all signatures disabled, because otherwise I can't read shit in this forum theme. :>
 
Back
Top