Jump to content

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


Recommended Posts

I got it to work by doing this:

 

http://i.imgur.com/dvemDH9.png

 

 

Both work now and thank you so much for your help!

 

Would you perhaps mind helping me with another script I want to use with this mod?

 

I Want to set a door on a timer so that when the player unlocks and opens it, the door, after a certain amount of time will close and re lock itself

Link to comment
Share on other sites

Ya, that's not the way I'm doing it ... You must not have script property [maker] set to the XMarker ... pic #2

 

http://i.imgur.com/TIqQK3F.png

 

This is not the Valve pic but it's showing you where the Properties button is.

Now Look back at pic #2 and make it look like that ...

Edited by NexusComa
Link to comment
Share on other sites

Yes, now remove that Active Parent setting. From your last pic.

All that is being handled in the script ...

 

Make sure the XMarker is set to Initially Disabled.

 

If you google this stuff they will show you the other way.

Which would be fine if the script was different ...

However that way fails sometimes and we don't want that.

Edited by NexusComa
Link to comment
Share on other sites

Hmmm ... :tongue:

 

Glad you have it working. You will find this little script and set up to be very powerful. The real trick here is we are letting the XMarker itself be the saved variable (or Keyword)

since the XMarker can only be enabled or disabled and the script will self correct no mater what it is the switch will never fail. Nothing hurts more then downloading a mod

and the switches don't work at all. The way you had it with Active Parent and no Keyword set to remember where it was last save it would start to fail on reloads.

Also when players get click happy it can throw everything off. Depending on how the script was wrote this can break the switch ... you see that over and over in other mods.

 

This setup will work with anything too ... lights, fires, mist anything you want. With the reverse setup I talk about in the 1st post you can do amazing things with it.

Also, one really cool thing about this setup is you could go ahead and add a 2nd switch or valve in this case with the same script aimed at the same XMarker

and they both will work fine with each other. Never messing up the on and off ... The other way of doing this will never be able to do that and not fail over time.

 

One last thing ... sometimes you can see a small flash when objects switch so, try to put the switch or valve in a spot they can't see the change so easy

(like face them the other way to turn the valve). Anyways bla bla bla ... have fun!

Edited by NexusComa
Link to comment
Share on other sites

It has no check for who is activating it in that script.

Need to add a few lines for a player only activate version.

 

Like this ...

 

 

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 akActionRef == Game.GetPlayer()
If(Marker.IsDisabled())
GoToState("Enable")
Else
GoToState("Disable")
EndIf
EndIf
EndEvent
EndState
;-----------------------
State Enable
Event OnBeginState()
Marker.Enable()
EndEvent
Event OnActivate(ObjectReference akActionRef)
If akActionRef == Game.GetPlayer()
If(Marker.IsDisabled())
GoToState("Enable")
Else
GoToState("Disable")
EndIf
EndIf
EndEvent
EndState
;

 

Link to comment
Share on other sites

A few other versions of the same script.

 

Timed Toggle version ...

Enables XMarker for a stated time then Disables it.

 

 

Scriptname _zzz_EnableMarkerTimeToggle extends ObjectReference
;* Marker Enable/Timed Disable * By: NexusComa * ; nexusmods.com
ObjectReference Property Marker auto
Float property Time auto
;
Event OnInit()
GoToState("Disable")
EndEvent
State Disable
Event OnBeginState()
Marker.Disable()
EndEvent
Event OnActivate(ObjectReference akActionRef)
GoToState("Enable")
EndEvent
EndState
;-----------------------
State Enable
Event OnBeginState()
Marker.Enable()
Utility.Wait(Time)
GoToState("Disable")
EndEvent
EndState
;

 

 

 

Three Way Toggle Version ...

Toggle other 2 Disabled when one is Enabled.

(this one has 3 buttons/switches and 3 XMarkers)

 

 

Scriptname _zzz_EnableMarker3wayToggle extends ObjectReference
;* Marker Enable/Disable three way toggle * By: NexusComa * ; nexusmods.com
ObjectReference Property Marker Auto
ObjectReference Property MarkerA Auto
ObjectReference Property MarkerB 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()
MarkerA.Disable()
MarkerB.Disable()
EndEvent
Event OnActivate(ObjectReference akActionRef)
If(Marker.IsDisabled())
GoToState("Enable")
EndIf
EndEvent
EndState
;

 

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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