Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-10-2010, 12:25 PM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Retrieving a subarray?

Assuming I even know what I'm talking about, I've run into a problem where I cant seem to get the npcserver to check arrays within an array.

for example:
PHP Code:
function onCreated(){
  
this.somearray = {temp.otherarray1,temp.otherarray2,};
  
temp.otherarray1 = {"a","b","c",};
  
temp.otherarray2 = {"1","2","3",};
}

function 
doCheckStuff(){
  if(
"b" in this.somearray){
    
player.chat "It's there!";
  }
  else{
    
player.chat "Couldn't find it...";
  }

So when I call doCheckStuff(), it either won't want to check the entire array. or itll list it like -if i decided to send it to rc- something like this:
PHP Code:
NPC-Server (Server): "a,b,c","1,2,3" 
(Except, of course, when i use it with strings, dozens of additional quotation marks are thrown around seemingly haphazardly in what sendtorc returns.)

I could do something like if("b" in this.somearray[0]) but then theres the obvious problem that it wont check this.somearray[1]. Any advice?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 08:08 AM.


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