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.
[03:37 pm]
NudeRaider -- (-.-,)
[03:35 pm]
Zoan -- ;o I thought that was a monkey emote
[03:34 pm]
Zoan -- :mods:
[03:34 pm]
Zoan -- :mods"
[03:20 pm]
NudeRaider -- Vrael
Vrael shouted: moderation? on SEN? in 2026? completely localized in anoeth47's topic? at this time of year?
boy, if you're not careful I'll moderate your sorry ass too!
[03:06 pm]
RIVE -- Yyyes. Don't you see it?
[02:11 pm]
Vrael -- moderation? on SEN? in 2026? completely localized in anoeth47's topic? at this time of year?
[01:39 pm]
NudeRaider -- anoeth47
anoeth47 shouted: Can I get a moderator/lord of the forum to clean up my topics - delete posts not really part of the topic.
send me the links of the posts you want deleted via pm
[01:39 pm]
NudeRaider -- anoeth47
anoeth47 shouted: Can you download from forum if not a member?
log out and find out. ;)
[11:20 pm]
Vrael -- probably not, that sounds like work
Please log in to shout.


Members Online: Lalabett, NudeRaider, Zoan, Dem0n