MCHLV
Member
Hello,
I am sure there is an obvious reason ...
I can store sprite_index in a ds_list (and use for drawing later)
But this does not work with ds_map... I have tried string / asset_get_index...<edit> it does in fact </edit>
This works fine
<edit>This works also fine - Thanks for your help !
</edit>
<edit>This is the code I tried which does not work
</edit>
I would like to use ds_map to organize attacks properties for my players, monsters, bosses. Storing multiple attacks with all variables I need to manage them in terms of timing, damages, sprites...
Thanks for your help,
M.
I am sure there is an obvious reason ...
I can store sprite_index in a ds_list (and use for drawing later)
But this does not work with ds_map... I have tried string / asset_get_index...<edit> it does in fact </edit>
This works fine
Code:
// create_event
list = ds_list_create();
ds_list_add(list, sNPC_4_Attack);
// draw_event
draw_sprite(ds_list_find_value(list, 0), 0, x, y)
Code:
// create_event
map = ds_map_create();
ds_map_add(map, "sprite", sNPC_4_Attack);
// draw_event
draw_sprite(map[? "sprite"]), 0, x, y)
<edit>This is the code I tried which does not work
Code:
// create_event
map = ds_map_create();
ds_map_add(map, "sprite", sNPC_4_Attack);
// draw_event
draw_sprite(ds_map_read(map,"sprite"), 0, x, y)
--> this is where I was wrong as ds_map_read is not to get the value from the map...
I would like to use ds_map to organize attacks properties for my players, monsters, bosses. Storing multiple attacks with all variables I need to manage them in terms of timing, damages, sprites...
Thanks for your help,
M.
Last edited: