Jump to content

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


Recommended Posts

Anything that actually uses the valve triggers all the scripts on the valve. Take a look at pic #1, you will see there are 3 scripts.

 

The _zzz_EnableMarker, script is our marker enable/disable logic script. (enabling or disabling the XMarker in this case)

The DwePipeVaule01Script, script is the actual animation calls to the valve (the animations are held within the objects mesh).

The TrapLever, script is a set of variable used change what outcomes are possible from the switch. (and what type of switch it is)

Link to comment
Share on other sites

Yes, I understand that anyone using the valve will cause the scripts to trigger, but how do you get an npc to use the valve to turn on and then off again? Is there a way to do that? I understand the player can do that but don't know if npc can.

 

Very nice of you to help out in the forums with a scripts.

Edited by NexBeth
Link to comment
Share on other sites

NPC's tent to walk around stubbing on activators then activating them. Some things can

be scripted by setting down makers by the activators and some marker have predefined actions.

(exp: SearchChest marker)

 

I'm sure there is a way to do just what you're asking too ... I have never done that so off the top of my head I wouldn't know.

 

You may wish to open a new thread on this subject.

 

However:

http://www.creationkit.com/index.php?title=Dynamically_Attaching_Scripts

http://www.gamesas.com/dynamically-attaching-scripts-actors-near-the-player-t255702.html

https://forums.bethsoft.com/topic/1349649-dynamically-attaching-scripts-to-actors-near-the-player/

Edited by NexusComa
Link to comment
Share on other sites

I actually have one set up for npcs using a trigger box, but they can't activate a valve. I'm going to keep your info bookmarked for an opportunity to implement it using the player. I don't know how to script (yet). Thanks for sharing.

Link to comment
Share on other sites

  • 2 weeks later...

Hi, I'm trying to do this too, but I keep getting the "extends script does not exist" message, even after I extracted scripts.rar :sad:

What's going on, what am I doing wrong?

 

EDIT: nvm I did it wrong, it's working now :)

 

So am I right in thinking it's okay to use this script in my mod? Should I credit you in some way?

Edited by EliFoxFly
Link to comment
Share on other sites

Cool, thanks!

 

Also, one more question--like the person above was saying, I also would like NPCs to be able to activate the faucets but i don't know if they can use the valve. Would there be a way to set up a trigger box connected to the x-marker that would activate the water when NPCs walk into it? so basically there'd be two ways to activate the same things, valve for the player and trigger box for NPCs?

Link to comment
Share on other sites

Any switch, lever, button or valve can be set in it's [ Activate Parent ] to trigger the animation/activation. The Activate Parent could be a collision box like the one use in a bookshelf [ PlayerBookShelfClickTrigger ].

Drag that object from the [ Object Window ] to the [ Cell View Window ], then rename it to whatever you like ( Yes to create new object ). Then add lower script to your new custom collision box object.

When the NPC walks within the box it will trigger the Valve ( Most switch objects have no PlayerRef checks ).

 

Script for the Box would be something like this:

(didn't test this script but it should work)

 

Scriptname _zzz_ActivateBox Extends ObjectReference

;
Auto State ActivateBox
Event OnTriggerEnter(ObjectReference akTriggerRef)
If akTriggerRef != Game.GetPlayer()
Activate(Self)
Endif
EndEvent
EndState
;
NPC walks in activating the box this script is on, the Valve is set from [ Activate Parent ] tab to the box ... Valve animates/activates ...
Keep in mind any script that checks for PlayerRef on the Valve would fail. In this case here that shouldn't be any problem.
You also may be able to use something like a [ LeanTableMarker ] in front of the valve ( again untested ).
In theory the NPC while walking around randomly decides to move to the Marker (or scripted/quest scripted to interact with the Marker), entering the Box kicking off the Valve turning on or off the water pipe.
The line [ If akTriggerRef != Game.GetPlayer() ] = If Not the Player .. ( != ). So you don't kick it off by walking into the box yourself.
Note: There is also a BOX on the top bar of the Creation Kit that will make a collision box from scratch ...
Edited by NexusComa
Link to comment
Share on other sites

Aha, thanks! Sorry I didn't see this before... for some reason I don't get notifications when someone replies to a topic I've commented on... I should probably go check my settings and fix that.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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