User Tools

Site Tools


tnhscript:timedgrenade

TimedGrenade

A timed grenade is armed when it is thrown (but not dropped) from the player’s inventory. The grenade arms itself by playing a schema and activating a model tweq. After a delay, the grenade is slain. If the archetype for the grenade has a RenderFlash link, the flash is activated.

Picking up an active grenade will disarm it. Except if there is less than 2 seconds on the timer, it will explode. It also explodes in response to PokeStim or BashStim while armed. A FireStim will explode the grenade even when not armed.

Schemas are played for the grenade events. When armed, Event Activate is played followed by Event ActiveLoop which is a repeating schema. Event Deactivate is played when the grenade is disarmed, and Event Death when slain. Setting the schemas as a major anomaly makes any AI that hear it wander out of the range of the grenade. Make the schemas a minor anomaly, or set the volume very low, and they’ll be more likely to get hit. The Death schema, of course, should be a major anomaly.

A suitable archetype must be created for the grenade. Receptrons for PokeStim, BashStim, and FireStim should react with Send to Scripts. There should be a Corpse link to an explosion object. The Schema\Class Tags property classifies the archetype for playing schemas.

Messages FrobWorldBegin, FrobInvEnd, Slain
Links RenderFlash
Properties Script\Timing, Tweq\Models
Stims FireStim, BashStim, PokeStim
Schema Tags Event Activate, Event Deactivate, Event ActiveLoop, Event Death
Parameters launch_active (boolean) Activate the grenade immediately. Use when the grenade comes from an emitter trap.
tnhscript/timedgrenade.txt · Last modified: 2010/11/22 19:11 (external edit)