• 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.

chat message help

Status
Not open for further replies.
Level 4
Joined
Jul 9, 2008
Messages
88
i need host configuration in he beginning of the game, and i need to convert something in what the host sais to an integer, and then to a variable.
For example, if red typed this:
-Level 47

the integer 47 would be converted to a variable.
I prefer GUI, but JASS is fine too.
Thanks for your help.
 
Level 5
Joined
Nov 14, 2007
Messages
161
Substrings are your answer.
Code:
so the text is "-level####"
                1234567890
we are using:   ------7890
because i put in 7, 10
now you have a string set for the last 3 characters/numbers
and an integer set for the last 3 numbers which you can set to your level variable or whatever.
hope that made sense:weekani:

  • SubStrings
    • Events
      • Player - Player 1 (Red) types a chat message containing -level as A substring
    • Conditions
    • Actions
      • Set string = (Substring((Entered chat string), 7, 10))
      • Set integer = (Integer(string))
      • Game - Display to (All players) for 30.00 seconds the text: string
      • Game - Display to (All players) for 30.00 seconds the text: (String(integer))

And that is your GUI way to do it.
 
Level 4
Joined
Jul 9, 2008
Messages
88
ty
that helped a lot not only on this issue, but on many things to come in the future.
ty
+rep
 
Status
Not open for further replies.
Top