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

[Solved] Player chat string?

Status
Not open for further replies.
Level 6
Joined
Oct 4, 2011
Messages
226
Hi. My map involves a host that types to change the game settings before he starts it. My desired way for the host to set the number of points it takes for victory equal to the number after "-win " so "-win XX" I think its possible but I dont know how.
 
Level 7
Joined
Sep 9, 2007
Messages
253
Take a look at this Tutorial http://www.hiveworkshop.com/forums/general-mapping-tutorials-278/using-chat-commands-34686/


  • Trigger_Set_Wins
    • Events
      • Player - Player 1 (Red) types a chat message containing -win as A substring
    • Conditions
      • (Substring((Entered chat string), 1, 5)) Equal to -win
    • Actions
      • Set aaTempInteger = (Integer((Substring((Entered chat string), 6, 7))))
please note that the condition must match entered substring characters 1-5... The 5th character is a space after "-win" but before "XX". XX is the 6th and 7th character.
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
Level 6
Joined
Oct 4, 2011
Messages
226
Thanks for that link shadow, I looked it over and it seemed very informative. If I find myself needed substring help in the future which im sure I will then I will remember to look here. :)
 
Status
Not open for further replies.
Top