IntVar is an Integer defined some time after map initialization and WordlistString is just a string with different words. The problem seems to be that Integer Variables for events are checked at map initialization and don't change even if IntVar is changed.
While debugging, this event triggers the actions whenever anything is typed in chat. Now, I figured I could just add a condition to see if what was typed was the same as the word of Wordstring that my variable defines. This is the only Condition I found that matches:
(Enteredchatstring)==(WordIntVarofWordlistString)
It doesn't work though.
I don't know what else to add. Any help would be appreciated.
what is IntVar set to? if its set to 0 it wont work. the first word is index 1. i just tried this trigger exactly like yours and it works.
Events
Game - Player Any Player types a chat message containing (Entered chat string), matching Exactly
Local Variables
Conditions
(Entered chat string) == (Word 2 of "test words for chat string")
Actions
UI - Display (Text((Entered chat string))) for (All players) to Subtitle area
While we're on the topic of chat message inputs, is there a way to read for arguments? Like a player types -command <some integer>. The trigger would set some variable to <some integer>
Thats exactly what Word of String does. You give it an index (1 or up) and it will get the word corresponding to the index. So -comm <integer> you would get index 2. If you wanted to store it in an integer variable then you would use the convert string to integer function.
I figured it out. It's case sensitive when it checks the word of the string via a condition, but it's not when it was defined in the event.
Ty Barakatx. Good thing you used an all lower case string because it was EXACTLY the same as what I had except for the capitalization but yours worked and mine didn't.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I had This
IntVar is an Integer defined some time after map initialization and WordlistString is just a string with different words. The problem seems to be that Integer Variables for events are checked at map initialization and don't change even if IntVar is changed.
I changed it to
While debugging, this event triggers the actions whenever anything is typed in chat. Now, I figured I could just add a condition to see if what was typed was the same as the word of Wordstring that my variable defines. This is the only Condition I found that matches:
It doesn't work though.
I don't know what else to add. Any help would be appreciated.
what is IntVar set to? if its set to 0 it wont work. the first word is index 1. i just tried this trigger exactly like yours and it works.
Events
Game - Player Any Player types a chat message containing (Entered chat string), matching Exactly
Local Variables
Conditions
(Entered chat string) == (Word 2 of "test words for chat string")
Actions
UI - Display (Text((Entered chat string))) for (All players) to Subtitle area
it shows "words" whenever i type "words"
While we're on the topic of chat message inputs, is there a way to read for arguments? Like a player types -command <some integer>. The trigger would set some variable to <some integer>
@tordecybombo:
Thats exactly what Word of String does. You give it an index (1 or up) and it will get the word corresponding to the index. So -comm <integer> you would get index 2. If you wanted to store it in an integer variable then you would use the convert string to integer function.
@barakatx2: Go
I figured it out. It's case sensitive when it checks the word of the string via a condition, but it's not when it was defined in the event.
Ty Barakatx. Good thing you used an all lower case string because it was EXACTLY the same as what I had except for the capitalization but yours worked and mine didn't.