jlghost117 Posted August 31 Author Share Posted August 31 Ok so i did get it to work by making a custom script that i applied to the switch and only the switch however it still requires the moveable water activator. Link to comment Share on other sites More sharing options...
jlghost117 Posted August 31 Author Share Posted August 31 Scriptname ccrp_WaterSwitchScript extends ObjectReference Conditional ObjectReference Property WaterSwitch Auto Const Int Property Status Auto Conditional Float Property WaterLevelFlooded Auto Const { Water level (height) when flooded } Float Property WaterLevelDrained Auto Const { Water level (height) when drained } Float Property PumpSpeed Auto Const { Rate of change (units per second) } ObjectReference[] Property WaterPlanes Auto Const { Array of water planes to effect } Bool Property InitiallyFlooded Auto Const { Set to true if chamber is initially flooded } Event OnActivate(ObjectReference AkActionRef) If AkActionRef == Game.GetPlayer() If Status == 0 TranslateWaterPlanes(WaterLevelFlooded) GotoState("Flooded") Status = 1 ElseIf Status == 1 TranslateWaterPlanes(WaterLevelDrained) GotoState("Drained") Status = 0 EndIf EndIf EndEvent Function TranslateWaterPlanes(Float targetZ) Int i = 0 ObjectReference wp ; remote event registration If (WaterPlanes.Length > 0) UnRegisterForRemoteEvent(WaterPlanes[0], "OnTranslationComplete") RegisterForRemoteEvent(WaterPlanes[0], "OnTranslationComplete") EndIf ; set keyframed motion type on all planes While (i < WaterPlanes.Length) wp = WaterPlanes wp.SetMotionType(wp.Motion_Keyframed) i += 1 EndWhile ; translate planes i = 0 While (i < WaterPlanes.Length) wp = WaterPlanes If (i > 0) wp.TranslateTo(wp.GetPositionX(), wp.GetPositionY(), targetZ - 0.1, wp.GetAngleX(), wp.GetAngleY(), wp.GetAngleZ(), PumpSpeed) Else wp.TranslateTo(wp.GetPositionX(), wp.GetPositionY(), targetZ, wp.GetAngleX(), wp.GetAngleY(), wp.GetAngleZ(), PumpSpeed) EndIf i += 1 EndWhile EndFunction Also Anyone know how i can add sounds to the script when the water is rising/falling? Link to comment Share on other sites More sharing options...
dferstat Posted September 11 Share Posted September 11 I'm sorry, but I've only just seen this thread. Have you seen niston's Forest Grove Water Lock? It has scripted water level changes, and sound effects. Link to comment Share on other sites More sharing options...
Recommended Posts