• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Solved] Multiple chat message recognition within a single trigger

Status
Not open for further replies.
Level 12
Joined
Jul 5, 2014
Messages
556
Assuming this is the event.

  • Player - Player 1 (Red) types a chat message containing left as An exact match
  • Player - Player 1 (Red) types a chat message containing right as An exact match
Is it possible to recognize the two message individually within a single trigger without creating more triggers? So the result would be something like this:

  • Player - Player 1 (Red) types a chat message containing left as An exact match
  • Game - Display to (All players) the text: You said left.
  • Player - Player 1 (Red) types a chat message containing right as An exact match
  • Game - Display to (All players) the text: You said right.
 
It's a sub... string. A smaller string that was part of a bigger one. It helps if you read the action descriptions:
run.png
 
Multiple Events can be registered to the same trigger:
  • Events
    • Player - Player 1 (Red) types a chat message containing left as An exact match
    • Player - Player 1 (Red) types a chat message containing right as An exact match
  • Conditions
  • Actions
    • Set Variable Str = (Entered chat string)
    • If all conditions are true then do (Actions)
      • If - Conditions
        • Str Equal to left
      • Then - Actions
        • -------- P1 typed "left" --------
      • Else - Actions
    • If all conditions are true then do (Actions)
      • If - Conditions
        • Str Equal to right
      • Then - Actions
        • -------- P1 typed "right" --------
      • Else - Actions
The Actions will run the moment any of the Events occur.
 
Multiple Events can be registered to the same trigger:
  • Events
    • Player - Player 1 (Red) types a chat message containing left as An exact match
    • Player - Player 1 (Red) types a chat message containing right as An exact match
  • Conditions
  • Actions
    • Set Variable Str = (Entered chat string)
    • If all conditions are true then do (Actions)
      • If - Conditions
        • Str Equal to left
      • Then - Actions
        • -------- P1 typed "left" --------
      • Else - Actions
    • If all conditions are true then do (Actions)
      • If - Conditions
        • Str Equal to right
      • Then - Actions
        • -------- P1 typed "right" --------
      • Else - Actions
The Actions will run when one or the other happens.
Yes, Pyrogasm mentioned the chat id condition. What's the idea behind using a variable, rather than just using the condition?
 
Yes, Pyrogasm mentioned the chat id condition. What's the idea behind using a variable, rather than just using the condition?
Micro optimization, it also just makes things easier if you expand the trigger.

Then you would drag the second ITE into the Else - Actions of the first ITE since these two things are mutually exclusive.

But these types of optimizations aren't going to make or break anything - unless your trigger does some crazy heavy task.
 
Micro optimization, it also just makes things easier if you expand the trigger.

Then you would drag the second ITE into the Else - Actions of the first ITE since these two things are mutually exclusive.

But these types of optimizations aren't going to make or break anything - unless your trigger does some crazy heavy task.
I don't see the difference. It requires typing in the wanted chat message, same as giving the condition simply "entered chat string". What exactly it makes easier?
 
I don't see the difference. It requires typing in the wanted chat message, same as giving the condition simply "entered chat string". What exactly it makes easier?
It's more efficient which is what I really care about. A variable look-up is faster than calling a function to retrieve a variable.

But I personally find it easier to browse through my variables instead of a list of functions. I often only have a couple of String variables.

Variables in general make things easier.
 
Status
Not open for further replies.
Back
Top