• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[Trigger] Trigger is glitching and it spawns a unit for every player?

Not open for further replies.
Level 5
Aug 18, 2013
  • Decrpy PROPER 2 Copy 8
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • ((Ability being cast) Equal to Decrypt ) and (Decrypt12 Equal to 0)
    • Actions
      • Set SpawnLoc = (Target point of ability being cast)
      • Unit - Create 1 Decrypter for Player 12 (Brown) at SpawnLoc facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_SpawnLoc)
      • Set DecryptRed12 = (Last created unit)
      • Set Decrypt12 = (Decrypt12 + 1)
      • Set SpawnLoc = (Position of DecryptRed12)
      • Visibility - Create an initially Enabled visibility modifier for Player 12 (Brown) emitting Visibility from SpawnLoc to a radius of 1024.00
      • Custom script: call RemoveLocation (udg_SpawnLoc)
      • Set Visibility12 = (Last created visibility modifier)
      • Countdown Timer - Start DecryptTimer12 as a One-shot timer that will expire in 300.00 seconds
      • Wait 2.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DecryptRed12 is alive) Equal to True
        • Then - Actions
          • Set Player = Player 12 (Brown)
          • Custom script: if GetLocalPlayer() == udg_Player then
          • Sound - Play RADAR_On <gen>
          • Custom script: endif
        • Else - Actions
I gave each player a similar trigger but it spawns a unit for every living player.

What did I do wrong?
This is the problem:
I gave each player a similar trigger
Just change all "Player 12" in your trigger to "Owning Player of Triggering Unit" and remove all other instances of this trigger. You just need one trigger for this.
Also, make "DecryptRed12" and "Decrypt12" array variables and index them by the player number:
Decrypt[Player ID: Owning Player of Triggering Unit]
Not open for further replies.