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

Create only 1 unit for the players within group

Status
Not open for further replies.
Level 17
Joined
Jun 2, 2009
Messages
1,137
Hello everyone. Let me start what i am looking for. If you already played Trolls & Elves you will get it what i want.
This is my system and i believe there are too many flaws.


This trigger asks to players "Do you want to be a Troll?"

  • Events
  • Conditions
  • Actions
    • Dialog - Clear Diyalog1
    • Dialog - Change the title of Diyalog1 to Troll olmak ister m...
    • Dialog - Create a dialog button for Diyalog1 labelled Evet
    • Set DiyalogBoku[1] = (Last created dialog Button)
    • Dialog - Create a dialog button for Diyalog1 labelled Hayir
    • Set DiyalogBoku[2] = (Last created dialog Button)
    • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
      • Loop - Actions
        • Dialog - Show Diyalog1 for (Picked player)
And this trigger adds players to player groups

If you say yes, you will be added into TrollPlease
İf you say no, you will be added into ElfPlease

  • SecimAsamasi
    • Events
      • Dialog - A dialog button is clicked for Diyalog1
      • Dialog - A dialog button is clicked for Diyalog2
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DiyalogBoku[1]
        • Then - Actions
          • Player Group - Add (Triggering player) to TrollPlease
          • Game - Display to (All players) the text: (Troll isteyenler; + (Name of (Triggering player)))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DiyalogBoku[2]
        • Then - Actions
          • Player Group - Add (Triggering player) to ElfPlease
          • Game - Display to (All players) the text: (Elf isteyenler; + (Name of (Triggering player)))
        • Else - Actions
      • Countdown Timer - Start SecimTimer as a One-shot timer that will expire in 5.00 seconds
  • SecimAsamasiDevamYeni
    • Events
      • Time - SecimTimer expires
    • Conditions
    • Actions
      • Trigger - Run SecimAsamasiDevam <gen> (checking conditions)
Now it is my creation trigger. Currently i am testing it on two computers. I am starting the game, choosing NO and game gives Elf to me (player 1) but player 2 gets nothing.

My objective is: If everyone picks elves, 1 of them randomly selected as Troll and Troll unit given to this player.
If more than 1 player picks troll, 1 of them randomly selected troll and i want to give Elf rest of them

Only 1 Troll unit
Rest of them Elves.

  • SecimAsamasiDevam
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in TrollPlease and do (Actions)
        • Loop - Actions
          • Set TrollSelectedPLAYER = (Random player from TrollPlease)
          • Game - Display to (All players) for 2.00 seconds the text: (Name of TrollSelectedPLAYER)
          • Player Group - Remove TrollSelectedPLAYER from TrollPlease
          • Player Group - Pick every player in TrollPlease and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to ElfPlease
          • Player Group - Remove all players from TrollPlease
          • Game - Display to (All players) for 10.00 seconds the text: Troll 31 saniye son...
      • Countdown Timer - Start TrollSayacTimer as a One-shot timer that will expire in 5.00 seconds
      • Countdown Timer - Create a timer window for TrollSayacTimer with title Troll 31 saniye son...
      • Set TrollSayac = (Last created timer window)
      • Player Group - Pick every player in ElfPlease and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Elf for (Picked player) at BaslangicYeri facing Default building facing degrees
          • Camera - Pan camera for (Picked player) to (Position of (Last created unit)) over 0.00 seconds
          • Selection - Add (Last created unit) to selection for (Picked player)
          • Player Group - Pick every player in ElfPlease and do (Actions)
            • Loop - Actions
              • Player - Make (Picked player) treat (Picked player) as an Ally with shared vision
Currently i am choosing no on both of computers, 1 Elf creates for Player 1 but Player 2 gets nothing.

Trolls VS Elves. Elves must be an allies.
 
Last edited:

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
I want to create only 1 unit for each player but created unit increasing with number of players.
I quite frankly don't understand this sentence. What does the 2nd part of the sentence "but created unit increasing with number of players" mean?
You don't need nor should turn off trigger inside the Player Group scope, it just makes no sense, it triggers as many times as how many players are in the group.
  • Player Group - Pick every player in ElfPlease and do (Actions)
    • Loop - Actions
      • Trigger - Turn off (This trigger)
      • Unit - Create 1 Elf for (Picked player) at BaslangicYeri facing Default building facing degrees
