GML string_char_at question

WinuX

Member
Hello everyone

Is it possible to read the whole number not just the first number that comes after the "\"

upload_2017-3-30_18-26-53.png

Because I want to have more than 10 modifiers and i don't want to make it into a string so i can use letters as well is there any possible solution?

EDIT: btw. "i" is the current string position in the typewriter textbox
 
Last edited:
Loop through reading chars until you're at the end of the string or you reach a pre-defined terminating character.
For example:
Code:
var len = string_length(global.txt[global.txt_current]);
var z = i;
var tmp = "";
if(string_char_at(global.txt[global.txt_current],z]) == "\")
{
     while(z<len){
          tmp+=string_char_at(global.txt[global.txt_current],z+1);
          z+=1;
     }
     modifier=real(tmp);
}
 

WinuX

Member
Loop through reading chars until you're at the end of the string or you reach a pre-defined terminating character.
For example:
Code:
var len = string_length(global.txt[global.txt_current]);
var z = i;
var tmp = "";
if(string_char_at(global.txt[global.txt_current],z]) == "\")
{
     while(z<len){
          tmp+=string_char_at(global.txt[global.txt_current],z+1);
          z+=1;
     }
     modifier=real(tmp);
}
Thank you very much, it works perfectly :D
 
Top