I want to make points of lost units score of player "P5_AI_Enemy" as exp for human player.
So i made a triger:
EventsUnit-AnyUnitdiesLocalVariablesAdd_Exp=0<Integer>Score=0<Integer>Score_Old=0<Integer>Marine=0<Integer>Conditions(Ownerof(Triggeringunit))==P5_AI_EnemyActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Unittypeof(Killingunit))==Hero-MarineLevel_Number[Player][Marine] != 12
Then
Variable - Set Score = (Player P5_AI_Enemy Point Value of Units Lost score)
Variable - Set Add_Exp = (Score - Score_Old)
Variable - Set Score_Old = (Player P5_AI_Enemy Point Value of Units Lost score)
Variable - Set Experience[Player][Marine] = (Experience[Player][Marine] + (Real(Add_Exp)))
Bank - Store real Experience[Player][Marine] as "cur_exp" of section "hero" in bank Bank[Player]
Bank - Save bank Bank[Player]
for (Player group(Player))
Problem is:
Every time unit killed worth of 1 point
Add_Exp will go +1 so with every cycle il get Add_Exp = 1/2/3/4... and so on.
I don't get it....
Its like action Variable - Set Add_Exp just ignore Score_Old vale....
I want to make points of lost units score of player "P5_AI_Enemy" as exp for human player. So i made a triger:
Problem is: Every time unit killed worth of 1 point Add_Exp will go +1 so with every cycle il get Add_Exp = 1/2/3/4... and so on. I don't get it.... Its like action Variable - Set Add_Exp just ignore Score_Old vale....
so score = 1
then add exp = 1-0
then score old = 1
then exp = 0 +1
second time around
score =1
add exp = 1-0
score old = 1
exp = 1 + 1
I don't understand the purpose of the score_old at all in your calculation. It has no purpose currently where it i is
Unit killd +1 score
so score = 1
then add exp = 1-0
then score old = 1
then exp = 0 +1
second time around
Unit killd +1 score
score =2
add exp = 2 - 1
score old = 2 (for next time)
exp = 1 + 1
But thets a thing score old semms to always have 0
k i think i get it...... score old shoud be in globals....
Thx man x)
@Fireball14: Go
but score is a local variable so everytime the trigger runs it is set back to 0?
your using local variable not global ones. they are reset to their standards everytime.
Thx you realy help out there =)
It was my headache for almost 2 hours