How can i create "ONLY 1 ELF" for each player?
You... are doing it right now? Can't tell anything else until you show the whole trigger.
What's not working? What's actually happening? Is ElfPlease player group actually empty? Does the trigger actually fire?
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
I quite frankly don't understand this sentence. What does the 2nd part of the sentence "but created unit increasing with number of players" mean?
You don't need nor should turn off trigger inside the Player Group scope, it just makes no sense, it triggers as many times as how many players are in the group.

You... are doing it right now? Can't tell anything else until you show the whole trigger.
What's not working? What's actually happening? Is ElfPlease player group actually empty? Does the trigger actually fire?
Ok here is the whole trigger

  • SecimAsamasi
    • Events
      • Dialog - A dialog button is clicked for Diyalog1
      • Dialog - A dialog button is clicked for Diyalog2
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DiyalogBoku[1]
        • Then - Actions
          • Player Group - Add (Triggering player) to TrollPlease
          • Game - Display to (All players) the text: (Troll isteyenler; + (Name of (Triggering player)))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DiyalogBoku[2]
        • Then - Actions
          • Player Group - Add (Triggering player) to ElfPlease
          • Game - Display to (All players) the text: (Elf isteyenler; + (Name of (Triggering player)))
        • Else - Actions
      • Wait 5.00 seconds
      • Trigger - Run SecimAsamasiDevam <gen> (checking conditions)
  • SecimAsamasiDevam
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in TrollPlease and do (Actions)
        • Loop - Actions
          • Set TrollSelectedPLAYER = (Random player from TrollPlease)
          • Game - Display to (All players) for 2.00 seconds the text: (Name of TrollSelectedPLAYER)
          • Player Group - Remove TrollSelectedPLAYER from TrollPlease
          • Player Group - Remove TrollSelectedPLAYER from ElfPlease
          • Player Group - Pick every player in TrollPlease and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to ElfPlease
          • Player Group - Remove all players from TrollPlease
          • Game - Display to (All players) for 10.00 seconds the text: Troll 31 saniye son...
          • Countdown Timer - Start TrollSayacTimer as a One-shot timer that will expire in 5.00 seconds
          • Countdown Timer - Create a timer window for TrollSayacTimer with title Troll 31 saniye son...
          • Set TrollSayac = (Last created timer window)
      • Player Group - Pick every player in ElfPlease and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ElvesBoolean[(Player number of (Picked player))] Equal to False
            • Then - Actions
              • Unit - Create 1 Elf for (Picked player) at BaslangicYeri facing Default building facing degrees
              • Set ElvesBoolean[(Player number of (Picked player))] = True
              • Camera - Pan camera for (Picked player) to (Position of (Last created unit)) over 0.00 seconds
              • Selection - Add (Last created unit) to selection for (Picked player)
            • Else - Actions
If you select elves, you will get 1 elf
If you and player 2 selects elves, you and player 2 gets 2 elves
If you, player 2 and player 3 select elves, you, player 2 and player 3 gets 3 elves
You will get elves = numbers of players that select elves

I don't want to this

p1, p2, p3, p4, p5 wanted to be an elf and p6 wanted to be a troll
p1, p2, p3, p4, p5 gets 5 elves.

I want to this

p1, p2, p3, p4, p5 wanted to be an elf and p6 wanted to be a troll
p1, p2, p3, p4, p5 gets 1 elf.

Somehow my trigger creates more than 1 elf. Since 4 days i am trying to fix this issue and still i couldn't find.
 

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
I just read your other thread and read this one again and I see the problem.
your problem is in SecimAsamasi trigger, this is being run 5 secs every time a player clicks on a button:
  • Trigger - Run SecimAsamasiDevam <gen> (checking conditions)
1. remove that action and the wait.
2. in the trigger where you create the dialog with the buttons, make a timer that expires however long you want, (10-20 secs or whatever) this is the time that people can choose the roles.
3. assuming you know how to make a timer and use the variables, add "timer - timervariable expires" event to this second trigger you have.
4. profit, works.
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
I just read your other thread and read this one again and I see the problem.
your problem is in SecimAsamasi trigger, this is being run 5 secs every time a player clicks on a button:
  • Trigger - Run SecimAsamasiDevam <gen> (checking conditions)
