sfall-team / sfall

sfall - Engine modifications for Fallout 2
https://sfall-team.github.io/sfall/
GNU General Public License v3.0
338 stars 40 forks source link

Function explosion() doesn't run properly while in combat #551

Open blackpaulillyria opened 1 month ago

blackpaulillyria commented 1 month ago

If function explosion() is ran while outside of combat, then the damage, VFX and SFX run normally. However, if combat is started, then they do not. I can't get hurt, the VFX and SFX do not run either.

It seems that the developers were aware of this issue since they created this workaround throughout the code. For example:

explosion( tile_num( self_obj ), elevation( self_obj ), 1 );
critter_dmg(source_obj,random(MIN_DMG,MAX_DMG),(DMG_normal_dam BWOR DMG_BYPASS_ARMOR BWOR DMG_NOANIMATE));

Can this be fixed?

phobos2077 commented 1 month ago

Well if you fix it you will break existing scripts. Could make a new opcode for that, but really just write a procedure that branches out if you're in combat. That's how my explosive traps work.

blackpaulillyria commented 1 month ago

I’ll create a scripting workaround for explosions based on C code behaviour in the meantime. The main issue with the combat workaround they made is that there is no radius damage. Also, use of this is somewhat weird and unfair: DMG_BYPASS_ARMOR

phobos2077 commented 1 month ago

Well, I'd argue it's not unfair if you stepped on a mine and it explodes below you - your armor probably isn't well protected from below, unless it's a PA. Radius damage you can implement just as well. Take a look at my implementation:

https://github.com/phobos2077/fo2_ecco/blob/ea84ce234d8361a6dba7b479bf212584a429294e/scripts_src/_pbs_headers/traps.h#L276

blackpaulillyria commented 1 month ago

Thanks for sharing your implementation, I’ll check it out!

About the armor, it worries me that there’s a certain condition that ignores Explosive damage DT/DR and that isn’t communicated to the player. It also raises questions should other damage types also have such conditions too?

Definitively a good topic for roundtable discussion and how much we want to gamify/simulate real world inside Fallout? My rule of thumb, if it makes it more fun while staying true to the game world’s internal laws, go for it!