View previous topic :: View next topic |
Author |
Message |
Baconlabs PURPLE IS MANLY

Joined: 15 Mar 2009 Posts: 335 Location: Tennessee
|
Posted: Sat Oct 31, 2009 2:40 pm Post subject: NPC depth |
|
|
Quick question, is there any way to set specific NPCs to appear over other NPCs?
How is this - "NPC depth" - determined, anyway? I've tried messing around with the order of NPC creation in the script as well as their numeric order, and I can't come to any conclusions. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sun Nov 01, 2009 1:23 am Post subject: |
|
|
NPCs are layered by reference number. The NPC reference number is in the range -300 to -1. NPCs placed in Custom are given references starting from -1 and going down, they get the highest unused reference. CreateNPC assigns reference numbers starting from -300 up, into the lowest available slot.
NPC -1 is drawn first, -300 last, so NPCs created by scripts will appear above all NPCs placed in Custom, unless you place close to 300 NPCs on the map so that the ranges overlap.
Years ago, since we didn't have slices, I wrote this script to change the layering of already-existing npcs:
'What is the 3rd Party HSI?#swap npc ref (npc ref1, npc ref2)'
These days you can could use slices instead. Eventually (prehaps very soon), NPCs will just become slices, so you'll be able to change the layering directly. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Baconlabs PURPLE IS MANLY

Joined: 15 Mar 2009 Posts: 335 Location: Tennessee
|
Posted: Sun Nov 01, 2009 2:25 am Post subject: |
|
|
I keep forgetting about these newfangled slices! I'll probably use that to solve my problem.
Come to think of it, I should probably stop using strings of NPCs just to illustrate large objects. |
|
Back to top |
|
 |
Bagne ALL YOUR NUDIBRANCH ARE BELONG TO GASTROPODA

Joined: 19 Feb 2003 Posts: 518 Location: Halifax
|
Posted: Sun Nov 01, 2009 4:07 am Post subject: |
|
|
Eh?
What's a slice?
Is that just another word for one of the 3 maptile layers? _________________ Working on rain and cloud formation |
|
Back to top |
|
 |
Newbie_Power

Joined: 04 Sep 2006 Posts: 1762
|
Posted: Sun Nov 01, 2009 5:58 am Post subject: |
|
|
Map layers are slices, but that's not all slices are. They're really something from a MacGyver episode with different purposes, such as moving sprites, hud displays, or even non-graphic slices for storing data or tracking x/y for other slices.
Slices are a magic spell conjured up by the highest order of Technomancy and preserved in scrolls whose fibers are constructed like the finest toilet paper, and contain arcane wisdom written in Freebasic and a sharpie. _________________
TheGiz> Am I the only one who likes to imagine that Elijah Wood's character in Back to the Future 2, the kid at the Wild Gunman machine in the Cafe 80's, is some future descendant of the AVGN? |
|
Back to top |
|
 |
|