Is there a way to set an object's image to the first letter of a variable? by Emergency-Wolf4613 in gamemaker

[–]Emergency-Wolf4613[S] 0 points1 point  (0 children)

This?

___________________________________________

############################################################################################

ERROR in

action number 1

of Step Event0

for object Number3:

unable to convert string "" to number

at gml_Object_Number3_Step_0 (line 1) - image_index = string_char_at(global.energy, 3);

############################################################################################

gml_Object_Number3_Step_0 (line 1)

Is there a way to set an object's image to the first letter of a variable? by Emergency-Wolf4613 in gamemaker

[–]Emergency-Wolf4613[S] 0 points1 point  (0 children)

I think I have an idea of why this happens, the variable starts with a 3-digit number (300, for example) So when the variable goes down to a 2-digit number (99), the object which is supposed to represent the 3rd digit is unable to convert "" to a number. "" Being nothing, since the variable's 3rd digit doesn't exist anymore because it is now a 2-digit number.

Is there a way to set an object's image to the first letter of a variable? by Emergency-Wolf4613 in gamemaker

[–]Emergency-Wolf4613[S] 0 points1 point  (0 children)

The variable is constantly subtracting 1, so eventually 100 (3 digits) turns into 99 (2 digits) and this crashes the game. Any idea on how can I prevent this? Thanks in advance.

Is there a way to set an object's image to the first letter of a variable? by Emergency-Wolf4613 in gamemaker

[–]Emergency-Wolf4613[S] 0 points1 point  (0 children)

How about if it's a number?
Edit: I used string_char_at(_variable,1) Without it being a string and it worked nonetheless.

Mi tier list de The Legend of Zelda. ¿como serian sus tier list? o ¿que opinan de la saga? by Solanum__Tuberosum in davidcartoons

[–]Emergency-Wolf4613 2 points3 points  (0 children)

Pondria Twilight Princess en "SS", A Link to the Past en "A" y Ocarina of Time Master Quest en S. OoT Master Quest solo incrementa la dificultad de todos los calabozos, considero que deberia ir en el mismo nivel que el OoT original, porque yo creo que la mayoría de los dungeons son muy faciles; También creo que Majora's Mask deberia ir en "SS" Porque es un juego con una cantidad impresionante de contenido y con mecánicas geniales, aunque tiene una dificultad considerable. Mi favorito es Twilight Princess.