dcsex.world
World - functions related to the game world.
Contents
- Description
- Functions
- _t.getCoalitionEnemy(side)
- _t.getCoalitionString(coaID)
- _t.getCurrentMarkID()
- _t.getNextMarkID()
- _t.isEnemy(side1, side2)
- _t.unit.isPlayer(unit)
- _t.unit.explode(unit, amount)
- _t.unit.getLifeNormalized(unit)
- _t.unit.setCarrierIllumination(unit, mode)
- _t.unit.setLife(unit, life)
- _t.group.isAlive(grp)
- _t.group.isPlayer(grp)
Description
All the functions in this module take a DCS object instance.
Functions
_t.getCoalitionEnemy(side)
Parameters
- side
- coalition we want the enemy of
Returns
- enemy coalition id from
coalition.side
table.
_t.getCoalitionString(coaID)
Parameters
- coaID
- coalition ID
Returns
- string or nil if invalid coaID provided
_t.getCurrentMarkID()
Returns
- number or nil
_t.getNextMarkID()
Returns
- number
_t.isEnemy(side1, side2)
Parameters
- side1
- side2
Returns
- true means
side1
andside2
are enemies
_t.unit.isPlayer(unit)
Parameters
- unit
- DCS Unit instance return true if the unit is controlled by a player
_t.unit.explode(unit, amount)
Parameters
- unit
- DCS Unit instance
- amount
- power factor of the explosion
_t.unit.getLifeNormalized(unit)
Parameters
- unit
- DCS Unit instance return normalized health of unit
_t.unit.setCarrierIllumination(unit, mode)
Parameters
- unit
- DCS Unit instance
- mode
- one of the values from table ex.enum.CARRIER_ILLUM_MODE
_t.unit.setLife(unit, life)
Parameters
- unit
- DCS Unit instance
- life
- normalized float
_t.group.isAlive(grp)
A more refined but heavier version of this function is to check that there exists at least one unit with a life value greater than or equal to one.
Parameters
- grp
- a DCS Group instance
Returns
- true the group is alive
_t.group.isPlayer(grp)
Parameters
- grp
- a DCS Group instance
Returns
- true if at least one unit in the group is a player