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

[Trigger] Mixing Up Triggers?

Status
Not open for further replies.
Level 11
Joined
Dec 13, 2008
Messages
1,047
Hello everyone. I created two triggers that basically transfer control of specific units to a player. Yet, the player has several choices, which are represented by each trigger. In addition, after one of the choices is picked, the others are not supposed to be picked. Yet, when I test it and choose one of the options, it seems to mix up the triggers and the camera movement will go to the correct spot, but the unit transfers are mixed up. Any ways this can be fixed? The triggers are posted below:

  • Ragnaros and Dark Iron Pink
    • Events
      • Unit - Optional Race Chooser 0556 <gen> Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Dark Iron Dwarves and Ragnaros
    • Actions
      • Trigger - Turn off Deathwing and Twilight Pink <gen>
      • Trigger - Turn off Ragnaros and Dark Iron Pink <gen>
      • Camera - Pan camera for Player 8 (Pink) to (Center of Center Blackrock <gen>) over 5.00 seconds
      • Game - Display to (All players) the text: The Dark Iron Dwarv...
      • Unit - Change ownership of Grand Hall of Grim Batol 0422 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Corrupted Black Dragon Aspect 0458 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Black Dragon Roost 0424 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Black Dragon Roost 0423 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Magma Blacksmith 0504 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Obsidian Great Hall 0509 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Twilight Tower 0503 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Twilight Tower 0501 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Twilight Tower 0502 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Twilight Tower 0508 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dragonkin Worker 0505 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dragonkin Worker 0507 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dragonkin Worker 0506 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Twilight Dragon Hatchling 0425 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Twilight Dragon Hatchling 0453 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Twilight Dragon Hatchling 0457 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Magma Hydra 0461 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Magma Hydra 0500 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Magma Hydra 0496 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Black Dragonspawn Wyrmkin 0492 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Black Dragonspawn Wyrmkin 0489 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Black Dragon Slasher 0462 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Black Dragon Slasher 0463 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Black Dragon Slasher 0464 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Black Dragon Slasher 0469 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Black Dragon Slasher 0470 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Black Dragon Slasher 0487 <gen> to Player 8 (Pink) and Change color
      • Unit - Remove Optional Race Chooser 0556 <gen> from the game
      • Neutral Building - Enable Gate of Grim Batol 0510 <gen>
      • Neutral Building - Enable Grim Batol 0747 <gen>
      • Neutral Building - Set Grim Batol 0747 <gen> destination to (Center of Grim Batol Entrance <gen>)
      • Neutral Building - Set Gate of Grim Batol 0510 <gen> destination to (Center of Grim Batol Exit <gen>)
      • Trigger - Turn on Marketplace Income Ragnaros Pink <gen>
  • Deathwing and Twilight Pink
    • Events
      • Unit - Optional Race Chooser 0556 <gen> Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Deathwing and the Twilight Dragonflight
    • Actions
      • Trigger - Turn off Ragnaros and Dark Iron Pink <gen>
      • Trigger - Turn off Deathwing and Twilight Pink <gen>
      • Camera - Pan camera for Player 8 (Pink) to (Center of Center Grim Batol <gen>) over 5.00 seconds
      • Game - Display to (All players) the text: The feared Aspect o...
      • Unit - Change ownership of Heart of Blackrock Mountain 0222 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Flamewalker 0128 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Barracks 0209 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Barracks 0210 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Magma Forgesmith 0217 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Fire Plane Great Hall 0218 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Tower of Eternal Flame 0186 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Tower of Eternal Flame 0185 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Tower of Eternal Flame 0220 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Tower of Eternal Flame 0219 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Slave 0214 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Slave 0213 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Slave 0182 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Fire-Weaver 0201 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Fire-Weaver 0200 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Fire-Weaver 0199 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Rifleman 0198 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Rifleman 0181 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Rifleman 0188 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Warrior 0174 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Warrior 0175 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Warrior 0176 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Warrior 0177 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Warrior 0178 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Warrior 0180 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Dark Iron Golem 0211 <gen> to Player 8 (Pink) and Change color
      • Unit - Change ownership of Emperor of Blackrock Mountain 0173 <gen> to Player 8 (Pink) and Change color
      • Unit - Remove Optional Race Chooser 0556 <gen> from the game
      • Neutral Building - Enable Gates of Blackrock Mountain 0223 <gen>
      • Neutral Building - Enable Blackrock Mountain 0716 <gen>
      • Neutral Building - Set Gates of Blackrock Mountain 0223 <gen> destination to (Center of Blackrock Exit <gen>)
      • Neutral Building - Set Blackrock Mountain 0716 <gen> destination to (Center of Blackrock Entrance <gen>)
      • Trigger - Turn on Marketplace Income Deathwing Pink <gen>
