Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   player.localx & player.localy (https://forums.graalonline.com/forums/showthread.php?t=85755)

DustyPorViva 05-26-2009 07:50 PM

player.localx & player.localy
 
On gmaps, these will return the player's local coordinates in the level, not on the gmap.

salesman 05-26-2009 08:45 PM

Can't you just mod the player.x or player.y by 64?

player.x [PERCENTSIGN] 64;
player.y [PERCENTSIGN] 64;

The only problem is that I think it may be off by a small amount because it can't return odd decimals

DustyPorViva 05-26-2009 08:56 PM

Actually it's int(player.x/64)*64 + player.x :)

salesman 05-26-2009 09:10 PM

Quote:

Originally Posted by DustyPorViva (Post 1494363)
Actually it's int(player.x/64)*64 + player.x :)

That's definitely not the local x coordinate

napo_p2p 05-26-2009 09:52 PM

Could use:
PHP Code:

player.64*getmapx(player.level.name);  //Local x
player.64*getmapy(player.level.name);  //Local y 


cbk1994 05-26-2009 10:05 PM

Quote:

Originally Posted by DustyPorViva (Post 1494363)
Actually it's int(player.x/64)*64 + player.x :)

... what?

Sales is correct, however, this would be a great addition (for serverside and clientside).

Inverness 05-26-2009 10:07 PM

I agree with the suggestion.

DustyPorViva 05-26-2009 10:56 PM

Quote:

Originally Posted by cbk1994 (Post 1494386)
... what?

Sales is correct, however, this would be a great addition (for serverside and clientside).

Ya, that's my mistake. I was thinking something totally different because I was working on a script using that. My bad :P

salesman 05-27-2009 03:54 AM

Thought of something while I was at work that would give the exact decimal instead of a .0625 approximation which is what you get when simply doing player.x [mod] 64

PHP Code:

int(player.64) + (player.int(player.x)); 

but what napo said might be easier

DustyPorViva 05-27-2009 04:13 AM

It is pretty simple, but to have to do this whenever we want to do a simple comparison check in a level gets redundant. Not to mention for LATs and such, it's probably way out of their league.

salesman 05-27-2009 04:14 AM

Quote:

Originally Posted by DustyPorViva (Post 1494498)
It is pretty simple, but to have to do this whenever we want to do a simple comparison check in a level gets redundant. Not to mention for LATs and such, it's probably way out of their league.

Agreed, player.localx and player.localy would be nice


All times are GMT +2. The time now is 11:26 PM.

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