Jump to content

[LE] New to Scripting, how to make a Dwemer Pipe Valve activate running water


Recommended Posts

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

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's

or 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.com
ObjectReference Property Marker Auto
;
Event OnInit()
If(Marker.IsDisabled())
GoToState("Disable")
Else
GoToState("Enable")
EndIf
EndEvent
;-----------------------
State Disable
Event OnBeginState()
Marker.Disable()
EndEvent
Event OnActivate(ObjectReference akActionRef)
If(Marker.IsDisabled())
GoToState("Enable")
Else
GoToState("Disable")
EndIf
EndEvent
EndState
;-----------------------
State Enable
Event OnBeginState()
Marker.Enable()
EndEvent
Event OnActivate(ObjectReference akActionRef)
If(Marker.IsDisabled())
GoToState("Enable")
Else
GoToState("Disable")
EndIf
EndEvent
EndState
;

 


This is a generic double fault script. It can be used over and over even with mutable switches

for the same task (exp: you want two switches doing the same thing on the same XMarker).

Edited by NexusComa
Link to comment
Share on other sites

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's

or 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.com

ObjectReference Property Marker Auto

;

Event OnInit()

If(Marker.IsDisabled())

GoToState("Disable")

Else

GoToState("Enable")

EndIf

EndEvent

;-----------------------

State Disable

Event OnBeginState()

Marker.Disable()

EndEvent

Event OnActivate(ObjectReference akActionRef)

If(Marker.IsDisabled())

GoToState("Enable")

Else

GoToState("Disable")

EndIf

EndEvent

EndState

;-----------------------

State Enable

Event OnBeginState()

Marker.Enable()

EndEvent

Event OnActivate(ObjectReference akActionRef)

If(Marker.IsDisabled())

GoToState("Enable")

Else

GoToState("Disable")

EndIf

EndEvent

EndState

;

 

 

This is a generic double fault script. It can be used over and over even with mutable switches

for 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

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 by NexusComa
Link to comment
Share on other sites

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 by NexusComa
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...