PDA

View Full Version : AI and level controls


Kirikups
08.02.2006, 01:50
Hello,

i have a little problem compiling a part of a code:

class MyClass : ParentClass
{
parameter:
float MyVar = 50;


handler:
EventHandler SPELLED(speller, skill_name_id)
{
if ((myself.sm.level / speller.level) < 1) {
MyVar = MyVar * (myself.sm.level / speller.level);
}

}
}

i get an error on the line:

MyVar = MyVar * (myself.sm.level / speller.level);

wtf, i want to decrease MyVar is PC is higher level than NPC... Impossible ?? Ty for any help :)

hr
08.02.2006, 03:33
you can't change parameters, use built-in variables instead

archy
08.02.2006, 05:54
handler:
EventHandler SPELLED(speller, skill_name_id,c1)
{
if ((myself.sm.level / speller.level) < 1) {
c1 = c1 * (myself.sm.level / speller.level);
}

}
}

Kirikups
08.02.2006, 11:29
tx for your answer :)

hr
08.02.2006, 13:23
actually cX are CreatureData variables, you should use fX variables in this example

Kirikups
08.02.2006, 14:24
yes you are right, i used i0 and it works great now, tx a lot fo your advices :)