So after seeing that entry 26 (guard_attention) in ambient_ai.xls was to be used via a trigger. So, I quickly wrote up a script that would use Ambient_Override to temporarily change a specified number of creatures with a specified tag come to attention upon the PC entering...
case EVENT_TYPE_ENTER:
{
object oCreature = GetEventCreator(ev);
if (oCreature == oPC)
{
object[] oGuard;
int maxGuards = GetLocalInt(OBJECT_SELF, TRIG_TALK_SET_FLAG);
PrintToLog("tswtr_salute: Creatures with tag: " + GetLocalString(OBJECT_SELF, TRIG_TALK_SET_PLOT) + " should salute." );
PrintToLog("tswtr_salute: There are " + IntToString(maxGuards) + " creatures specified to salute." );
oGuard = GetNearestObjectByTag(oPC,
GetLocalString(OBJECT_SELF, TRIG_TALK_SET_PLOT),
OBJECT_TYPE_CREATURE,
maxGuards);
int loop;
for (loop = 0; loop < maxGuards; loop++)
{
PrintToLog("tswtr_salute: Creature with tag: " + GetLocalString(OBJECT_SELF, TRIG_TALK_SET_PLOT) + " should start saluting now." );
if (IsObjectValid(oGuard[loop]))
{
//Ambient_Stop(oGuard[loop]);
Ambient_OverrideBehaviour(oGuard[loop], 26, -1.0, 5);
Ambient_Animate(oGuard[loop]);
//Ambient_Start(oGuard[loop]);
}
}
}
break;
}
Unfortunately, it doesn't work. I initially just had the Override line in, but that didn't work, so I started fiddling with the other commands to try and make it work. If anyone has had any success getting this to work (or remembers in the main campaign where this behaviour occurs so I can look at it), I'd love to here from you.
Ambient_OverrideBehaviour
Débuté par
AmstradHero
, août 28 2010 02:28
#1
Posté 28 août 2010 - 02:28
#2
Posté 04 septembre 2010 - 12:46
Have you tried it with a different animation to check your basic code is working? For example I changed the AMBIENT_ANIM_PATTERN_OVERRIDE to 26 on one of my ambient triggers but it didn't have any effect: neither my "shopper" nor the "merchant" jumped to attention.
#3
Posté 25 septembre 2010 - 02:38
You're quite right. It seems that this animation doesn't actually do what it appears to suggest. There is also an existing global ambient trigger that will serve the purpose of making NPCs perform a particular animation. However, it only seems to fire once. Changing ambient animations reliably appears to be a difficult task.
#4
Posté 07 octobre 2010 - 08:31
If you are working on your custom module, have you enabled the ambient behaviour of the creatures by setting their Variable AMBIENT_SYSTEM_STATE?
Read the wiki article about overriding ambient behaviour.
Another thing you have to take count of, is that creatures can perform animations grouped by Blend trees defined in APR_base.gda.
In fact, the main reason because in APR_base there are many Human appearances, is to handle different behaviours. In the column AMBIENTOVERRIDE they have different Blend tree group to allow them performing specific animation (library, servant and so on).
Download the animation worksheets from this project for a better understanding.
Read the wiki article about overriding ambient behaviour.
Another thing you have to take count of, is that creatures can perform animations grouped by Blend trees defined in APR_base.gda.
In fact, the main reason because in APR_base there are many Human appearances, is to handle different behaviours. In the column AMBIENTOVERRIDE they have different Blend tree group to allow them performing specific animation (library, servant and so on).
Download the animation worksheets from this project for a better understanding.
Modifié par Nattfodd, 07 octobre 2010 - 08:31 .





Retour en haut






