Special Effects
UnrealED2 Tutorials by EZkeel

Locks and Keys

Email :EZkeel
Accompanied files : Locknkey.UNR

For this you could actually use script to make a real key and keytrigger. You can get this from Chimeric. But if you don’t want to bother with that there is a way you can do this with careful usage of triggers and movers.
Tutorials you will need to have read are: Movers, Triggers

1) Create a sizeable room connected to another room via a passage that is blocked by a mover in the form of a door. (See the tutorial on movers if you’re unsure how to do that). Make sure the door is set to “trigger toggle”. Call it “open” in its tag field.

2) Next, place a trigger infront of the door. Set the event field to “open” so that when the player walks into the trigger it opens the door.

3) In the trigger’s “object” property set the “initial state” field to “Other trigger turns on”. In its “Trigger” property set the “initially on” field to False. In the trigger’s. Call the trigger “Gotkey” in its “tag” field. Now the trigger will only open the door when it is itself switched on by something else.

4) Now you need to make a key that will unlock the door. Create another mover in the shape of a key and small enough that the player will think they can pick it up. It may also be a good idea to make the textures “unlit” so that the key will stand out like all other items. Set keyframe 1 so that the key is way of the map somewhere and set it to “ignore when encroached”. You also need to set it to “trigger toggle” and the mover time to zero. Call it “key” in its “tag” field. You should also put an inventory pick up sound in the mover’s opening sound field (you’ll find that in the Unrealshare sounds under generic”. With the mover set up in this way, it will appear to disappear and be picked up in the same way any item would once it is triggered.

5) Now place a trigger over the key and set its event field to “key” and make it btriggeronceonly = true. (note: you could set the mover to be bump or stand open timed, but if you do this the key will eventually reappear again). Now when the player walks over the trigger, they will feel as though they picked the key up.

6) Now set the mover’s (your key) event field to “Gotkey”. As soon as the key is moved the trigger that opens the door will now be activated allowing the player access through the door. Additional triggers should also be added to inform the player that they “have the key” or “you need a key for this door”. These can be done by using special event triggers with the same tags as the associated events.