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

[Trigger] Variable Problem

Status
Not open for further replies.
Level 1
Joined
May 31, 2007
Messages
1
Ok im having a problem with this variable*Array* I made. The variable is supposed to when used its going to be used for every player doing the trigger. But the problem is when a person does the trigger it only sets the variable for the first person doing the action and all the other players can not do anything since the whole map runs on using that one variable. Can anyone tell me what the problem is so I can fix it and get this map on the roll. Please and thank you in advance.
  • HeroSelection
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
      • Player - Player 5 (Yellow) Selects a unit
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to Selection Button Choose 0005 <gen>
        • Then - Actions
          • Selection - Clear selection for (Triggering player)
          • Unit - Create 1 C88 for (Triggering player) at (Center of TestSelect <gen>) facing Default building facing degrees
          • Set SelectionUnit[(Player number of (Triggering player))] = (Last created unit)
          • Trigger - Run Loading <gen> (checking conditions)
          • Trigger - Turn on Selected Unit <gen>
          • Selection - Select SelectionUnit[(Player number of (Triggering player))] for (Owner of (Last created unit))
          • Unit - Pause SelectionUnit[(Player number of (Triggering player))]
          • Wait 20.00 seconds
          • Cinematic - Hide filter
          • Unit - Create 1 Dummy for Neutral Passive at (Center of TestSelect <gen>) facing Default building facing degrees
          • Unit - Remove (Last created unit) from the game
          • Item - Create Test Gun at (Position of SelectionUnit[(Player number of (Triggering player))])
          • Hero - Give (Last created item) to SelectionUnit[(Player number of (Triggering player))]
          • Player - Add 20 to (Owner of SelectionUnit[(Player number of (Triggering player))]) Current lumber
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to Selection Button Choose 0015 <gen>
            • Then - Actions
              • Selection - Clear selection for (Triggering player)
              • Unit - Create 1 D90 for (Triggering player) at (Center of TestSelect <gen>) facing Default building facing degrees
              • Set SelectionUnit[(Player number of (Triggering player))] = (Last created unit)
              • Trigger - Run Loading <gen> (checking conditions)
              • Trigger - Turn on Selected Unit <gen>
              • Selection - Select SelectionUnit[(Player number of (Triggering player))] for (Owner of (Last created unit))
              • Unit - Pause SelectionUnit[(Player number of (Triggering player))]
              • Wait 20.00 seconds
              • Cinematic - Hide filter
              • Unit - Create 1 Dummy for Neutral Passive at (Center of TestSelect <gen>) facing Default building facing degrees
              • Unit - Remove (Last created unit) from the game
              • Item - Create Test Gun at (Position of SelectionUnit[(Player number of (Triggering player))])
              • Hero - Give (Last created item) to SelectionUnit[(Player number of (Triggering player))]
              • Player - Add 20 to (Owner of SelectionUnit[(Player number of (Triggering player))]) Current lumber
            • Else - Actions
 
I don't see anything weird in your trigger... Check if the other triggers does not:
- replace the buttons
- turn this trigger off

And another thing I've noticed: in instead of creating the item and THEN giving it to the hero, you could use Item - Create item for hero (or is it in the 'hero' section? xD).
And why do you create a dummy and remove it?

Of course I didn't help much but be patient =D
 
Status
Not open for further replies.
Top