Tengo una sprite Arquero1

Tengo un objeto llamado Arquero
quiero hacer que la variable Dir1 sea = a Arquero1

pero quiero hacerlo de la siguiente manero

Dir1 = object_get_name(object_index)+"1";

El probleme es que aca no le asigno un balor a la variable Dir1, sino que le asigno un string

?Como hago para combertir ese string en el nombre de una variable?

?hay alguna funcion para ello?

por ejemplo

Dir1 = combertir(object_get_name(object_index)+"1");

Echale un ojo a estas funciones. El nombre dado para crear la variable debe ser una cadena:

Citarvariable_global_set(name,value) Sets the global variable with the given name (a string) to the given value.

variable_global_array_set(name,ind,value) Sets the index ind in the global array variable with the given name (a string) to the given value.

variable_global_array2_set(name,ind1,ind2,value) Sets the index ind1,ind2 in the global 2-dimensional array variable with the given name (a string) to the given value.

variable_local_set(name,value) Sets the local variable with the given name (a string) to the given value.

variable_local_array_set(name,ind,value) Sets the index ind in the local
array variable with the given name (a string) to the given value.

variable_local_array2_set(name,ind1,ind2,value) Sets the index ind1,ind2 in the local 2-dimensional array variable with the given name (a string) to the given value.




esas funciones sirben para crear variables, pero yo lo que quiero es poder acseder a una variable ya existente, para poder aseder a dicha varible presiso llamarla por su nombre.

yo puedo conseguir su nombre, pero seria simplemente un string el cual no me permite acseder al valor de la variable:

object_get_name(object_index)+"1"

-----------------------------

hay una funcion que me permite hacerlo con variables globales o locales:
variable_global_get(name)
variable_local_get(name)

la probe y si sirve para variables globales y locales pero no sirve para los sprites


EN RESUMEN LO QUE PRESISO ES LA FUNCION O UN SCRIPT OPUESTO A:
sprite_get_name(ind)

a esta funcion le das el id y devuelve elnombre

yo quiero darle el nombre y que me devuelva el id

Curiosamente, hardraid pregunto lo mismo hace un par de d?as, la discusion que tuvo el tema se borro con el cambio del foro, pero puedes encontrar el script que uso al final del tema:

http://www.comunidadgm.org/index.php?topic=10391.0