View previous topic :: View next topic |
Author |
Message |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Thu Aug 21, 2003 9:30 pm Post subject: Positioning NPCs |
|
|
I'm trying to place one NPC on top of another.
Let's say I'm using a circle and a square NPC. I want the circle NPC to appear on top of the square NPC. I moved the square NPC to the destined place first, and then moved the circle NPC to that same location and it appeared under the square, not on it.
I used the command "supsend obstruction" earlier in the script, if that means anything.
I had a script earlier in which the square NPC was already in the place I wanted it and then moved the circle over it, and it worked fine. But with the script I'm making I can't have the square NPC start off in that place, it has to move there after things happen.
If you have any idea what I could do please let me know.
Thanks,
~Worthy |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
Posted: Thu Aug 21, 2003 10:20 pm Post subject: |
|
|
I hate to break this to you, man, but this is really quite simple, and it doesn't require plotscripting.
Here's what ya do!
1) Obviously, create the circle and square NPCs
2) When you place them, be sure to hold "CTRL" and pick a direction. This
is commonly used when you are trying to get a still NPC to stand in a certain direction, but as long as you use this function, it will paste on top.
The only problem is that both NPCs cannot be activated when one is on top of another. _________________
Facebook: http://www.facebook.com/georgerpowell
Newgrounds: http://setu-firestorm.newgrounds.com |
|
Back to top |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Thu Aug 21, 2003 11:26 pm Post subject: |
|
|
What I mean was if I have the circle in the position (0,0) and the square in position (0,1) how can I,using plotscripting, set the square's position to (10,10) and then the circle's position to (10,10) and have the circle be on top?
Like if the player talks to an NPC I want those two NPCs to appear in the (10,10) position with the square on bottom.
~Worthy |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Fri Aug 22, 2003 2:39 am Post subject: NPC draw order |
|
|
NPCs are drawn to the screen in NPC Reference order NPCs with low reference numbers will be underneath NPCs with high reference numbers. Unfortunately, the Reference of an NPC is not something you have very precise control over.
When you place an NPC in the map editor, it uses the first reference number available, which is 0. The second NPC you place will have reference number 1, and the third NPC you place will be 2. So generally speaking, the NPCs you place on a map later will be drawn on top of NPCs that you place earlier.
But this rule breaks down if you have placed a bunch of NPCs, and then removed a few of them. In that case, the next NPC you place will use the lowest available reference number, which might not always be higher than the reference number of all the other NPCs currently on the map. Confusing, no? Well, normally I never expected anybody to care about this sort of thing, so thats just the way it is :)
As for NPCs create with the "create NPC" plotscripting command, they work the exact opposite. They take the highest available NPC reference number, starting with 299. the next NPC you create with "create NPC" will be 298, and so on, counting backwards. This means that the first NPC you create with plotscripting will be shown on top of NPCs you create later, as well as on top of NPCs placed on the map in the map editor. |
|
Back to top |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Fri Aug 22, 2003 2:50 am Post subject: |
|
|
Thanks! You're right, it's a bit confusing but I'll figure it out.
~Worthy |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Aug 22, 2003 11:30 am Post subject: |
|
|
But... i thought that the maximum number of npcs on a map was 200... not 300... or did I get that wrong? I hope so....  _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Fri Aug 22, 2003 4:08 pm Post subject: |
|
|
using 100 npcs is usually a lot...
i don't see why you would need 200+... unless your doing an intensive movie type scene. or just plain need it... _________________ If we were a pack of dogs, IM would be a grand Hound, CN would be a very ficious little pitball, and Giz...well, it doesn't matter breed he is, he'd still be a bitch
(no offense to anyone that was mentioned) |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Mon Aug 25, 2003 4:49 am Post subject: |
|
|
And one more question.... how is it decided whether npcs are drawn on top of heros? Not step on npcs of course.. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
|
Back to top |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Tue Aug 26, 2003 2:07 am Post subject: |
|
|
I agree, I haven't been able to get NPCs on top of heroes. That's why I just use NPCs representing the heroes.
~Worthy |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Aug 26, 2003 6:13 am Post subject: |
|
|
James once said (in the howto I think) that with some some really clever plotscripting, you could fake see-through over head tiles.. maybe he was talking about using npcs as heros? _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Setu_Firestorm Music Composer

Joined: 26 Mar 2003 Posts: 2566 Location: Holiday. FL
|
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed Aug 27, 2003 2:14 pm Post subject: |
|
|
Yeah, I suppose that must be it. Oh well, cat of of the bag, I expect everyone to implement partly-overhead tiles in all demos released within 2 weeks :flamedevil: _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
|