User Tools

Site Tools


script:module:world

This is an old revision of the document!


World (Module)

Native module that provides bindings to objects in the game world.

Functions

consolePlayer ( )

Returns an object representing the console player (App.Player).

World.Thing

Base class for mobjs.

attack ( damage : Number, missileId : Number )

(Availability: 2.2, only in Heretic.)

Starts the attack action of an enemy by calling the native function P_Attack(). If the current target of the enemy is in the melee range, damage points of damage will be dealt. Otherwise, a missile is spawned.

health ( )

Returns the remaining hit points of the thing (as a Number).

id ( )

Returns the ID number of the thing.

player ( )

If the mobj belongs to a player, returns an object representing that player (see App.Player). Otherwise returns None.

recoil ( force : Number )

Pushes the thing backwards by force units. For example, the Heretic Phoenix Rod uses a recoil of 4 units. The current direction of the thing determines which direction the recoil is applied.

startSound ( id : Text, volume : Number = 1.0 )

Starts playing a sound using the thing as the emitter. By default, the volume is at maximum (1.0). There must be a Sound definition with a matching id.

script/module/world.1576428056.txt.gz · Last modified: 2019-12-15 18:40 by skyjake