Hi,
I'd like to preface this query by highlighting that I am aware of the copy-on-write limitation with GMLive. That said, its strange that the array and script setup I have works correctly if GMLive is enabled. When GMLive is disabled, the arguments passed end up as undefined.
My setup is as follows:
Create ev:
list=ds_list_create(); alarm[0]=1;
Alarm[0] ev:
var script_arr; script_arr[0] = scr_debug_msg; script_arr[1] = ["msg1","msg2","msg3"]; ds_list_add(list,script_arr);
Step ev:
if keyboard_check_pressed(192) { var script_arr = list[| 0]; script_execute(script_arr[0],script_arr[1]); }
Inside scr_debug_msg:
if (live_call(argument0,argument1,argument2,argument3)) return live_result; var script_args = argument[0]; for (var i=1;i<=array_length_1d(script_args);i++) { argument[i] = script_args[i-1]; } show_message(argument0); show_message(argument1); show_message(argument2); show_message(argument3);
When scr_debug_msg is run, the first message I get is the one that script_arr[1] refers to (i.e. { { msg1, msg2, msg3 } }). The next three dialogue boxes show undefined. This is when the "live_enabled" macro is set to 0. If the live_enabled macro is set to 1, the script works perfectly fine and the three dialogue boxes after the first correctly show msg1, msg2 and msg3 respectively.
I'm confused since I thought the opposite should have been the case, where the script would work fine with GMLive disabled, but not work when enabled.
Any help is appreciated. Thanks!