Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   AI and level controls (https://postpacific.loc-online.com/showthread.php?t=3278)

Kirikups 08.02.2006 01:50

AI and level controls
 
Hello,

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

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:

Code:

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 :)


All times are GMT. The time now is 15:40.