Multiple buttons to turn on a light (or anything else)
Post Reply
Quote
Re: Multiple buttons to turn on a light (or anything else)
Posted by Gazoo on Mon Feb 20th at 3:55pm 2006


Hey,

I've been desperatly trying to figure out how to make multiple buttons (together) activate anything - primarily a light. I've hooked up a single button to a light no problem (thanks to a tutorial on this great site) - but I've failed to make two buttons activate the light together.

Essentially I want each button to be pressed before the light turns on. Whatever order is irrelevant - as long as each button has been pressed the light should turn on. I've looked at logic_multicompare and tried a few combinations - but so far nothing.

I'd be much obliged if anyone has an idea and the time to help...

Thanks in advance,

Gazoo

P.s Hopefully this post turns out ok - I'm using this forum via Firefox and the editor is acting all screwy (starting with black text on a black background)...
tmargin=2>




Quote
Re: Multiple buttons to turn on a light (or anything else)
Posted by Orpheus on Mon Feb 20th at 3:59pm 2006


The mechanics of HL2 is slightly different that HL1 but, You are not going to target the light, but the other switches. The switch will then target the light.

Try thinking of the problem in that sequence.

Sorry I cannot be more specific.

Good luck.





The best things in life, aren't things.



Quote
Re: Multiple buttons to turn on a light (or anything else)
Posted by Gazoo on Mon Feb 20th at 4:20pm 2006


Can't admit that I gained any insight by your reply. I'm almost more confused. Something has to target the light and if it's one of the switches - then what's going to prohibit it from turning it on alone.

The player has to press each button before the light turns on <img src=" SRC="images/smiles/icon_smile.gif">

Thanks thou,

Gazoo
rel="stylesheet" href="themes/standard.css" type="text/css"></head><body topmargin=2 leftmargin=2>




Quote
Re: Multiple buttons to turn on a light (or anything else)
Posted by Orpheus on Mon Feb 20th at 4:41pm 2006


The thing is, I suck at entity setups. I know what you need to do, but not how.

First, you must understand that you will not directly target the light. You will target the switches. That action will then target the light.

Also, the entities you may use may have multiple applications depending on the job that needs done. For instance, the light setup you want may be obtained by looking into an elevator tutorial. Since an elevator needs to stop on the floor you desire, and there are many floors then the switches would need to target the switches, not the elevator.

Try looking onto any tutorial that involves multiple outcomes.





The best things in life, aren't things.



Quote
Re: Multiple buttons to turn on a light (or anything else)
Posted by DrGlass on Mon Feb 20th at 5:46pm 2006


I'll get back to you on this, I thought it would be a simple matter but I'm having trouble trying to get this to work.

check out logic_ entities for starters












Quote
Re: Multiple buttons to turn on a light (or anything else)
Posted by Stadric on Mon Feb 20th at 6:32pm 2006


place a math_counter, give it a name, set its maximum value to two.
give it the output:
OnMaxValue>>light>>turnOn

now make your buttons, make them both lock after the first press, and give them both this output:
onPressed>>Math_counter>>add>>1

I should write a tutorial on this <img src=" SRC="images/smiles/icon_smile.gif">



Also change the texture of the dock. Docks are rarely tile. -Facepunch
As I Lay Dying



Quote
Re: Multiple buttons to turn on a light (or anything else)
Posted by DrGlass on Mon Feb 20th at 11:25pm 2006


Also, you can set your button

OnIn>>>Math_counter>>add>>1
OnOut>>>Math_counter>>subtract>>1

so both buttons need to be pressed before they reset




Quote
Re: Multiple buttons to turn on a light (or anything else)
Posted by ReNo on Tue Feb 21st at 4:15am 2006


I see Stadric was kind enough to follow up on his idea, so if you need more detail on how to achieve your effect check it out...

http://www.snarkpit.net/editing.php?page=tutorials&game=HL2&id=197






Quote
Re: Multiple buttons to turn on a light (or anything else)
Posted by SuperCobra on Wed Feb 22nd at 8:06am 2006


That would be awsome to write a tut on this kinda thing. You should I highly encourage it.


Life is like a box of chocolates u never know what you'll get you might get a.....scream.



Quote
Re: Multiple buttons to turn on a light (or anything else)
Posted by Addicted to Morphine on Wed Feb 22nd at 4:42pm 2006


He did, it's already up on the frontpage -- ReNo linked to it above your post.




Quote
Re: Multiple buttons to turn on a light (or anything else)
Posted by Gazoo on Fri Feb 24th at 8:35am 2006


Worked like a charm... <img src=" SRC="images/smiles/icon_smile.gif">

Thanks for the help...

Gazoo





Post Reply