Locked and Pickable Doors

From FleshWorks

Jump to: navigation, search

by David


Points to Note

Locks cannot have individual sweet spots, number of rings etc. This is done on a per lock-type basis. The info for this can be found in the Actor Class browser under MetaData > LockDifficultyInfo. If you edit these you will have to ship the gamesys (T3Gamesys.t3u) with your mission. This will add around 250k for a zipped mission and 170 for a RAR.


Tutorial

1) Create a door between two rooms (obviously). They can be found in the Actor Class browser under WorldObj > Moving > Hinged or Sliding.

Note
by nhivanye

You can change the direction a door opens by rignt clicking the door and picking "Actor links". Then from the lists of links ;select the one btween the door and itslef with "Hinged Attachment" flavour. Then under properties/Physics/m_hingeAxis change ;Z from -1 to 1 or vice versa. X and Y can be chosen as axes for trapdoors.

2) Right-click the door and choose its properties, this is the top item in the menu. Note down the section in brackets from the property title bar. You'll see something similar to ""D_317MyLevel.D_317__9(GenDoor__0)"", the bit you are interested in is ""GenDoor__0"".

3) On the bottom rung of the property ladder choose Add Property. Choose Locked from the first column and blsLocked from the second column. Set this to True. This obviously makes the door locked. By default all newly created doors are unlocked.

4) Add two of the same locks to the map, one for each side of the door. The can be found in the Actor Class browser under WorldObj > Environmental > Lock. Technically they do not need to be anywhere near the door as that is automatically taken care of later, but for neatness place one on each side of the door in its centre. In turn, right-click each lock and note down its object name as you did for the door.

5) Select the door and right-click it. Choose "Actor Links" from the menu. Click Add Link. From the Link Types pick RigidAttachment. The FROM textbox should contain the name of the door that you noted down earlier (similar to ""GenDoor__0""). If it is not, then enter it now, and yes there are supposed to be two underscores in a row there. In the TO box enter one of the lock object names, it should be in a similar format to the door. Click Ok and then do the same for the other lock. Click the DONE button when you have finished.

6) Right click one of the locks and choose Actor Links from the menu. Click the link which has the door as the Destination and ~RigidAttachment as the Flavor. The ~ is important!

7) Click Edit Selected Link and expand the properties ladder in the Edit Link Data window that pops up. Expand the Attachment rung and set m_parentBone to either hp_lockA or hp_lockB. Repeat steps 6 and 7 for the other lock, this time setting m_parentBone to the one you didn't use last time. hp_lockA is one side of the door, and hp_lockB is the other side.

Note
by nhivanye

When I tried this the locks attached at the origin of the door. I had to move the door in the editor for the locks to appear at the correct place. It's possible to edit the attachment bone from the link you created from the door so you don't have to select the locks.

8) Tada! the door is now locked and can be opened via lockpicks. Remember to see the Upgrading The Player tutorial for information on how to give lockpicks to the player.


TTLG Forums Discussion Thread



Back to Doors, Locks and Keys Tutorials Page

Back to Mission Design: World Objects Tutorials Page

Back to Mission Design Tutorials Page

Back to Main Tutorials Page

Personal tools