Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-17-2006, 03:10 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Custom map

Not that others may use this, but I just wanted to show the script, and get some oppinions on it. Maybe tips to improve it?

- Contiga

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
map.offset_x map.offset_y 0;
  
map.movespeed 10;
  
map.status 0;
}

function 
onKeyPressednumkeyscan) {
  if ( 
key "m") {
    if ( 
isonmap) {
      
map.update true;
      
map.status map.status;
    }
    
setTimer0.05);
  }
}

function 
loadPos() {
  
setAni"bomyisland_map-unfold""");
  
map.offset_x = ( player.* ( map.i_width map.r_width)) - ( screenwidth 2) + 16;
  
map.offset_y = ( player.* ( map.i_height map.r_height)) - ( screenheight 2) + 32;
  
fixMapPos();
  
map.update false;
  
map.wait 1;
}

function 
onTimeout() {
  if ( 
map.status == 1) {
    if ( 
isonmapdrawMap();
    else 
hideMap();
  }
  else 
hideMap();
}

public function 
turnOff()
  
map.status 0;

function 
hideMap() {
  
setAni"bomyisland_map-fold""");
  
hideImgs200map.images_index);
  
disabledaynight false;
}

function 
drawMap() {
  
freezeplayer.1);
  if ( 
map.wait 0)
    
map.wait -= 0.1;
  
disabledaynight true;
  
hideImgs200map.images_index); 
  
map.images_index 200;
  
map.r_width map.r_height int64 25); 
  
map.background_poly = { 00screenwidth0screenwidthscreenheight0screenheight};
  
map.co_ordinates = { map.offset_xmap.offset_yscreenwidth 32screenheight 32};
  
map.i_width imgwidthnewmainmap.png); 
  
map.i_height imgheightnewmainmap.png);
  
fixMapPos();
  
drawImg"bomyisland_bigmap.png"16161710.81map.co_ordinates);
  
drawPolymap.background_poly160.71, { 000});
  
map.objects.clear(); 
  
map.objects.add( { "*" player.accountintplayer.x), intplayer.y), player.head, { 0643232}});
  
map.objects.add( { "Train"serverr.train_10], serverr.train_11], "trainicon.png", { 003232}});
  for ( 
plallplayers) {
    if ( 
pl.level.starts"world"))
      
map.objects.add( { "*" pl.accountintpl.x), intpl.y), pl.head, { 0643232}});
  }
  for ( 
omap.objects) {
    
obj_new_x = ( o1] * ( map.i_width map.r_width)) - map.offset_x;
    
obj_new_y = ( o2] * ( map.i_height map.r_height)) - map.offset_y;
    if ( 
obj_new_x in 0screenwidth| && obj_new_y in 0screenheight|) {
      
drawImgo3], obj_new_xobj_new_y190.511o4]);
      if ( 
mousescreenx in obj_new_x 8obj_new_x 24| && mousescreeny in obj_new_y 8obj_new_y 24|) {
        
drawTexto0], obj_new_x 26obj_new_y 4"Arial"0.8"bi", { 111}, 19);
        
obj_polygon_1 = { obj_new_x 26obj_new_y 4obj_new_x 30 getTextWidth0.8"Arial""bi"o0]), obj_new_y 4obj_new_x 30 getTextWidth0.8"Arial""bi"o0]), obj_new_y 24obj_new_x 26obj_new_y 24};
        
obj_polygon_2 = { obj_new_x 6obj_new_y 4obj_new_x 26obj_new_y 4obj_new_x 26obj_new_y 24obj_new_x 6obj_new_y 24};
        
drawPolyobj_polygon_1180.71, { 10.50}); drawPolyobj_polygon_2180.61, { 010});
      }
    }
  }
  if ( 
keydown0) || mousescreeny in 016|) map.offset_y max0map.offset_y map.movespeed);
  if ( 
keydown1) || mousescreenx in 016|) map.offset_x max0map.offset_x map.movespeed);
  if ( 
keydown2) || mousescreeny in screenheight 16screenheight|) map.offset_y minmap.i_height screenheight 32map.offset_y map.movespeed);
  if ( 
keydown3) || mousescreenx in screenwidth 16screenwidth|) map.offset_x minmap.i_width screenwidth 32map.offset_x map.movespeed);
  
findWeapon"*Inventory").invOff();
  if ( 
map.update == true)
    
loadPos();
  
setTimer0.05);
}

function 
fixMapPos() {
  
map.offset_y max0map.offset_y); 
  
map.offset_y minmap.i_height screenheight 32map.offset_y);
  
map.offset_x minmap.i_width screenwidth 32map.offset_x); 
  
map.offset_x max0map.offset_x);
}

function 
drawPolyipiliaimic) {
  
map.images_index ++;
  
with findImgmap.images_index)) {
    
polygon iplayer ilalpha iamode im;
    
red ic0]; green ic1]; blue ic2];
  }
}

function 
drawImgimixiyiliziaimodeipart) {
  
map.images_index ++;
  
with findImgmap.images_index)) {
    
image imixiylayer il;
    
zoom izalpha iamode imode;
  } 
changeImgPartmap.images_indexipart0], ipart1], ipart2], ipart3]);
}

function 
drawTexttmtxtytftztstctl) {
  if ( 
tc 0tc = { 111};
  
map.images_index ++;
  
with findImgmap.images_index)) {
    
txtyfont tfzoom tztext tmstyle ts;
    
red tc0]; blue tc2]; green tc1]; layer tl 1;
  }
  
map.images_index ++;
  
with findImgmap.images_index)) {
    
tx 1ty + ( - ( 16)); font tfzoom tz;
    
text tmstyle tsred blue green 0layer tl;
  }
}

function 
onMouseDownbutton) {
  switch ( 
button) {
    case 
"left":
      if ( 
map.status 0) return "";
      if ( 
keydown2162true)) {
        
map.warp_x = ( ( mousescreenx map.offset_x) - 16) * ( map.r_width map.i_width);
        
map.warp_y = ( ( mousescreeny map.offset_y) - 16) * ( map.r_height map.i_height);
        
player.chat "warpto " intmap.warp_x) @ " " intmap.warp_y) @ " newmain.gmap";
        
map.status 0;
      }
      break;
  }

__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #2  
Old 10-17-2006, 03:47 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 contiga View Post
Not that others may use this
Did you somehow miss the point of the code gallery? Isn't this like a share the wealth sub forum?
Reply With Quote
  #3  
Old 10-17-2006, 09:41 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Quote:
Originally Posted by Twinny View Post
Did you somehow miss the point of the code gallery? Isn't this like a share the wealth sub forum?
What I ment, is not entirely copy, but get the base from it perhaps.. I don't want to see an exact copy of it on another server tho..
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
Reply With Quote
  #4  
Old 10-31-2006, 09:30 PM
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
How about a feature list?

I couldn't get it to work. The map never displays. Anyway, I released a custom map a while back how does it compare?
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #5  
Old 11-11-2006, 03:55 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by JkWhoSaysNi View Post
I released a custom map a while back
So did I . And Contiga, this forum is for sripts to be released for anyone to use it anywhere. Dont like it? Dont post.
__________________
Follow my work on social media post-Graal:Updated august 2025.
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 12:23 AM.


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