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

[Trigger] Item - Remove runs the trigger twice

Status
Not open for further replies.
Level 3
Joined
Jan 28, 2015
Messages
48
Hi guys!
I've stumbled upon an interesting "feature": whenever I order an item removal it runs the trigger where it appears twice.

For example try this one out.
  • Convert dropped to runic Copy
    • Events
      • Unit - A unit owned by Player 1 (Red) Loses an item
      • Unit - A unit owned by Player 1 (Red) Acquires an item
    • Conditions
    • Actions
      • Item - Remove (Item being manipulated)
      • Game - Display to (All players) the text: It ran.
Any suggestions?
 
Level 3
Joined
Jan 28, 2015
Messages
48
NWM. I should have thought about adding a variable to fix this issue.

  • Convert dropped to runic
    • Events
      • Unit - A unit owned by Player 1 (Red) Loses an item
OR
  • Convert dropped to runic
    • Events
      • Unit - A unit owned by Player 1 (Red) Acquires an item
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • SecondRun Equal to False
      • Then - Actions
        • Set SecondRun = True
        • Item - Remove (Item being manipulated)
        • Game - Display to (All players) the text: Cicle
      • Else - Actions
        • Set SecondRun = False
But still this double run upon removal is quite strange.

P.S. Bobby was a clever boy. He asked himself some questions and answered them.
 
Last edited:
Level 24
Joined
Aug 1, 2013
Messages
4,658
Hi, Wiet.
Can you explain what 'Disply text ""' is there for?

Your unit acquires an item.
So the trigger is called.
You display the text "Cicle" to the players and you see it.

Next to that, you remove the item from the game.
So the item is also removed from the unit.
That means that your unit loses an item.
So the trigger is called.
You display the text "Cicle" to the players again.
(They are in fact called in the opposite way but that doesn't matter)

What you have to do is remove the event "A unit loses an item"
or you do this:
Disable (this trigger)
Remove (Item Being Manipulated)
Enable (this trigger)
 
Level 3
Joined
Jan 28, 2015
Messages
48
The idea behind making this trigger was to show that an "item removal" command runs trigger twice whether it was acquired or lost. This strange behavior can be perfectly observed by commenting either event line and running the test map.

My bad not expressing myself clear enough.
 

Wrda

Spell Reviewer
Level 28
Joined
Nov 18, 2012
Messages
2,000
As Wietlol said,
You acquire an item:
item - remove manipulating item
display text "...."
You lose an item:
item - remove manipulating item
display text "...."
When you acquire the item, it removes the item, and so you INSTANTLY lose the item, thats why the trigger fires again, calling again item - remove manipulating item and display text "...."
I don't see any strange behavior in this.
 
Level 3
Joined
Jan 28, 2015
Messages
48
OMG, once again :)

By commenting out the line I meant using ONLY ONE of the following events in a test:
  • Unit - A unit owned by Player 1 (Red) Loses an item
OR
  • Unit - A unit owned by Player 1 (Red) Acquires an item
 
Status
Not open for further replies.
Top