![]() |
AI - How join SEE_CREATURE() and TIMER_FIRED() ?
Hello all,
i woudl like to link EventHandler SEE_CREATURE(creature) and EventHandler TIMER_FIRED() then i wrote: Code:
EventHandler SEE_CREATURE(creature)Regards :) |
Convert b to int before store in a
ex : myself.i_ai1 = FloatToInt(creature.x); i think will work |
Success!!!
Tx a lot for your help :P |
Here my code:
Code:
EventHandler SEE_CREATURE(creature) |
seems nice...
as i still want to learn about ai, i'd love to know what myself.i_ai0 and myself.c_ai0 are used for... also, why is do you check if its NOT a creature if you are going to make it one... i'm talking about this code: [...]if ((myself.c_ai0 != creature)[...] myself.c_ai0 = creature;[...] thanks in advance :) |
i wrote
[...]if ((myself.c_ai0 != creature)[...] myself.c_ai0 = creature;[...] because i suppose creature is a pointer to the pc address: void CNPC::SeeCreature(CSharedCreatureData* spCreature) i supposed naturally having to save it in myself.c_ai0 to be able to recall that address in the TIMER_FIRED() handler ... i didnt find any TIMER_FIRED(creature) sample in NASC samples files, and it is normal since that handler is not launched by a creature but by SetTimerPeriod function Correct me if i am wrong :) |
cant correct you thats why i asked :P
well thanks... thinks i understood it now^^ |
btw i tested this code with a summoned mob + setai and it doesnt work :?
|
| All times are GMT. The time now is 15:21. |