Hi, I'm fed up with having to load my map to test every single unit, and value. So I'm writing a debugging tool that will allow me to add units in-game by message. How do I do as follows:
Event: Player enters message containing "Add [number]"
Action: Adds [number] of ... to .. bla bla
So far I managed to find this of another trigger tutorial:
Game - Player 1 types a chat message containing ("Add " + (Entered chat string)), matching Partially
AmountOfUnits = "" <String>
Variable - Set AmountOfUnits = (Entered chat string)
Variable - Set AmountOfUnits = (AmountOfUnits with characters from 1 to 5 replaced by "")
Problem is, I can't call upon that variable as a number, in a further trigger (e.g. add [AmountOfUnit] of type [zerglings] to....)
None.
This is what I used to change the difficulty integer on one of my maps. It should be easily modifiable:
SayDIfficulty
Events
Game - Player 1 types a chat message containing "-difficulty ", matching Partially
Local Variables
Conditions
And
Conditions
(Integer((Word 2 of (Entered chat string)))) <= 100
(Integer((Word 2 of (Entered chat string)))) >= 1
Actions
Variable - Set Difficulty = (Integer((Word 2 of (Entered chat string))))
You basically just need to use the "Convert String to Integer" function, and use the "Word of String" function as it's argument. In you case it should be still be word 2
None.