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 04-01-2006, 09:58 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Wtf!? Passing arrays

Alright, so..
I have an NPC weapon that parses a string into a multi-dimensional array, then sends it to the serverside.
It was working fine.
I relogged and it broke.

PHP Code:
function onActionServerside() {
  
player.chat params[1];
}
//#CLIENTSIDE
triggeraction(0,0,"serverside",name,"useitem",ParseMods(emods(item)),item);
function 
ParseMods(mods) {
  
temp.mods.tokenize();
  
temp.willreturn = new[temp.t.size()];
  for (
temp.modcounttemp.t) {
    
temp.newmod temp.modcount.tokenize(":");
    for (
temp.addmodtemp.newmod) {
      
temp.willreturn[temp.t.index(modcount)].add(temp.addmod);
    }
  }
  return 
temp.willreturn;

If I set my chat to ParseMods(emods(item))[0] in the clientside, it sets my chat to 'addhpp,.3'
ParseMods(emods(item))[0][0] returns 'addhp'
It's parsing it fine.

However, when it tries to read params[1] in the serverside, it gives me 1.
Just 1. There's nothing else. params[1].size() is 0.
I know it's possible to pass arrays through triggeractions, as I've done it before.

Any help?
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 02:22 PM.


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