1. remove that action and the wait.
2. in the trigger where you create the dialog with the buttons, make a timer that expires however long you want, (10-20 secs or whatever) this is the time that people can choose the roles.
3. assuming you know how to make a timer and use the variables, add "timer - timervariable expires" event to this second trigger you have.
4. profit, works.
It seems i made everything worse than i tought.. Listen, to be honest i am a brainless, imbecil person. Because i have a 20 years old moba game and i was created many maps since 2002 (it's first release) still i don't understand many things. That makes me an idiot. It is the truth. I am not saying it because i am sucked and depressed. Can you tell me step by step how to do that?
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
Can you tell me step by step how to do that?
Your problem is in SecimAsamasi trigger, this is being run 5 secs every time a player clicks on a button:
  • page.gif
    Trigger - Run SecimAsamasiDevam <gen> (checking conditions)
1. remove that action and the wait.
2. in the trigger where you create the dialog with the buttons, make a timer that expires however long you want, (10-20 secs or whatever) this is the time that people can choose the roles.
3. assuming you know how to make a timer and use the variables, add "timer - timervariable expires" event to this second trigger you have.
4. profit, works.
The things you need are:
  • Events
    • Countdown Timer - YOUR_TIMER_VARIABLE expires
  • -------- --------
  • Actions
    • Countdown Timer - Start YOUR_TIMER_VARIABLE as a One-shot timer that will expire in 20.00 seconds
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
Ehm. No it is not working, my mistake. Here is the trigger.

  • Events
    • Dialog - A dialog button is clicked for Diyalog1
    • Dialog - A dialog button is clicked for Diyalog2
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Clicked dialog button) Equal to DiyalogBoku[1]
      • Then - Actions
        • Player Group - Add (Triggering player) to TrollPlease
      • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Clicked dialog button) Equal to DiyalogBoku[2]
      • Then - Actions
        • Player Group - Add (Triggering player) to ElfPlease
      • Else - Actions
    • Countdown Timer - Start SecimTimer as a One-shot timer that will expire in 5.00 seconds
Players are choosing dialog 2. Me and my 2 friends choosed No within 5 seconds. Now let's check the other part.

  • Events
    • Time - SecimTimer expires
  • Conditions
  • Actions
    • Trigger - Run SecimAsamasiDevam <gen> (checking conditions)
This timer expired and now we are going for the SecimAsamasiDevam

  • SecimAsamasiDevam
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in TrollPlease and do (Actions)
        • Loop - Actions
          • Set TrollSelectedPLAYER = (Random player from TrollPlease)
          • Game - Display to (All players) for 2.00 seconds the text: (Name of TrollSelectedPLAYER)
          • Player Group - Remove TrollSelectedPLAYER from TrollPlease
          • Player Group - Remove TrollSelectedPLAYER from ElfPlease
          • Player Group - Pick every player in TrollPlease and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to ElfPlease
          • Player Group - Remove all players from TrollPlease
          • Game - Display to (All players) for 10.00 seconds the text: Troll 31 saniye son...
          • Countdown Timer - Start TrollSayacTimer as a One-shot timer that will expire in 5.00 seconds
          • Countdown Timer - Create a timer window for TrollSayacTimer with title Troll 31 saniye son...
          • Set TrollSayac = (Last created timer window)
      • Player Group - Pick every player in ElfPlease and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Elf for (Picked player) at BaslangicYeri facing Default building facing degrees
          • Camera - Pan camera for (Picked player) to (Position of (Last created unit)) over 0.00 seconds
          • Selection - Add (Last created unit) to selection for (Picked player)
          • Player Group - Pick every player in ElfPlease and do (Actions)
            • Loop - Actions
              • Player - Make (Picked player) treat (Picked player) as an Ally with shared vision
