Skip to main content

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

[Solved] Bug

A topic by forkes created Jan 28, 2023 Views: 442 Replies: 15
Viewing posts 1 to 2
(3 edits)

Every time it becomes my turn in a fight with a slime I get this error.

___________________________________________

############################################################################################

ERROR in

action number 1

of  Step Event0

for object oBattle:

trying to index a variable which is not an array

at gml_Script_anon_anon_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_3955_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_4001_anon_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_3955_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0

############################################################################################

gml_Script_anon_anon_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_3955_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_4001_anon_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_3955_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0 (line -1)

gml_Script_anon_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_3955_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0

gml_Script_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0 (line -1)

gml_Object_oBattle_Step_0

version: IDE v2022.9.1.51


I'm new to Gamemaker so I don't know how easy this is to fix

Developer

Hello! Could you try updating to 2022.11+ and let me know if you still see this?

I updated and it's still there.

Developer

Ok, are you saying that this happens with a fresh download of the project files too? Or have you made some modifications? As this doesn't happen on my end. Are your runtimes also up to date?

Developer

Fwiw the error itself refers to code trying to treat something that isn't an array, as an array.  And if it's happening when it becomes one of your character's turns, chances are it's happening when trying to build the action menu for that character. Which might mean you've added or changed something in gamedata for that character (or perhaps an action) but accidentally affected the datatype or missplaced a comma or something similar?

I haven't made any modifications but reinstalled both the zip and the yyp and both do the same thing. I'm also updated on both now.

Developer (1 edit)

Unfortunately I'm low on ideas as I simply cannot reproduce the issue on my own end without changing the code intentionally to do so. All I can really suggest is that you place a breakpoint somewhere inside the  DoTurn() function in oBattle's create event, just after the point where it has decided that it's a player turn (like the if (_unit.enemy == false) line). and run debug mode. Then when you hit this breakpoint use the Step Into Function Call button to progress one line at a time until the error occurs which might give you more clues. As your error as posted is struggling to isolate the problem line.

I got it working, the problem was that it was running in the browser. Thank you for responding though.

Developer

Oh interesting, while I haven't tried or designed it for the browser specifically I'll try and take a look at that. Thanks for letting me know!

Developer (1 edit)

Hello again! sorry to bother you, but I believe your bug may have been related to this issue that was reported recently. Was HTML5 the platform where you were hitting this bug? If so and you get a spare moment would you be able to either get the latest files or implement the fix mentioned in that post and let me know if you still get issues in the browser? 

-S

No dice, I was using the GX.games browser launcher, it might just be that system it seems pretty buggy. But I'm running into another issue with the regular launcher, after yours and the slime's turn it does this:

############################################################################################

ERROR in

action number 1

of  Step Event0

for object oBattle:

trying to index a variable which is not an array

 at gml_Script_anon_anon_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_4071_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_4117_anon_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_4071_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0 (line 139) -                                           if (_option[0] == "Attack") return 99;

############################################################################################

gml_Script_anon_anon_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_4071_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_4117_anon_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_4071_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0 (line 139)

gml_Script_anon_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0_4071_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0 (line 146) -                                    return _Priority(_b) - _Priority(_a);

gml_Script_anon_gml_Object_oBattle_Create_0_1502_gml_Object_oBattle_Create_0 (line 135)

gml_Object_oBattle_Step_0 (line 42) -               if (!instance_exists(oMenu)) DoTurn(units[turn]);

Developer

That, fortunately is the exact issue mentioned in the post above. Will look into the GX games thing but with the windows launcher if you implement the fix in the link in my previous post, or get the newest files it will fix that particular error. The mention of "  if (_option[0] == "Attack") return 99;" is the giveaway.