Jump to content

How to make a door open with push block


Recommended Posts

I'm relatively new to modding and was wondering how to make a gate/door open when the player activates a push block, I'm not trying to make a secret door or anything I just want to know how I open and close a door with a push block. I also know absolutely nothing about scripting and everything I looked up was wildly confusing

Link to comment
Share on other sites

I checked some of the 'secret' doors I found in the Construction Set, and most of them appear to be set up somewhat like this:

  • the door object itself is an Activator, and the door 3D object has some sort of built-in animations in it to open and close the door, and the door also has a script on it that reacts to activations (but not from player) and plays the built-in animations to toggle the open/closes state of the door
  • the lever/button is also an Activator, with included animations somewhere in the 3D object as well to animate the pulling or pushing or somesuch
  • the lever/button object has a script attached to it, that reacts to activations by player, plays the built-in activation animation on itself, and also activated the door reference (which in turn causes the door to script to play animations on the door, to toggle the open/closed state)
  • the script uses as the door ref (to play the animation groups on) either the enable parent referencef of the lever itself, or a specific reference written in the script - the enable parent version is the more general version

So to easily setup an example door, without doing any scripting, you could find a lever and a door with the appropriate script pairs, with a more general script for the lever (using GetParentRef to get the door, etc.), place them in the gameworld, set the door as persistent, assign the door as the enable parent for the lever and then test. I tested with the LeverCandleTriple01Off (00083430) activator as the lever and the CastleIntNarrowSecretDoor02 (00054963) activator as the door. I made the door ref persistent and then assigned it as the enable parent for the lever. Activating the lever then caused the door to open/close.

 

What sort of a door are you looking for? An Ayleid one? An iron gate (like in Battlehorn Castle)? Something else? That might help narrow the search.

Link to comment
Share on other sites

Okay. For example ARGate01 (0001E7A5, activator) for the door and ARWallSwitch01 (000228B7, also activator) for the button seems to work. You can place one of each in the gameworld, make the door reference persistent (double-click the door ref -> tick the "Persistent Reference" box), then assign the door as the enable parent for the button (double-click the button ref -> "Enable Parent" tab -> select the door reference). Activating the button should toggle the door, the scripts have been made in a general enough way for it to work, and you do not need to do any scripting yourself.

 

If you need some other sort of door or a button, they all probably works in a similar way, with a door, a button, and the enable parent assignment. Some of the Ayleid ruins should have ready-made examples in them that you can have a look at, too.

Edited by Contrathetix
Link to comment
Share on other sites

  • Recently Browsing   0 members

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