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:35 pm]
Symmetry -- though mine's probably worse
[03:35 pm]
Symmetry -- That certainly sounds similar to what I've made
[06:28 am]
Ultraviolet -- sounds like Bound & Defend
[07:43 pm]
Symmetry -- If you take the reins you damn well be ready to ride
[2026-5-23. : 2:46 pm]
NudeRaider -- you wish
[2026-5-23. : 12:43 am]
IskatuMesk -- Ah, so Reindeer Breeding 3: BDSM edition.
[2026-5-22. : 12:45 am]
Moose -- tbh
[2026-5-20. : 8:27 pm]
Symmetry -- It's a bound map where you cross obstacles to earn units to defend your base
[2026-5-20. : 8:16 pm]
Symmetry -- No, the world isn't ready for that
[2026-5-20. : 5:11 pm]
Zoan -- Reindeer Breeding 3?
Please log in to shout.


Members Online: Symmetry