Hm, I have run into a weird issue, I can't delay the unequip animation no matter what I try. Here is my most recent attempt:
void ReallyPlayCustomAnimation(object oObject, string sAnimationName, int nLooping, float fSpeed = 1.0f)
{
PlayCustomAnimation(oObject, sAnimationName, nLooping, fSpeed);
}
void main()
{
object oPC = GetLastAttacker();
if (!GetIsPC(oPC))
return;
string sName = GetName(oPC);
SpeakString("I have been attacked by " + sName);
object oWeapon = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC);
string sWeapon = GetName(oWeapon);
string sTag = GetTag(oWeapon);
SpeakString("Attacker's weapon: " + sWeapon);
int nOldLoad = GetLocalInt(oWeapon, "nLoaded");
SendMessageToPC(oPC, "nLoaded is " + IntToString(nOldLoad));
SetLocalInt(oWeapon, "nLoaded", 0);
int nNewLoad = GetLocalInt(oWeapon, "nLoaded");
SendMessageToPC(oPC, "nLoaded is now " + IntToString(nNewLoad));
AssignCommand(oPC, ClearAllActions(TRUE));
DelayCommand(1.0, ActionDoCommand(ReallyPlayCustomAnimation(oPC, "*equipW", 0, 0.2)));
DelayCommand(1.3, AssignCommand(oPC, ActionUnequipItem(oWeapon)));
}
No matter what I do, the unequip animation always fires right after the attack, nothing seems to create a delay. I've tried sticking it in the action queue and using delay command by itself, but nothing seems to work. What am I missing?
Thanks,
Matt