ACS - SetActorProperty DamageFactor For a Specific Type?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
Azagthoth
Posts: 63
Joined: Wed Jan 20, 2021 4:06 pm

ACS - SetActorProperty DamageFactor For a Specific Type?

Post by Azagthoth »

Hi guys. I was wondering if it's possible to set/get a specific DamageFactor type in ACS. So for instance I want to set DamageFactor "fire" to 0.2. Can it be done?
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: ACS - SetActorProperty DamageFactor For a Specific Type?

Post by Enjay »

How is the damage being applied (damaging sector, scripted event etc)?

The answer is probably yes, but without knowing how you are dealing the damage, it's hard to give specifics.
Jarewill
 
 
Posts: 1766
Joined: Sun Jul 21, 2019 8:54 am

Re: ACS - SetActorProperty DamageFactor For a Specific Type?

Post by Jarewill »

I don't think it's possible to set DamageFactors that way.
But you can create a PowerProtection item and give it to the player/monster.
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: ACS - SetActorProperty DamageFactor For a Specific Type?

Post by Enjay »

Sorry, I misread "damage factor" as "doing damage".
Azagthoth
Posts: 63
Joined: Wed Jan 20, 2021 4:06 pm

Re: ACS - SetActorProperty DamageFactor For a Specific Type?

Post by Azagthoth »

Jarewill wrote:I don't think it's possible to set DamageFactors that way.
But you can create a PowerProtection item and give it to the player/monster.
I guess that could SET values but I don't think I can GET values that way, or can I? What I'm trying to do is get a specific DamageFactor's value, check if it's lower than 0.2, then if it is I want to set it to 0.2. Do you think this is possible to do somehow?
.
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: ACS - SetActorProperty DamageFactor For a Specific Type?

Post by Blue Shadow »

What is it that you're trying to achieve here (generally speaking)?
Azagthoth
Posts: 63
Joined: Wed Jan 20, 2021 4:06 pm

Re: ACS - SetActorProperty DamageFactor For a Specific Type?

Post by Azagthoth »

Blue Shadow wrote:What is it that you're trying to achieve here (generally speaking)?
A debuff that removes immunities from certain damage types. So for instance, let's say a monster has DamageFactor "Fire", 0.0, I want to set it to 0.2. But if another monster has DamageFactor "Fire", 1.0, I don't want to change it. Basically, I need a way to Get and Set specific DamageFactor types.

Alternatively, just add 0.2 to the DamageFactor "Fire", if it's possible. So in this case, 0.0 would become 0.2, 1.0 would become 1.2, and so on.
Post Reply

Return to “Scripting”