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 09-09-2006, 09:59 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
Custom bigmap. (For gmaps only)

Heres a decent attempt at recreating the map.

How it works
Firstly, there is a control NPC which gets the locations of each player no more than once a second. The map NPC on the client then requests this info from the control NPC.

Why have I done it like this? To minimize the amount of info needing to be sent backwards and forwards continously. As it stands, information is only collected when one or more people are viewing the map.*

* though this solution would be slightly less efficient if there was always going to be one or more people viewing the map, e.g. if it were to be used as a minimap. However, this is not the case so the way it's done is like that for a reason. If it were to be used as a minimap i'd have the control npc collect the info continously rather than waiting for requests from the client

Features:
  • Uses M key to open like the normal map
  • When opened will focus in on your position (though always show as much of the map as possible, it will never show past the edges of the map.)
  • Keypad + and Keypad - zoom in and out, arrow keys scroll
  • Your head is shown slightly larger on the map than other peoples
  • Retains ctrl+click functionality for Staff (Buggy while zommed in or out at the moment.)

The scripts:

MapDB (control NPC)
PHP Code:
//////////////////////////////////////
//   Script by Knight Who Says Ni   //
//////////////////////////////////////
public function onCreated() {
  
this.gmapname "overworld.gmap";
}
public function 
pollInfo() {
  if(
this.lastupdate+timevar2) {
    
this.locations.clear();
    
this.playernames.clear();
    for (
pallplayers) {
      if (
p.level ==this.gmapname) {
      
this.locations.add({p.account,p.level,p.x,p.y});
    }
  }
  
this.lastupdate int(timevar2);
  }
}

public function 
getLocations() {
  return 
this.locations;
}
//#CLIENTSIDE 
-Map weapon NPC
PHP Code:
//////////////////////////////////////
//   Script by Knight Who Says Ni   //
//////////////////////////////////////
function onCreated() {
  
this.staffGuilds = {"Manager","LAT","NAT","etc"};
  
this.allowedAccounts = {"JkWhoSaysNi","..."};
}
function 
isStaff() {
  return (
player.account in this.allowedAccounts || player.guild in this.staffGuilds);
}
function 
onActionServerside() {
  
//retrieve data from the mapdb npc
  
if (params[0] == "info") {
   
mapdb findnpc("MapDB");
   
mapdb.pollInfo();
   
locations mapdb.getLocations();
    
//send data back to the client
   
triggeraction(0,0,"clientside","-Map",locations);
  }
  elseif (
params[0] == "warp" && isStaff()) {
     
setlevel2(params[1],params[2],params[3]);
  }
}
//#CLIENTSIDE
function putimg(id,imx,imy,image,vis) {
  
showimg(id,image,imx,imy);
  
changeimgvis(id,vis);
}
function 
onCreated() {
  
disablemap();
  
this.active 0;
  
this.mapimg "mapimg.png";
  
this.mapimgwidth 1624
  
this.mapimgheight 1344;
  
this.levelswide 29
  
this.levelshigh 24;
  
this.gmapname "overworld.gmap";
}
function 
showmap() {
  
disabledefmovement();
  
setani("maps1","");
  
this.zoom 1;
  
putimg(201,this.xoffset,this.yoffset,this.mapimg,6);  
  
changeimgzoom(201,1);

  
showpoly(200,{0,0,screenwidth,0,screenwidth,screenheight,0,screenwidth,0,0});
  
changeimgvis(200,5);
  
  
changeimgcolors(200,0,0,0,1);
  
showtext(2022020"Arial""b""Press 'M' exit." ).zoom 0.6;
  
changeimgvis(202,7);
  
showtext(2032030"Arial""b""Keypad + Zoom in" ).zoom 0.6;
  
changeimgvis(203,7);
  
showtext(2042040"Arial""b""Keypad - Zoom out" ).zoom 0.6;
  
changeimgvis(204,7);
  
showtext(2052050"Arial""b""Press the 'Arrow Keys' to move around" ).zoom 0.6;
  
changeimgvis(205,7);
  
this.active 1;
  
showPlayers();

}

