Jump to content

Adding a Water Pump (Activator object that disables multiple objects in-game)


Medizy

Recommended Posts

This is an idea I have of my mod: Mechanist Lair Overhaul, there's a flooded room in that area, someone asked for a way to remove the water in the flooded area, so I thought of adding a "Water pump" into the cell, where it's an activator where if interacted with, would drain/undrain the room of water.

 

I'm not too experienced with the creation kit yet, does anyone else have any pointers on how such a thing could be achieved?

Link to comment
Share on other sites

The water in room should be "dropped" (should be object reference). Make an activator and attach new script on it. Make a new property (name it whatever you want for example waterObjProperty) of type object reference and point to that water object. Inside script write this

 

Event OnActivate(ObjectReference akActionRef)

If (waterObjProperty.isEnabled()

waterObjProperty.disable()

Else

waterObjProperty.enable()

Endif

EndEvent

 

Place the activator in room and it should do what you want.

Link to comment
Share on other sites

A cooler way would be to script the water plane to translate slowly downwards when the pump is activated, before disabling it, to simulate the water being pumped out of the room :)

Link to comment
Share on other sites

A cooler way would be to script the water plane to translate slowly downwards when the pump is activated, before disabling it, to simulate the water being pumped out of the room :)

Yep, steve is right. You should try translateTo function. Something like this:

 

Event OnActivate(ObjectReference akActionRef)

If (waterObjProperty.isEnabled()

waterObjProperty.translateTo(waterObjProperty.X, waterObjProperty.Y, waterObjProperty.Z - 100, 0,0,0, 100)

Else

waterObjProperty.translateTo(waterObjProperty.X, waterObjProperty.Y, waterObjProperty.Z + 100, 0,0,0, 100) Endif

EndEvent

 

You will have to mess with the parameters where is written 100. First controls how much in units water will be translated along z axis, second one is speed. And you can disable water after translation is completed, with ontranslationcomplete event. So your whole script will be something like this:

 

bool checker

 

Event OnActivate(ObjectReference akActionRef)

If (waterObjProperty.isEnabled())

checker = false

waterObjProperty.translateTo(waterObjProperty.X, waterObjProperty.Y, waterObjProperty.Z - 100, 0,0,0, 100)

Else

waterObjProperty.enable()

checker = true

waterObjProperty.translateTo(waterObjProperty.X, waterObjProperty.Y, waterObjProperty.Z + 100, 0,0,0, 100)

 

Endif

EndEvent

 

Event onTranslationComplete()

If (waterObjProperty.isEnabled() && checker == false)

waterObjProperty.disable()

Endevent

 

 

That should be all.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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