View Single Post
  #2  
Old 02-17-2005, 10:10 AM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
Instead of *6.5 you want *(960/420) to scale it to the gmap..

(The map is actually 960 tiles big not 957)

That can be simplified to *(16/7)....

...however i think you have some logical errors... firstly... mapxy[] is where the map is positioned on the screen? Or where you are saving the cordinates to? You seem to be using it for both . Also you seem to use to totally new variables when passing to the triggeraction...

Try...

NPC Code:

if (mousescreenx in | mapxy[0], mapxy[0] + 420 | && mousescreeny in | mapxy[1], mapxy[1] + 420 | ) {
if (keydown2(17, true)) {
this.tempxy = {mousescreenx-mapxy[0]*(16/7),mousescreeny-mapxy[1]*(16/7)};
triggeraction 0, 0, serverside, -Map, warp, #v(this.tempxy[0]),#v(this.tempxy[1]);
}
}



Now mapxy[] is the position of the map on the screen and tempxy[] is where we temporarily store the values when calculating them.

If there somthing glaringly wrong in what I posted, then blame lack of sleep
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote