-
Loop problem
I probably made some dumb mistake with the loop. I can't find whats wrong though (loops hate me).
PHP Code:
//set up passive abilitys
var passive:Array = [counter,
reflect,
reflect2,
hpdrain,
mpdrain,
atkhp,
atkmp,
damagemp,
hitmp,
ulthp,
ultmp,
mpusehp,
ultusehp,
ultusemp,
poisonheal,
bleedheal,
guard,
atkdebuff,
atk2debuff,
defdebuff,
def2debuff,
spddebuff,
evddebuff,
accdebuff,
poison,
bleed,
burn,
freeze,
stun,
sleep,
silence,
death,
autoatk,
autoatk2,
autodef,
autodef2,
autospd,
autoevd,
autoacc,
autoregen,
poisonproof,
bleedproof,
burnproof,
freezeproof,
stunproof,
sleepproof,
silenceproof,
deathproof,
ultboost,
hpdamagescale,
mpdamagescale,
ultdamagescale]
function statcalc:void{
for (var a:uint = 1, a < 5, a++){
for (var b:uint = 0, b < passive.length - 1, b++){
var "p"+a+"pass"+passive[b]=0
}
var "p"+1a+"hpmax":uint = (number("p"+1a+"atk")+number("p"+1a+"matk")+number("p"+1a+"def")+number("p"+1a+"mdef")+number("p"+1a+"spd")+number("p"+1a+"evd")+number("p"+1a+"acc"))
}
}
-
What exactly are you trying to do?
-
 Originally Posted by ilike2
What exactly are you trying to do?
the part within the function arent working and I think the function might be the problem
This is the main concern
PHP Code:
function statcalc:void{ for (var a:uint = 1, a < 5, a++){ for (var b:uint = 0, b < passive.length - 1, b++){ var "p"+a+"pass"+passive[b]=0 } var "p"+1a+"hpmax":uint = (number("p"+1a+"atk")+number("p"+1a+"matk")+number("p"+1a+"def")+number("p"+1a+"mdef")+number("p"+1a+"spd")+number("p"+1a+"evd")+number("p"+1a+"acc")) } }
The rest is a bit redundant
Last edited by Neko303; 07-18-2010 at 09:27 AM.
Reason: typo
-
solved most of them
PHP Code:
function statcalc():void{ for (var a:uint = 1; a < 5; a++){ for (var b:uint = 0; b < passive.length - 1; b++){ var "p"+a+"pass"+passive[b]:uint=0 } var "p"+a+"hpmax":uint = undefined } }
I just get this now
1084: Syntax error: expecting identifier before p. var "p"+a+"pass"+passive[b]:uint=0
1084: Syntax error: expecting identifier before p. var "p"+a+"hpmax":uint = undefined
Last edited by Neko303; 07-18-2010 at 09:51 AM.
-
That's no wonder you're getting this type of errors.
You cannot put string after a keyword var.
This is an illegal line:
Actionscript Code:
var "p"+a+"hpmax":uint = undefined
It would be easier to say what's wrong if we knew exactly what you want from this loop..
Maybe you meant to say: ?
Last edited by caseyryan; 07-18-2010 at 12:39 PM.
-
Im trying to set up a variable not trace something D:
P.S. I should mention I already fixed the loop
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|