[Added] Clearscope For Actor.ApplyDamageFactor

Moderator: GZDoom Developers

Clearscope For Actor.ApplyDamageFactor

Postby RaveYard » Fri Nov 12, 2021 12:52 pm

I kinda need this and I've looked into the source and I don't see any reason why this function in Actor can't be clearscope.
Code: Select allExpand view
native int ApplyDamageFactor(Name damagetype, int damage);
RaveYard
 
Joined: 12 Apr 2013

Re: Clearscope For Actor.ApplyDamageFactor

Postby Rachael » Fri Nov 12, 2021 7:48 pm

Why do you need it to be clearscope? What exactly is it you are trying to do?
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Debian-like Linux (Debian, Ubuntu, Mint, etc) 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Clearscope For Actor.ApplyDamageFactor

Postby Gez » Sat Nov 13, 2021 5:12 am

Clearscope functions are functions that do not have an impact on the gameplay. They're math operations and simple information getters. From the wiki description of ApplyDamageFactors, it seems it'd be safe, since all it does is compute a value, i.e. it applies damage factors to a damage value, but it does not apply damage to the actor. If it has no undocumented side effects, it'd be fine. Could be used for things such as VATS-like previewing how much damage an attack would inflict on a target, for example.
Gez
 
 
 
Joined: 06 Jul 2007

Re: Clearscope For Actor.ApplyDamageFactor

Postby RaveYard » Sat Nov 13, 2021 7:03 am

That's what I'm trying to do. I want to do an indicator of how much damage you'll deal with specific damage type.
RaveYard
 
Joined: 12 Apr 2013

Re: Clearscope For Actor.ApplyDamageFactor

Postby Graf Zahl » Sat Nov 13, 2021 7:04 am

It's marked 'const' so yes, it will be safe.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Clearscope For Actor.ApplyDamageFactor

Postby Rachael » Sat Nov 13, 2021 10:08 am

User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Debian-like Linux (Debian, Ubuntu, Mint, etc) 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Clearscope For Actor.ApplyDamageFactor

Postby Blue Shadow » Sat Nov 13, 2021 10:20 pm

Note that there is ApplyDamageFactor (singular) and ApplyDamageFactors (plural). The change was made to the latter (plural), while the OP is requesting to change the former (singular).
User avatar
Blue Shadow
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Clearscope For Actor.ApplyDamageFactor

Postby RaveYard » Thu Nov 18, 2021 7:54 am

Yes, I happen to be using the former. Should I ask again?
RaveYard
 
Joined: 12 Apr 2013

Re: Clearscope For Actor.ApplyDamageFactor

Postby Rachael » Thu Nov 18, 2021 1:31 pm

No I will simply reopen this. But I don't have time to do this right now. I'll get to it later if someone doesn't beat me to it.
User avatar
Rachael
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Debian-like Linux (Debian, Ubuntu, Mint, etc) 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests