Please or Register to create posts and topics.

Enable and Disable a func_physbox [Solved]

I have a func_physbox which is enabled by one button and disabled by another (both run through logic relays). It starts out enabled (visible). Each time I press the button to disable (vanish) it, it works fine. But sometimes the button to enable it works, and other times it does not. I am unsure why this is happening.

The output of one relay disables the physbox on a delay of 2 seconds. The other enables it on a similar delay. I don't think the delay is the problem, because I wait until it appears or vanishes before pressing the other button.

I want the player to be able to toggle it at will using the buttons. Any ideas on why I am having a problem?

Winner of the Nobel Prize for Being Immune to Neurotoxin

Thanks for over 1,000 downloads: The Cold Shoulder

You want player's to enable and disable the physbox? Did you try the "toggle" output? If the button has multiple "OnPressed" Outputs, it might randomly fire an output command. I'm just throwing ideas out since I never used a physbox.

Maybe instead of using logic_relay, have the physbox start enabled, and for the button that enables/disables the physbox, try this output on the button:
OnPressed/<physbox_name>/Toggle
I'm not absolutely sure this will work but try it anyway.

Crazy is as crazy does.
My Work
[spoiler]Maps:
Revenge of the Angry Turrets
Capture the Cube [Co-op]
Capture the Cube 2 [Co-op]
TPWEGTH Sample Map
Aperture Aquatic Testing Center
Aperture Aquatic Testing Center 2
Aperture Time Testing Center
ML's Halloween Trick - 1000 downloads!
ML's Halloween Treat
ML's Combination - 1000 downloads!
ML's Jailbreak Labyrinth
ML's Tricky Teamwork [Co-op]
WIP:
"Capture the Cube 3"
Workshop Maps Link: http://steamcommunity.com/profiles/76561198008890579/myworkshopfiles/[/spoiler]

Currently it's two separate buttons. I'll see if there is a toggle option.

Winner of the Nobel Prize for Being Immune to Neurotoxin

Thanks for over 1,000 downloads: The Cold Shoulder

Oh, it's two buttons? Then you don't even need a logic_relay to enable or disable the physbox. Just tie the outputs to the buttons.

Crazy is as crazy does.
My Work
[spoiler]Maps:
Revenge of the Angry Turrets
Capture the Cube [Co-op]
Capture the Cube 2 [Co-op]
TPWEGTH Sample Map
Aperture Aquatic Testing Center
Aperture Aquatic Testing Center 2
Aperture Time Testing Center
ML's Halloween Trick - 1000 downloads!
ML's Halloween Treat
ML's Combination - 1000 downloads!
ML's Jailbreak Labyrinth
ML's Tricky Teamwork [Co-op]
WIP:
"Capture the Cube 3"
Workshop Maps Link: http://steamcommunity.com/profiles/76561198008890579/myworkshopfiles/[/spoiler]

I used the logic_relays in case I decided I want to disable the buttons temporarily (because of the delay).

Don't expect that the logic_relay is causing the problem, though. It's so weird... sometimes it works, sometimes it doesn't.

Winner of the Nobel Prize for Being Immune to Neurotoxin

Thanks for over 1,000 downloads: The Cold Shoulder

You can disable the buttons with a "lock" input, so only one can be active at a time. I don't know that that would cause your problem, but I would prefer that over creating excess relays.
When it doesn't work, do you have to reload the map to get it to work, or does the button randomly work when you press it again?
I personally haven't tried flat-out disabling a physbox, it might have some problems due to it's properties... I guess there are reasons that it is necessary to use one instead of just a brush?

Picture that. In your dreams.
Maps:
SP MonoPortal | Lesson 0
WIP: LaserLock Preview Images

The better would be to make the enabling and disabling done with one button, removing the chance for this error, unless of course having the two buttons are actually part of a puzzle element.

You can do this by either using a math_counter and a logic_case or a logic_branch which 'Toggletests' with outputs firing 'OnTrue' and 'OnFalse'.

If you want a delay between enabling and disabling the physbox, just increase the delay keyvalue inside your prop_button.

?????????????????????????????TWP Releases | My Workshop

The two buttons are part of the puzzle.

When it doesn't work, I have to reload the map. Sometimes this fixes it and other times not. I haven't been able to identify any circumstance that could be related to the problem; it seems to be random each time I load the map.

Is it possible to make it a brush and enable/disable it in the same way? I need to to totally disappear when disabled.

Winner of the Nobel Prize for Being Immune to Neurotoxin

Thanks for over 1,000 downloads: The Cold Shoulder
Marise wrote:
The two buttons are part of the puzzle.

When it doesn't work, I have to reload the map. Sometimes this fixes it and other times not. I haven't been able to identify any circumstance that could be related to the problem; it seems to be random each time I load the map.

Is it possible to make it a brush and enable/disable it in the same way? I need to to totally disappear when disabled.

Yes it is, I did that with my boss's shield (Portal Bomber). Try that and see if it works.

Crazy is as crazy does.
My Work
[spoiler]Maps:
Revenge of the Angry Turrets
Capture the Cube [Co-op]
Capture the Cube 2 [Co-op]
TPWEGTH Sample Map
Aperture Aquatic Testing Center
Aperture Aquatic Testing Center 2
Aperture Time Testing Center
ML's Halloween Trick - 1000 downloads!
ML's Halloween Treat
ML's Combination - 1000 downloads!
ML's Jailbreak Labyrinth
ML's Tricky Teamwork [Co-op]
WIP:
"Capture the Cube 3"
Workshop Maps Link: http://steamcommunity.com/profiles/76561198008890579/myworkshopfiles/[/spoiler]

So far so good with the func_brush instead of a func_physbox. I'll have to do more testing tomorrow, but I think it's working fine.

Thanks, all.

Winner of the Nobel Prize for Being Immune to Neurotoxin

Thanks for over 1,000 downloads: The Cold Shoulder