Me and my 2 friends are within ElfPlease group. But this triggers gives Elf only to me. My friends can't get anything.
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
Bruh. Again all I ask is that you please try to think about what each action does and if it actually helps you do what you're trying to do. Learn to analyze your own trigger. You specifically ask a lot of stupid questions that you could at least try to figure out yourself first.

  • Set TrollSelectedPLAYER = (Random player from TrollPlease) is unnecessarily complicated. By randomizing this way you have to make sure you don't randomly pick the same player twice. Because of this, you are doing all this silly adding to/removing from the group bullshit. There is no need for this. Player Group - Pick... already picks every player in the group without repeating. Just used Picked Player instead of Random player from TrollPlease.

  • Look at every action inside of the first (outermost) Player Group - Pick every player in TrollPlease. Do any of those actions create a troll unit for the player? No. So it's impossible for a player to be given a troll. Elves are created in the ElfPlease group pick.

    • Player Group - Remove TrollSelectedPLAYER from TrollPlease
    • Player Group - Remove TrollSelectedPLAYER from ElfPlease
    • Player Group - Pick every player in TrollPlease and do (Actions)
      • Loop - Actions
        • Player Group - Add (Picked player) to ElfPlease
    What are you trying to do here? This is what is "randomly" giving people elves. It takes everyone except the randomly chosen player in the troll group, and then adds them all to the elf group. Then after all that first TrollPlease group is looped through, you take everyone in ElfPlease and give them an elf! How could this do anything else other than give the wrong players extra elves! All of these lines are unnecessary and pointless.

    • Countdown Timer - Start TrollSayacTimer as a One-shot timer that will expire in 5.00 seconds
    • Countdown Timer - Create a timer window for TrollSayacTimer with title Troll 31 saniye son...
    • Set TrollSayac = (Last created timer window)
    Again... what are you trying to do here? This just restarts the timer to run this exact trigger again. The one that is already running. Do you want this trigger to always run every 5 seconds? It should just be periodic, then.

    However, every time this trigger runs it will create more elves for everyone in ElfPlease. So if you don't want that to happen and you do want to run this trigger periodically then you'll have to remove them from ElfPlease. Frankly, I have no idea how you want this to work.

  • Camera - Pan camera for (Picked player) to (Position of (Last created unit)) over 0.00 seconds leaks a point.

    • Player Group - Pick every player in ElfPlease and do (Actions)
      • Loop - Actions
        • Player - Make (Picked player) treat (Picked player) as an Ally with shared vision
    This actually does nothing. Picked Player and Picked Player are the same player (it doesn't know one of them should refer to the 'outer' picked player). You are making players treat themselves as allies which does nothing. Just like with TrollSelectedPLAYER in the first player group loop, you'll need to create a player variable and assign it to Picked Player just before the inner loop (the lines I quoted above). Then make that player variable treat Picked Player as an ally.

    You also need to make the alliance work in the opposite direction. ElfSelectedPlayer needs to treat Picked Player as an ally, and Picked Player needs to treat ElfSelectedPlayer as an ally. You probably also need to make all the elves treat all the trolls as enemies and all the trolls treat all the elves as enemies. Probably, but again I don't know your map.

  • Also remember when I said that every time this trigger runs it'll give elves to everyone in ElfPlease, and to solve that you could remove players from it? Well that means that removing units from the group will break this alliance setting bologna you have set up because now your Player Groups don't contain every player that they should.

All in all there is a lot of shit wrong here and what specifically you want to do isn't clear from your code. How often should units be distributed? Why is a timer involved? Do you need ElfPlease and TrollPlease to represent the forces (player groups) throughout the game, or only while these units are being created?
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
I don't take someone like you seriously.
Then I will come into every thread you ever post and explicitly tell people not to reply to you because you literally do not want to be helped.

Everything in my message was said to help you improve yourself and you're unwilling to listen to it. I'm not being hyperbolic. I'm not making fun of you or shitting on you. I'm telling you all of the specific ways in which your trigger is bad or incorrectly written and also expressing frustration that you repeatedly refuse to attempt to solve your own problems. Problems that you created for yourself by not understanding and then not trying to understand what you're doing.

Lordul Dracula said:
can you tell use what you want to make more exactly ?
It's clear what JFAMAP wants. A team of elves and a team of trolls. Troll players get a troll unit, are allied with trolls, and enemies with elves. Elf players get an elf unit, are allied with elves, and are enemies with trolls. One elf or troll per player. What's unclear is why a 5s timer is involved multiple times and what the scope/long-term-purposes of the ElfPlease and TrollPlease groups are.
 
Last edited:
Then I will come into every thread you ever post and explicitly tell people not to reply to you because you literally do not want to be helped.

Everything in my message was said to help you improve yourself and you're unwilling to listen to it. I'm not being hyperbolic. I'm not making fun of you or shitting on you. I'm telling you all of the specific ways in which your trigger is bad or incorrectly written and also expressing frustration that you repeatedly refuse to attempt to solve your own problems. Problems that you created for yourself by not understanding and then not trying to understand what you're doing.


It's clear what JFAMAP wants. A team of elves and a team of trolls. Troll players get a troll unit, are allied with trolls, and enemies with elves. Elf players get an elf unit, are allied with elves, and are enemies with trolls. One elf or troll per player. What's unclear is why a 5s timer is involved multiple times and what the scope/long-term-purposes of the ElfPlease and TrollPlease groups are.
Aaa ok so he want to make 2 teams. Maybe i will try later to make this trigger.
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
Ok so you want to make 2 teams, elf and troll and every player will get 1 unit. If all player will play as elfs one of them will become a troll and only one player can select the troll.
Exactly. 12 And 24 players but this is for my old map.
1 Player is troll, and rest of the players plays with Elf. If no one selects YES, one of them randomed as Troll.
Only 1 player will be selected as troll regardless of votes or players.

Elf players must be an allied.

Here is the example scenario for the make it clear for everyone.

Lordul Dracula wanted to be a Troll
JFAMAP wanted to be a Troll
Wrda wanted to be an Elf
Uncle wanted to be an Elf

1 Elf will be created for Wrda and Uncle. But 2 players wanted to be Troll. Lordul Dracula and JFAMAP.

Game allows only 1 Troll player and picks random player from all players who wanted to be a Troll, and give 1 Elf to rest of the player.
Results: Lordul Dracula selected as Troll and 1 Elf will be created for JFAMAP.

By the way when you kill the Elf, dialog button appears to owner of dying unit "want to join troll or want to help elves?" but it is the next part.
 
offf ok here is the trigger I'm not sure if is working 100%, because I tested this solo.
  • Player 1 Copy
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Dialog - Clear Choice[1]
      • Dialog - Change the title of Choice[1] to Chose your team.
      • Dialog - Create a dialog button for Choice[1] labelled Elf
      • Set Elf = (Last created dialog Button)
      • Dialog - Create a dialog button for Choice[1] labelled Troll
      • Set Troll = (Last created dialog Button)
      • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
        • Loop - Actions
          • Dialog - Show Choice[1] for (Picked player)
  • Player 1 Copy 2
    • Events
      • Dialog - A dialog button is clicked for Choice[1]
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Troll
        • Then - Actions
          • Player Group - Add (Triggering player) to PlayerTroll
          • Unit - Create 1 Dark Troll for (Random player from PlayerTroll) at (Center of (Playable map area)) facing (Center of (Playable map area))
          • Set TrollUnit = (Last created unit)
          • Player Group - Remove (Owner of TrollUnit) from PlayerTroll
          • Player Group - Pick every player in PlayerTroll and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to PlayerElf
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Elf
        • Then - Actions
          • Player Group - Add (Triggering player) to PlayerElf
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TrollUnit is in (Units in (Playable map area))) Equal to False
            • Then - Actions
              • Unit - Create 1 Dark Troll for (Random player from PlayerElf) at (Center of (Playable map area)) facing (Center of (Playable map area))
              • Set TrollUnit = (Last created unit)
              • Player Group - Remove (Owner of TrollUnit) from PlayerElf
            • Else - Actions
          • Player Group - Pick every player in PlayerElf and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to PlayerElf
              • Unit - Create 1 Archer for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees
              • Player Group - Make PlayerElf treat PlayerElf as an Ally with shared vision
        • Else - Actions
