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

Joined: 11 Aug 2003 Posts: 186
|
Posted: Fri May 28, 2004 4:09 pm Post subject: NPC Location |
|
|
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 |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri May 28, 2004 5:37 pm Post subject: |
|
|
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 |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Sat May 29, 2004 6:25 am Post subject: |
|
|
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 |
|
 |
Flamer The last guy on earth...

Joined: 04 Feb 2003 Posts: 725 Location: New Zealand (newly discovered)
|
Posted: Sat May 29, 2004 4:16 pm Post subject: |
|
|
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:
_________________ 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 |
|
 |
*Worthy* Critical Thinker

Joined: 11 Aug 2003 Posts: 186
|
Posted: Sun May 30, 2004 4:42 am Post subject: |
|
|
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 |
|
 |
|
|
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
|