Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 08-31-2007, 03:54 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
The Exact Center

I've had a LOT of different people tell me different ways to get the exact center of the player. Now, of all that I've heard I know it's either one of two ways:

PHP Code:
temp.centerx player.1.5;
temp.centery player.2
Or....

PHP Code:
temp.centerx player.0.5;
temp.centery player.1.5

Which is it, this has confused me for so long...?
__________________
Stan.
Reply With Quote
  #2  
Old 08-31-2007, 04:22 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
It depends on where you want the 'center' of the player. The x is always player.x+1.5, but the y, I usually prefer it in the center of the body, not the whole player.
The 'size' of the player is 3x3, this is shown in Graalshop by the 48x48 pixel box. Now, if you mean the center of that, then it's player.x+1.5 and playery+1.5, but I prefer player.x+1.5 and playery+2(or 2.5), which is near the center of the player's body.
Reply With Quote
  #3  
Old 08-31-2007, 04:28 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Zeo knows the exact center of the player apparently...it's like a f'ing long decimal
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #4  
Old 08-31-2007, 04:49 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Quote:
Originally Posted by DustyPorViva View Post
It depends on where you want the 'center' of the player. The x is always player.x+1.5, but the y, I usually prefer it in the center of the body, not the whole player.
The 'size' of the player is 3x3, this is shown in Graalshop by the 48x48 pixel box. Now, if you mean the center of that, then it's player.x+1.5 and playery+1.5, but I prefer player.x+1.5 and playery+2(or 2.5), which is near the center of the player's body.
So if you wanted the exact center of a player.

Center X - player.x + 1.5
Center Y - player.y + 2

Because I want the center of the body.
__________________
Stan.
Reply With Quote
  #5  
Old 08-31-2007, 04:51 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by coreys View Post
Zeo knows the exact center of the player apparently...it's like a f'ing long decimal
Uh, no its not. The player is 3x3 tiles (48x48 pixels). The center would be at 24x24 pixels and 1.5x1.5 tiles from the origin. There is no super-long number concerning it.
__________________
Reply With Quote
  #6  
Old 08-31-2007, 04:58 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Quote:
Originally Posted by Kyranki View Post
So if you wanted the exact center of a player.

Center X - player.x + 1.5
Center Y - player.y + 2

Because I want the center of the body.
Ya, but you can tag on a .25-.5 to the Y, depending on your preference.
Reply With Quote
  #7  
Old 08-31-2007, 05:17 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
Quote:
Originally Posted by DustyPorViva View Post
Ya, but you can tag on a .25-.5 to the Y, depending on your preference.
your words are just too exact for me... xD
__________________
**FLIP OUT**
Reply With Quote
  #8  
Old 08-31-2007, 05:59 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
While testing....

PHP Code:
  temp.cx player.1.5;
  
temp.cy player.1.75
Is moreso the center of the player, directly under the chin of the head so it's quite considered the center of the Graal body considering the size and proportions of the body.
__________________
Stan.
Reply With Quote
  #9  
Old 08-31-2007, 06:09 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by Inverness View Post
Uh, no its not. The player is 3x3 tiles (48x48 pixels). The center would be at 24x24 pixels and 1.5x1.5 tiles from the origin. There is no super-long number concerning it.
Not the center of the actual player, but the center of the actual body. Which I would think is the same thing, but apparently not. z.z
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #10  
Old 08-31-2007, 06:12 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
For stuff like baddies(where you want them to aim at the body), I'd say y+2 would be much more appropriate. But it really doesn't matter, but I personally think 1.75 is a little bit too above the body.
Reply With Quote
  #11  
Old 08-31-2007, 07:37 AM
Kyranki Kyranki is offline
Freelance Coder
Join Date: Aug 2007
Location: At the end of the rainbow, in the pot of gold.
Posts: 202
Kyranki is on a distinguished road
Send a message via AIM to Kyranki Send a message via MSN to Kyranki
Quote:
Originally Posted by DustyPorViva View Post
For stuff like baddies(where you want them to aim at the body), I'd say y+2 would be much more appropriate. But it really doesn't matter, but I personally think 1.75 is a little bit too above the body.
I checked 1.5 and was hoping it'd be 'center-ish' however it was too high, and I feel like 1.75 is perfect as I feel 2 is too low. Besides, I'm not even checking for baddy hits. I'm going something else along the lines of that with it/
__________________
Stan.
Reply With Quote
  #12  
Old 08-31-2007, 12:04 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
temp.cx player.1.46875;
temp.cy player.1.96875
uhm?
__________________
Reply With Quote
  #13  
Old 08-31-2007, 12:36 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Chompy View Post
PHP Code:
temp.cx player.1.46875;
temp.cy player.1.96875
uhm?
Dammit! You beat me to it! . I remember'd that those are the figures Loriel came up with. Apparently "Uberpixelexact"
Reply With Quote
  #14  
Old 08-31-2007, 12:40 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
Quote:
Originally Posted by Twinny View Post
Dammit! You beat me to it! . I remember'd that those are the figures Loriel came up with. Apparently "Uberpixelexact"
Yep
__________________
Reply With Quote
  #15  
Old 08-31-2007, 01:09 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
The blocking part of "showcharacters" and players is x=0.5, y=1, width=2, height=2, so the center would be x=1.5 and y=2
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:04 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.