function 
showPlayers() {
  
triggeraction(0,0,"serverside","-Map","info");

}

function 
onActionClientside() {

  for(
i=0;i<=params[0].size();i++) {
     if (
params[0][i][1] == this.gmapname) {

         
putimg(i+250,(((params[0][i][2]/64)*((this.mapimgwidth/this.levelswide)*(this.zoom)))-10)+this.xoffset,        (((params[0][i][3]/64)*((this.mapimgheight/this.levelshigh)*(this.zoom)))-10)+this.yoffset,findplayer(params[0][i][0]).headimg,8);
        
changeimgpart(i+250,0,64,32,32);
        
changeimgzoom(i+250,(params[0][i][0] == player.account) ? 0.7 0.5);
     } 
  }
}

function 
onTimeout() {
  if (
this.active == 1) {
    if(
this.lastupdate+timevar2) { 
      
showPlayers();
      
this.lastupdate timevar2;
     }
     if(
keydown2(38,false)) { 
        
this.yoffset += 20;  
        
findimg(201).+= 20;
        for (
i=250i<=(250+this.numplayers);i++) {
          
findimg(i).+= 20;
        }
     }

     if(
keydown2(40,false)) { 
          
this.yoffset -= 20;
          
findimg(201).-= 20;
          for (
i=250i<=(250+this.numplayers);i++) {
            
findimg(i).-= 20;
          }
     }    
     
     if(
keydown2(39,false)) {
      
this.xoffset -=20;
      
findimg(201).-= 20;
      for (
i=250i<=(250+this.numplayers);i++) {
          
findimg(i).-= 20;
        }
      }
     
     if(
keydown2(37,false)) {
      
this.xoffset += 20;
      
findimg(201).+= 20;
      
      for (
i=250i<=(250+this.numplayers);i++) {
          
findimg(i).+= 20;
        }
      }
 
     
setTimer(0.05);
  }
  else exit();
  
  
}

function 
onMouseDown() {
    if (
this.active == && this.ctrlpressed) {
        
enabledefmovement();
        
this.active 0;
        exit();
        
triggeraction(0,0,"serverside","-Map","warp",this.gmapname,((mousescreenx-this.xoffset)/this.mapimgwidth)*(this.levelswide*64),((mousescreeny-this.yoffset)/this.mapimgheight)*(this.levelshigh*64));
        
sleep(0.1);
        exit();
  }
}

function 
onKeyPressed() {

  if (
params[1] == "m") {
    if (
this.active == 0) {
      
this.ctrlpressed false;
      
player.ani "maps1";
      
disabledefmovement();
      
setTimer(0.1);
      
this.xoffset 0;
      
this.yoffset 0;
      if (
player.level == this.gmapname) {
       
        
poffsetx = ((player.x/64)*(this.mapimgwidth/this.levelswide));
        
poffsety = ((player.y/64)*(this.mapimgheight/this.levelshigh));    
        if (
poffsetx screenwidth) {
         
this.xoffset = (0-poffsetx)+screenwidth/2;
        }
        if (
poffsety screenheight) {
           
this.yoffset = (0-poffsety)+screenheight/2;
        }
        if ((
this.xoffset this.mapimgwidth) < screenwidth) {
            
this.xoffset 0-(this.mapimgwidth screenwidth);
        }
        if ((
this.yoffset this.mapimgheight) < screenheight) {
            
this.yoffset 0-(this.mapimgheight screenheight);
        }
      }
      
showmap();
    }
    elseif (
this.active == 1) {
      exit();
      
enabledefmovement();
      
this.active 0;
      
sleep(0.5);
      exit();
    }
  }
  if (
this.active == 1) {
    if (
params[1] == "+") {    
    
this.zoom += 0.1;
    
changeimgzoom(201,this.zoom);
    
  
    
this.xoffset = (this.mapimgwidth*(1-this.zoom))/2;
    
this.yoffset = (this.mapimgheight*(1-this.zoom))/2;
    
    
this.xoffset += findimg(201).x;
    
this.yoffset += findimg(201).y;
      
triggeraction(0,0,"serverside","-Map","info");
    
  }
  if (
params[1] == "-") {    
    
this.zoom -= 0.1;
    
changeimgzoom(201,this.zoom);
    
    
    
this.xoffset = (this.mapimgwidth*(1-this.zoom))/2;
    
this.yoffset = (this.mapimgheight*(1-this.zoom))/2;
    
    
this.xoffset += findimg(201).x;
    
this.yoffset += findimg(201).y;
      
triggeraction(0,0,"serverside","-Map","info");
  }
  }
  if (
params[2] == 29){ 
    
this.ctrlpressed true;
  }

}

