To download this library for your Linux/Mac installation, enter this on your command line:
DreamDownload byond://Foomer.Triggers##version=1 Emulator users, in the BYOND pager go to File | Open Location and enter this URL:byond://Foomer.Triggers##version=1 |
This library provides a new object type called a trigger, which can be used to cause reactions in other objects in the world through the use of tags. For example, a lever is a trigger object, and when pulled, the lever opens the gate object with the appropriate tag. There are a variety of different trigger setups you can create to influence objects in your game. Triggers work through activation and deactivation, or toggling. You can activate a trigger directly, such as when a player steps on a trigger object, using the Activate(object) proc, where the object argument is the object the activated it. You can also deactivate it directly using the Deactivate(object) proc. Or, if you're not sure whether you want to activate or deactivate it, such as in the case of using a lever, you can use the Toggle(object) proc, which will activate or deactivate it depending on its settings. When a trigger is activated, it will add to a targeted object's triggers_set variable, and the amount added is dependent on the trigger's trigger_weight value. When the triggered object's triggers_set value equals its triggers_req (triggers required) value, then the object is activated, such as a gate's opening. When the object's triggers_set value no longer matches its triggers_req value, it will deactivate, such as a gate closing. You specify which objects a trigger will affect through the trigger's trigger_target var. This variable is a params list of the tags for the trigger to locate. So in order to affect an object, you need to set the object's tag value, and set the trigger's target value to include the object's tag value. Lets cover the trigger variables so you'll understand in what ways you can customize your triggers to make them do what you want. TRIGGER VARIABLES: trigger_target - This is a params string used to tell the trigger which tags to search for when looking for objects to affect. For example: "gate1;gate2" OBJECTS Each atom now comes with four new variables, but the ones you'll primarily be concerned with are the triggers_set and triggers_req variables. When a trigger is activated and has an atom as a target, that atom's triggers_set value will increase by the trigger's trigger_weight value. If the trigger is deactivated, the atom's triggers_set value will decrease by the trigger's trigger_weight. |
Please support BYOND through Membership or a donation!
|
Related Libraries
|
|||||||||||||||||||||||||||||||||||
More Libraries by Foomer
|
Copyright © 2024 BYOND Software.
All rights reserved.