Question about func_button

BenCo

L5: Dapper Member
Dec 30, 2015
242
135
So currently i'm making a deathrun map for tf2. In tf2 button can only be activated by damaging it because the game dont use a "Use" bind. In my map there is 2 doors where players have to decide which one is the good and which one is the bad. Our activator have two buttons to activate: if he choose the left button the left door will be the bad. If he chooses the right button the right door is the bad. But now the problem...If the activator chooses the left door to be bad then he can still activate the right door. This is bad since he forced to activate just one. I set the buttons to fire only once, to lock the button when the other is activated but no i still cannot disable the other button when one of them activated. So do anybod yknow how to do fix this?
 

zahndah

professional letter
aa
Jul 4, 2015
721
642
if you 'kill' the other button it would simply vanish as soon as the 1st one was pressed, so death can only activate 1 of them then.
 

BenCo

L5: Dapper Member
Dec 30, 2015
242
135
Oh thank you! You helped me alot! First i tought that would kill the activator or something else. Idk why. Thanks again!
 

Chrazini

L1: Registered
Aug 22, 2015
4
2
I don't understand why you're unable to lock the button. Have you tried locking the door instead? Killing the buttons seems a bit excessive, but if you don't mind the buttons just vanishing, I guess it's a fine solution to your problem.
 

BenCo

L5: Dapper Member
Dec 30, 2015
242
135
Well I tried everything and it seems only killing the buttons the answer to fix this problem. Maybe on later maps I do something else with it. Btw if i can and it's allowed to upload deathrun maps then you will see the map in just a few days :)
 

Izotope

Sourcerer
aa
May 13, 2013
698
764
Locking buttons works. It didn't work in your case because you use the "OnDamaged" Output.
This fires when you damage the buttons, whether it's locked or not.
You should use the "OnPressed" Output in all your buttons instead, this allows you to lock them if you wish to do so.
But I personally kill them as well.

Keep in mind that you have to tick the "Damage activates" flag in order for the "OnPressed" output to work.
I also recommend to tick the "Use activates" flag, because you CAN bind "Use",
and some people (like me) are actually using this method.

There are a few advantages for activating buttons with the "Use" bind:
- You don't suffer the fire delays of your weapons.
- It's silent, meaning you can use this to trick the runners.

I hope this information helps you.
 

BenCo

L5: Dapper Member
Dec 30, 2015
242
135
Locking buttons works. It didn't work in your case because you use the "OnDamaged" Output.
This fires when you damage the buttons, whether it's locked or not.
You should use the "OnPressed" Output in all your buttons instead, this allows you to lock them if you wish to do so.
But I personally kill them as well.

Keep in mind that you have to tick the "Damage activates" flag in order for the "OnPressed" output to work.
I also recommend to tick the "Use activates" flag, because you CAN bind "Use",
and some people (like me) are actually using this method.

There are a few advantages for activating buttons with the "Use" bind:
- You don't suffer the fire delays of your weapons.
- It's silent, meaning you can use this to trick the runners.

I hope this information helps you.
This is indeed very helpful. Well i like the buttons locking much better. It's just strange if buttons disappear. And also I didn't knew that you can bind Use. Anyway thanks again! My buttons finally work correctly!
 

UKCS-Alias

Mann vs Machine... or... Mapper vs Meta?
aa
Sep 8, 2008
1,264
816
If you dont want to kill the button just put a relay between the button and disable the relay. That way a +use requirement isnt needed. And you can even combine both the damaged and use events.
 

Izotope

Sourcerer
aa
May 13, 2013
698
764
If you dont want to kill the button just put a relay between the button and disable the relay. That way a +use requirement isnt needed. And you can even combine both the damaged and use events.
You don't need a relay to use both damage and use. You just need to use the OnPressed Output instead of the OnDamaged and have "Damage/Use activates" flags ticked.