I want to modify the ambient animation of an npc but I can't use his variables in the creature file because I'm spawning him through scripting + he's to be a follower so I don't want him to act like he's browsing books throughout the game
on the toolset wiki I found this:
The script sys_ambient_h contains the implementation of the ambient behaviour system. The AMBIENT_* local variables should never be directly modified at run-time. Instead, use the following functions to customize a creature's ambient behaviour through script.
// Normally this function is called automatically to begin or resume ambient behaviour when a
// creature perceives the player. However, it can be called explicitly to force a creature to begin
// performing ambient behaviour or, if nAmbientEnable is 1, to enable ambient behaviour on a creature.
void Ambient_Start(object oCreature = OBJECT_SELF, int nAmbientEnable = 0, int nMovePattern = 0, string sMovePrefix = "");
// Normally this function is called automatically to pause ambient behaviour after the party has
// been out of the creature's sight for a while. However, this function can be used to force a
// creature to temporarily cease ambient behaviour. Note that the creature will automatically
// resume ambient behaviour when it perceives the player again.
void Ambient_Pause(object oCreature = OBJECT_SELF, int bCheckVisibility = TRUE);
// Turns off ambient behaviour on a creature. The creature will resume ambient behaviour only
// after Ambient_Start() is called.
void Ambient_Stop(object oCreature = OBJECT_SELF);
// Overrides the ambient animation pattern and animation frequency defined by the creature's template.
void Ambient_OverrideBehaviour(object oCreature, int nAnimPattern, float fAnimFreq);
// Restores a creature's ambient animation behaviour to that defined in the creature's template.
void Ambient_RestoreBehaviour(object oCreature);
A couple of questions:
1) I used this: Ambient_OverrideBehaviour(oMaethan, 69, 0.0f, 0);;
Nothing happens, but I'm not sure how to define fAnimFreq
2) What's the values of fAnimFreq
The wiki doesn't say which values are possible for float fAnimFreq, I thought it might have to with ths
Animation frequency. The part left of the decimal specifies the minimum and the part right of the decimal specifies the maximum number of random animations to play during an animation phase. So, for example, a value of 1.3 will play between 1 and 3 random animations from the animation pattern listed in ambient_ai.xls. A value of -1.0 plays all animations in the animation pattern in the order they are listed in ambient_ai.xls. Animation pattens that are highlighted in green on the worksheeet should always be played in order (i.e. AMBIENT_ANIM_FREQ is -1.0).
I don't want to play any random animations, only the one I specified.
Thanks for any help
Modifié par LukaCrosszeria, 02 février 2011 - 10:33 .





Retour en haut






