WorldThingDamaged(WorldEvent e) : add NewDamage

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

WorldThingDamaged(WorldEvent e) : add NewDamage

Postby merlin86 » Thu Apr 30, 2020 2:22 am

Hello,
it would be usfeful to add a NewDamage property to the event WorldThingDamaged, like WorldLineDamaged and WorldSectorDamaged do, because Damage is a read-only property.

I'm asking this because I'm trying to apply different damages to the player without subclassing the player class, otherwise it works only for the new class and not for every player class avaialable during the game.
User avatar
merlin86
Somewhere between supercazzola and quintana
 
Joined: 29 Jan 2008
Discord: LuciferSam#7338
Twitch ID: LuciferSam86
Github ID: LuciferSam86
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: Yes (Using Development/Testing Version)
Graphics Processor: nVidia with Vulkan support

Re: WorldThingDamaged(WorldEvent e) : add NewDamage

Postby Major Cooke » Thu Apr 30, 2020 8:04 am

WorldThingDamaged can't be changed like this since it was made strictly for postmortem, but I have an idea.

Perhaps having a WorldThingPreDamage virtual, a new function to perform what is desired in, could suffice. This would be called before DamageMobj so it's not intrusive on the code, and contains an IsFinal boolean to stop further event handlers from running it if needed.

Modders can use this to effectively intercept damage variables before they're actually processed. However it's still subject to DamageMobj itself and any overrides the original player had. I'm also contemplating sending along the original parameters in a struct so anyone overriding DamageMobj can compare, since actors overriding them are meant to have the final say.

I'll be giving this a try since this will be beneficial to a project I'm working on too.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: WorldThingDamaged(WorldEvent e) : add NewDamage

Postby merlin86 » Thu Apr 30, 2020 11:57 am

Would be super nice having this function, it could help doing some mods.
Thanks :)
User avatar
merlin86
Somewhere between supercazzola and quintana
 
Joined: 29 Jan 2008
Discord: LuciferSam#7338
Twitch ID: LuciferSam86
Github ID: LuciferSam86
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: Yes (Using Development/Testing Version)
Graphics Processor: nVidia with Vulkan support

Re: WorldThingDamaged(WorldEvent e) : add NewDamage

Postby Major Cooke » Thu Apr 30, 2020 1:06 pm

Yeah. I agree, it would be nifty but this may take some time.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests