View previous topic :: View next topic |
Author |
Message |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
Posted: Wed Jul 30, 2008 1:14 pm Post subject: NPC Pixel Misalignment |
|
|
Ok, this is a shot in the dark, but here goes...
In my game, I have a series of NPCs of the same ID. I want them to animate individually when hit with a weapon. I've achieved this by destroying the hit NPC, replacing it with an NPC of a new ID which corresponds to the hit animation, and then destroying that NPC and replacing it with an NPC of id == the original. I position these NPCs with the "put NPC" command, because I want them to be created at the same pixel as the original NPC, not just the same tile, to avoid animation jumpiness.
Ok, that's the technique. Visually, everything works fine. Unfortunately, if this swapping occurs while the NPC is walking between tiles, the new NPCs are misaligned and start doing all sorts of undesirable stuff like walking through walls.
So, my question is... Is the any way around this? Is there anyway I can let a newly created NPC know it is halfway through it's journey to a neighboring tile? I really don't want to have to code a custom movement system. |
|
Back to top |
|
 |
MADSOFT Games Representing more than 80% of the internet!

Joined: 06 Nov 2004 Posts: 221 Location: AWESOME land
|
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
Posted: Wed Jul 30, 2008 1:36 pm Post subject: |
|
|
What about Change NPC ID? That way to don't need to create and destroy.
All NPCs actually have an "X Go" and "Y Go" value that shows how they are currently walking, but the only scripting command that exposes this data is NPC is walking which does not help your situation. |
|
Back to top |
|
 |
Camdog
Joined: 08 Aug 2003 Posts: 606
|
Posted: Wed Jul 30, 2008 2:05 pm Post subject: |
|
|
Holy crap, that's exactly what I needed! I was hoping I had missed something obvious. Thanks James! |
|
Back to top |
|
 |
|