Script objects

From The DarkMod Wiki
Revision as of 11:20, 15 January 2011 by Tels (talk | contribs) (update after split)
Jump to navigationJump to search

Introduction

A script object is an object that is written in the idTech4 scripting language, and an be attached to arbitrary entities. Each entity can have only one script object.

For your convience, TDM already contains a few useful script objects:

tdm_suicide

 "script_object" "tdm_suicide"
 "remove_delay"  "100"              // remove this entity 100 seconds after spawning it

tdm_light_holder

 "script_object" "tdm_light_holder"
 "extinguished"  "1"                // the light starts off, but can be lit by the player

This is typical attached to either lights (an electrical lamp f.i.) or light holders (a candle holder with attached candle + flame, or a torch with attached flame). This script object has handy methods to toggle all lights that this holder has, regardless how many (multiple flames?) or where (flame on holder or flame on candle on holder?).

This script object also makes the entity react to fire stims, an/or triggers like when you link a button/lever/trigger to this entity.

See also