function scr_setnpclogic(arg0, arg1, arg2) { if (arg0 == -4) { scr_debug_print("Failed to add NPC logic"); exit; } if (arg0.marker.sprite_index == spr_debug_40x40) arg0.marker.visible = 0; with (instance_create(0, 0, obj_npc_wrapper)) { if (variable_struct_exists(arg1, "animspeed")) animspeed = arg1.animspeed; if (variable_struct_exists(arg1, "typer")) typer = arg1.typer; if (variable_struct_exists(arg1, "alwaysanimate")) alwaysanimate = arg1.alwaysanimate; npc = arg0; if (!variable_instance_exists(npc.id, "dialogue_side")) npc.dialogue_side = -1; setdialogue = arg2; choices = []; for (var i = 3; i < argument_count; i++) array_push(choices, argument[i]); } }