![]() |
Tokenize
What is wrong with this? This is my first time with tokenize and I am needing help
NPC Code:if (timeout) { |
The command tokenize doesn't accept arguments. Put bluntly, no commas. Also, I'd use startswith instead of strcontains: it means that saying "Oh, yeah, you just say setred to do that" won't trigger the script. What exactly are you trying to do?
|
Re: Tokenize
Quote:
|
Quote:
NPC Code:// NPC made from ZicklePop Productions Updated |
Quote:
setred = #t(0) |
Regular tokenize does not accept parameters...
tokenize2 string,params |
if (playerchats&&startswith(setred,#c)){
tokenize #c; this.red = strtofloat(#t(1)); } NPC Code: That should be enough examples..... |
LOL, I don't use tokenize much, but wouldn't it just be easier to use variables?
if (playerchats&&startswith(#c,setred)) this.color=red; if (this.color==red) ACTION; or perhaps use numbers instead of words? ---Shifter |
Quote:
you can not save word values to variables... |
It looks like you have a grasp of it, but it looks like something is wrong with your description. Tokenize itself will split a string into parts seperated by spaces and commas.
setstring string,hello world; tokenize #s(string); and tokenize hello world; will both give you 2 tokens #t(0) = hello #t(1) = world tokenize2 will add extra delimeters (delimeters are the letters or characters that the tokens will be split, this is ADDED to the 2 default ones: spaces and commas) so tokenize2 -,hello-world,foo=bar; or setstring string,hello-world,foo=bar; tokenize2 -,#s(string); will both give you 3 tokens. #t(0): hello (which uses your extra delemiter "-" ) #t(1): world (which is sperated by the default comma delimeter) #t(2): foo=bar (which is the last token) In response to adams information that you do not need a #s() for tokenize2. That is a confusing statment. Any valid string parameter in the syntax of any script in graal is viable to use the #s() message code. |
Whats the #s() for/do?
|
Quote:
Sorry. I don't get your meaning. Nice of you to offer a second explanation from a different point of view I guess..... I thought mine was a fine explanation though. |
........
gees....
if you use #t (0) you have to use #t (1) in it 2 XD else it wont reconize the string of the value of the blah blah blah i like to talk this way :D |
anything you do with strings (message code) you will always use #s()....
|
NPC Code: |
All times are GMT +2. The time now is 11:01 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.