User Tools

Site Tools


script:module:app

This is an old revision of the document!


App (Module)

Module that wraps the native App class. Derived classes like ClientApp may also augment the module with their variables and functions.

Functions

gamePlugin ( )

Returns the identifier of the currently loaded game plugin. The return value is text, for instance for the Doom game plugin:

"doom"

Variables

audienceForGameChange

An array of functions that will be called whenever the game changes. Note that this is also called when the game is unloaded. The ID of the loaded game mode is provided as an argument to the functions.

def gameHasChanged(newGame)
    print "Game is now:", newGame
end
App.audienceForGameChange += [gameHasChanged]

App.Player

Base class for players in the game.

armor ( )

(Availability: Not available in Hexen.)

Returns the current armor points of the player.

armorType ( )

(Availability: Not available in Hexen.)

Returns the current armor type (0, 1, or 2) of the player.

health ( )

Returns the current health points of the player.

id ( )

Returns the ID/console number of the player. In a single-player game, this is always zero.

power ( type : Number )

Returns one of the power-up counters of the player. The returned value is the number of 35 Hz tics that the power-up is in effect. It counts downward over time. If the returned value is positive, the corresponding power-up is currently active.

The values for type depend on the game (see enum powertype_t).

thing ( )

Returns the player mobj as a World.Thing object.

script/module/app.1577021481.txt.gz · Last modified: 2019-12-22 15:31 by skyjake