trigger problem, need help

Dalemil

New Member
Reaction score
2
I'm trying to make it whenever a player clicks a dialog button, a trigger will run that spawns units based on what they chose. For example, if a player chooses Night Elves, the player's spawning unit will spawn Treants so on and so forth.

Trigger:
  • Button Setup
    • Events
      • Time - Elapsed game time is 10.00 seconds
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Dialog - Clear Dialog
              • Dialog - Change the title of Dialog to |c00889e78Choose Yo...
              • Dialog - Create a dialog button for Dialog labelled Human
              • Set Button[1] = (Last created dialog Button)
              • Dialog - Create a dialog button for Dialog labelled Orc
              • Set Button[2] = (Last created dialog Button)
              • Dialog - Create a dialog button for Dialog labelled Night Elf
              • Set Button[3] = (Last created dialog Button)
              • Dialog - Create a dialog button for Dialog labelled Undead
              • Set Button[4] = (Last created dialog Button)
              • Dialog - Show Dialog for (Picked player)
            • Else - Actions
              • Do nothing




Trigger:
  • Picked Nation
    • Events
      • Dialog - A dialog button is clicked for Dialog
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Button[1]
        • Then - Actions
          • Unit - Create 1 Human Spawner for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
          • Camera - Pan camera for (Owner of (Last created unit)) to (Position of (Last created unit)) over 0.00 seconds
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Button[2]
        • Then - Actions
          • Unit - Create 1 Orc Spawner for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
          • Camera - Pan camera for (Owner of (Last created unit)) to (Position of (Last created unit)) over 0.00 seconds
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Button[3]
        • Then - Actions
          • Unit - Create 1 Night Elf Spawner for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
          • Camera - Pan camera for (Owner of (Last created unit)) to (Position of (Last created unit)) over 0.00 seconds
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Button[4]
        • Then - Actions
          • Unit - Create 1 Undead Spawner for (Triggering player) at ((Triggering player) start location) facing Default building facing degrees
          • Camera - Pan camera for (Owner of (Last created unit)) to (Position of (Last created unit)) over 0.00 seconds
        • Else - Actions
 

Dalemil

New Member
Reaction score
2
I can't figure out how to create the triggers that are turned on whenever a player clicks the button.
 

Dalemil

New Member
Reaction score
2
Nevermind, I just decided to do this:

Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit Sells a unit
    • Conditions
    • Actions
      • Set Sold_unit = (Sold unit)
      • Set owner_Sold = (Owner of (Sold unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Sold unit)) Equal to Human Spawner
        • Then - Actions
          • Unit - Move Sold_unit instantly to (owner_Sold start location)
          • Camera - Pan camera for owner_Sold to (Position of Sold_unit) over 0.00 seconds
          • Trigger - Turn on Picks Human <gen>
        • Else - Actions


Trigger:
  • Picks Human
    • Events
      • Time - timer expires
    • Conditions
    • Actions
      • Set temp_point = (Position of Sold_unit)
      • Unit - Create 2 Footman for owner_Sold at temp_point facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_temp_point)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top