Update:Is working or not
 

Attachments

  • sal2.1.w3x
    22.7 KB · Views: 9
Last edited:

Wrda

Spell Reviewer
Level 26
Joined
Nov 18, 2012
Messages
1,887
You need to test this map with 2 or more players. The reason why you will get troll no matter what you chose is because you said that 1 player must become troll. So if you play solo.....
You forgot to add more players in player properties.
By the way, I tested with myself duplicated and the first player DOES get troll no matter what I choose. The second player's options work.

Also, this doesn't account for players that haven't chosen anything in first place, imagine they're afk. That's why the timer I said earlier solves this issue, but again, I said to start the timer on the trigger where you SHOW the dialog with options, not WHEN players CLICK the options. Last but not least, why should the first clickers get the advantage to get the unit and move around the map first? Everyone should be on equal footing.

  • Events
    • Time - SecimTimer expires
  • Conditions
  • Actions
    • Trigger - Run SecimAsamasiDevam <gen> (checking conditions)
This timer expired and now we are going for the SecimAsamasiDevam

  • SecimAsamasiDevam
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in TrollPlease and do (Actions)
        • Loop - Actions
          • Set TrollSelectedPLAYER = (Random player from TrollPlease)
          • Game - Display to (All players) for 2.00 seconds the text: (Name of TrollSelectedPLAYER)
          • Player Group - Remove TrollSelectedPLAYER from TrollPlease
          • Player Group - Remove TrollSelectedPLAYER from ElfPlease
          • Player Group - Pick every player in TrollPlease and do (Actions)
            • Loop - Actions
              • Player Group - Add (Picked player) to ElfPlease
          • Player Group - Remove all players from TrollPlease
          • Game - Display to (All players) for 10.00 seconds the text: Troll 31 saniye son...
          • Countdown Timer - Start TrollSayacTimer as a One-shot timer that will expire in 5.00 seconds
          • Countdown Timer - Create a timer window for TrollSayacTimer with title Troll 31 saniye son...
          • Set TrollSayac = (Last created timer window)
      • Player Group - Pick every player in ElfPlease and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Elf for (Picked player) at BaslangicYeri facing Default building facing degrees
          • Camera - Pan camera for (Picked player) to (Position of (Last created unit)) over 0.00 seconds
          • Selection - Add (Last created unit) to selection for (Picked player)
          • Player Group - Pick every player in ElfPlease and do (Actions)
            • Loop - Actions
              • Player - Make (Picked player) treat (Picked player) as an Ally with shared vision