Note: I would like 6-7 of these triggers in my map for each person that uses this sytem (there will be 3) so a total of 18-21 triggers. So, if you think there is possibly a better way to do it, you can also share your views on that.

If you have questions, need something explained, etc, just let me know

Thanks a lot!!
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Also, rather than selecting every unit individually, do they all share some common link?

1. All localized to a certain region
2. All owned by a certain player

If they are all found in one region, just do:

  • Custom script: set bj_wantDestroyGroup = true
  • Unit Group - Pick all units in (Units in MyRegion <gen>) and do (Actions)
 
Level 11
Joined
Dec 13, 2008
Messages
1,047
@Bribe: What is a leak? And how do I fix this? And that region idea seems like a good idea...it would save me a lot of time, haha

@defskull: Well several players will have the exact same options. So "begin effects of casting an ability" wouldnt work right? Because if two people pressed it, they both would be starting the effects and then have a problem.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,190
I am guessing you may have based the choices off the same ability? It is probably casting the incorrect one due to order collisions. Use channel and give them unique orders or try different abilities. Changing the order string will not work for most abilities (hard coded). This is a common bug and nearly everyone will have been fooled by it at some stage.

@Bribe: What is a leak? And how do I fix this? And that region idea seems like a good idea...it would save me a lot of time, haha
A leak is when computational resources get allocated for a process but remain allocated after the process has finished. Like leaving the taps open after you finish washing your hands and no longer need water. The result is that there are less available resources for the computer to use and can result in instability or poor performance if too many resources get allocated (as a computer only has a finite quantity of resources to allocate) and can be thought of as running out of water (as you did not close the tap, the house no longer has water).
By resources, I mean elements used by your processor to do computing. Even if most of the elements are unused (like you have a hundred million processors), it is still possible that another element will bottlekneck performance (WC3 is single threaded for example, so it is limited to the speed of a single processor).

@defskull: Well several players will have the exact same options. So "begin effects of casting an ability" wouldnt work right? Because if two people pressed it, they both would be starting the effects and then have a problem.
Yes, that could happen... If you do not fix it that is. Simply turn the trigger off after it has run once, this prevents the actions from ever being run again even if the event appears to have been triggerd twice at the same time (as it will be turned off before the second event occurs in the update cycle). As it appears you do this already, I have no idea why you are concerned.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
Make sure the units are stays closedly together for the trigger to pick the units
  • Unit Group - Pick all units in (Units in MyRegion <gen>) and do (Actions)

Hes' grouping units within a rect, as long as the units are inside the rect, they'd be picked.
 
Level 22
Joined
Sep 24, 2005
Messages
4,821
I was pertaining to Bribe's suggestion, since that would be an optimal solution.
Can you select multiple units for GUI triggers? I thought that wasn't possible.
 
Level 11
Joined
Dec 13, 2008
Messages
1,047
Thanks a lot everyone!! I took your suggestions, tweaked the trigger around, and it seems to be working perfectly now. Thanks a bunch! :)
+rep to everyone!
 
Status
Not open for further replies.
Top