Trying to make an action for my revive trigger so that when its activated it subtracts a set Percent of the triggering players minerals each time it goes off.
Not sure how to make it so it can calculate the triggering players current total minerals or how to set a percent of it being subtracted.
Thanks in advance for any help with this, wracking my brain for days trying to figure it out.
If you want your player to lose 1/3 of his minerals do:
Action: any unit dies
Condition: unit type of (triggering unit) == HeroUnit
Action: Modify Player (owner of (triggering unit)) Minerals - Subtract = Arithmetic Integer( "Property (minerals) of Player (owner of (triggering unit))" "/" "value: 3"
Trying to make an action for my revive trigger so that when its activated it subtracts a set Percent of the triggering players minerals each time it goes off.
Not sure how to make it so it can calculate the triggering players current total minerals or how to set a percent of it being subtracted.
Thanks in advance for any help with this, wracking my brain for days trying to figure it out.
I think there's an action named set player property so you just have to set to mineral.
For the equation, you can do a function like x/total mineral = y/100 which x is the resulted mineral and y the desired pourcentage.
Well i have made that already, not sure how i would do what you are saying though haven't done a whole lot with triggers yet
Edit: Figured it out with the help of this thread: http://www.sc2mapster.com/forums/resources/tutorials/13715-video-new-hero-revival-tutorial/?post=5
Here is a solution to it. It is accurate to 1 mineral for small numbers and 100 minerals for large numbers.
If you want your player to lose 1/3 of his minerals do:
Action: any unit dies
Condition: unit type of (triggering unit) == HeroUnit
Action: Modify Player (owner of (triggering unit)) Minerals - Subtract = Arithmetic Integer( "Property (minerals) of Player (owner of (triggering unit))" "/" "value: 3"