I have 2 scripts, each of which are run when you step on an NPC (NPC #12, and NPC #13).
On the map, NPC #12 is placed directly above NPC#13. Depending on which of these NPCs the character steps on, a slightly different script will be run.
Here's the scripts:
If you step on NPC #12:
Code: Select all
plotscript, sunkenA_AfterJumpAcrossLedgesNPC12, begin
suspend player
suspend random enemies
suspend caterpillar
suspend NPCs
suspend box advance
show text box (13)
wait (34)
set NPC direction (10, right)
wait(4)
show text box (14)
wait(10)
advance text box
focus camera (31, 19, 10)
walk NPC (10, right, 4)
walk hero (me, right, 5)
wait for hero (me)
walk hero (me, down, 1)
wait for hero (me)
walk hero (me, right, 1)
#wait for hero (me)
wait for camera
#The Guard's Patrol Sequence
sunkenA_GuardKilledByJinso
#camera follows hero
destroy NPC (12)
destroy NPC (13)
#resume player
#resume random enemies
#resume caterpillar
#resume NPCs
endCode: Select all
plotscript, sunkenA_AfterJumpAcrossLedgesNPC13, begin
suspend player
suspend random enemies
suspend caterpillar
suspend NPCs
suspend box advance
set NPC direction (10, down)
wait(4)
show text box (13)
wait (34)
set NPC direction (10, right)
wait(4)
show text box (14)
wait(10)
advance text box
focus camera (31, 19, 10)
walk NPC (10, right, 4)
walk hero (me, right, 2)
wait for hero (me)
walk hero (me, right, 3)
wait for hero (me)
walk hero (me, right, 1)
#wait for hero (me)
wait for camera
#The Guard's Patrol Sequence
sunkenA_GuardKilledByJinso
#camera follows hero
destroy NPC (12)
destroy NPC (13)
#resume player
#resume random enemies
#resume caterpillar
#resume NPCs
endCode: Select all
script, sunkenA_GuardKilledByJinso, begin
#Guard Patrol Pattern
create NPC (14, 33, 29, up)
walk NPC (14, up, 8)
wait for NPC (14)
wait (20)
walk NPC (14, right, 3)
wait for NPC (14)
wait (20)
walk NPC (14, down, 1)
wait for NPC (14)
wait (20)
walk NPC (14, left, 3)
wait for NPC (14)
wait (20)
walk NPC (14, up, 1)
wait for NPC (14)
wait (20)
walk NPC (14, right, 3)
end
When stepping on NPC #12, the sunkenA_GuardKilledByJinso script executes perfectly. But when the character steps on NPC #13, the sunkenA_GuardKilledByJinso script seems to execute but the guard NPC (14) is not visible until about halfway through his pattern.
I don't understand what would cause this. I think I'm using all the right wait functions and as far as I can tell the NPC #12 & 13's scripts are basically the same asides from a few less steps in the latter.
I've gotta go to work now. If know one knows what I mean, I'll make a video later.