Please or Register to create posts and topics.

Open Random Door by Button

In my map I have a large square room separated by 4 walls, thus making 6 tiny rooms all equal in size. the walls are all func_door 's and there are 4 buttons spread out through the rooms. What I want to know is how to make each one of the buttons open a random door out of let's say 2 choices. But a button can only be pressed once unless another button is pressed in 10-15 seconds. (I haven't decided a number yet.) However if a button is not pressed in that time period, a trap door will open with a path back to the beginning corresponding with which room the player is in at the time.

I realize this is very challenging, (I think.) and I know it will be very time consuming; and sorry for the confusing question and I hope it all makes sense. Thanks in advance!

-sssummer :D

Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings.
sssummer wrote:
In my map I have a large square room separated by 4 walls, thus making 6 tiny rooms all equal in size. the walls are all func_door 's and there are 4 buttons spread out through the rooms. What I want to know is how to make each one of the buttons open a random door out of let's say 2 choices. But a button can only be pressed once unless another button is pressed in 10-15 seconds. (I haven't decided a number yet.) However if a button is not pressed in that time period, a trap door will open with a path back to the beginning corresponding with which room the player is in at the time.

I realize this is very challenging, (I think.) and I know it will be very time consuming; and sorry for the confusing question and I hope it all makes sense. Thanks in advance!

-sssummer :D

lol ALL your questions are confusing :P lol j/k. but i have to goto work right now, i'll try to think of a solution at work. IF i think of anything i'll post back tonight

do NOT click this

I'm not entirely sure what effect you are going for, but I would recommend starting with a logic_case.

You can trigger the logic_case using the parameter "PickRandom" when the button is pressed and it will randomly select one of up to sixteen cases (but only out of those for which you have entered a value for that case, so as few as two). Make a logic_relay for each case and set the logic_case to output "OnCaseNN target entity <name of logic_relay> target input "trigger".

You should need to make a logic case for each time you need a random output, so one for each button.

As far as the second part, I'm not sure if you are doing this in a chain pattern where the player can only reach one other button at a time, or if the player will be able to reach all of the buttons at once.

If a chain, you can simply disable all but the first button and have that button enable the next one for however many seconds you need it to, then disable it again when the time has run out and open the return exit. Then when that button is pressed it should enable the next one for however long, and so forth.

If on the other hand all the buttons are accessible at once, I would recommend using a math_counter and just reset the value whenever the time runs out.

I played around with a chain of button pushes in what would have been my entry for the January map contest if I'd gotten it more than halfway finished. I remember I had some trouble getting the chain to work correctly, although I don't remember exactly why. I think maybe the buttons would keep doing whatever they were set to do even when the time for the previous button ran out.

What I ultimately ended up doing was having a single timer that represented the total amount of time the player could take to finish the puzzle, and I used a math_counter to keep track of how many buttons the player had pressed. If the player exceeded the total time then the puzzle reset itself and the player had to start over.

I hope this was helpful. Good luck!

Great help! And for more explanation of my second question, when a player presses a button, the two doors that open are both accessible at the time, and a button will be in at least one room he/she has access to.

Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings.

bump, still need help

Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings.
sssummer wrote:
bump, still need help

you barely started this thread yesterday... and you're already bumping it?

:notwant:

do NOT click this
rellikpd wrote:
you barely started this thread yesterday... and you're already bumping it?

:notwant:

sry didn't realize it was that recent.. I did this on my psp and dates are all screwed up on it... sorry again

Friendship is like peeing on yourself: everyone can see it, but only you get the warm feeling that it brings.