• 🏆 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 help] Player groups, etc

Status
Not open for further replies.
Level 1
Joined
Nov 28, 2010
Messages
3
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:
 
Level 3
Joined
Nov 19, 2010
Messages
51
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.
 
Level 1
Joined
Nov 28, 2010
Messages
3
  • 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:
Level 33
Joined
Mar 27, 2008
Messages
8,035
  • 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.
Top