you want to get all of them as a string or get the integer ? Still, the entire chat string is called by "entered chat strings", only usable when event Player enter chat message is used. Use can use substring and convert to get what you want
I found the substring; Variable - Set StringA = (Substring((Entered chat string), 13, 19))
and it does indeed what I asked for. however I am not able to convert the string that I recived from the substring above into a intiger value. nor am I able to use any intiger variable in Environment - Set fog's density to 0.0
I'm not positive cause I've enver worked with the fog density (and I'm not sure this is your question)...
but I'm assuming it takes a variable between 0 and 1?
Simply tell the player to enter an interger between 0 and 100, and convert it down
I want to store the number a played typed into a variable in a string following this example "-string string 22". how do I get out that value?
@pinzu: Go
you want to get all of them as a string or get the integer ? Still, the entire chat string is called by "entered chat strings", only usable when event Player enter chat message is used. Use can use substring and convert to get what you want
@progammer: Go
sorry its late :)
I want the intiger that the player typed in.
* edit *
I found the substring; Variable - Set StringA = (Substring((Entered chat string), 13, 19))
and it does indeed what I asked for. however I am not able to convert the string that I recived from the substring above into a intiger value. nor am I able to use any intiger variable in Environment - Set fog's density to 0.0
thank you for your time!
Action: Set Varible Variable: convertedInt to "Convert String to Interger" Value: yourString
I got this far:
Untitled Trigger 002
Events
Game - Player Any Player types a chat message containing "-fog density ", matching Partially
Local Variables
StringA = "" <String>
IntigerA = 0 <Integer>
real = 0.0 <Real>
Conditions
Actions
Variable - Set StringA = (Substring((Entered chat string), 13, 19))
Variable - Set IntigerA = (Integer((Substring((Entered chat string), 13, 19))))
Variable - Set real = (Real(IntigerA))
Environment - Set fog's density to real
UI - Display (Text(real) with Any Precision decimal places) for (All players) to Subtitle area
but it dosn't allow decimals and so basically there is either maximum fog value 1 or no fog value 0. correct me if im wrong.
How to solve this?
I'm not positive cause I've enver worked with the fog density (and I'm not sure this is your question)... but I'm assuming it takes a variable between 0 and 1?
Simply tell the player to enter an interger between 0 and 100, and convert it down
@Anthius: Go
I did this; Variable - Set real = (Real((IntigerA / 100)))
and it still only returns 1 or 0 with the same results. however it shortens down to 0 already when you ask it to convert from 99....
thank you for your time anyway.
@pinzu: Go
This should work:
Variable - Set Percent = ((Real(IntegerA)) / 100.0)
Percent being the value you get that is between 0 and 1, this way it converts the number they entered into a real then divides it by 100.
ye, i did that and figured out I didn't need those extra variables. being new to this really sucks all the time on trivial things ;/
well thx