I have an npc in a script that has to walk over another npc. I gave the bottom npc the 'step on' effect, so the top npc can move onto it, but it is drawn underneath the npc that I want to be the bottom. how can I fix this?
also, one more thing; What is a good way to repeatedly trigger a script over and over again at consistent intervals of time?
How to make one npc always be drawn on top of another.
Moderators: marionline, SDHawk
- Seamus Moore
- Slime
- Posts: 19
- Joined: Mon Mar 16, 2020 9:39 pm
- Location: Seamus Moore's House
How to make one npc always be drawn on top of another.
Last edited by Seamus Moore on Sun Dec 13, 2020 7:18 pm, edited 1 time in total.
dQw4w9WgXcQ
- Bob the Hamster
- Lord of the Slimes
- Posts: 7684
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
Controlling NPC sorting is tricky unfortunately
One trick is to move the upper NPC down one tile, but use "set NPC z(n, 20)" on it.
That makes the NPC always drawn on top because it is one tile lower, but it doesn't look one tile lower because of the "set NPC z"
Another trick is to create a slice in place of the NPC, move it, and then remove it
I know both of these methods are a pain. Maybe someone else has a better suggestion?
As for running a script at regular intervals, use the "set timer" command. At the end of the script, use "set timer" again to schedule the next interval
One trick is to move the upper NPC down one tile, but use "set NPC z(n, 20)" on it.
That makes the NPC always drawn on top because it is one tile lower, but it doesn't look one tile lower because of the "set NPC z"
Another trick is to create a slice in place of the NPC, move it, and then remove it
I know both of these methods are a pain. Maybe someone else has a better suggestion?
As for running a script at regular intervals, use the "set timer" command. At the end of the script, use "set timer" again to schedule the next interval
- Seamus Moore
- Slime
- Posts: 19
- Joined: Mon Mar 16, 2020 9:39 pm
- Location: Seamus Moore's House
that should work, thanks!Bob the Hamster wrote:Controlling NPC sorting is tricky unfortunately
One trick is to move the upper NPC down one tile, but use "set NPC z(n, 20)" on it.
That makes the NPC always drawn on top because it is one tile lower, but it doesn't look one tile lower because of the "set NPC z"
Another trick is to create a slice in place of the NPC, move it, and then remove it
I know both of these methods are a pain. Maybe someone else has a better suggestion?
As for running a script at regular intervals, use the "set timer" command. At the end of the script, use "set timer" again to schedule the next interval
dQw4w9WgXcQ