• 🏆 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!

Double Triggering

Status
Not open for further replies.
Level 5
Joined
Jul 15, 2018
Messages
111
I created this trigger for a map item to ping certain locations. The text that accompanies this appears twice in a row for some reason. Why is this happening?

If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Rough Map
Then - Actions
Set TriggeringPlayer = (Triggering player)
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Town Hall 0400 <gen>) for 5.00 seconds
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Town Hall 0417 <gen>) for 5.00 seconds
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Castle Doodad 0001 <gen>) for 5.00 seconds
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Town Hall 0399 <gen>) for 5.00 seconds
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Town Hall 0058 <gen>) for 5.00 seconds
Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) for 5.00 seconds the text:
Northwest - Lordsport
Northeast- Brimhaven
Central- Capital City
South- Deepwood
Southeast- Runestone
Else - Actions
 
Level 5
Joined
Jul 15, 2018
Messages
111
The actions are obviously being run twice, possibly because the event that runs the trigger executes twice or the loop that piece of code is in runs twice. You will need to post the rest of the trigger if you want to know the specific reason.


I have two map items that use a general item event to start the action. I've posted them both in full below. For some reason the second map works correctly only executing once. Could it perhaps be something to do with the way I set triggering player as a variable so i could reference it in the ping actions?





Events
Unit - A unit Uses an item
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Rough Map
Then - Actions
Set TriggeringPlayer = (Triggering player)
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Town Hall 0400 <gen>) for 5.00 seconds
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Town Hall 0417 <gen>) for 5.00 seconds
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Castle Doodad 0001 <gen>) for 5.00 seconds
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Town Hall 0399 <gen>) for 5.00 seconds
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Town Hall 0058 <gen>) for 5.00 seconds
Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) for 5.00 seconds the text:
Northwest - Lordsport
Northeast- Brimhaven
Central- Capital City
South- Deepwood
Southeast- Runestone
Else - Actions


---------------

Events
Unit - A unit Uses an item
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item being manipulated)) Equal to Trader's Map
Then - Actions
Set TriggeringPlayer = (Triggering player)
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Wildman Merchant 0340 <gen>) for 5.00 seconds
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Golem Enchantress 0965 <gen>) for 5.00 seconds
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Dwarven Caravan 0329 <gen>) for 5.00 seconds
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Slave Auction 0527 <gen>) for 5.00 seconds
Cinematic - Ping minimap for (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) at (Position of Sea Captain 0337 <gen>) for 5.00 seconds
Game - Display to (All players matching ((Owner of (Triggering unit)) Equal to TriggeringPlayer)) for 5.00 seconds the text: Purchase coins at -banks , use them to trade with other players.
Else - Actions
 
Level 9
Joined
Jul 30, 2018
Messages
445
Might be something to do with that you have the "same" ability twice on the item. Since the both item abilities are "Penguin Squeek", the other one just has its name changed. The game engine mostly likely uses this Use-ability as a check up for the trigger event "Unit uses an item", so because it has the same ability twice, it runs the trigger twice. Changing a name doesn't change the all code behind the ability.

Edit:
Yep, tested it now. Works perfectly when you just remove the Penguin Squeek from the item. Works fine with only the Rough Map ability.
 
Last edited:
Level 5
Joined
Jul 15, 2018
Messages
111
Might be something to do with that you have the "same" ability twice on the item. Since the both item abilities are "Penguin Squeek", the other one just has its name changed. The game engine mostly likely uses this Use-ability as a check up for the trigger event "Unit uses an item", so because it has the same ability twice, it runs the trigger twice. Changing a name doesn't change the all code behind the ability.

Edit:
Yep, tested it now. Works perfectly when you just remove the Penguin Squeek from the item. Works fine with only the Rough Map ability.

Very interesting. That's good to know moving forward. I guess I'll have to find other innocuous animal noise themed abilities in the future.
 
Status
Not open for further replies.
Top