Clearscope For Actor.ApplyDamageFactor

Moderator: GZDoom Developers

RaveYard
Posts: 186
Joined: Fri Apr 12, 2013 10:51 am

Clearscope For Actor.ApplyDamageFactor

Post by RaveYard »

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 all

native int ApplyDamageFactor(Name damagetype, int damage);
User avatar
Rachael
Admin
Posts: 13089
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Clearscope For Actor.ApplyDamageFactor

Post by Rachael »

Why do you need it to be clearscope? What exactly is it you are trying to do?
Gez
 
 
Posts: 17684
Joined: Fri Jul 06, 2007 3:22 pm

Re: Clearscope For Actor.ApplyDamageFactor

Post by Gez »

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 [wiki]ApplyDamageFactors[/wiki], 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.
RaveYard
Posts: 186
Joined: Fri Apr 12, 2013 10:51 am

Re: Clearscope For Actor.ApplyDamageFactor

Post by RaveYard »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 48334
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Clearscope For Actor.ApplyDamageFactor

Post by Graf Zahl »

It's marked 'const' so yes, it will be safe.
User avatar
Rachael
Admin
Posts: 13089
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Clearscope For Actor.ApplyDamageFactor

Post by Rachael »

Blue Shadow
Posts: 4906
Joined: Sun Nov 14, 2010 12:59 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Clearscope For Actor.ApplyDamageFactor

Post by Blue Shadow »

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).
RaveYard
Posts: 186
Joined: Fri Apr 12, 2013 10:51 am

Re: Clearscope For Actor.ApplyDamageFactor

Post by RaveYard »

Yes, I happen to be using the former. Should I ask again?
User avatar
Rachael
Admin
Posts: 13089
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Clearscope For Actor.ApplyDamageFactor

Post by Rachael »

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.

Return to “Closed Feature Suggestions [GZDoom]”