Lua:trigger ff script
trigger_ff_scriptThis entity is functionally the same as trigger_multiple. Most of these functions will also work with the other trigger_* entities. A trigger_ff_script is a brush-based scriptable entity. Unlike most Source entities, which represent one type of object and have predetermined behavior, the scriptability behind this entity makes it extremely flexibile. trigger_ff_script entities represent areas that can affect, and be affected by players. Such items might be the capture points in a CTF map, nobuild areas, or team-killing laser fields. These entities are placed in a map editor, such as Hammer, and must be given a name in order to function correctly. This name will be used to link it into the map's corresponding Lua file. So, whenever you put a named trigger_ff_script entity in your map, the game attempts to find a correspondingly named function in mapname.lua. FF includes a number of pre-existing game modes that require very little work to implement in your own maps--that is, assuming your map's gameplay is similar enough to one of these templates. You'll simply need to add the appropriate entities, give them the proper names, and you're all set. More on that can be found by looking at the available map templates. Creating a trigger_ff_script-- This is my first base trigger! endzone = trigger_ff_script:new({ points_per_score = 6, fortpoints_per_score = 100 allowedmethod = redTeamOnly }) --Access to events is typically in the following format: function endzone:ontrigger( entity ) --What to do when this method is called --return anything, if necessary end Eventsallowed( allowed_entity )Called when the engine needs to know if the player in the first parameter of this function is allowed to trigger this entity. Return true from this function if the trigger is allowed, otherwise return false. onfailtouch( touch_entity )Called when allowed() returns false. ontouch( trigger_entity )Called when a player starts touching this entity. onendtouch( trigger_entity )Called when a player stops touching this entity. ontrigger( trigger_entity )Called when this entity is triggered. Note that this takes into account the wait time of this trigger, whereas ontouch() does not. |