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 Location

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
*Worthy*
Critical Thinker




Joined: 11 Aug 2003
Posts: 186

PostPosted: Fri May 28, 2004 4:09 pm    Post subject: NPC Location Reply with quote

If an NPC has a coordinate of X in pixels of 219, what TILE would the command NPCX(who) return?

Anyone heard of a command that returns the frame number of an NPC?

Thanks,

~Worthy
_________________
You can do whatever you want...but prison is full of people who make bad decisions.
Back to top
View user's profile Send private message Send e-mail AIM Address
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Fri May 28, 2004 5:37 pm    Post subject: Reply with quote

To obtain tiles from pixels, divide by 20 trucating (which is the only sort of dividing that plotscripting does). So 219 pixels will in located in tile 10.

I've looked for it before, and there is no command to return neither npc nor hero frame number.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
*Worthy*
Critical Thinker




Joined: 11 Aug 2003
Posts: 186

PostPosted: Sat May 29, 2004 6:25 am    Post subject: Reply with quote

219 divided by 20 is 10.95, so wouldn't it round up to 11?

Also, bonus points if anyone can answer this: The X-coordinate (in pixels) of 20 corresponds to the very end of tile 1. So, if one wants to place an NPC in the middle of a tile 1, should he/she use to X-coordinate of 10? When one types "put NPC (2,10,0)," what part of the NPC is put at "10"? (the middle, the right end, the left end).

Thanks!

~Worthy
_________________
You can do whatever you want...but prison is full of people who make bad decisions.
Back to top
View user's profile Send private message Send e-mail AIM Address
Flamer
The last guy on earth...




Joined: 04 Feb 2003
Posts: 725
Location: New Zealand (newly discovered)

PostPosted: Sat May 29, 2004 4:16 pm    Post subject: Reply with quote

trucating means that the decimal is ignored altogether, so there is not rounding up... meaning it's 10 tiles

if someone puts in the command "putNPC(2,10,0)"
none of the NPC will be in tileX 10.
remember, putNPC uses pixel arguements, not tiles.

to put the NPC half way between tileX 10 and 11, it should look something like this:
Code:
putNPC(2,(10*20)+(20/2),y)

or it can be simplified to:
Code:
putNPC(2,210,y)

_________________
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 Raspberry!
(no offense to anyone that was mentioned)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
*Worthy*
Critical Thinker




Joined: 11 Aug 2003
Posts: 186

PostPosted: Sun May 30, 2004 4:42 am    Post subject: Reply with quote

Thanks for the explanation of trucating; I never heard of that....

I know "put NPC" uses pixel arguments, and I was not trying to put the NPC between tile's 10 & 11. From what you said, I take it that the "put NPC" command places the left-most corner of the NPC at the pixel indicated. If I am wrong, please let me know. Otherwise, thanks a lot Flamer!

Thanks,

~Worthy
_________________
You can do whatever you want...but prison is full of people who make bad decisions.
Back to top
View user's profile Send private message Send e-mail AIM Address
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