Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

NPC Pixel Misalignment

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Camdog




Joined: 08 Aug 2003
Posts: 606

PostPosted: Wed Jul 30, 2008 1:14 pm    Post subject: NPC Pixel Misalignment Reply with quote

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
View user's profile Send private message
MADSOFT Games
Representing more than 80% of the internet!




Joined: 06 Nov 2004
Posts: 221
Location: AWESOME land

PostPosted: Wed Jul 30, 2008 1:28 pm    Post subject: Reply with quote

I haven't used plotscripting in a long time, but can't you do something that checks the NPC's current location and creates the new NPC at the same specific x and y coordinates....?
_________________
http://www.madsoftgames.net/
http://www.madsoftgames.org/
http://www.andrewdavid.net/
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Wed Jul 30, 2008 1:36 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Camdog




Joined: 08 Aug 2003
Posts: 606

PostPosted: Wed Jul 30, 2008 2:05 pm    Post subject: Reply with quote

Holy crap, that's exactly what I needed! I was hoping I had missed something obvious. Thanks James!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group