Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Greetings, Shaun.

I too am running into this same issue and was wondering if you were able to find an adequate solution. I've been struggling with this error for some time and I fear it may further bottleneck my progress unless I remove the ability to re-battle enemies entirely.

I currently don't want to do that so I'm reaching out to you or anyone else who can help. Here is the error message:

___________________________________________
############################################################################################
ERROR in
action number 1
of  Step Event0
for object obj_battlecontroller:
Variable <unknown_object>.hp(100114, -2147483648) not set before reading it.
 at gml_Script_anon____struct___30____struct___29_init_bestiary_gml_GlobalScript_init_bestiary_1982____struct___30____struct___29_init_bestiary_gml_GlobalScript_init_bestiary (line 65) -                                    if (hp < (maxhp * 0.2))
############################################################################################
gml_Script_anon____struct___30____struct___29_init_bestiary_gml_GlobalScript_init_bestiary_1982____struct___30____struct___29_init_bestiary_gml_GlobalScript_init_bestiary (line 65)
gml_Script_battle_state_select_action_gml_Object_obj_battlecontroller_Create_0 (line 226) -                                    var _enemy_action = _unit.ai_script();
gml_Object_obj_battlecontroller_Step_0 (line 1) - battle_state();
I have also run into similar issues where the game would either crash or enemies would use actions that weren't assigned to them. I tried poking around in debug mode but have not found anything different from what I have seen in this thread.

There was one other solution in this thread that worked for others where you would repeat the third argument for the BeginAction script:

begin_action(_unit.id, _enemy_action[0], _enemy_action[1]);
begin_action(_unit.id, _enemy_action[0], _enemy_action[1], _enemy_action[1]);

but for me, I get a different error message saying that the variable is not an array.

~TwinTails100