Graal Forums  

Go Back   Graal Forums > Development Forums > Future Improvements
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 01-20-2003, 06:11 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Scripting Ideas

Here are some ideas I think would be good to add to graal scripting (please don't tell me to
tell stefan just because I have debug access, he told me to only tell things that are changes to the scripting engine and to post general changes here)

1.)
synxtax: stripcharacters(character,text);

used: serverside & clientside

example of usage: stripcharacters(«,#s(this.text))

why this would be useful:
in my example it would look at the string #s(this.text) and replace all the « character's with a space
I can't use tokenize2 because tokenize2 is for an ADDITIONAL delimeter, so if I used tokenize2 on the script I needed it for, it would also divide things that are normally spaced into tokens
I would prefer having this than doing what I made as a replacement;
NPC Code:

for(i=0;i<strlen(#s(this.temp));i++){
if(strequals(#e(i,1,#s(this.temp)),‡)){
setstring this.temp,#e(0,this.lastpos,#s(this.temp))#e(this. lastpos,i-this.lastpos,#s(this.temp)) #e(i+1,-1,#s(this.temp));
addstring this.temp2,#e(this.lastpos,i-this.lastpos,#s(this.temp));
this.lastpos = i;
}
}


there are probably other ways to do this but wouldnt a script command/function that did this require less processing time?

EDIT: stefan reminded me that I can use indexof for this new replacement
NPC Code:

while(indexof(‡,#s(this.temp)) > -1){
this.index = indexof(‡,#s(this.temp));
setstring this.temp,#e(0,this.index,#s(this.temp)) #e(this.index+1,-1,#s(this.temp));
}


so I don't really need this anymore ^_^

2.)

syntax:var = getnearesttile(type);

used: serverside

example of usage: i = getnearesttile(8);

why this would be useful:
pretend in the example, 8 is water type, the script would automatically find the closest water tile and make i = 0/{x,y,z}, replccing each letter with the correct axis, could be used
for things like pets if you want to get the nearest water tile, again i could do a loop but what would require less processing time ??

3.)

syntax: with(getlevel(levelname))

used: serverside

example of usage: with(getlevel(onlinestartlocal.nw))

why this would be useful:
it could be used to get all the players, npcs, and the tileset board of another levelwithout actually warping to the level

4.)

syntax: showonplayerlist;

used: serverside on database npcs

example of usage: see syntax

why this would be useful:
they could recieve if(pm) as an action as well, it would be fun to add npcs to the playerlist and why bother having the Control-NPC recieve even more actions than it already does
and take up more proccessing time by making it into an FAQ bot when you can do it withanother npc??

5.)

syntax: deletestrings stringstart,begin index,end index;

used: clientside and serverside

example of useage: deletestrings this.item,0,100;

why this would be useful:
the example will delete #s(this.item0), #s(this.item1), all the way to #s(this.item100)
I think this would take less processing time than
for(i=0;strlen(#s(this.item#v(i))) > 0;i++) setstring this.item#v(i),;

6.)
a way to define if something you draw with showpoly gets filled or not x.x

if I think of more ideas I will reply and post them or edit this post

also, don't say that accessing / editing files on the server's ftp would also be useful, Stefan has already said he will add this later

Last edited by Python523; 01-20-2003 at 06:40 AM..
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 12:29 PM.


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