Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-19-2006, 02:21 AM
Sum41Freeeeek Sum41Freeeeek is offline
Future Coder
Join Date: Feb 2004
Location: New York
Posts: 376
Sum41Freeeeek is on a distinguished road
Send a message via AIM to Sum41Freeeeek
tokenize

I'm having trouble.
How do you turn
tokenize #c;
clientr.randomstring = #t(1);

into gs2?
I made my script in gs1 but I'm not sure how to do tokenize #c in gs2.

thanks
__________________
Frankie Cassini: ex-Era LAT
Quote:
Originally Posted by brakk View Post
omg just go to your room and draw a pony then

**** the chicken wings!
Reply With Quote
  #2  
Old 09-19-2006, 02:40 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
temp.toks = player.chat.tokenize();
temp.toks[1];

=d
Reply With Quote
  #3  
Old 09-21-2006, 01:03 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Yes the exact translation from tokenize from GS1 to GS2 is
tokens = player.chat.tokenize();

Your example could be like this (to make it as short as possible):
clientr.randomstring = player.chat.tokenize()[1];
Reply With Quote
  #4  
Old 09-21-2006, 01:20 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by Stefan View Post
Yes the exact translation from tokenize from GS1 to GS2 is
tokens = player.chat.tokenize();

Your example could be like this (to make it as short as possible):
clientr.randomstring = player.chat.tokenize()[1];
Ahh, didn't know you can do that =O
Reply With Quote
  #5  
Old 09-21-2006, 01:55 AM
JkWhoSaysNi JkWhoSaysNi is offline
Ruler of the graalaxy
Join Date: Feb 2005
Location: Great Britain
Posts: 488
JkWhoSaysNi is on a distinguished road
Send a message via ICQ to JkWhoSaysNi
hmm, does that work with other functions that return arrays? I'm sure I tried it with a self made function and it diddnt work.
__________________

Coming soon (Hopefully:P)
Reply With Quote
  #6  
Old 09-21-2006, 08:45 AM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
Quote:
Originally Posted by Stefan View Post
Yes the exact translation from tokenize from GS1 to GS2 is
tokens = player.chat.tokenize();

Your example could be like this (to make it as short as possible):
clientr.randomstring = player.chat.tokenize()[1];
Another way of tokenizing in GS2 (tokenize2 ,; ) is:

tokens = player.chat.tokenize( "_");

If I'd say hi_lol_how_are_you
tokens would be { "hi", "lol", "how", "are", "you"}.
tokens[ 3] would get "are", tokens[ 0] would get "hi".
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
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 10:34 PM.


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