This makes no sense, why are these two things seperated? Just merge them, by copying.
 
You forgot to add more players in player properties.
By the way, I tested with myself duplicated and the first player DOES get troll no matter what I choose. The second player's options work.

Also, this doesn't account for players that haven't chosen anything in first place, imagine they're afk. That's why the timer I said earlier solves this issue, but again, I said to start the timer on the trigger where you SHOW the dialog with options, not WHEN players CLICK the options. Last but not least, why should the first clickers get the advantage to get the unit and move around the map first? Everyone should be on equal footing.


This makes no sense, why are these two things seperated? Just merge them, by copying.
Yes i know that my trigger is not 100% finished, i never made a trigger like this before also is not easy because of that random troll player, I will try to fix the trigger but i can't test this solo.
Update: what i need to do is to wait for every player to chose a team after that they should get the unit.
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
I don't know but i have re-organized my trigger and let me show you what happened in there.
By the way i am sorry Lordul but since 2 hours i have tried to implement your system into my map but failed.

@Wrda

  • DiyalogYapma
    • Events
    • Conditions
    • Actions
      • Dialog - Clear Diyalog1
      • Dialog - Change the title of Diyalog1 to Troll olmak ister m...
      • Dialog - Create a dialog button for Diyalog1 labelled Evet
      • Set DiyalogBoku[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for Diyalog1 labelled Hayir
      • Set DiyalogBoku[2] = (Last created dialog Button)
      • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
        • Loop - Actions
          • Dialog - Show Diyalog1 for (Picked player)
This trigger asks players to "do you want to be toll?" and players are choosing yes or no.


  • SecimAsamasi
    • Events
      • Dialog - A dialog button is clicked for Diyalog1
      • Dialog - A dialog button is clicked for Diyalog2
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DiyalogBoku[1]
        • Then - Actions
          • Player Group - Add (Triggering player) to TrollPLS_PlayerGroup
          • Game - Display to (All players) the text: (Troll isteyenler; + (Name of (Triggering player)))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to DiyalogBoku[2]
        • Then - Actions
          • Player Group - Add (Triggering player) to ElfPLS_PlayerGroup
          • Game - Display to (All players) the text: (Elf isteyenler; + (Name of (Triggering player)))
        • Else - Actions
      • Wait 5.00 seconds
      • Game - Display to (All players) for 2.00 seconds the text: diger koda gecildi
      • Trigger - Run SecimAsamasiDevam <gen> (checking conditions)
When one of them clicked button, this trigger runs.
If they click DiyalogBoku[1] they are adding to TrollPLS_PlayerGroup
If they click DiyalogBoku[2] they are adding to ElfPLS_PlayerGroup
And i am running another trigger after 5 seconds.

Is everything ok until here?
We have 2 player groups.
The players want to be Troll and players want to be Elf.

  • SecimAsamasiDevam
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in TrollPLS_PlayerGroup and do (Actions)
        • Loop - Actions
          • Set TrollSecilenP = (Random player from TrollPLS_PlayerGroup)
          • Game - Display to (All players) for 2.00 seconds the text: (Name of TrollSecilenP)
          • Player Group - Remove TrollSecilenP from TrollPLS_PlayerGroup
          • Player Group - Remove TrollSecilenP from ElfPLS_PlayerGroup
          • Game - Display to (All players) for 10.00 seconds the text: Troll 31 saniye son...
          • Countdown Timer - Start TrollSayacTimer as a One-shot timer that will expire in 5.00 seconds
          • Countdown Timer - Create a timer window for TrollSayacTimer with title Troll 31 saniye son...
          • Set TrollSayac = (Last created timer window)
      • Player Group - Pick every player in ElfPLS_PlayerGroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Elf for (Picked player) at BaslangicYeri facing Default building facing degrees
      • Player Group - Pick every player in TrollPLS_PlayerGroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Elf for (Picked player) at BaslangicYeri facing Default building facing degrees
I am picking every player within TrollPLS_PlayerGroup and doing this
Set TrollSecilenP = Random player from TrollPLS_PlayerGroup.
Because Troll given to only 1 player. And i am removing TrollSecilenP from other groups (TrollPLS_PlayerGroup and ElfPLS_PlayerGroup)

Now let's have a look for the other players.

I am picking every player within ElfPLS_PlayerGroup and creating Elf for Picked player
And i am doing this to the same for the TrollPLS_PlayerGroup because 1 random player set as Troll, and they will play as Elf.

And just tested with one of my friends and this is happened.

  • Countdown Timer - Start TrollSayacTimer as a One-shot timer that will expire in 5.00 seconds
  • Countdown Timer - Create a timer window for TrollSayacTimer with title Troll 31 saniye son...
This trigger ran twice and he get 1 Elf, then Troll and i get nothing. What am i missing?
Edit: Ok because it is in the loop. Now i have changed trigger

  • SecimAsamasiDevam
    • Events
    • Conditions
    • Actions
      • Player Group - Pick every player in TrollPLS_PlayerGroup and do (Actions)
        • Loop - Actions
          • Set TrollSecilenP = (Random player from TrollPLS_PlayerGroup)
          • Game - Display to (All players) for 2.00 seconds the text: (Name of TrollSecilenP)
      • Player Group - Remove TrollSecilenP from TrollPLS_PlayerGroup
      • Player Group - Remove TrollSecilenP from ElfPLS_PlayerGroup
      • Game - Display to (All players) for 10.00 seconds the text: Troll 31 saniye son...
      • Countdown Timer - Start TrollSayacTimer as a One-shot timer that will expire in 5.00 seconds
      • Countdown Timer - Create a timer window for TrollSayacTimer with title Troll 31 saniye son...
      • Set TrollSayac = (Last created timer window)
      • Player Group - Pick every player in ElfPLS_PlayerGroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Elf for (Picked player) at BaslangicYeri facing Default building facing degrees
      • Player Group - Pick every player in TrollPLS_PlayerGroup and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Elf for (Picked player) at BaslangicYeri facing Default building facing degrees
Now i am going to test it again.
Lol nothing changed... What am i missing?
Edit: Both of us selected Elves and now game gives us 2 Elves... 2 For me 2 for him. I believe it is super easy to find what is wrong in here. But since 2 hours i am tired and not thinking properly.
Edit 2: Ok just figured it out. Trigger runs multiple times for each player clicked dialog.
 
Last edited:
Level 17
Joined
Jun 2, 2009
Messages
1,137
Ok guys everyhing ok except one thing. There are no troll when
If I explain to you again how to fix your triggers, will you listen to me and try to follow my suggestions? Or will you ignore me because I'm 'being rude'?
I am not skillful, talented, smart as you. But this does not give you the right to insult me. If you find my questions "stupid" as you mentioned, you don't have the help me. You talk like you are scolding and that makes you repulsive.
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
Ok here is the another mystery.

  • Events
    • Time - TrollSayacTimer expires
  • Conditions
  • Actions
    • Unit - Create 1 Dark Troll for TrollSecilenP at BaslangicYeri facing Default building facing degrees
    • Countdown Timer - Destroy TrollSayac
    • Set PlayerGoldIncome[(Player number of TrollSecilenP)] = 2
    • Set Troll = (Last created unit)
    • Selection - Select Troll for TrollSecilenP
    • Unit - Change ownership of TrollEvi to TrollSecilenP and Change color
This trigger sets Gold Income for TrollSecilenP to 2
But it is affecting me when i am Elf.
When i set it to 0, it solves the problem for Elf.
BUT when i press ESC, it says (null)

If i am not joined TrollSecilenP, why this PlayerGoldIncome affects me?
If i am joined TrollSecilenP, why this trigger not displays my player name?

  • Events
    • Player - Player 1 (Red) skips a cinematic sequence
  • Conditions
  • Actions
    • Game - Display to (All players) for 1.00 seconds the text: (Name of TrollSecilenP)
 
Level 17
Joined
Jun 2, 2009
Messages
1,137
  • Actions
    • Player Group - Pick every player in TrollPLS_PlayerGroup and do (Actions)
      • Loop - Actions
        • Set TrollSecilenP = (Random player from TrollPLS_PlayerGroup)
        • Game - Display to (All players) for 2.00 seconds the text: (Name of TrollSecilenP)
    • Player Group - Remove TrollSecilenP from TrollPLS_PlayerGroup
    • Player Group - Remove TrollSecilenP from ElfPLS_PlayerGroup
    • Game - Display to (All players) for 10.00 seconds the text: Troll 31 saniye son...
    • Countdown Timer - Start TrollSayacTimer as a One-shot timer that will expire in 5.00 seconds
    • Countdown Timer - Create a timer window for TrollSayacTimer with title Troll 31 saniye son...
    • Set TrollSayac = (Last created timer window)
    • Player Group - Pick every player in ElfPLS_PlayerGroup and do (Actions)
      • Loop - Actions
        • Unit - Create 1 Elf for (Picked player) at BaslangicYeri facing Default building facing degrees
    • Player Group - Pick every player in TrollPLS_PlayerGroup and do (Actions)
      • Loop - Actions
        • Unit - Create 1 Elf for (Picked player) at BaslangicYeri facing Default building facing degrees
I am testing it alone and choosing Elves.

  • Set TrollSecilenP = (Random player from TrollPLS_PlayerGroup)
But i am not selecting this.

Why this Value setting as 2 for me? I am voting for NO (i am part of the ElfPLS_PlayerGroup, not the TrollPLS_PlayerGroup)
 
Ok done this should work
  • Player 1 Copy
    • Events
      • Time - Elapsed game time is 0.00 seconds
    • Conditions
    • Actions
      • Countdown Timer - Start Time as a One-shot timer that will expire in 15.00 seconds
      • Countdown Timer - Create a timer window for (Last started timer) with title Time
      • Dialog - Clear Choice
      • Dialog - Change the title of Choice to Chose your team.
      • Dialog - Create a dialog button for Choice labelled Elf
      • Set Elf = (Last created dialog Button)
      • Dialog - Create a dialog button for Choice labelled Troll
      • Set Troll = (Last created dialog Button)
      • Player Group - Pick every player in (All players controlled by a User player) and do (Actions)
        • Loop - Actions
          • Dialog - Show Choice for (Picked player)
  • Player 1 Copy 2
    • Events
      • Dialog - A dialog button is clicked for Choice
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Troll
        • Then - Actions
          • Player Group - Add (Triggering player) to PlayerTroll
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to Elf
        • Then - Actions
          • Player Group - Add (Triggering player) to PlayerElf
        • Else - Actions
  • Untitled Trigger 001
    • Events
      • Time - Time expires
    • Conditions
    • Actions
      • Countdown Timer - Destroy (Last created timer window)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in PlayerTroll) Greater than or equal to 1
        • Then - Actions
          • Unit - Create 1 Dark Troll for (Random player from PlayerTroll) at (Center of (Playable map area)) facing (Center of (Playable map area))
          • Set TrollUnit = (Last created unit)
          • Player Group - Pick every player in PlayerTroll and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked player) Not equal to (Owner of TrollUnit)
                • Then - Actions
                  • Player Group - Add (Picked player) to PlayerElf
                • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of players in PlayerTroll) Equal to 0
        • Then - Actions
          • Unit - Create 1 Dark Troll for (Random player from PlayerElf) at (Center of (Playable map area)) facing (Center of (Playable map area))
          • Set TrollUnit = (Last created unit)
          • Player Group - Remove (Owner of TrollUnit) from PlayerElf
          • Player Group - Add (Owner of TrollUnit) to PlayerTroll
        • Else - Actions
      • Player Group - Pick every player in PlayerElf and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Archer for (Picked player) at (Center of (Playable map area)) facing Default building facing degrees
          • Player Group - Make PlayerElf treat PlayerElf as an Ally with shared vision
So @JFAMAP did you fixed your trigger?
 
Last edited:
Status
Not open for further replies.
Top