Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-17-2002, 01:53 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
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 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 :-)
Reply With Quote
  #2  
Old 05-17-2002, 02:02 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
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]
Reply With Quote
  #3  
Old 05-17-2002, 02:26 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
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
Reply With Quote
  #4  
Old 05-17-2002, 02:28 AM
GrowlZ1010 GrowlZ1010 is offline
defunct
Join Date: May 2002
Posts: 187
GrowlZ1010 is on a distinguished road
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.
Reply With Quote
  #5  
Old 05-17-2002, 02:29 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
tokenize is sorta outdated
the point IS to make it simpler
smallers scripts too
Reply With Quote
  #6  
Old 05-17-2002, 03:26 AM
screen_name screen_name is offline
is watching you
Join Date: Mar 2002
Location: The 3rd Dimension
Posts: 2,160
screen_name is on a distinguished road
Send a message via AIM to screen_name Send a message via MSN to screen_name
it would be cool, a lot easier too

but i dont mind using tokenize either
__________________
[signature]insert here[/signature]
Reply With Quote
  #7  
Old 05-17-2002, 03:40 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
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 <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
Reply With Quote
  #8  
Old 05-17-2002, 03:41 AM
KJL KJL is offline
Registered User
Join Date: Jan 2002
Location: Minnesota, USA
Posts: 33
KJL is on a distinguished road
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.
Reply With Quote
  #9  
Old 05-17-2002, 03:51 AM
Warcaptain Warcaptain is offline
Banned
Warcaptain's Avatar
Join Date: Jun 2001
Location: Virginia, USA
Posts: 2,086
Warcaptain is on a distinguished road
Send a message via ICQ to Warcaptain Send a message via AIM to Warcaptain Send a message via Yahoo to Warcaptain
Quote:
Originally posted by CheeToS2
tokenize is sorta outdated
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.
Reply With Quote
  #10  
Old 05-17-2002, 04:26 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
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?
Reply With Quote
  #11  
Old 05-17-2002, 05:15 AM
Dustey4Ever Dustey4Ever is offline
Registered User
Join Date: Apr 2002
Posts: 348
Dustey4Ever is on a distinguished road
Send a message via AIM to Dustey4Ever
Quote:
Originally posted by CheeToS2
tokenize is sorta outdated
the point IS to make it simpler
smallers scripts too
its not outdated 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
__________________
Dustey, Rob Getashu, Van?
Van- I use this acct because mine dun work.....
Rob- Same
Reply With Quote
  #12  
Old 05-17-2002, 05:27 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
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.
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #13  
Old 05-17-2002, 05:51 AM
Dustey4Ever Dustey4Ever is offline
Registered User
Join Date: Apr 2002
Posts: 348
Dustey4Ever is on a distinguished road
Send a message via AIM to Dustey4Ever
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? I never knew Stefan was a American
__________________
Dustey, Rob Getashu, Van?
Van- I use this acct because mine dun work.....
Rob- Same
Reply With Quote
  #14  
Old 05-17-2002, 06:18 AM
Saga2001 Saga2001 is offline
Wishing he had 3 feet
Join Date: Aug 2001
Location: Basement
Posts: 1,565
Saga2001 is on a distinguished road
Send a message via ICQ to Saga2001 Send a message via AIM to Saga2001 Send a message via Yahoo to Saga2001
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? I never knew Stefan was a American
Its PastAustin, and I am a big fan of Europe...
__________________

!Wan ( 11:27:55 AM):
can i c ur scripts please?
Zorg (RC): If I hear NPC Server call Ne0, Past Austin or Brent sexy one more time im disconnecting it
Reply With Quote
  #15  
Old 05-18-2002, 01:07 AM
Gohan43331 Gohan43331 is offline
Registered User
Join Date: Jan 2002
Posts: 87
Gohan43331 is on a distinguished road
Send a message via AIM to Gohan43331
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*)
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 07:41 PM.


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