• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

"Player types a message" problem

Status
Not open for further replies.
Level 1
Joined
Jul 12, 2010
Messages
1
I can not use a variable on " Player - <need the variable> types a chat message containing <my message> As exact match. "

I have a variable called Host (Type of variable = Player), but i can not use it on the above line of trigger, why ?

*Edit* : Sorry for the prefix, didn't read the announcement.
 
Last edited:
Level 8
Joined
Jun 26, 2010
Messages
530
Strange. Try creating a dummy unit for Host and set it to a variable, then use "owner of unit" in the event.
 
Level 14
Joined
Aug 31, 2009
Messages
775
Tirlititi's method is the most efficient, but there's also the alternative of using:
Player 1 enters a chat message containing "message" as an exact match.
Player 2 enters a....

etc. repeated to fill all 12 player slots. Then using the condition "Triggering Player equal to Host".
 
Level 4
Joined
Jul 23, 2008
Messages
99
Create two trigger...

First, Create a trigger named "something", then put your desired actions there. Do not put any events there.

Second, Create a new trigger named "init" and put Map Initialization in event. And for actions, add "For Loop from 1 to 12 Do Actions" and Add "Add Event - Add Something<gen> an event : Player(Integer A) type "-command" as exact...
 
Level 13
Joined
Mar 4, 2009
Messages
1,156
for all commands in your map just use 2 triggers
  • Map initialization 2
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Trigger - Add to Commands <gen> the event (Player - (Picked player) types a chat message containing - as A substring)
  • Commands
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 2, 8)) Equal to command
          • <Host> Equal to <Your Player>
        • Then - Actions
          • -------- you actions --------
        • Else - Actions
2,8 bacuse of "-" at beginning

Edit:
@Section,he does need to set Host variable on his own.....
 
Last edited:
Level 4
Joined
Jul 23, 2008
Messages
99
Yea... ALiEN95 has cleared it all perfectly. But maybe it means like this?

  • Map initialization 2
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Host = <theHost>
      • Trigger - Add to Commands <gen> the event (Player - Host types a chat message containing - as A substring)
 
Status
Not open for further replies.
Top