Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-17-2005, 09:04 AM
SSS SSS is offline
Owner of Sceleris
Join Date: Jan 2005
Posts: 14
SSS is on a distinguished road
Gmap warp on a custom map script

Hi i have a custom map script on my playerworld and am trying to do the warping for it..
it works but i cant figure out how to get the gmap coords from the screencoords of the map..

The map image is 420x420
The gmap is 15 x 15 levels..
Im not good at math so im having some problems here..
mapxy is the coordinates of the map image on the screen..

How is the math done?
to convert the mousescreen coordinates on the map
to gmap coordinates.. so if i click the bottem right corner i will
warp to the bottem right corner, which is 957x957..

this is a part of the script
NPC Code:

if (mousescreenx in | mapxy[0], mapxy[0] + 420 | &&
mousescreeny in | mapxy[1], mapxy[1] + 420 | ) {
this.mapxy = {mousescreenx-mapxy[0]*6.5,mousescreeny-mapxy[1]*6.5}; //here is where i get the gmap coords from the screencoords
//but the math is wrong

if (keydown2(17, true)) {
triggeraction 0, 0, serverside, -Map, warp, #v(this.mapx),#v(this.mapy);

}
}

Reply With Quote
 


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 11:57 AM.


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