PDA

View Full Version : AI - About myself.boss anf float


Kirikups
12.02.2006, 00:58
Greetings,

coding some AI i used:

myself.boss.hp
myself.boss.max_hp

and i have no error when i compil, but i would like to know if maybe someone can tell me that syntax is really correct or ignored by compiler, i want my NPC as a Minion checking his master stats, and if he has (master) hp < max_hp/2 then he will heal him...

In other part i would like to check NPC and PC levels to decrease some parameter:


in MyParameter = 100;
...
i0 = 1;
if ((myself.sm.level / attacker.level) < 1) {
i0 = (myself.sm.level / attacker.level);
}
...
Result = MyParameter * i0;

It seems like Results is always 0 and never 0,XXX

Tx for your help, i have some doubts because of myself.sm and myself.sm.level syntax :)

hr
12.02.2006, 08:44
use f0 instead of i0

Kirikups
12.02.2006, 17:25
tx a lot, i think i understood :)