• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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