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(i = 0; i < passedeffects.tokenize(",").size(); i ++){
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.