GameMaker: Studio

GameMaker: Studio

View Stats:
BeeVeelutions Apr 20, 2019 @ 12:01pm
I am getting this error and i want to know why
So i made an object for when an enemy calls for another enemy to spawn in combat, but for some reason, when the enemy tries to use this move, i get this error message


___________________________________________
############################################################################################
FATAL ERROR in
action number 1
of Alarm Event for alarm 0
for object objCallForHelp:

Variable objCallForHelp.objEnemyPar(100424, -2147483648) not set before reading it.
at gml_Object_objCallForHelp_ObjAlarm0_1 (line 7) - if instance_number(objEnemyPar) < 5 {
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_objCallForHelp_ObjAlarm0_1 (line 7)

EnemyPar is the parrent object of all enemy objects in battle

< >
Showing 1-7 of 7 comments
Zappy Apr 20, 2019 @ 12:04pm 
Originally posted by davidkvis99:
- -Code- EnemyPar is the parrent object of all enemy objects in battle
The erroring code is looking for (and failing to find a resource called) "objEnemyPar", though, not "EnemyPar". That seems like the issue here. (If not, some other typo seems like the issue here.)
BeeVeelutions Apr 20, 2019 @ 12:21pm 
Originally posted by Zappy:
Originally posted by davidkvis99:
- -Code- EnemyPar is the parrent object of all enemy objects in battle
The erroring code is looking for (and failing to find a resource called) "objEnemyPar", though, not "EnemyPar". That seems like the issue here. (If not, some other typo seems like the issue here.)
Well i found my problem but a new arised now i get this instead


___________________________________________
############################################################################################
ERROR in
action number 1
of Create Event
for object objBattleController:

Creating instance for non-existing object: 100082
at gml_Object_objCallForHelp_ObjAlarm0_1 (line 60) - e[1] = instance_create(25+v_offset,120,global.enemy[1]).id;
############################################################################################
--------------------------------------------------------------------------------------------
stack frame is
gml_Object_objBattleController_CreateEvent_1 (line 60)
called from - gml_Object_objCallForHelp_ObjAlarm0_1 (line 20) - global.enemy[ds_list_find_value(list, 0)] = (instance_create(irandom_range(32,288),irandom_range(64,144),choose(help_enemy1,help_enemy2,help_enemy3))).id


woodsguide Apr 20, 2019 @ 4:46pm 
trying to create an instance of an object that does not exist?

id say doublecheck your code and your objects ..sounds like a typo error to me..
The Winter Bud Apr 20, 2019 @ 6:26pm 
e[1] = instance_create(25+v_offset, 120, global.enemy[1]).id;
instance_create() returns an id so there is no need for (.id) at the end of it
and if you are referencing an object id the instance_create() function wants and index so you would supply it with an object index of the selected object.
maybe you meant
e[1] = instance_create(25+v_offset,120,global.enemy[1].object_index);
or just simply
e[1] = instance_create(25+v_offset,120,global.enemy[1]);
Depends on what you're storing in 'global.enemy[x]'
Last edited by The Winter Bud; Apr 20, 2019 @ 6:29pm
BeeVeelutions Apr 20, 2019 @ 11:03pm 
Ok so i took a closer look at the code but i dont know what i did wrong so i will post the code of the areas that are being called by the code.

for (var i=1;i<6;i++) {
e = 0
}

switch global.en_count {
case 1:
e[1] = instance_create(160+v_offset,120,global.enemy[1]);
dropenemy = e[1];
break;
case 2:
e[1] = instance_create(102+v_offset,120,global.enemy[1]);
e[2] = instance_create(218+v_offset,120,global.enemy[2]);
dropenemy = choose(e[1],e[2]);
break;
case 3:
e[1] = instance_create(160+v_offset,120,global.enemy[1]);
e[2] = instance_create(80+v_offset,96,global.enemy[2]);
e[3] = instance_create(240+v_offset,96,global.enemy[3]);
dropenemy = choose(e[1],e[2],e[3]);
break;
case 4:
e[1] = instance_create(25+v_offset,120,global.enemy[1]);
e[2] = instance_create(115+v_offset,120,global.enemy[2]);
e[3] = instance_create(205+v_offset,120,global.enemy[3]);
e[4] = instance_create(295+v_offset,120,global.enemy[4]);
dropenemy = choose(e[1],e[2],e[3],e[4]);
break;
case 5:
e[1] = instance_create(160+v_offset,130,global.enemy[1]);
e[2] = instance_create(100+v_offset,86,global.enemy[2]);
e[3] = instance_create(220+v_offset,86,global.enemy[3]);
e[4] = instance_create(40+v_offset,130,global.enemy[4]);
e[5] = instance_create(280+v_offset,130,global.enemy[5]);
dropenemy = choose(e[1],e[2],e[3],e[4],e[5]);
break;
}

for (var i=1;i<6;i++) {
global.enemy = e
}

This is what is being called by the next set of code, this one just calls enemies into combat by seeing how many of the enemies collide with the player

if random(256) < 205 and instance_number(objEnPar) < 5 {
if global.en_count < 5 {
global.en_count++;
}
var list;
list = ds_list_create();

if global.enemy[1] = 0 { ds_list_add(list,1); }
if global.enemy[2] = 0 { ds_list_add(list,2); }
if global.enemy[3] = 0 { ds_list_add(list,3); }
if global.enemy[4] = 0 { ds_list_add(list,4); }
if global.enemy[5] = 0 { ds_list_add(list,5); }

global.enemy[ds_list_find_value(list, 0)] = (instance_create(irandom_range(32,288),irandom_range(64,144),choose(help_enemy1,help_enemy2,help_enemy3)))
global.totalexp += global.enemy[ds_list_find_value(list, 0)].e_exp
a.str[0] = upper(global.enemy[ds_list_find_value(list, 0)].e_art)+global.enemy[ds_list_find_value(list, 0)].e_name+" joined the battle!";
ds_list_destroy(list);

And this is the one that is trying to see if there are any free slots for an enemy to join in midcombat
Last edited by BeeVeelutions; Apr 20, 2019 @ 11:03pm
johnmc50 Jun 1, 2019 @ 8:34am 
verable was not set or a possible on of ( are missing or doubled

these following reason that error comes


error example

(( hello)

note it has 2 left one right
or

(hello

one missing

spelling error

vereble not set or not spelled to match that object
BeeVeelutions Jun 1, 2019 @ 8:39am 
Originally posted by johnmc50:
verable was not set or a possible on of ( are missing or doubled

these following reason that error comes


error example

(( hello)

note it has 2 left one right
or

(hello

one missing

spelling error

vereble not set or not spelled to match that object
Oh i already solved this problem, but thanks for the reply.
< >
Showing 1-7 of 7 comments
Per page: 1530 50