From 317872bbb29326bc96ca4fb1db8cb91dd498c0e5 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sun, 10 Feb 2019 01:48:46 -0200 Subject: [skip ci] several bugfixes based on debug --- npc/005-1-1/main.txt | 3 ++- npc/005-5/nylo.txt | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'npc') diff --git a/npc/005-1-1/main.txt b/npc/005-1-1/main.txt index 43fa5f2cc..99b17a51f 100644 --- a/npc/005-1-1/main.txt +++ b/npc/005-1-1/main.txt @@ -133,7 +133,7 @@ OnInteract: if (array_find(@DESTROYED, .@cropId$) == -1) { array_push(@DESTROYED, .@cropId$); debugmes("[LOGIC] -------------------------- crop destroyed"); - hideonnpc instance_npcname("#Marggo"+.@cropId$); + hideonnpc instance_npcname("#Marggo"+.@cropId$, MARGGO_ID); } // Tell the Maggot to walk to a random coordinate @@ -187,6 +187,7 @@ OnFinish: deltimer("Nylo#Marggo::OnInteract"); deltimer("Nylo#Marggo::OnSpawn"); deltimer("Nylo#Marggo::OnFinish"); + MARGGO_ID=0; .@trueratio=100*getarraysize(@DESTROYED)/169; .@ratio=100-.@trueratio; debugmes("Player lost %d crops", getarraysize(@DESTROYED)); diff --git a/npc/005-5/nylo.txt b/npc/005-5/nylo.txt index 701501304..e6233a055 100644 --- a/npc/005-5/nylo.txt +++ b/npc/005-5/nylo.txt @@ -198,8 +198,9 @@ L_Main: // Create the Marggo .@INSTID = instance_create("MRGX@"+(.@ID), 0, IOT_NONE); + .@instanceMapName$ = instance_attachmap("005-1-1", .@INSTID, 0, .@MAP$); // Instance already exists - if (.@INSTID < 0) { + if (.@instanceMapName$ == "") { mesn; mesq l("Wait. I remember you. You ruined my crops a few seconds ago!!"); next; @@ -208,10 +209,12 @@ L_Main: close; } // It was just created, so begin Marggo Quest - .@instanceMapName$ = instance_attachmap("005-1-1", .@INSTID, 0, .@MAP$); instance_set_timeout(300, 300, .@INSTID); instance_init(.@INSTID); warp .@MAP$, 29, 20; + + // We'll need instance ID later and @vars are unreliable + MARGGO_ID=.@INSTID; doevent("Nylo#Marggo::OnStart"); closeclientdialog; close; -- cgit v1.2.3-60-g2f50