View Single Post
  #1  
Old 08-22-2011, 01:07 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is just really niceTricxta is just really nice
Just wondering if this is possible

Hey guys,

Im trying to learn GS2 now and im making some system that will read a string then spit out some data according to it.

So an example of what i'm trying to do is:

I want to get the information from a particular string but the program doesn't know what strings its going to receive so a predefined array is useless.

PHP Code:
clientr.some_weapon_ 
starts the string and this much I know, I also know that the weapon corresponding to the string ends with the same characters as the string.
So the weapon name could be weapons/bat and the string could be clientr.some_weapon_bat

So to construct the string I need I would do:
PHP Code:
temp.wname="bat";
temp.sname="clientr.some_" temp.wname
But now the actual problem... how would I tokenize the string to give me the value of client.some_weapon_bat ?

I've tried doing
PHP Code:
temp.wname="bat";
temp.sname="clientr.some_" temp.wname;
temp.tokens=temp.sname.tokenize(); 
But that didn't work... So is what i'm trying to do actually possible and if so how?
Reply With Quote