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.
[06:02 pm]
Zoan -- of course it isn't full understanding. You could ask "is the mechanism by which this counterexample blows up the ONLY mechanism possible for an initial configuration to blow up?"
[05:48 pm]
Zoan -- ppl do it all the time in PDEs
[05:47 pm]
Zoan -- Heinermann
Heinermann shouted: it also didn't solve that problem but hey as long as the investors are pleased
Constructing a counterexample is answering the question: "Is Navier Stokes well posed?" in the negative
[05:44 pm]
NudeRaider -- I only heard about it, didn't any news article, so what did it do then?
[05:43 pm]
Heinermann -- it also didn't solve that problem but hey as long as the investors are pleased
[05:39 pm]
NudeRaider -- I have no idea tbh. All I know no human was ever able to solve it, but there's at least a few that beat portal ;)
[05:32 pm]
Zoan -- Navier Stokes is not that esoteric I thought
[04:32 pm]
NudeRaider -- Zoan
Zoan shouted: I find it kind of sad that on the same day it was announced AI solved Navier Stokes, it was also announced AI beat Portal, and there's a good deal of people who don't know which is more impressive
you find it sad not everyone is a math nerd?
[03:25 pm]
NudeRaider -- (and yes, I capitalized that correctly :ego:)
[03:24 pm]
NudeRaider -- Symmetry
Symmetry shouted: Hi not I'm dad
Hi dad, I'm nude
Please log in to shout.


Members Online: Excalibur, Rawflesh0615, Ultraviolet