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 01-28-2004, 03:46 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
tokens

Is there anyway to tokenize a string w/o it breaking it up by spaces, and only by commas.
IE the string: This is an example,test test test,hi
would be broken up into:
This is an example
test test test
hi
I'm just wondering if there is a command for it, if not I guess i'll do it the hard way since wraptext2 width,font size,delimiter,text; doesnt seem to be working (delimiter portion of it).
__________________
Reply With Quote
  #2  
Old 01-28-2004, 04:00 PM
mhermher mhermher is offline
galase galase!
mhermher's Avatar
Join Date: Jun 2001
Location: Sweden, Stockholm.
Posts: 2,012
mhermher is on a distinguished road
Send a message via ICQ to mhermher Send a message via AIM to mhermher Send a message via Yahoo to mhermher
Re: tokens

Quote:
Originally posted by ZeLpH_MyStiK
Is there anyway to tokenize a string w/o it breaking it up by spaces, and only by commas.
IE the string: This is an example,test test test,hi
would be broken up into:
This is an example
test test test
hi
I'm just wondering if there is a command for it, if not I guess i'll do it the hard way since wraptext2 width,font size,delimiter,text; doesnt seem to be working (delimiter portion of it).
sarraylen(string)
#I(string,index)


Sample:

for (i=0;i<sarraylen(string);i++) {
showtext blablabla,blabla,blabla,blalb,alb,alb,#I(string,i) ;
}
__________________
Donate money for my trip to Germany

Adiarde Manager
Reply With Quote
  #3  
Old 01-28-2004, 04:36 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Re: Re: tokens

Quote:
Originally posted by ZeLpH_MyStiK
Is there anyway to tokenize a string w/o it breaking it up by spaces, and only by commas.
IE the string: This is an example,test test test,hi
would be broken up into:
This is an example
test test test
hi
I'm just wondering if there is a command for it, if not I guess i'll do it the hard way since wraptext2 width,font size,delimiter,text; doesnt seem to be working (delimiter portion of it).
Probably the best way is wraptext.

Quote:
Originally posted by mhermher

showtext blablabla,blabla,blabla,blalb,alb,alb,#I(string,i) ;
NPC Code:

showtext index,x,y,font,style,text;



There is no blablabla
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #4  
Old 01-28-2004, 05:28 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Re: Re: Re: tokens

Quote:
Originally posted by osrs


Probably the best way is wraptext.



NPC Code:

showtext index,x,y,font,style,text;



There is no blablabla
Ya i tried wraptext2 with delimiters but it doesnt cut it off when there is a delimiter, only when it reaches the pixel width does it cut it off.
__________________
Reply With Quote
  #5  
Old 01-28-2004, 05:31 PM
-Ramirez- -Ramirez- is offline
Registered User
Join Date: Jun 2002
Location: USA, Ohio
Posts: 729
-Ramirez- has a spectacular aura about-Ramirez- has a spectacular aura about
I asked Stefan about this before. Tokenize2 shouldn't count spaces as a delimiter at all times. He said it should be fixed in 3.1.
__________________
Kat
Reply With Quote
  #6  
Old 01-28-2004, 06:18 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
#I() and stuff probably will not work, I think multiple words in one comma seperated string need to be enclosed by ""-quotes.
Reply With Quote
  #7  
Old 01-28-2004, 06:38 PM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally posted by Loriel
#I() and stuff probably will not work, I think multiple words in one comma seperated string need to be enclosed by ""-quotes.
Yep thanks to Loriel it works. I used #I and sarraylen at first, but it turned out to be just like tokenize, and then I saw Loriel's post and added in "" to the string and again also using #I and arraylen and it works! =)
__________________
Reply With Quote
  #8  
Old 01-31-2004, 07:22 PM
wonderboysp2p wonderboysp2p is offline
Registered User
wonderboysp2p's Avatar
Join Date: Sep 2002
Location: -Wonderboy
Posts: 537
wonderboysp2p is on a distinguished road
Send a message via AIM to wonderboysp2p
Quote:
Originally posted by -Ramirez-
I asked Stefan about this before. Tokenize2 shouldn't count spaces as a delimiter at all times. He said it should be fixed in 3.1.
i mentioned that earlier.. maybe it was to stefan or maybe it was on the forums, but until then!! use quotes, like loriel said
__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
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 07:30 PM.


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