func_button issue

I got a issue with func_buttons on my map.
For some odd reason I can’t unlock if after it starts locked, gets locked, then when it unlocks it just kinda goes in a mode where it’s not locked or unlocked…?

I’m aware SDK Wiki says not to lock the button while pressed, so what I did was to lock it through a logic_case, though that didn’t solve my problem.

Any ideas?

So it starts locked, then you trigger it to lock again, and then you unlock it?

No. Starts locked, is unlocked. Then locked again once pressed. Then the time it unlocks, it goes into this unknown mode where it’s neither locked or unlocked.

So you have a second button to unlock it? Is it only usable once?

The thing that unlocks the button is, is a logic_case, which is triggered randomly.
Once I press the button it changes a color of a light, and locks again until it might be unlocked again by the random logic_case.

You understand?

Did you try changing the random time to 1-2 seconds?

The random time on the logic_case is 6-12 seconds. I doubt it’ll help to make it less?

Make sure the problem is the logic_case by unlocking it with something else.

Unlocking with something else? As get an another type of entity to unlock?
I’ve tried to unlock it as an output from func_button but that gave me the same error, and it’s also known as an bug in SourceSDK wiki.

I’m compiling with HL2 as engine. Does it have anything to say maybe?

I would like to help you there, but I’m reading your posts like 10 times and I’m still in wtf mode.

What are you trying to achieve?

Heh, yeah it’s a bit complex. Let me try to illustrate it somehow.

  • I’m making a machine, once it’s turned on it got 6 screens/sprites, under the screen is a button.
  • I’ve a logic case which picks a random screen each 6-12 seconds, and turns the screen red & unlocks button under it.
  • The player now needs to press the button underneath the screen, in order to make it turn green again.

This part works fine. But the button-fuckup happens once the button has been pressed once, and locked again. When the random in logic_case picks that screen again, and triggers unlock on the button. It goes into this “wtf state” the whole button.
I got locked/granted sound once pressing it, at this point none of these play…? And it obviously has no effect. This happens to all 6 buttons after a while.

Do you understand it a bit better how it works now?

Confusing, but now I get it better, let me try on my side and I’ll let you know.

Great man, thanks!
Do you think that I compile with HL2 engine might be something ?

Have you tried locking it on map load instead of having it set to lock by default?

Tried it out now, it seems to make it even worse(?) , at least it didn’t fix it no.

I’ve done this with sprites, made a button to toggle the sprites, works here.

I’ve set a logic_case here and I used a logic_timer (coz mind fuck otherwise o_O).

Logic_timer -> Poop named (name given).
Outputs: OnTimer - Poop case (name given to the logic_case) - Pick Random - None - 0.00

Logic_case -> Poop case (Name given)
Outputs: OnCase01 - Screen1Sprite1 - Color - 255 0 0 - 0.00
OnCase01 - Screen1Button1 - Unlock - None - 0.01

func_button -> Screen1Button1 (Name given)
Outputs: OnPressed - Screen1Sprite1 - Color - 0 255 0 - 0.01

If I’m getting it right, is it what you want to do?

Then do the same thing with the other screens.

Looks something like I’m trying to do yes. Though you’re not locking the buttons? Only unlocking on logic_case?

Then just use the !self on your button so it locks itself after pressing it.

That’s when the button-fuckup starts, which is my the issue I’m trying to get solved.

You mean when it locks itself, it never unlocks again?

Does the screen get red at random time or on a certain period?

If it’s random, send the map ; if it’s on a certain period, look your func_button delay before reset.