[Trigger help] Player groups, etc

Status
Not open for further replies.

Newbiemapmaker

N

Newbiemapmaker

TL;DR
How do I make it so I don't have to keep making new triggers for each individual player.

I'm relatively new to the world editor, but I have made around 3 maps, and in all of them I have the same trouble...
jr4jzr.png

There has got to be an easier way, what I want to know e.g. a text command where it goes...

Player - Player 1 red -types a chat message with (whatever) as an exact match.

Is there any way I can just make it so if any player types it only they get the command working, because I hate making 12 sets of the same trigger just to change the players name.

Also, I wanted to know if I can do all players, or team 1/2.


Thanks in advance, pissed off map maker. :ogre_icwydt:
 
I believe it would be something like this:
  • Command
    • Events
      • Player - Player 1 (Red) types a chat message containing Text as An exact match
      • Player - Player 2 (Blue) types a chat message containing Text as An exact match
      • Player - Player 3 (Teal) types a chat message containing Text as An exact match
      • Player - Player 4 (Purple) types a chat message containing Text as An exact match
      • Player - Player 5 (Yellow) types a chat message containing Text as An exact match
      • Player - Player 6 (Orange) types a chat message containing Text as An exact match
      • Player - Player 7 (Green) types a chat message containing Text as An exact match
      • Player - Player 8 (Pink) types a chat message containing Text as An exact match
      • Player - Player 9 (Gray) types a chat message containing Text as An exact match
      • Player - Player 10 (Light Blue) types a chat message containing Text as An exact match
      • Player - Player 11 (Dark Green) types a chat message containing Text as An exact match
      • Player - Player 12 (Brown) types a chat message containing Text as An exact match
    • Conditions
    • Actions
      • Set Player = (Triggering player)
      • Game - Display to (All players) the text: (Name of (Triggering player))
      • Trigger - Do stuff...
      • Trigger - Do stuff...
      • Unit - Change ownership of YourUnit to Player and Change color
      • Trigger - Turn off (This trigger)
The variable I made is of type Player and it's called Player just for to be user-friendly. I don't know if this is leak-free or if it's the best way to do it. But I would guess that you have to make another variable that will turn on the appropriate trigger by using the variable.

EDIT:
Now that I think about it you don't need a variable to make this part work. You just need to use "Triggering Player" as the target for the effects.
 
But in the events part is there any way to make it if (x) player, so I dont have to do it twelve times?
 
  • Eg 1
    • Events
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Trigger - Add to Eg 2 <gen> the event (Player - (Player((Integer A))) types a chat message containing -mode as An exact match))
  • Eg 2
    • Events
    • Conditions
    • Actions
      • -------- Actions here --------

I think this is right, thanks!
But, it's a bit complicated can you please make it easier to understand - I'm a newb
 
Last edited by a moderator:
  • Start
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Effect <gen> the event (Player - (Picked player) types a chat message containing -Anything as A substring)
  • Effect
    • Events
    • Conditions
    • Actions
      • *Actions*
Just throwing out suggestions
 
Status
Not open for further replies.
Back
Top