Did you implement some kind of way for the script to wait until the passage has been filled/emptied? The script I posted didn't contain that, but I did place comments where such measures had to be taken (lines 27 and 33 in the original version). Otherwise the script will immediately call BlockActivation(False) on the door, which should be possible to open once the passage has been filled/emptied, and resulting in the problem you are encountering. You could either wait a static amount of time (Utility.Wait(X), where X is a float value) or use a while-loop to check if the water plane is in a certain position or within a certain distance from the marker it is moving towards.
EDIT: Assuming that the translation speed is in CK's length units per second, then you could probably use a function like this:
Float Function GetTranslationTime(ObjectReference akFirst, ObjectReference akSecond, Float afTranslationSpeed) If((akFirst != None) && (akSecond != None) && (afTranslationSpeed > 0.0)) Float fDistance = akFirst.GetDistance(akSecond) Return fDistance / afTranslationSpeed Else Return 0.0 EndIfEndFunction
Then call Utility.Wait(GetTranslationTime(kWaterPlane, kEmptiedMarker, fTranslationSpeed)) and the same, but with kFloodedMarker as the second parameter. The result would be:
Spoiler Scriptname AirlockPump Extends ObjectReferenceObjectReference Property kWaterPlane Auto ;The water plane that is moved up and down to fill/empty the passage with/of waterObjectReference Property kExternalDoor Auto ;The outer doorObjectReference Property kInternalDoor Auto ;The inner doorObjectReference Property kFloodedMarker Auto ;The marker that sets the point where the plane of water should be at when the passage is filled with waterObjectReference Property kEmptiedMarker Auto ;The marker that sets the point where the plane of water should be when the passage is emptied of waterFloat fTranslationSpeed = 2.5 ;The speed at which the plane of water is moved between the two markers (current value is a random value)Bool bFlooded = TrueBool bProcessingInputEvent OnInit() kWaterPlane.TranslateToRef(kFloodedMarker, fTranslationSpeed) kInternalDoor.BlockActivation()EndEventEvent OnActivate(ObjectReference akActionRef) If(!bProcessingInput) bProcessingInput = True Self.BlockActivation() If((kExternalDoor.GetOpenState() == 3) && (kInternalDoor.GetOpenState() == 3)) If(bFlooded) bFlooded = False kExternalDoor.BlockActivation() kWaterPlane.TranslateToRef(kEmptiedMarker, fTranslationSpeed) Utility.Wait(GetTranslationTime(kWaterPlane, kEmptiedMarker, fTranslationSpeed)) kInternalDoor.BlockActivation(False) Else bFlooded = True kInternalDoor.BlockActivation() kWaterPlane.TranslateToRef(kFloodedMarker, fTranslationSpeed) Utility.Wait(GetTranslationTime(kWaterPlane, kFloodedMarker, fTranslationSpeed)) kExternalDoor.BlockActivation(False) EndIf EndIf Self.BlockActivation(False) bProcessingInput = False EndIfEndEventFloat Function GetTranslationTime(ObjectReference akFirst, ObjectReference akSecond, Float afTranslationSpeed) If((akFirst != None) && (akSecond != None) && (afTranslationSpeed > 0.0)) Float fDistance = akFirst.GetDistance(akSecond) Return fDistance / afTranslationSpeed Else Return 0.0 EndIfEndFunction
Using a while-loop to check whether or not the water plane has reached its destination could also be used to make the script wait. There's more than one way to skin a cat.