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-22-2011, 01:22 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Quick help with a small script.

I had this old section of script that was giving me problems. Eventually I tore it down and rescripted the section, making it much much smaller as well as making it far more compatible with my current systems. However the problem I experienced before seems to have popped up once again. The issue is that for example, if I send through as the variable passedeffects:
"100:cause:Bleed:3:auto:460:bleed","75:cause:Disea se:15:auto:-15,120:spread_disease"
edit: I'm not sure why the forums are putting a space in "Disease" but disregard that.

only the first thing will be returned if I do:
echo(effect);

In this case in F2 I will only get:
"100:cause:Bleed:3:auto:460:bleed"
and not the other effect. Naturally, this means that the script is not processing the rest of the line. However, when I do:
echo(passedeffects);
on the same line, all effects will be outputted to F2.

In short, not matter how many buffs I send through, it will only ever use the first one on the list.
I'm sure it's some silly thing that I've been overlooking for the past two days, but perhaps one of you guys can help me figure out exactly what it is.
Here is the script:

PHP Code:
for(0passedeffects.tokenize(",").size(); ++){
    
temp.effect passedeffects.tokenize(",")[i].tokenize(":");
    
temp.effectroll random(0,100);
    if(
effectroll <= effect[0] && effect[1] == "cause"){
      
BuffSystem.addbuff(effect[2],effect[3],effect[4],effect[5],effect[6]);
    }
  } 
Any help is greatly appreciated.
__________________
MY POSTS ARE PRONE TO EDITS!

Last edited by Jiroxys7; 04-22-2011 at 02:44 AM..
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 11:57 AM.


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