hello, i'm newbie with gml2, i'm having this problem
___________________________________________
############################################################################################
ERROR in
action number 1
of Create Event
for object <undefined>:
Variable <unknown_object>.actualWeapon(100004, 0) not set before reading it.
at gml_GlobalScript_ChangeGun (line 2) - var wp_map = actualWeapon[weapon];
############################################################################################
gml_GlobalScript_ChangeGun (line 2)
i really dont know how solve it, only happens when i use the script, here's my code:
--------create--------
//BareHanded
actualWeapon[0] = ds_map_create();
ds_map_add(actualWeapon[0], "sprite", sPistol)
//BasicPistol
actualWeapon[1] = ds_map_create();
ds_map_add(actualWeapon[1], "sprite", sPistol2)
ChangeGun()
--------script (ChangeGun)--------
weapon = 0
var wp_map = actualWeapon[weapon];
sprite = ds_map_find_value(wp_map, "sprite");
i understand the problem is with var wp_map but i dont know how solve it.
___________________________________________
############################################################################################
ERROR in
action number 1
of Create Event
for object <undefined>:
Variable <unknown_object>.actualWeapon(100004, 0) not set before reading it.
at gml_GlobalScript_ChangeGun (line 2) - var wp_map = actualWeapon[weapon];
############################################################################################
gml_GlobalScript_ChangeGun (line 2)
i really dont know how solve it, only happens when i use the script, here's my code:
--------create--------
//BareHanded
actualWeapon[0] = ds_map_create();
ds_map_add(actualWeapon[0], "sprite", sPistol)
//BasicPistol
actualWeapon[1] = ds_map_create();
ds_map_add(actualWeapon[1], "sprite", sPistol2)
ChangeGun()
--------script (ChangeGun)--------
weapon = 0
var wp_map = actualWeapon[weapon];
sprite = ds_map_find_value(wp_map, "sprite");
i understand the problem is with var wp_map but i dont know how solve it.