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 04-01-2007, 11:13 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Algorithm for warping

On my custom map script, I need the player to be able to warp (like CTRL + click on classic map). I can't find the algorithm.

I'm using a GuiShowImgCtrl named Map_Window.

The gmap is 32x32 levels wide.

This is what I've got ... it's probably all wrong.

PHP Code:
function Map_Window.onRightMouseDownddxdyclicks )
{
  
temp.coords Map_Window.globaltolocalcoord( { dxdy } );
  
  
temp.ddx temp.coords[0];
  
temp.ddy temp.coords[1];
  
  
temp.wid Map_Window.width;
  
temp.rate = ( 538 32 ) / 63;
  
  
temp.tiles temp.wid temp.rate;
  
  
temp.posx = ( temp.wid 32 ) / temp.tiles temp.ddx;
  
  
player.chat "warpto" SPC temp.posx SPC 30
I'm only working with x for now. If I can figure that out I can get y to work.

The map image is 538x538 pixels.

Looks like this:

PHP Code:
   new GuiShowImgCtrl"Map_Window" )
  {
    
image temp.map;
    
width 538;
    
height 538;
    
visible temp.show;
    
screenwidth - ( width );
    
screenheight - ( height );
  } 
Thanks a TON!
__________________
Reply With Quote
  #2  
Old 04-02-2007, 12:00 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
Check out my custom bigmap script:

http://forums.graalonline.com/forums...ad.php?t=68644

It has the exact thing you want. Look at the onMouseDown() event.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #3  
Old 04-02-2007, 12:42 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Thank you so much! That worked perfectly. For those curious I did this.

PHP Code:
function Map_Window.onRightMouseDownddxdyclicks )
{
  
temp.coords Map_Window.globaltolocalcoord( { dxdy } );
  
temp.ddx = ( temp.coords[0] / 538 ) * ( 32 64 );
  
temp.ddy = ( temp.coords[1] / 538 ) * ( 32 64 );
  
player.chat "warpto" SPC temp.ddx SPC temp.ddy;

__________________
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 07:39 PM.


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