Posted by hexpunK on Sun Jun 29th at 6:39pm 2008
Thanks for any help anyone gives me. And sorry if this has already been asked, but I could'nt find a topic or tut on it.
member
15 posts
12 snarkmarks
Registered: Mar 24th 2008
Location: England

Occupation: Student, paperboy, Web Master, Amatuer M
Posted by Riven on Sun Jun 29th at 10:34pm 2008
Well, seeing that you used the word "toggle" in your question then you must have noticed the option for it when sending outputs to other entities. There are two easy ways I can think of ATM on how to do this.
my output named: OnPressed
Targets entities named: light (or whatever)
Via this input: Toggle
^That will give you a light that can be turned on or off with a single button. If you select the flag to tell the light to start off, then when you press the button, it will turn on. So, for instance, this method would work if you had several light switches in a room, and all gave them this output to the same light; they should function like a real set of light switches.
My output named: OnIn
Targets entities named: light (or whatever)
Via this input: TurnOn
-&-Another output that says:
My output named: OnOut
Targets entities named: light (or whatever)
Via this input: TurnOff
^And that would give you the same effect as the "toggle" output. But this version really only works for one button, unless you don't mind your buttons having to be specified to an "on" or "off" state (just make sure the player realizes it, or it may frustrate them), rather than just a switch that will 'toggle' between the two modes.
Those are the easiest ways of using a single func_button, but if you think about it, you can create much more elaborate versions that can give you some flexibility by adding in criteria that may need to be met before a switch can work (from the light's end of the I/O system). BTW, I too did a quick forum search to no avail on this topic. I'm surprised it's never been posted before, this is a beginner?s topic, but one that eludes many people, (including myself once).
Riven
super admin
1639 posts
802 snarkmarks
Registered: May 2nd 2005
Location: Austin, Texas, USA

Occupation: Architect
Posted by hexpunK on Mon Jun 30th at 4:38pm 2008
I have tried the two button system, I even used lights to say on or off and entity that displays text at a certain point, I forget the name, but it was tiresome an gave away the buttons position, they are meant to be a little bit hidden.
member
15 posts
12 snarkmarks
Registered: Mar 24th 2008
Location: England

Occupation: Student, paperboy, Web Master, Amatuer M
Posted by hexpunK on Mon Jun 30th at 7:01pm 2008
When making a single button to toggle entities that don't support the toggle input, go into "flags" and check "Toggle", then just set the first thing you want to do in the toggle to "OnIn" then the second thing to "OnOut" rather like what Riven said.
member
15 posts
12 snarkmarks
Registered: Mar 24th 2008
Location: England

Occupation: Student, paperboy, Web Master, Amatuer M
Posted by Zein on Tue Jul 24th at 2:35am 2012
Zein
member
167 posts
142 snarkmarks
Registered: Sep 1st 2006
Location: United States
Occupation: Computer fixing
Snarkpit v6.1.0 created this page in 0.0115 seconds.

