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