Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 01-20-2003, 07:19 AM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
Re: Scripting Ideas

Quote:
Originally posted by Python523
moo
I like those ideas.. but.. for #2, what if you're directly in between 4 water tiles? wouldn't it cause some kind of error? x.x
__________________

Reply With Quote
  #3  
Old 01-21-2003, 05:33 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
Re: Re: Scripting Ideas

Quote:
Originally posted by CheeToS2


I like those ideas.. but.. for #2, what if you're directly in between 4 water tiles? wouldn't it cause some kind of error? x.x
if that was the case, it would probably set the array to whatever tile it finds first in whatever it uses to detect tiles
Reply With Quote
  #4  
Old 01-21-2003, 05:42 AM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Re: Re: Scripting Ideas

Quote:
Originally posted by CheeToS2


#2, what if you're directly in between 4 water tiles? wouldn't it cause some kind of error? x.x
Mayb another param in which direction it checks first?
__________________
new account: Trevor
Reply With Quote
  #5  
Old 01-24-2003, 11:59 PM
Jasen Jasen is offline
Banned
Join Date: Jan 2003
Location: USA
Posts: 45
Jasen is on a distinguished road
Send a message via AIM to Jasen
Too confusing for me. o.o
*Runs away*
Reply With Quote
  #6  
Old 01-25-2003, 04:20 PM
Com013 Com013 is offline
Registered User
Join Date: Aug 2002
Location: GMT+1
Posts: 381
Com013 is on a distinguished road
Re: Scripting Ideas

Quote:
Originally posted by Python523
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
I know you didn't want to warp, but wouldn't this be the same?

NPC Code:

setstring this.oldlvl,#L;
warpto somewhere.nw,x,y;
...
warpto #s(this.oldlvl),x,y;

__________________
Com013
Former Admin of the LAT on Graal The Adventure

e-mail: [email protected]
Reply With Quote
  #7  
Old 01-25-2003, 04:35 PM
tlf288 tlf288 is offline
Registered User
tlf288's Avatar
Join Date: Nov 2001
Location: new account: Trevor
Posts: 0
tlf288 is on a distinguished road
Send a message via AIM to tlf288 Send a message via Yahoo to tlf288
Re: Re: Scripting Ideas

Quote:
Originally posted by Com013


I know you didn't want to warp, but wouldn't this be the same?

NPC Code:

setstring this.oldlvl,#L;
warpto somewhere.nw,x,y;
...
warpto #s(this.oldlvl),x,y;

I think your missing the point. The NPC would still have to go to the level for the string to set. getlevel() would be used for in serverside to get the attributes of a level.
__________________
new account: Trevor
Reply With Quote
  #8  
Old 01-25-2003, 09:03 PM
Jeff Jeff is offline
Registered User
Join Date: Oct 2002
Location: Nebraska, USA
Posts: 707
Jeff is on a distinguished road
Only database NPCs can warpto.

Any NPC could getlevel, as it would access the players, npcs, board, and level variables of the level without needing to warp a database NPC into the level to bounce things back, a relatively inefficient process.

I have a secret project for which something like this would be most useful...
__________________
Jeff, the Archduke of Dustari
Member of the LAT on Graal The Adventure
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GO d+ s++:+ !a C++ UL+(UL+++)@ P+ L+(++)>+++ E---- W++@ N- !o ?K w(w--) !O !M@ !V PS- PE+ Y PGP t+ 5 X R tv(tv+) b++(b+)>b++++ DI(DI+) D-- G e->e++++ h! !r y
------END GEEK CODE BLOCK------
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:00 PM.


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