Negative ReducedDamagePct?

Discussions about Coding and Scripting
Post Reply
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Negative ReducedDamagePct?

Post by zacman »

Small question, seems silly to make a thread for it, but here we go:
So, I'm working on a map concept, and I was curious: With the ReducedDamagePct property of the Pawn class, is it possible to set this as Negative? That is, is it possible to give a pawn a Weakness to a particular damage type? (I was considering a Zone that restores health, but inflicts a weakness to a particular damage type upon players)
Image[url=steam://friends/add/76561198048595886]Image[/url]
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Negative ReducedDamagePct?

Post by JackGriffin »

Yeah, you are going to need to set the pawn's reduced damage. I'd do it by awarding an armor inventory item that reduces certain damage types. That way you can fully control the player's possession of it and by extension the effects you want to accomplish. The player doesn't even need to be aware they have the armor-based item if you don't want to make it visual.
So long, and thanks for all the fish
User avatar
zacman
Adept
Posts: 412
Joined: Wed Apr 15, 2009 5:36 am
Personal rank: M-M-M-MONSTER KILL

Re: Negative ReducedDamagePct?

Post by zacman »

Well, I was thinking of just taking the approach that the VaccumZone does, but rather than changing the player's FOV, change their ReducedDamagePct and ReducedDamageType.
Image[url=steam://friends/add/76561198048595886]Image[/url]
JackGriffin
Godlike
Posts: 3774
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Negative ReducedDamagePct?

Post by JackGriffin »

Altering a client-side variable is different than affecting something that replicates from server to client and back. It's going to be a bit more technical to do this than you are thinking. If you have a lava zone, it can directly damage the player and there's no issue. The server tells the client "You were hurt, your new health is X." and everything is fine. However if the server attempts to assign damage taken by a pawn but also needs to compare damage type and if that pawn is in a particular zone, that's a lot more complex. It's just way easier to assign an inventory item to the pawn when he is in your chosen zone, let that item affect takedamage, then destroy it if the pawn leaves the zone. Replication is preserved, the chain of mutator takedamage stays simple, and it will be easy to code since lots of examples exist.

It's very possible to do it your way but it's going to require multiple extra "if/then" checks on every bit of damage taken. Too much of a load for me to go that route.
So long, and thanks for all the fish
Post Reply