Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-30-2003, 09:54 PM
Benm00t Benm00t is offline
I made a tree!
Benm00t's Avatar
Join Date: Jul 2003
Location: The Intarwebbernetwork!
Posts: 987
Benm00t is on a distinguished road
#t() help

How can I have all the tokens after a certain token be shown?

What i mean is, after #t(1), i want all the tokens to be shown along with that, but because the amount of tokens is always changing, i just can't add more #t(). Is there a character i can add with #t() so it knows to show all the tokens after it, or will i need to put it into a loop..
Reply With Quote
  #2  
Old 07-30-2003, 10:38 PM
Thought Thought is offline
PipBoy Extraordinaire!
Thought's Avatar
Join Date: Nov 2001
Location: Long Beach, California.
Posts: 692
Thought is on a distinguished road
The variable tokenscount should help, make a for loop that appends the rest of the tokens to a string, for example.
__________________
Rick ([email protected])
#gscript on FreeNode (#gscript Guild, #gscript Information)
Graal User Statistics

I am now using my new account, Rick.
Reply With Quote
  #3  
Old 07-30-2003, 11:02 PM
Alexander Alexander is offline
Registered User
Join Date: Apr 2003
Location: California
Posts: 246
Alexander is on a distinguished road
Send a message via AIM to Alexander
Quote:
Originally posted by Thought
The variable tokenscount should help, make a for loop that appends the rest of the tokens to a string, for example.
You could use #e so you won't have to use a loop, and indexof like indexof(#t(2),#c).
Reply With Quote
  #4  
Old 07-31-2003, 08:46 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
Arg, did I ever tell you how much you people scare me?!
This is an example that will take something if you chat, and sendtorc #t(1) up to #t(i) =) This is the MOST efficent way
NPC Code:

if (playerchats){
tokenize #c;
sendtorc #t(1) - #t(1) = #T(#e(strlen(#t(0)),-1,#c));
}


Short, sweet, and to the point =)
#e (as alex said) is the best way, but all you have to do is have it do the string length. Plus #T removes spaces at the beginning =D
---Shifter
__________________
Who has time for life these days?
Reply With Quote
  #5  
Old 07-31-2003, 09:03 AM
Kaimetsu Kaimetsu is offline
Script Monkey
Kaimetsu's Avatar
Join Date: May 2001
Posts: 18,222
Kaimetsu will become famous soon enough
It's usually foolish to proclaim that your method is the most efficient, especially in a language like GScript. It's impossible to know for sure since we don't know how Graal works internally, and you run the risk of somebody saying something like:

Hey dorkface, that only works if spaces are the only delimiters.
__________________
Reply With Quote
  #6  
Old 08-01-2003, 05:39 AM
Projectshifter Projectshifter is offline
The David
Projectshifter's Avatar
Join Date: Apr 2002
Location: USA
Posts: 912
Projectshifter is an unknown quantity at this point
Send a message via ICQ to Projectshifter Send a message via AIM to Projectshifter Send a message via MSN to Projectshifter Send a message via Yahoo to Projectshifter
LOL, point taken Kai. But to the best of my knowledge, that is the most efficient way
And if you're using another delimiter, it should be self explanatory
---Shifter
__________________
Who has time for life these days?
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 05:29 PM.


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