Multiple buttons to turn on a light (or anything else)

Multiple buttons to turn on a light (or anything else)

Re: Multiple buttons to turn on a light (or anything else) Posted by Gazoo on Mon Feb 20th 2006 at 3:55pm
Gazoo
3 posts
Posted 2006-02-20 3:55pm
Gazoo
member
3 posts 0 snarkmarks Registered: Feb 20th 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>
Re: Multiple buttons to turn on a light (or anything else) Posted by Orpheus on Mon Feb 20th 2006 at 3:59pm
Orpheus
13860 posts
Posted 2006-02-20 3:59pm
Orpheus
member
13860 posts 2024 snarkmarks Registered: Aug 26th 2001 Occupation: Long Haul Trucking Location: Long Oklahoma - USA
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.
Re: Multiple buttons to turn on a light (or anything else) Posted by Gazoo on Mon Feb 20th 2006 at 4:20pm
Gazoo
3 posts
Posted 2006-02-20 4:20pm
Gazoo
member
3 posts 0 snarkmarks Registered: Feb 20th 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 :smile:

Thanks thou,

Gazoo rel="stylesheet" href="themes/standard.css" type="text/css"></head><body topmargin=2 leftmargin=2>
Re: Multiple buttons to turn on a light (or anything else) Posted by Orpheus on Mon Feb 20th 2006 at 4:41pm
Orpheus
13860 posts
Posted 2006-02-20 4:41pm
Orpheus
member
13860 posts 2024 snarkmarks Registered: Aug 26th 2001 Occupation: Long Haul Trucking Location: Long Oklahoma - USA
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.
Re: Multiple buttons to turn on a light (or anything else) Posted by DrGlass on Mon Feb 20th 2006 at 5:46pm
DrGlass
1825 posts
Posted 2006-02-20 5:46pm
DrGlass
member
1825 posts 632 snarkmarks Registered: Dec 12th 2004 Occupation: 2D/3D digital artist Location: USA
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
Re: Multiple buttons to turn on a light (or anything else) Posted by Stadric on Mon Feb 20th 2006 at 6:32pm
Stadric
848 posts
Posted 2006-02-20 6:32pm
Stadric
member
848 posts 585 snarkmarks Registered: Jun 3rd 2005 Occupation: Slacker Location: Here
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 :smile:
Also change the texture of the dock. Docks are rarely tile. -Facepunch
As I Lay Dying
Re: Multiple buttons to turn on a light (or anything else) Posted by DrGlass on Mon Feb 20th 2006 at 11:25pm
DrGlass
1825 posts
Posted 2006-02-20 11:25pm
DrGlass
member
1825 posts 632 snarkmarks Registered: Dec 12th 2004 Occupation: 2D/3D digital artist Location: USA
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
Re: Multiple buttons to turn on a light (or anything else) Posted by ReNo on Tue Feb 21st 2006 at 4:15am
ReNo
5457 posts
Posted 2006-02-21 4:15am
ReNo
member
5457 posts 1991 snarkmarks Registered: Aug 22nd 2001 Occupation: Level Designer Location: Scotland
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
[img]http://card.mygamercard.net/sig/Default/reno84.png[/img]
Designer @ Haiku Interactive | ReNo-vation.net
Re: Multiple buttons to turn on a light (or anything else) Posted by SuperCobra on Wed Feb 22nd 2006 at 8:06am
SuperCobra
184 posts
Posted 2006-02-22 8:06am
184 posts 28 snarkmarks Registered: Jan 2nd 2005 Location: Oregon,USA
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.
Re: Multiple buttons to turn on a light (or anything else) Posted by Addicted to Morphine on Wed Feb 22nd 2006 at 4:42pm
Posted 2006-02-22 4:42pm
3012 posts 529 snarkmarks Registered: Feb 15th 2005
He did, it's already up on the frontpage -- ReNo linked to it above your post.
Re: Multiple buttons to turn on a light (or anything else) Posted by Gazoo on Fri Feb 24th 2006 at 8:35am
Gazoo
3 posts
Posted 2006-02-24 8:35am
Gazoo
member
3 posts 0 snarkmarks Registered: Feb 20th 2006
Worked like a charm... :smile:

Thanks for the help...

Gazoo