Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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:56 PM.


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