Altering Frob with Scripting

From The DarkMod Wiki
Revision as of 16:58, 10 September 2006 by Greebo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Originally written by Ishtvan on http://forums.thedarkmod.com/topic/4205

Mappers may want to set and unset frobability on items. For example, items within a glass display case could be set to not frobable until the glass breaks, if the FM author wants to place them closer than the "frob width" without them frobbing. To do this, these scriptfunctions may be used:

// set and get whether the entity is frobable
scriptEvent void setFrobable( float frobable );
scriptEvent float isFrobable( );

Example:

// set an entity to be frobable
$<ent name>.setFrobable( 1 );
// set an entity to be unfrobable
$<ent name>.setFrobable( 0 ) to set it unfrobable.