• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Wrong increase of Value

Status
Not open for further replies.
Level 16
Joined
Oct 12, 2008
Messages
1,570
Hi people,,

Working on a little system, i found a stupid thing!
I want to increase the custom value of every unit in a unit group every one in a while,,
But somehow, it increases the custom value, by 2 =S
Here is the part of the trigger that is wrong:
  • Set zz_Destr_Group = (Units within 150.00 of (Position of (Picked destructible)))
  • Unit Group - Pick every unit in zz_Destr_Group and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Current order of (Picked unit)) Equal to (Order(smart))
        • Then - Actions
          • Set zz_Destr_CV1 = (Custom value of (Picked unit))
          • Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) + 1)
        • Else - Actions
The variable is used later on, dont ask about it,,
Can you guys tell me why it is increased by 2??
Tnx,,:grin:

Yixx,,
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Probably because those actions run more than once.
Or you increase the custom value somewhere else.
 
Status
Not open for further replies.
Top