• 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.

How can I make a trigger that adds 1 every time an object is obtained?

Status
Not open for further replies.
Level 4
Joined
Sep 27, 2018
Messages
61
Let me explain, I want to make a detonator that when a hero takes an object that number is added to that of a whole number. Something like that:

Sin título.jpg


For example, If I do a mission in which they must get 4 items and I put a message for each item that is achieved. How should I do it?
 
Level 9
Joined
Jul 30, 2018
Messages
445
You can use arithmetic value (Value + X) for the variable. Also, if you want to announce the amount in a game message, you can use concatenate strings, so you don't have to manually write the number. You just have to use Conversion - Convert Integer to String to get the integer value.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Set Detonator = (Detonator + 1)
      • Game - Display to (All players) the text: (Detonator value: + (String(Detonator)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Detonator Equal to [what ever amount you need]
        • Then - Actions
          • -------- Do something --------
        • Else - Actions
 
Last edited:
Status
Not open for further replies.
Top