Staredit Network > Forums > SC2 Assistance > Topic: Combining text-string, chat message & var. ?
Combining text-string, chat message & var. ?
Aug 17 2010, 4:50 pm
By: Deev  

Aug 17 2010, 4:50 pm Deev Post #1



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.

Aug 17 2010, 6:13 pm shmeeps Post #2



This is what I used to change the difficulty integer on one of my maps. It should be easily modifiable:

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

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[04:53 pm]
NudeRaider -- lil-Inferno
lil-Inferno shouted: Nude why'd you delete my shout
why not? :awesome:
[04:26 pm]
Vrael -- because you perfectly guessed SEN's root password and we cant have that displayed all over the shoutbox
[03:58 pm]
lil-Inferno -- sadjfjkasdhfijsadhmfcjhsdajkvfmjadslkfhjsdkahf
[03:58 pm]
lil-Inferno -- Nude why'd you delete my shout
[03:35 pm]
NudeRaider -- never trust a statistic you haven't forged yourself
[04:37 am]
Ultraviolet -- 80% of statistics are made up on the spot
[08:05 pm]
Symmetry -- 50% of strings in starcraft are references
[2026-6-07. : 1:59 am]
RIVE -- Lots of fun little nods to different works of others in the cheats too.
[2026-6-06. : 5:17 pm]
Oh_Man -- so i was today years old wen i learned rebel yell starcraft mission is named after a billy idol song. makes me wonder wat other missions are named after songs
[2026-6-04. : 3:42 am]
RIVE -- Hellooooo, Nurse
Please log in to shout.


Members Online: NudeRaider