NyxDagoneart Posted July 26, 2016 Share Posted July 26, 2016 Hello, I'm really new to scripting the whole thing seems a bit like rocket science, but anyway, Im trying to make it so when the player activates the valve it causes water to poor out of a pipe. Looking around online I've seen some "light switch" scripts that I think that could be rewritten to be a water on and off function, but I am not sure what that would even look like. thank you! Link to comment Share on other sites More sharing options...
NexusComa Posted July 26, 2016 Share Posted July 26, 2016 (edited) Hello, this is kind of complicated to explain. I'll try to make it short, sweet and simple.There are a few ways to do this but I like my way, as once you understand it,it can be used in pretty much any case like this. It also don't use Keywords, Global'sor Linked References (and most of all it will never fail). Here is the set up ... You can search for XMarker to find the red X marker. (note: the XMarker is set to Initially Disabled).I used FXWaterfallThin512x64 and FXSplashSmallParticles ... http://i.imgur.com/tc8VeAg.png #1. Add the script to the valve ...http://i.imgur.com/tdodzgC.png #2. Select the XMarker as the "Marker" script property ... http://i.imgur.com/qqrqSg8.jpg #3. From the object (in this case the waterfall), from the Enable Parent Tab select the XMarker ...(notice the object is set to Initially Disabled like the XMarker).http://i.imgur.com/GCEANDb.png That's it. You can add as many objects as you like the same way. Just set the Enable Parent to the same XMarker.(exp: the FxSplash from the water or some steam effects or a sound object like: AMBWaterfallSmallLP). Also: If you wish to get tricky you can leave a object enabled and check the box [ Set Enable State Opposite of Parent ].This will give you a two state valve/switch effect. What you see when it's on and what you see when it's off.(exp: the pipe has a closed end cap when it's not on). The box for [ Pop In ] does just that or it will fade in. The script.(replace "zzz" in the script name with an abbreviation of your mods name) Scriptname _zzz_EnableMarker extends ObjectReference;* Marker Enable/Disable * By: NexusComa * ; nexusmods.comObjectReference Property Marker Auto;Event OnInit() If(Marker.IsDisabled()) GoToState("Disable") Else GoToState("Enable") EndIfEndEvent;-----------------------State Disable Event OnBeginState() Marker.Disable() EndEvent Event OnActivate(ObjectReference akActionRef) If(Marker.IsDisabled()) GoToState("Enable") Else GoToState("Disable") EndIf EndEventEndState;-----------------------State Enable Event OnBeginState() Marker.Enable() EndEvent Event OnActivate(ObjectReference akActionRef) If(Marker.IsDisabled()) GoToState("Enable") Else GoToState("Disable") EndIf EndEventEndState; This is a generic double fault script. It can be used over and over even with mutable switchesfor the same task (exp: you want two switches doing the same thing on the same XMarker). Edited July 27, 2016 by NexusComa Link to comment Share on other sites More sharing options...
NyxDagoneart Posted July 27, 2016 Author Share Posted July 27, 2016 Hello, this is kind of complicated to explain. I'll try to make it short, sweet and simple.There are a few ways to do this but I like my way, as once you understand it,it can be used in pretty much any case like this. It also don't use Keywords, Global'sor Linked References (and most of all it will never fail). Here is the set up ... You can search for XMarker to find the red X marker. (note: the XMarker is set to Initially Disabled).I used FXWaterfallThin512x64 and FXSplashSmallParticles ... http://i.imgur.com/tc8VeAg.png #1. Add the script to the valve ... http://i.imgur.com/tdodzgC.png #2. Select the XMarker as the "Marker" script property ... http://i.imgur.com/qqrqSg8.jpg #3. From the object (in this case the waterfall), from the Enable Parent Tab select the XMarker ...(notice the object is set to Initially Disabled like the XMarker). http://i.imgur.com/GCEANDb.png That's it. You can add as many objects as you like the same way. Just set the Enable Parent to the same XMarker.(exp: the FxSplash from the water or some steam effects or a sound object like: AMBWaterfallSmallLP). Also: If you wish to get tricky you can leave a object enabled and check the box [ Set Enable State Opposite of Parent ].This will give you a two state valve/switch effect. What you see when it's on and what you see when it's off.(exp: the pipe has a closed end cap when it's not on). The box for [ Pop In ] does just that or it will fade in. The script.(replace "zzz" in the script name with an abbreviation of your mods name) Scriptname _zzz_EnableMarker extends ObjectReference;* Marker Enable/Disable * By: NexusComa * ; nexusmods.comObjectReference Property Marker Auto;Event OnInit() If(Marker.IsDisabled()) GoToState("Disable") Else GoToState("Enable") EndIfEndEvent;-----------------------State Disable Event OnBeginState() Marker.Disable() EndEvent Event OnActivate(ObjectReference akActionRef) If(Marker.IsDisabled()) GoToState("Enable") Else GoToState("Disable") EndIf EndEventEndState;-----------------------State Enable Event OnBeginState() Marker.Enable() EndEvent Event OnActivate(ObjectReference akActionRef) If(Marker.IsDisabled()) GoToState("Enable") Else GoToState("Disable") EndIf EndEventEndState; This is a generic double fault script. It can be used over and over even with mutable switchesfor the same task (exp: you want two switches doing the same thing on the same XMarker). Thank you so much! But Im haveing troubles getting the script to be created as it were. Here are some screen shots http://i156.photobucket.com/albums/t39/Adalariea/lakevuiewbathserro1.png http://i156.photobucket.com/albums/t39/Adalariea/lakeviewerrorerror2.png Link to comment Share on other sites More sharing options...
NexusComa Posted July 27, 2016 Share Posted July 27, 2016 (edited) Save it by the name you named it in the Data\Scripts\source folder, then compile it _Lvbs_EnableMarker.psc I'll wait here a bit ... let me know ... Edited July 27, 2016 by NexusComa Link to comment Share on other sites More sharing options...
NyxDagoneart Posted July 27, 2016 Author Share Posted July 27, 2016 Save it by the name you named it in the Data\Scripts\source folder then compile it _Lvbs_EnableMarker.pscThank you I was haveing the "Unable to find flags file: TESV_Papyrus_Flags.flg" and so I just extracted the Scripts.rar archive. Link to comment Share on other sites More sharing options...
NexusComa Posted July 27, 2016 Share Posted July 27, 2016 (edited) So you got it now ?(i was kinda thinking that may happen) :P Edited July 27, 2016 by NexusComa Link to comment Share on other sites More sharing options...
NyxDagoneart Posted July 27, 2016 Author Share Posted July 27, 2016 I was testing it in game but I cant seem to get it to work :( Link to comment Share on other sites More sharing options...
NexusComa Posted July 27, 2016 Share Posted July 27, 2016 (edited) So you did get it to compile ?Go over the steps carefully ...Make sure the script is on the Valve.Make sure the scripts property [Marker] is set to the XMarker.Make sure the XMarker is set to Initially Disabled.Make sure the Objects (waterfall) is set like the pic above.Also when you add the script, I never see that box you showed about Conditional ...Remove the Script and try that part again ... now that the script is compiled. Use the [ Select Reference in Render Window Button ] then click on the XMarker when adding the Objects (like the waterfall) Are you going back to a save before the your mod was installed each time? Edited July 27, 2016 by NexusComa Link to comment Share on other sites More sharing options...
NyxDagoneart Posted July 27, 2016 Author Share Posted July 27, 2016 I got one of them to work, for some reason the blue arrow wont appear on the other like with the working one! http://i.imgur.com/ifNjl8E.png Link to comment Share on other sites More sharing options...
NexusComa Posted July 27, 2016 Share Posted July 27, 2016 (edited) All the objects should have arrows to the XMarker ... you do not have the enable parent set correctly ...(the valve will not show a blue line). Also ... if you have one working you got it ... just hold the Ctrl and click each part of the working one XMarker and all and press Ctrl+C to copy then Ctrl+V to paste ...The new set will have everything set to the new XMarker. Do you also have the audio objects set to the XMarker? Btw: that pic looks sweet, you got talent! Edited July 27, 2016 by NexusComa Link to comment Share on other sites More sharing options...
Recommended Posts