Greetings Vault Community, I’m currently beating my head against the wall trying to understand why the following script is not working. Basically, it’s just a simple lever that has the OnUsed Event to Unlock and Open a gate. For whatever reason, I am unable to get it to work, and I’m not sure what I’m missing since it seems like a relatively mundane thing to do, so I’m wondering if there’s something buggy about certain doors. I do have the appropriate tag set for the door:
void main()
{
object oPortcullis;
object oSound;
// Get the creature who triggered this event.
object oPC = GetLastUsedBy();oPortcullis = GetObjectByTag("FE_Portcullis"); // Animate lever. PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE); DelayCommand(1.0, PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)); oSound = GetObjectByTag("MillWheel"); DelayCommand(2.0, SoundObjectSetVolume(oSound, 127)); DelayCommand(2.2, SoundObjectPlay(oSound)); // Make changes to the sound object "MillWheel. DelayCommand(6.0, SoundObjectStop(oSound)); SetLocked(oPortcullis, FALSE); AssignCommand(oPortcullis, ActionOpenDoor(oPortcullis));
}
In another area of my module, I use this script to open two gates at once and it works fine:
void main()
{
object oTarget;
object oTarget2;
object oTarget3;
// Get the creature who triggered this event.
object oPC = GetLastUsedBy();// Unlock and open "FE_Portcullises". oTarget = GetObjectByTag("FE_Portcullis1"); oTarget2 = GetObjectByTag("FE_Portcullis2"); // Animate the lever. PlayAnimation(ANIMATION_PLACEABLE_ACTIVATE); DelayCommand(1.0, PlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE)); oTarget3 = GetObjectByTag("MillWheel2"); DelayCommand(2.0, SoundObjectSetVolume(oTarget3, 127)); DelayCommand(2.2, SoundObjectPlay(oTarget3)); // Make changes to the sound object "MillWheel. DelayCommand(6.0, SoundObjectStop(oTarget3)); SetLocked(oTarget, FALSE); SetLocked(oTarget2, FALSE); AssignCommand(oTarget, ActionOpenDoor(oTarget)); AssignCommand(oTarget2, ActionOpenDoor(oTarget2));
}