Creating a logic toggle
Quote from McGinge on May 27, 2011, 1:39 pmHey guys,
So I have a func_rotating that I'm rotating backwards and forwards with the SetRotateForward/Backward inputs, and I've been doing this with two separate buttons so far, one for each direction. However I'd like to turn this into a toggle, so that every time the player presses one button, it switches backwards and forwards. There doesn't seem to be a logic_toggle entity or anything of the sort, and the func_rotating's "toggle" input just turns it on and off. Does anyone know how to make a toggle using logic entities so I can make the switch?
Cheers.
Hey guys,
So I have a func_rotating that I'm rotating backwards and forwards with the SetRotateForward/Backward inputs, and I've been doing this with two separate buttons so far, one for each direction. However I'd like to turn this into a toggle, so that every time the player presses one button, it switches backwards and forwards. There doesn't seem to be a logic_toggle entity or anything of the sort, and the func_rotating's "toggle" input just turns it on and off. Does anyone know how to make a toggle using logic entities so I can make the switch?
Cheers.
Quote from NocturnalGhost on May 27, 2011, 2:10 pmLogic_branch, using the "toggle" input:
Logic_branch, using the "toggle" input:
Quote from McGinge on May 27, 2011, 3:49 pmCan you think of anything else that I would need to do to get this to work? The inputs that should be getting fired from the "OnTrue" and "OnFalse" outputs aren't causing my relays to trigger. I've also tried setting a default value of "true" first and then attempting the toggle just in case it needed an existing value, also no dice :/
Can you think of anything else that I would need to do to get this to work? The inputs that should be getting fired from the "OnTrue" and "OnFalse" outputs aren't causing my relays to trigger. I've also tried setting a default value of "true" first and then attempting the toggle just in case it needed an existing value, also no dice :/
Quote from NocturnalGhost on May 27, 2011, 3:55 pmSorry, my mistake, the input you use should be "ToggleTest", rather than "Toggle". Toggle just changes the stored state, whereas ToggleTest changes the state, then fires the OnTrue or OnFalse output.
Sorry, my mistake, the input you use should be "ToggleTest", rather than "Toggle". Toggle just changes the stored state, whereas ToggleTest changes the state, then fires the OnTrue or OnFalse output.
Quote from McGinge on May 27, 2011, 4:14 pmAh thanks, that works great; I just assumed toggletest was a debug addition a coder added and had forgotten to remove ;p thanks!
Ah thanks, that works great; I just assumed toggletest was a debug addition a coder added and had forgotten to remove ;p thanks!
