Warcraft III resources & community, 2003–2006 · archived

Trigger Help, dealing with chat strings

6 posts
#1

Trigger Help, dealing with chat strings

Im trying to create a trigger that will take the players chat string's and get the number entered after a substring.

Example:

-spawn 15

How can i get the trigger to get the number (15) that the player enters.

I started with "a player types a chat message containing "-spawn" as a substring" but after that i have no idea where to go, i looked threw most integer events and didnt find anything that looked to be what i was looking for, any help is greatly appreciated, thanks in advance :D
#2
use SubString
#3
I would suggest Substring 8 , 9
#4
How does the substring work?

it gives substring, #, #

im really confused and the example on the trigger doesnt help at all..
#5
Maybe it work with String-conversion to integer. Not sure, though
#6
I got it , found a nice tutorial that explained everything here:
http://world-editor-tutorials.thehelper.net/cat_usersubmit.php?view=28094

Substring, #, #
Subgstring = entered chat string, # of first character, # of last character.

For instance

player types "-spawn" as a substring

create {substring[entered chat string, 8,9] footman for player at location.

-spawn is 6 letters, to the sixth place, 7 for a space, 8 and 9 are for the ## u want to spawn.

-spawn 20
would now spawn 20 footman

hope i helped anyone who had the same question and thanks for help anyone gave me.