B
Ben Hubble
Guest
I'm making an 2-player, 2d arena-style shooter, and i'm currently making enemies. I thought my code would wprk until this comes up:
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_spawn:
DoConv :1: illegal array use
at gml_Script_scr_check_spawn
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_scr_check_spawn (line 0)
gml_Object_obj_spawn_Step_0
It's so confusing because that script and object didn't even use any arrays. And the in the whole game the only arrays I've used is the alarms. When I call the script it's in it's own code, all that's in it is scr_check_spawn(spawn_rate) and the code for that script is:
any ideas about what's going wrong?
___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Step Event0
for object obj_spawn:
DoConv :1: illegal array use
at gml_Script_scr_check_spawn
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Script_scr_check_spawn (line 0)
gml_Object_obj_spawn_Step_0
It's so confusing because that script and object didn't even use any arrays. And the in the whole game the only arrays I've used is the alarms. When I call the script it's in it's own code, all that's in it is scr_check_spawn(spawn_rate) and the code for that script is:
Code:
if(obj_network.is_server == true) {
var spwn = irandom(argument0);
if(spwn == 0)
{
enemy = instance_create(irandom_range(0,room_width-32),irandom_range(0,room_height+32),obj_enemy);
global.enemies_count++;
with(enemy) {
enemyx = enemy.x;
enemyy = enemy.y;
enemyid = global.enemies_count;
}
buffer_write(obj_network.buffer,buffer_u8,5);
buffer_write(obj_network.buffer,buffer_u16,enemyid);
buffer_write(obj_network.buffer,buffer_u16,enemyx);
buffer_write(obj_network.buffer,buffer_u16,enemyy);
network_send_packet(obj_network.buffer,buffer_seek_start,buffer_tell(obj_network.buffer));
}
}
Last edited by a moderator: