To enable or disable an entity, you'll need to use a
multisource
to act as its master. Enabling an entity is easier to do than disabling it, but both are quite doable (once you know how to work around a few quirks and bugs!).
So we've got
func_button
A, which must be enabled or disabled by
func_button
B. We'll add a
multisource
MS, and set A's 'master' property to MS. Let's now look at 4 possible scenario's:
B is a toggle button...
- ...that must enable A: add a
trigger_relay
TR and make it toggle multisource
MS, then make func_button
B target trigger_relay
TR. (if you let B target MS directly, you'll hit a bug where MS won't be triggered one out of every 4 button presses) - ...that must disable A: same as above, but also add a
trigger_auto
that triggers trigger_relay
TR as soon as the level starts. This inverts the relationship between B and MS. (give the trigger_auto a small delay, otherwise it might fire before TR has been spawned)
B is an auto-reset button...
- ...that must enable A: the most common and easy setup: just make
func_button
B target multisource
MS. (buttons don't trigger their target when they auto-reset, unless their target is a multisource - so this scenario was designed to be easy to do) - ...that must disable A: add a
trigger_relay
TR that toggles multisource
MS, and add a trigger_auto
that triggers trigger_relay
TR when the level starts. But instead of making func_button
B target trigger_relay
TR directly (which you would do if B were a toggle button), make it target a multi_manager
MM. Then make multi_manager
MM target trigger_relay
TR twice: first with a delay of 0, then with a delay that corresponds to func_button
B's auto-reset time (or slightly lower, just to be safe). (the problem here is that auto-resetting buttons do not trigger their target when the reset, so we'll have to use a multi_manager to simulate that behavior)
If you want to use multiple buttons to enable/disable
func_button
A, then repeat the above steps for each of those buttons. And if you want to enable/disable multiple things at the same time, then just make all of those things use
multisource
MS as their master.