Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

GMLive.gml

Livecoding for GameMaker: Studio / GameMaker Studio 2 路 By YellowAfterlife

[Fixed in 1.0.48+] Error loop in Animation Event

A topic by K.Blank created May 02, 2021 Views: 226 Replies: 5
Viewing posts 1 to 4
(1 edit)

First of all i'm using the latest GMS 2 ( IDE 2.3.2.560, RT 2.3.2.426 ), and GMLive 1.0.47

I enabled live function for only the problematic script, and the error still occurs.

I'm using Spine 2D, so the animation event is to receive the boardcast messages from the Spine sprites.

I just updated my game from GMS 2.2 to 2.3; it runs smoothly after i cleared out some of the syntax errors, but as soon as i enabled gmlive, errors are thrown.


The structure:

o_plr > Animation Event > scr_prt_humanbase_animationEvent() > scr_isMultiTrackAnim()

I kept the codes clean in all of those code panels. no other codes exists, only two custom scripts. and i only enabled live call for scr_prt_humanbase_animationEvent.


The codes in scr_prt_humanbase_animationEvent() : 

function scr_prt_humanbase_animationEvent() {
 if (live_call()) return live_result;
 var evName = event_data[? "name"];
 var evTrack = event_data[? "track"];
 var evInt = event_data[? "integer"];
 var evFloat = event_data[? "float"];
 var evString = event_data[? "string"];
 if !scr_isMultiTrackAnim() && evTrack == 1 exit;
};

The codes in scr_isMultiTrackAnim() : 

function scr_isMultiTrackAnim() {
 var _result;
 if status2 == noone {
  _result = (
   (status <= 5) &&
   (sp_animName[status] != "idle_blockage")
  );
 } else {
  _result = (
   (sp_animName[status2] == "atk_knife_light_atk") ||
   (sp_animName[status2] == "atk_knife_throw_charge") ||
   (sp_animName[status2] == "atk_knife_throw_atk") ||
   (sp_animName[status2] == "wand_cast") ||
   (sp_animName[status2] == "wand_charge") ||
   (sp_animName[status2] == "wand_idle")
  );
 };
return(_result);
};

The error output:

[live][2021/5/2 16:57:06] Runtime error: [error] { line : 659, longMessage : "ERROR in
action number 1
of Other Event: <unknown>
for object o_plr:
Push :: Execution Error - Variable Index [-1] out of range [16] - -7.l_st(100430,-1)
 at gml_Script_vm_group_jump_on_bool_and (line 659) - if(l_st[l_st[0]]){
", stacktrace : [ "gml_Script_vm_group_jump_on_bool_and (line 659)","gml_Script_anon_gml_thread_gml_GlobalScript_GMLive_thread_2702_gml_thread_gml_GlobalScript_GMLive_thread (line 95) - var l_ar1=l_handler(l__gthis,l_act);
","gml_Script_anon_gml_program_gml_GlobalScript_GMLive_program_1477_gml_program_gml_GlobalScript_GMLive_program (line 66) - l_th.h_exec();
","gml_Script_live_proc_call_impl (line 33) - var l_th=l_pg.h_call_v(l_scriptName,l_args1,false);
","gml_Script_live_call (line 74) - return live_proc_call_impl(l_data,l_vals,l_def);
","gml_Script_scr_prt_humanbase_animationEvent (line 2) - if (live_call( )) return live_result;
","gml_Object_o_plr_Other_59 (line 1) - scr_prt_humanbase_animationEvent();
","gml_Script_scr_humanbase_draw (line 47)","gml_Object_o_plr_Draw_0 (line 4) - scr_humanbase_draw();
" ], script : "gml_Script_vm_group_jump_on_bool_and", message : "Push :: Execution Error - Variable Index [-1] out of range [16] - -7.l_st(100430,-1)" }
 called from game:gml_std_haxe_Exception_caught:1222
 called from game:anon_gml_thread_gml_GlobalScript_GMLive_thread_2702_gml_thread_gml_GlobalScript_GMLive_thread:105
 called from game:anon_gml_program_gml_GlobalScript_GMLive_program_1477_gml_program_gml_GlobalScript_GMLive_program:66
 called from game:live_proc_call_impl:33
 called from game:live_call:74
 called from game:scr_prt_humanbase_animationEvent:2
 called from game:o_plr_Other_59:1
 called from game:scr_humanbase_draw:47
 called from game:o_plr_Draw_0:4
 called from 0
 called from scr_prt_humanbase_animationEvent[L10,c29]

The error above repeated 5 times, stacked together.

And my game freezes.


馃槬 please help

Developer

Similar to last topic about this, send me a sample project that reproduces the issue.

Sent!

Developer

The actual problem appears to be that variable_global_get("event_data") doesn鈥檛 work again and can be workarounded by adding the following to the end of obj_gmlive鈥檚 Create event,

live_variable_add("event_data*", function() {
	return event_data;
})

(note: also applies to other global built-in variables like async_load)

but the rest is unclear - seemingly at random, you either get the actual error message as intended by GMLive,

[live][2021-05-03 17:11:51] Runtime error: [error] Expected an index
 called from o_plr:Other_59[L2,c18]

or the technically-impossible error seen in your post.

Alright, thanks for the workaround. 

GMS 2.3 sucks, man 馃槬 guess i'll avoid live coding in those unstable events then.

Developer

This is fixed in 1.0.48+ (I added wrapper functions as shown)