Making a door open only if you are carrying a cube
I have just started making Portal maps. Whupper, also active in this forum, inspired me. I am having alot of fun.

I have a map where the objective is to bring the cube with you and I wanted to make a door that opened if, and only if, you had the cube in your possession (holding it, really).
What I came up with was very simple and I thought I'd share the find with the forum in case someone else wants to do the same thing.
Instructions:
- Fashion a door of some type: func_door as parent and all that.- Make a trigger brush
- Make a filter_multi and name it. EndDoorFilterBox in my case- Make a filter_activator_name and name it Filter_Player
""""
- Make another filter_activator_name and name it Filter_box
- Back at the filter_multi
- Set the Filter attribute of the trigger to the name of the filter_multi(None of the values should actually use the double quotes. I use them just to make it easier to read)
The result is that the trigger will only be triggered if you are holding the cube in your hand (with "e") while walking thru it. The door will remain closed if you aren't holding the cube.
Regards
--Slakkie
""
The way I achieved that was with a second trigger, located just behind the first (both just a few pixels wide), that send a "test" output to a logic_branch that was set to 1 (true) by the trigger mentioned in my last post if the user has the cube. Per default it is set to 0 (false)
When receiving a Test input the logic_branch outputs a trigger to a logic_relay that actually opens the door if it (the logic_branch) is set to 1 or outputs a "display" to a game_text entity if 0.
- Create a logic_branch- Create a game_text entity.
- Create a new trigger_multiple just behind the first trigger so that the player will trigger it just after he triggers the discriminating trigger described in my first post.
- Set the first trigger_multiple to output a SetValue with parameter of 1 to the logic_branch.- Set the logic_branch to output display to the game_text OnFalse and a trigger to the logic_relay to open the door OnTrueThis works really well. The message appears again when the player backs away but that is probably a good thing. It does not appear when he/she comes back with the cube. Instead the door is opened!!
Regards
Slakkie
""""
slakkie wrote:
The message appears again when the player back away but that is probably a good thing.
Sounds like your trigger is very thin, so the user (or cube) goes through it entirely on the way to the door.
Instead, make it a much larger trigger (more of a box instead of a wall) that fills up the area in front of the door. . . so the player walks into the trigger and stays inside its area if he is in front of the door.. Then assign the trigger for the message to OnStartTouch, or something. That way, the message is given every time he leaves the area and approaches the door, instead of when he is both coming and going.