Legacy GM Input (get_string_async) [SOLVED]

J

Julian244

Guest
Hey, i never did something like working with strings and numbers together and i'm from germany so please dont talk about my english^^

My code is something like this:

Code:
global.amount = get_string_async("Wie viel willst du aufladen?","")
global.v = 0
string_digits(global.amount)
global.v = real(global.amount)
global.money += global.v
global.worth -= global.v
and i wanna have a text input field and take the numbers out of it and then add(or take) it to the globals but i dont really know how to do that.... and i wanted to have the get_string_async because it works on android too.
 

FrostyCat

Redemption Seeker
Why don't you use get_integer_async() instead, and read the Manual's instructions this time?

The Manual clearly says that the runner doesn't wait for functions such as get_string_async() and get_integer_async() to finish, that's why they work on mobiles. The example also clearly tells you to catch the response in the Asynchronous Dialog event.

Create:
Code:
ih_amount = -1;
When the message should pop up:
Code:
ih_amount = get_integer_async("Wie viel willst du aufladen?", 0);
Asynchronous Dialog event:
Code:
if (async_load[? 'id'] == ih_amount) {
  if (async_load[? 'status']) {
    global.money += async_load[? 'value'];
    global.worth -= async_load[? 'value'];
  }
}
 
J

Julian244

Guest
Why don't you use get_integer_async() instead, and read the Manual's instructions this time?

The Manual clearly says that the runner doesn't wait for functions such as get_string_async() and get_integer_async() to finish, that's why they work on mobiles. The example also clearly tells you to catch the response in the Asynchronous Dialog event.

Create:
Code:
ih_amount = -1;
When the message should pop up:
Code:
ih_amount = get_integer_async("Wie viel willst du aufladen?", 0);
Asynchronous Dialog event:
Code:
if (async_load[? 'id'] == ih_amount) {
  if (async_load[? 'status']) {
    global.money += async_load[? 'value'];
    global.worth -= async_load[? 'value'];
  }
}
Thanks and sorry^^ I will try it soon^^
 
J

Julian244

Guest
Why don't you use get_integer_async() instead, and read the Manual's instructions this time?

The Manual clearly says that the runner doesn't wait for functions such as get_string_async() and get_integer_async() to finish, that's why they work on mobiles. The example also clearly tells you to catch the response in the Asynchronous Dialog event.

Create:
Code:
ih_amount = -1;
When the message should pop up:
Code:
ih_amount = get_integer_async("Wie viel willst du aufladen?", 0);
Asynchronous Dialog event:
Code:
if (async_load[? 'id'] == ih_amount) {
  if (async_load[? 'status']) {
    global.money += async_load[? 'value'];
    global.worth -= async_load[? 'value'];
  }
}

ok 1. it wont do the 'global.worth -= async_load[? 'value'];' and sometimes i get asked twice for a input...... and i still dont understand what everything does....
 
Top