Toggled Loop Example

Half-Life HL
Toggled Loop Example by Erty
Posted 4 months ago2024-07-10 07:39:05 UTC • Examples • Half-Life
Loading...
Screenshot Thumbnail
Name
Toggled Loop Example
By
Erty Erty
Type
Map
Engine
Goldsource
Game
Half-Life
Category
Examples
Included
RMF/VMF
Created
4 months ago2024-07-10 07:39:05 UTC
Updated
4 months ago2024-07-10 07:39:05 UTC
Views
363
Downloads
134
Comments
0

An example setup for a toggled loop.

A simple multi_manager loop is started in "the background" at map start, constantly triggering a trigger_relay without a target every half second.
Pressing the button triggers a pair of trigger_changetarget: One changes the target of the relay to the indicator lamp, connecting it to the loop, and the other changes the target of the button.
The next time the button is pressed, it'll trigger a different pair of trigger_changetarget to reverse the changes from the first pair.

This way the button is able to toggle the loop, by alternatively connecting and disconnecting the intended target to the multi_manager loop.

Comments

You must log in to post a comment. You can login or register a new account.