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

Setting triggers to repeat for each player in a team

Status
Not open for further replies.
Level 6
Joined
Oct 29, 2008
Messages
115
Hello Hivers!
I have a question that I'd really need an answer about as i'm really confused. What I want to know is how do you set a group of triggers with dilog and spawners to be set to every player on 1 team.
I not only want to know that, but if the player is a computer player, then set them to choose randomly.

I am asking this as I am working on upgrading the Monolith map for the players to be the monolith while choosing the race they want, while also having CPU that chooses randomly.

I have made a set of triggers that do work with only 1v1 battle, but once I add another computer player on creeps team, the last player (player 5 and player 6 play, while only the triggers are set to player 6).
Can someone please help me to how to do this for every player? I tried everything I know to my knowledge.

Main Creep selection screen
  • Creep Select
  • Events
    • Time - cenematicTimer expires
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • (cpPlayers[cpCurrent] controller) Equal to Computer
    • Then - Actions
      • Unit - Create 4 creepWorker[cpCreep Types[cpCurrent]] for cpPlayers[cpCurrent] at (Centre of startLocCurrent) facing Default building facing degrees
    • Else - Actions
      • Dialog - Clear CreepSelection
      • Dialog - Change the title of CreepSelection to Select Creep Race
      • Dialog - Create a dialog button for CreepSelection labelled Dark Troll
      • Set CreepSelectionButton[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for CreepSelection labelled Beast
      • Set CreepSelectionButton[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for CreepSelection labelled Furbolg
      • Set CreepSelectionButton[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for CreepSelection labelled Lizard
      • Set CreepSelectionButton[4] = (Last created dialog Button)
      • Dialog - Create a dialog button for CreepSelection labelled Murloc
      • Set CreepSelectionButton[5] = (Last created dialog Button)
      • Dialog - Create a dialog button for CreepSelection labelled Satyr
      • Set CreepSelectionButton[6] = (Last created dialog Button)
      • Dialog - Create a dialog button for CreepSelection labelled Spider
      • Set CreepSelectionButton[7] = (Last created dialog Button)
      • Dialog - Create a dialog button for CreepSelection labelled Wolf
      • Set CreepSelectionButton[8] = (Last created dialog Button)
      • Dialog - Show CreepSelection for cpPlayers[cpCurrent]
Creep type
  • Dark Troll
    • Events
      • Dialog - A dialog button is clicked for CreepSelection
    • Conditions
      • (Clicked dialog button) Equal to CreepSelectionButton[1]
    • Actions
      • Unit - Create 4 Dark Troll Enlisted for cpPlayers[cpCurrent] at (Center of startLocCurrent) facing Default building facing degrees
And so on... (Different creep types)

Thank you if you do help me.
I will publish the finnished map as soon as I get everything working.
 
Last edited:
Level 6
Joined
Oct 29, 2008
Messages
115
Post the triggers you already have, and we can work from there.

Thanks for checking this out so early. Didn't expect anyone to go on the forums and actually reply so quickly.
Anyway. For you to know, i updated the post with the triggers (Couldn't figure out how to actually put them on, but then I had an idea and it worked xD)

I also want you to know, I have only started using triggers. I'm still learning. This is actually the first time i ever even looked at triggers fully. I'll give credit for your help if you would tell me.
So thx anyway :D
Eating chips right now :p
 
Level 6
Joined
Oct 29, 2008
Messages
115
cpPlayers[cpCurrent] is the creep player, or atleast from what the triggers would tell me. And also, i have tried setting this for every player in my other version, but it didn't work at all, while also giving me all of the buttons 4 times more. What I mean by that is this:
Dark Troll
Beast
Furbolg
Lizard
Murloc
Satyr
Spider
Wolf
Dark Troll
Beast
Furbolg
Lizard
Murloc
Satyr
Spider
Wolf
Dark Troll
Beast
Furbolg
Lizard
Murloc
Satyr
Spider
Wolf
Dark Troll
Beast
Furbolg
Lizard
Murloc
Satyr
Spider
Wolf

Do I have to create the dialog butoon for 'CreepSelection' 3 more times with maybe a number/player number at? As I'm really confused.

Edit:
Also, how do I loop? I tried using the trigger:
  • For each (Integer A) from 1 to 4, do (Actions)
    • Loop - Actions
But I don't understand how it works, or what it actually does.
 
Level 6
Joined
Oct 29, 2008
Messages
115
What that loop does is repeat all actions under Loop - Actions a set number of times, in this case 4.

The loop I'm talking about is the Pick every player loop.

I'll take a look in the map's triggers to get a better understand of how it works and them maybe we can build a system from there.

Is that 'Pick every player loop' a trigger? Or just what you manually make? And what section is it in? Events? Actions? Conditions?
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
1. You should pick every player in (All players)
2. The way to use the Pick every player function is that the trigger saves the (Picked player) function/variable to the "picked player". So in the condition, we need to check if (Picked player) is a computer-controlled player instead of cpPlayers[cpCurrent].
3. All actions in the dialog section, except for the last one (Show CreepSelection) should be moved to before the Pick every player action. Also, it should read:
  • Dialog - Show CreepSelection for (Picked player)
The unit creation trigger needs to likewise change:
  • Unit - Create 4 creepWorkers[cpCreepTypes[cpCurrent]] for (Picked player) at (Center of startLocCurrent) facing Default building facing degrees
Since you're new to triggers, I strongly recommend reading some basic trigger tutorials in the Tutorials section.
 
Level 6
Joined
Oct 29, 2008
Messages
115
1. You should pick every player in (All players)
2. The way to use the Pick every player function is that the trigger saves the (Picked player) function/variable to the "picked player". So in the condition, we need to check if (Picked player) is a computer-controlled player instead of cpPlayers[cpCurrent].
3. All actions in the dialog section, except for the last one (Show CreepSelection) should be moved to before the Pick every player action. Also, it should read:
  • Dialog - Show CreepSelection for (Picked player)
The unit creation trigger needs to likewise change:
  • Unit - Create 4 creepWorkers[cpCreepTypes[cpCurrent]] for (Picked player) at (Center of startLocCurrent) facing Default building facing degrees
Since you're new to triggers, I strongly recommend reading some basic trigger tutorials in the Tutorials section.

  • Unit - Create 4 creepWorkers[cpCreepTypes[cpCurrent]] for (Picked player) at (Center of startLocCurrent) facing Default building facing degrees
That trigger spawns 4 random creep workers without allowing me to make a choosable race. You can basically make the playable creeps by changing the computer option in the Player propperties to User. Not sure if you ment to change the creep to that trigger, but that's just to let you know.
 
Status
Not open for further replies.
Top