function exit() {
  
hideimg(201);
  
hideimg(200);
  
hideimg(202);
  
hideimg(203);
  
hideimg(204);
  
hideimg(205);
  
this.ctrlpressed false;
  for (
i=250i<=(250+this.numplayers);i++) {
    
hideimg(i);
  }

Usage
In the MapDB npc you must set this.gmapname to the name of the gmap being used.

In -Map (serverside) you should set this.staffGuilds and this.allowedAccounts to allow staff to use ctrl+click warping

In -Map (clientside) you need to set the following:
this.mapimg The name of the image of the map.
this.mapimgwidth The width, in pixels, of the map image
this.mapimgheight The height, in pixels, of the map image
this.levelswide The width, in levels of the gmap
this.levelshigh The height, in levels of the gmap.
this.gmapname The name of the .gmap corresponding to the map image.


Hope some people find this useful and please give credit where it's due!
__________________

Coming soon (Hopefully:P)

Last edited by JkWhoSaysNi; 09-10-2006 at 04:45 PM.. Reason: small error fixed
Reply With Quote
  #2  
Old 09-09-2006, 10:05 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by JkWhoSaysNi
Heres a decent attempt at recreating the map.

How it works
Firstly, there is a control NPC which gets the locations of each player no more than once a second. The map NPC on the client then requests this info from the control NPC.

Why have I done it like this? To minimize the amount of info needing to be sent backwards and forwards continously. As it stands, information is only collected when one or more people are viewing the map.*

* though this solution would be slightly less efficient if there was always going to be one or more people viewing the map, e.g. if it were to be used as a minimap. However, this is not the case so the way it's done is like that for a reason. If it were to be used as a minimap i'd have the control npc collect the info continously rather than waiting for requests from the client

Features:
  • Uses M key to open like the normal map
  • When opened will focus in on your position (though always show as much of the map as possible, it will never show past the edges of the map.)
  • Keypad + and Keypad - zoom in and out, arrow keys scroll
  • Your head is shown slightly larger on the map than other peoples
  • Retains ctrl+click functionality for Staff (Buggy while zommed in or out at the moment.)

The scripts:

MapDB (control NPC)
PHP Code:
//////////////////////////////////////
//   Script by Knight Who Says Ni   //
//////////////////////////////////////
public function onCreated() {
  
this.gmapname "overworld.gmap";
}
public function 
pollInfo() {
  if(
this.lastupdate+timevar2) {
    
this.locations.clear();
    
this.playernames.clear();
    for (
pallplayers) {
      if (
p.level ==this.gmapname) {
      
this.locations.add({p.account,p.level,p.x,p.y});
    }
  }
  
this.lastupdate int(timevar2);
  }
}

public function 
getLocations() {
  return 
this.locations;
}
//#CLIENTSIDE 
-Map weapon NPC
PHP Code:
//////////////////////////////////////
//   Script by Knight Who Says Ni   //
//////////////////////////////////////
function onCreated() {
  
this.staffGuilds = {"Manager","LAT","NAT","etc"};
  
this.allowedAccounts = {"JkWhoSaysNi","..."};
}
function 
isStaff() {
  return (
player.account in this.allowedAccounts || player.guild in this.staffGuilds);
}
function 
onActionServerside() {
  
//retrieve data from the mapdb npc
  
if (params[0] == "info") {
   
mapdb findnpc("MapDB");
   
mapdb.pollInfo();
   
locations mapdb.getLocations();
    
//send data back to the client
   
triggeraction(0,0,"clientside","-Map",locations);
  }
  elseif (
params[0] == "warp" && isStaff()) {
     
setlevel2(params[1],params[2],params[3]);
  }
}
//#CLIENTSIDE
function putimg(id,imx,imy,image,vis) {
  
showimg(id,image,imx,imy);
  
changeimgvis(id,vis);
}
function 
onCreated() {
  
disablemap();
  
this.active 0;
  
this.mapimg "mapimg.png";
  
this.mapimgwidth 1624
  
this.mapimgheight 1344;
  
this.levelswide 29
  
this.levelshigh 24;
  
this.gmapname "overworld.gmap";
}
function 
showmap() {
  
disabledefmovement();
  
setani("maps1","");
  
this.zoom 1;
  
putimg(201,this.xoffset,this.yoffset,this.mapimg,6);  
  
changeimgzoom(201,1);

  
showpoly(200,{0,0,screenwidth,0,screenwidth,screenheight,0,screenwidth,0,0});
  
changeimgvis(200,5);
  
  
changeimgcolors(200,0,0,0,1);
  
showtext(2022020"Arial""b""Press 'M' exit." ).zoom 0.6;
  
changeimgvis(202,7);
  
showtext(2032030"Arial""b""Keypad + Zoom in" ).zoom 0.6;
  
changeimgvis(203,7);
  
showtext(2042040"Arial""b""Keypad - Zoom out" ).zoom 0.6;
  
changeimgvis(204,7);
  
showtext(2052050"Arial""b""Press the 'Arrow Keys' to move around" ).zoom 0.6;
  
changeimgvis(205,7);
  
this.active 1;
  
showPlayers();

}

function 
showPlayers() {
  
triggeraction(0,0,"serverside","-Map","info");

}

function 
onActionClientside() {

 
locationsarry params[0];
  for(
i=0;i<=locationsarray.size();i++) {
     if (
params[0][i][1] == this.gmapname) {

         
putimg(i+250,(((params[0][i][2]/64)*((this.mapimgwidth/this.levelswide)*(this.zoom)))-10)+this.xoffset,
        (((
params[0][i][3]/64)*((this.mapimgheight/this.levelshigh)*(this.zoom)))-10)+this.yoffset,findplayer(params[0][i][0]).headimg,8);
        
changeimgpart(i+250,0,64,32,32);
        
changeimgzoom(i+250,(params[0][i][0] == player.account) ? 0.7 0.5);
     } 
  }
}

function 
onTimeout() {
  if (
this.active == 1) {
    if(
this.lastupdate+timevar2) { 
      
showPlayers();
      
this.lastupdate timevar2;
     }
     if(
keydown2(38,false)) { 
        
this.yoffset += 20;  
        
findimg(201).+= 20;
        for (
i=250i<=(250+this.numplayers);i++) {
          
findimg(i).+= 20;
        }
     }

     if(
keydown2(40,false)) { 
          
this.yoffset -= 20;
          
findimg(201).-= 20;
          for (
i=250i<=(250+this.numplayers);i++) {
            
findimg(i).-= 20;
          }
     }    
     
     if(
keydown2(39,false)) {
      
this.xoffset -=20;
      
findimg(201).-= 20;
      for (
i=250i<=(250+this.numplayers);i++) {
          
findimg(i).-= 20;
        }
      }
     
     if(
keydown2(37,false)) {
      
this.xoffset += 20;
      
findimg(201).+= 20;
      
      for (
i=250i<=(250+this.numplayers);i++) {
          
findimg(i).+= 20;
        }
      }
 
     
setTimer(0.05);
  }
  else exit();
  
  
}

function 
onMouseDown() {
    if (
this.active == && this.ctrlpressed) {
        
enabledefmovement();
        
this.active 0;
        exit();
        
triggeraction(0,0,"serverside","-Map","warp",this.gmapname,((mousescreenx-this.xoffset)/this.mapimgwidth)*(this.levelswide*64),((mousescreeny-this.yoffset)/this.mapimgheight)*(this.levelshigh*64));
        
sleep(0.1);
        exit();
  }
}

function 
onKeyPressed() {

  if (
params[1] == "m") {
    if (
this.active == 0) {
      
this.ctrlpressed false;
      
player.ani "maps1";
      
disabledefmovement();
      
setTimer(0.1);
      
this.xoffset 0;
      
this.yoffset 0;
      if (
player.level.starts("dn_ow")) {
       
        
poffsetx = ((player.x/64)*(this.mapimgwidth/this.levelswide));
        
poffsety = ((player.y/64)*(this.mapimgheight/this.levelshigh));    
        if (
poffsetx screenwidth) {
         
this.xoffset = (0-poffsetx)+screenwidth/2;
        }
        if (
poffsety screenheight) {
           
this.yoffset = (0-poffsety)+screenheight/2;
        }
        if ((
this.xoffset this.mapimgwidth) < screenwidth) {
            
this.xoffset 0-(this.mapimgwidth screenwidth);
        }
        if ((
this.yoffset this.mapimgheight) < screenheight) {
            
this.yoffset 0-(this.mapimgheight screenheight);
        }
      }
      
showmap();
    }
    elseif (
this.active == 1) {
      exit();
      
enabledefmovement();
      
this.active 0;
      
sleep(0.5);
      exit();
    }
  }
  if (
this.active == 1) {
    if (
params[1] == "+") {    
    
this.zoom += 0.1;
    
changeimgzoom(201,this.zoom);
    
  
    
this.xoffset = (this.mapimgwidth*(1-this.zoom))/2;
    
this.yoffset = (this.mapimgheight*(1-this.zoom))/2;
    
    
this.xoffset += findimg(201).x;
    
this.yoffset += findimg(201).y;
      
triggeraction(0,0,"serverside","-Map","info");
    
  }
  if (
params[1] == "-") {    
    
this.zoom -= 0.1;
    
changeimgzoom(201,this.zoom);
    
    
    
this.xoffset = (this.mapimgwidth*(1-this.zoom))/2;
    
this.yoffset = (this.mapimgheight*(1-this.zoom))/2;
    
    
this.xoffset += findimg(201).x;
    
this.yoffset += findimg(201).y;
      
triggeraction(0,0,"serverside","-Map","info");
  }
  }
  if (
params[2] == 29){ 
    
this.ctrlpressed true;
  }

}

function exit() {
  
hideimg(201);
  
hideimg(200);
  
hideimg(202);
  
hideimg(203);
  
hideimg(204);
  
hideimg(205);
  
this.ctrlpressed false;
  for (
i=250i<=(250+this.numplayers);i++) {
    
hideimg(i);
  }

Usage
In the MapDB npc you must set this.gmapname to the name of the gmap being used.

In -Map (serverside) you should set this.staffGuilds and this.allowedAccounts to allow staff to use ctrl+click warping

In -Map (clientside) you need to set the following:
this.mapimg The name of the image of the map.
this.mapimgwidth The width, in pixels, of the map image
this.mapimgheight The height, in pixels, of the map image
this.levelswide The width, in levels of the gmap
this.levelshigh The height, in levels of the gmap.
this.gmapname The name of the .gmap corresponding to the map image.
A good idea for warpto is to make them say warpto x y blah.gmap

Because that will automatically check if they have rights or not and saves time, then you can use that sys as an extra for staff who shouldnt have rc
Hope some people find this useful and please give credit where it's due!
Reply With Quote
  #3  
Old 09-09-2006, 10:14 PM
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
My old map script just got ownt. Time to get going to the workshop!
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #4  
Old 09-09-2006, 11:04 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
Quote:
Originally Posted by KuJi
A good idea for warpto is to make them say warpto x y blah.gmap

Because that will automatically check if they have rights or not and saves time, then you can use that sys as an extra for staff who shouldnt have rc
Well, in my actual script I have it joined to a class which contains a list of staff accounts that I use for other scripts, such as admin tools. I just included part of it in this.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #5  
Old 09-09-2006, 11:30 PM
zephirot zephirot is offline
Banned?
Join Date: Sep 2004
Location: Paris
Posts: 1,311
zephirot is a name known to allzephirot is a name known to allzephirot is a name known to all
Send a message via AIM to zephirot Send a message via MSN to zephirot
Nice, too bad this forum doesn't have a rep system, or I would have rep you.
__________________

Quote:
Originally Posted by unixmad
Can you just shut up ?
MAGA
MFGA
MEGA
Reply With Quote
  #6  
Old 09-09-2006, 11:32 PM
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
Well, in my actual script I have it joined to a class which contains a list of staff accounts that I use for other scripts, such as admin tools. I just included part of it in this.


Eww at preset staff strings, try this: http://forums.graalonline.com/forums...ad.php?t=67868
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #7  
Old 09-09-2006, 11:41 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
hmm, yes but can I get the persons staff position from that? Currently have some scripts available to certain staff positions.

I cant access graal.net to check the script at the moment, unfortunatly.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #8  
Old 09-09-2006, 11:48 PM
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
Yes, it loops through the staff= part of serveroptions, so you could easily modify the script so that it sets the staff position aswell.


Script:

PHP Code:
function onActionServerSide()
{
  
// Automaticly scans the serveroptions for staffs and add them
  // to serverr.staff.
  
if (params[0] == "updatestaffs") {
    for (
iparams[1]) {
      if (
i.starts("staff=")) temp.staff i;
    }
    
serverr.staff NULL;
    for (
itemp.staff.tokenize()) {
      if (!
i.starts("staff=") && !i.starts("(") && !i.ends(")")) serverr.staff.add(i);
    }
  }
}
//#CLIENTSIDE
function onCreated() requestText("options""");

function 
onReceiveText(texttypetextoptiontextlines) {
  if (
texttype == "options"triggeraction(00"serverside"name"updatestaffs"textlines.tokenize(), servername);

__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #9  
Old 09-09-2006, 11:53 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by xXziroXx
Yes, it loops through the staff= part of serveroptions, so you could easily modify the script so that it sets the staff position aswell.


Script:

[...]
I always thought that requesttext("options", ""); required clientrc to be active.
Reply With Quote
  #10  
Old 09-09-2006, 11:58 PM
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 Skyld
I always thought that requesttext("options", ""); required clientrc to be active.
Then you thought wrong!
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #11  
Old 09-10-2006, 08:39 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
I cannot get requesttext() to work.

I trying to do it the same way as your script. Heres all i'm trying to do:

PHP Code:
//#CLIENTSIDE
function onWeaponFired() {
requestText("options"""); 
}
function 
onReceiveText(texttypetextoptiontextlines) { 
echo(
"Recieved");
echo(
textlines);

It doesnt work. onReceiveText never gets called.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #12  
Old 09-10-2006, 09:49 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by xXziroXx
Then you thought wrong!
Sorry, I am inclined to disagree.

I tried with both clientrc enabled and disabled. With clientrc enabled, it worked fine. Without clientrc enabled, it didn't.

Reply With Quote
  #13  
Old 09-11-2006, 12:06 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 Skyld
Sorry, I am inclined to disagree.

I tried with both clientrc enabled and disabled. With clientrc enabled, it worked fine. Without clientrc enabled, it didn't.

Then explain to me why my script works? I just tried it with Client RC disabled, and made it echo it serversided once the action have been sent.


params[1] (sent as textlines.tokenize() in the trigger):

PHP Code:
"# Start location",startlevel=ml_tiletest.nw,startx=27,starty=35.5,"","# Unstick me location",unstickmelevel=ml_tiletest.nw,unstickmex=27,unstickmey=35.5,"","# Protected weapons","protectedweapons=System/Functions,System/Main","","# Jail levels",#jaillevels=,"","# Explosion restriction",noexplosions=true,"","# Static restriction",setbodyallowed=false,setheadallowed=false,setbomyallowed=false,setswordallowed=false,setshieldallowed=false,"","# Gralat loss options",mindeathgralats=0,maxdeathgralats=0,"","# Staff gralat restriction",normaladminscanchangegralats=true,"","# Local 'staff guilds'","staffguilds=Server,Owner","","# 'Bush' items",bu****ems=false,"","# 'Baddy' items",baddyitems=false,"","# 'Healing' swords",healswords=false,"","# Non-script timeouts",respawntime=10,horselifetime=0,baddyrespawntime=60,"","# Server scripting flags",dontaddserverflags=false,"","# Server maps","#bigmap=maptext,mapimage,defaultx,defaulty","#minimap=maptext,mapimage,defaultx,defaulty","","# Warping (all players)",warptoforall=true,warptoforlowadmins=true,"","# Warping activation",warpto=true,ignorewarpto=false,"","# Ghost mode",ghostmodeenabled=false,ghostmodefornotstaff=false,"","# Playerlist icons",#playerlisticons=,"","# Profile variables",#profilevars=,"","# Trial account limits",limitfreeplayers2=false,"","# AP system activation",apsystem=true,"","# Starting AP",startap=100,"","# Global guilds activation",globalguilds=false,"allowedglobalguilds=Mythic Legend","","# AP timeouts",aptime0=30,aptime1=90,aptime2=300,aptime3=600,aptime4=1200,"","# Hearts/Sword limits",heartlimit=3,swordlimit=1,"","# 'putnpc' scripting command",putnpcenabled=false,"","# Translation",enabletranslations=false,"","# Language selection",#translatedlanguages=,"","# Server language",serverlanguage=English,"","# NPC-Server 'sleep'",sleepwhennoplayers=false,"","# Tilesets",newtilesets=true,newtilesetlevels=ml_,"","# Staff","staff=(Owner),irule13,(Manager),xXziroXx,(Co-Manager),Admin-Playerworld53,(Developer),coreys,(NAT),DrakilorP2P,(GFX),killerogue,(Guest RC),LycJr7,DrukenSNiper,PoPoZakuto,(Temp Access),BigNoobie,TheOddCouple,Meridrak,Mooman3,xshadx,sanosthesickness,shadow212,Tasha,contiga","","# GMAP list",#gmaps=,"","# Weapon order","weaponorder=System/Functions,System/Main","","# NPC-Control rights",npcrights=true,"","# Kill count",dontchangekills=true,"","# NPC-Server nickname","nickname=Mythic Legends NPC","","# Speedhack tolerance",speedhacktolerance=90,"","# Idle disconnect",disconnectifnotmoved=false,"","# Save levels",savelevels=true,savelevelsmessage=true,"","# Staff only",onlystaff=true,"","# Log script function calls","scriptlogfunctions=write player.nick,write player.guild,call sendtonc,call sendtorc","","# Levels auto-save",levelsaveauto=true,"","","### NOTES ###","# Jer is using the Admin Account, no one else.","# Yeah i know, i just told him to use it." 

Now, lets try it with Client-RC!

PHP Code:
New Client-RCZiro (xXziroXx)
"# Start location",startlevel=ml_tiletest.nw,startx=27,starty=35.5,"","# Unstick me location",unstickmelevel=ml_tiletest.nw,unstickmex=27,unstickmey=35.5,"","# Protected weapons","protectedweapons=System/Functions,System/Main","","# Jail levels",#jaillevels=,"","# Explosion restriction",noexplosions=true,"","# Static restriction",setbodyallowed=false,setheadallowed=false,setbomyallowed=false,setswordallowed=false,setshieldallowed=false,"","# Gralat loss options",mindeathgralats=0,maxdeathgralats=0,"","# Staff gralat restriction",normaladminscanchangegralats=true,"","# Local 'staff guilds'","staffguilds=Server,Owner","","# 'Bush' items",bu****ems=false,"","# 'Baddy' items",baddyitems=false,"","# 'Healing' swords",healswords=false,"","# Non-script timeouts",respawntime=10,horselifetime=0,baddyrespawntime=60,"","# Server scripting flags",dontaddserverflags=false,"","# Server maps","#bigmap=maptext,mapimage,defaultx,defaulty","#minimap=maptext,mapimage,defaultx,defaulty","","# Warping (all players)",warptoforall=true,warptoforlowadmins=true,"","# Warping activation",warpto=true,ignorewarpto=false,"","# Ghost mode",ghostmodeenabled=false,ghostmodefornotstaff=false,"","# Playerlist icons",#playerlisticons=,"","# Profile variables",#profilevars=,"","# Trial account limits",limitfreeplayers2=false,"","# AP system activation",apsystem=true,"","# Starting AP",startap=100,"","# Global guilds activation",globalguilds=false,"allowedglobalguilds=Mythic Legend","","# AP timeouts",aptime0=30,aptime1=90,aptime2=300,aptime3=600,aptime4=1200,"","# Hearts/Sword limits",heartlimit=3,swordlimit=1,"","# 'putnpc' scripting command",putnpcenabled=false,"","# Translation",enabletranslations=false,"","# Language selection",#translatedlanguages=,"","# Server language",serverlanguage=English,"","# NPC-Server 'sleep'",sleepwhennoplayers=false,"","# Tilesets",newtilesets=true,newtilesetlevels=ml_,"","# Staff","staff=(Owner),irule13,(Manager),xXziroXx,(Co-Manager),Admin-Playerworld53,(Developer),coreys,(NAT),DrakilorP2P,(GFX),killerogue,(Guest RC),LycJr7,DrukenSNiper,PoPoZakuto,(Temp Access),BigNoobie,TheOddCouple,Meridrak,Mooman3,xshadx,sanosthesickness,shadow212,Tasha,contiga","","# GMAP list",#gmaps=,"","# Weapon order","weaponorder=System/Functions,System/Main","","# NPC-Control rights",npcrights=true,"","# Kill count",dontchangekills=true,"","# NPC-Server nickname","nickname=Mythic Legends NPC","","# Speedhack tolerance",speedhacktolerance=90,"","# Idle disconnect",disconnectifnotmoved=false,"","# Save levels",savelevels=true,savelevelsmessage=true,"","# Staff only",onlystaff=true,"","# Log script function calls","scriptlogfunctions=write player.nick,write player.guild,call sendtonc,call sendtorc","","# Levels auto-save",levelsaveauto=true,"","","### NOTES ###","# Jer is using the Admin Account, no one else.","# Yeah i know, i just told him to use it." 
__________________
Follow my work on social media post-Graal:Updated august 2025.

Last edited by xXziroXx; 09-11-2006 at 12:18 AM..
Reply With Quote
  #14  
Old 09-11-2006, 12:27 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
Then why doesnt my script work?
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #15  
Old 09-11-2006, 09:24 AM
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 Skyld
Sorry, I am inclined to disagree.
Oops
__________________
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
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 11:23 PM.


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