Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   new command suggestion (https://forums.graalonline.com/forums/showthread.php?t=29304)

CheeToS2 05-17-2002 01:53 AM

new command suggestion
 
Need something to return certain parameters of a return... like

parm(2-,#c) would return the second word and on of the players chat text..
parm(2,#c) return the second word alone,
parm(2-3,#c) would show the 2nd & 3rd words, etc.

I know theres already ways to do it with loops & stuff.. but that is annoying in a way :D just suggesting a simpler way to do it.

Also... left(2,parm(3,#c)) could show the first 2 letters of the third word in chat text, right() the opposite.. you get the idea :-)

CheeToS2 05-17-2002 02:02 AM

true.. but you still have to use loops w/ tokenize if you don't want the first word of a return to show up.. like:

setradio Kaimetsu is the script monkey
you have to make a loop to get rid of all of #t(0) so you only get the sentence you want =\

[edit] I'm a mIRC scripter.. I feel the parm stuff just makes a lot of stuff go way quicker when you're making it x.x [/edit]

Warcaptain 05-17-2002 02:26 AM

tokenize is the same way really..
thatd only make things a bit smoother, and so you can still tokenize and use that at same time.

but i doubt stefan would add 2 almost identical commands, unless the first was outdated

GrowlZ1010 05-17-2002 02:28 AM

Quote:

Originally posted by CheeToS2
true.. but you still have to use loops w/ tokenize if you don't want the first word of a return to show up.. like:

setradio Kaimetsu is the script monkey
you have to make a loop to get rid of all of #t(0) so you only get the sentence you want =\

Or, you can use 'setradio "Kaimetsu is the script monkey" ' with your radio text in speech marks, and then that phrase becomes one single token rather than five. Leaving you with the command 'setradio' , which can easily be stripped out by simply using #t(1) as the content of your sentence. Mystical.

If the above post was patronizing, then I apologize, but this method works fine. I can't see any need for improvement.

CheeToS2 05-17-2002 02:29 AM

tokenize is sorta outdated :D
the point IS to make it simpler
smallers scripts too

screen_name 05-17-2002 03:26 AM

it would be cool, a lot easier too

but i dont mind using tokenize either :D

CheeToS2 05-17-2002 03:40 AM

Quote:

Originally posted by GrowlZ1010


Or, you can use 'setradio "Kaimetsu is the script monkey" ' with your radio text in speech marks, and then that phrase becomes one single token rather than five. Leaving you with the command 'setradio' , which can easily be stripped out by simply using #t(1) as the content of your sentence. Mystical.

If the above post was patronizing, then I apologize, but this method works fine. I can't see any need for improvement.

news to me :D <3
new commands will still help anyways =P

my other suggestion I already told stefan about:
either make it so emotiocons draw over everything even if its a drawoverplayer npc, or have an option like "drawemoover"/"drawemounder"

I end up trying to do an emotioncon under a treetop often & it is aggrivating x.x

KJL 05-17-2002 03:41 AM

you can use something like #e to do the same thing basically

humm but then you would have to know how many chars to go in.

Warcaptain 05-17-2002 03:51 AM

Quote:

Originally posted by CheeToS2
tokenize is sorta outdated :D
the point IS to make it simpler
smallers scripts too

well.

its like 1\10 that itll get done.

there are commands like setbody and swetshield even though there is setplayerprop #8 setplayerporop #2 etc
only to make things simpler for the scripter

i dont see why this wouldnt work well.

but param() wouldnt work well worded like that
more like:
[script]
strtoken(token,string);
[/script]

sort of like #e() but its words not single characters.

CheeToS2 05-17-2002 04:26 AM

Quote:

Originally posted by Kaimetsu


I don't see how such a fundamental command can be outdated, but nevermind. Stefan rarely adds things if there are other ways to achieve the same result, and it's unlikely that he would add something so icky in that it uses a human-friendly string as an argument...

what do you mean human-friendly? :confused:

Dustey4Ever 05-17-2002 05:15 AM

Quote:

Originally posted by CheeToS2
tokenize is sorta outdated :D
the point IS to make it simpler
smallers scripts too

its not outdated :rolleyes: I think tokenize is fine, I use it all the time in my scripts and I dont wish yo learn a new thing like tokenize because Im too lazy to learn the same basic function twice over;)

Quote:

I don't see how such a fundamental command can be outdated
and yes Kai is right about Stefan rarely adding to things that do the same way or can be achieved with a bit of scripting

Saga2001 05-17-2002 05:27 AM

Quote:

Originally posted by Kaimetsu
Goshdarnit, though, I really wish Stefan would add tokenise as a mirror of tokenize. I hate being forced to use the American spelling!
Yes we Americans are quite bad. Though I like this idea just as much as the next guy, it simply won't happen, tokenize is used widely and will be used...don't change the wheel, use it.

Dustey4Ever 05-17-2002 05:51 AM

Quote:

Originally posted by Saga2001


Yes we Americans are quite bad. Though I like this idea just as much as the next guy, it simply won't happen, tokenize is used widely and will be used...don't change the wheel, use it.

no we arent *slaps saga* We just dont like the metric system, and for spelling like color instead of colour, lets just say our way is the best kk?:D I never knew Stefan was a American:confused:

Saga2001 05-17-2002 06:18 AM

Quote:

Originally posted by Dustey4Ever


no we arent *slaps saga* We just dont like the metric system, and for spelling like color instead of colour, lets just say our way is the best kk?:D I never knew Stefan was a American:confused:

Its PastAustin, and I am a big fan of Europe...

Gohan43331 05-18-2002 01:07 AM

Wouldn't this work?

NPC Code:

tokenize #c;
setstring server.radio,#e(strlen(#t(0))+1,-1,#c);



That would be setradio (8 letters) + 1, and take that string and continue until the end of #c...

Havn't tested it though, still at school (*curses proxies*)


All times are GMT +2. The time now is 12:44 AM.

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