I would like to set the AI_CUSTOM_AI_ACTIVE variable to 1 via a script but i don't know the syntax or function for it.
I was also wondering how the EVENT_TYPE_HANDLE_CUSTOM_AI works.
setting a variable of a creature through scripting
Débuté par
gordonbrown82
, sept. 14 2010 04:49
#1
Posté 14 septembre 2010 - 04:49
#2
Posté 15 septembre 2010 - 03:59
SetLocalInt() is the function you want. SetLocalInt(creature,"AI_CUSTOM_AI_ACTIVE",TRUE);
Basically, each combat round, that event will be sent to the creature script if that variable is true. You can just plop some logic in there to make your creature use abilities or whatever. You might want to take a look at the DetermineCombatRound family of functions to get an idea of what to do, which the game uses to do the normal combat AI. The Light variant just does autoattacks on nearby things, the Partial is for a player responding to being attacked, and Full is for everything else.
Basically, each combat round, that event will be sent to the creature script if that variable is true. You can just plop some logic in there to make your creature use abilities or whatever. You might want to take a look at the DetermineCombatRound family of functions to get an idea of what to do, which the game uses to do the normal combat AI. The Light variant just does autoattacks on nearby things, the Partial is for a player responding to being attacked, and Full is for everything else.





Retour en haut






