View Single Post
  #3  
Old 04-22-2011, 02:04 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quote:
Originally Posted by cbk1994 View Post
Multi-dimensional arrays are your friend.
I'm unsure whether you're hinting to the solution or questioning my use of :'s.

If you're hinting at the solution-
I'm pretty sure the problem line is:
temp.effect = passedeffects.tokenize(",")[i].tokenize(":");
I'm not sure why temp.effect isn't taking the entire array though. However, come to think of it, I've sometimes had to initiate the former as an array. In this case, I'd need to do something like:
PHP Code:
for(i=0;i<passedeffects.tokenize(",").size();i++){
  
temp.effect.add("");

before proceeding. However, I'll have to hold off on trying that until my other staff member logs on again so I can look at his F2 logs.

If you're questioning the use of :'s -
The reason why I use the :'s is simple. take the disease line.
"75:cause:Disease:15:auto:-15,120:spread_disease"

the section in bold is inserted by the buff system as an array. If I were to replace the :'s with ,'s, then I would have to create some new form of separation or else the 120 would go to the wrong section, and "spread_disease" would be entered into an invalid field. And personally, I like that look better than:
"75,cause,Disease,15,auto,-15:120,spread_disease" or something similar.
edit:again, don't know why it's putting weird spaces.
__________________
MY POSTS ARE PRONE TO EDITS!

Last edited by Jiroxys7; 04-22-2011 at 02:43 AM..
Reply With Quote