• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Condition current gold

Status
Not open for further replies.
Level 11
Joined
Apr 27, 2009
Messages
202
I used a trigger to make hero buy items. And when i copied the trigger into the map i was configurating it for it doesnt work. HELP.

  • Buy Items
    • Events
      • Unit - A unit enters RightSideSpawn <gen>
    • Conditions
      • ((Triggering unit) is A Hero) Equal to True
      • ((Owner of (Triggering unit)) controller) Equal to Computer
    • Actions
      • -------- --------
      • -------- --------
      • -------- --------
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Owner of AIHero[(Player number of (Owner of (Triggering unit)))]) Current gold) Greater than or equal to 250
        • Then - Actions
          • Game - Display to (All players) for 7.00 seconds the text: (String((Unit-type of (Triggering unit))))
          • Player - Add -250 to (Owner of (Triggering unit)) Current gold
          • Hero - Create Boots of Speed and give it to (Triggering unit)
        • Else - Actions
So after testing it i deleted the condition for current gold and he got Boots of speed seems that the problem is the condition:

  • ((Owner of AIHero[(Player number of (Owner of (Triggering unit)))]) Current gold) Greater than or equal to 250
even this doesnt work

  • ((Owner of (Triggering unit)) Current gold) Greater than or equal to 250
Can someone explain why it doesnt work? When i quit the game computer had more then 1000 gold.
 
Last edited:
Level 5
Joined
Apr 7, 2018
Messages
69
so i looked at it, i put this in there so i can see how much gold they have
  • TEST
    • Events
      • Time - Every 2.00 seconds of game time
    • Conditions
    • Actions
      • Game - Display to (All players) the text: (String((Player 1 (Red) Current gold)))
      • Game - Display to (All players) the text: (String((Player 2 (Blue) Current gold)))
      • Game - Display to (All players) the text: (String((Player 3 (Teal) Current gold)))
      • Game - Display to (All players) the text: (String((Player 4 (Purple) Current gold)))
      • Game - Display to (All players) the text: (String((Player 5 (Yellow) Current gold)))
      • Game - Display to (All players) the text: (String((Player 7 (Green) Current gold)))
      • Game - Display to (All players) the text: (String((Player 8 (Pink) Current gold)))
      • Game - Display to (All players) the text: (String((Player 9 (Gray) Current gold)))
      • Game - Display to (All players) the text: (String((Player 10 (Light Blue) Current gold)))
      • Game - Display to (All players) the text: (String((Player 11 (Dark Green) Current gold)))
this is result:
348
0
0
0
0
0
0
0
0
0
0
 
Status
Not open for further replies.
Top