Type Shield

Atlantis/Starship Shield Emitter

Methods

addPlayersToWhitelist( players ) Adds the given list of players to the shield's whitelist.
divertPower( face ) Sets the face to divert power to.
getDivertedFace() Gets the face index that the shield is currently diverting power to.
getFaceCharge( face ) Returns the current charge of the given face.
getMaxCharge() Returns the maximum possible charge of the shield emitter.
getRealTransferRate() Returns the current rate energy can be transferred between faces per transfer tick.
getSizeMultiplier() Returns the current size multiplier, if one is set.
getTotalCharge() Returns the current total charge of the shield emitter.
getTransferRate() Returns the maximum base rate energy can be transferred between faces per transfer tick.
getTransferTickInterval() Returns the time (in seconds) between shield facing power transfers (the transfer ticks).
getType() Returns the type (number identifier) of the shield emitter.
hasFaces() Returns whether the shield has faces or not.
hasWhitelist() Indicates whether the shield can whitelist certain players or not.
isActive() Returns whether the shield is currently active.
removePlayersFromWhitelist( players ) Removes the given list of players from the shield's whitelist.
setActive( active ) Sets whether the shield should be active.
setSizeMultiplier( sizeMultiplier ) Sets the size multiplier to use on the shield emitter.


Methods

Shield:addPlayersToWhitelist( players )
Adds the given list of players to the shield's whitelist.

Environment:

Server

Parameters:

  • players: A list of players to be added.

Usage:

    Shield:addPlayersToWhitelist( { Player1, Player2, Player3 } )
Shield:divertPower( face )
Sets the face to divert power to.

Environment:

Server

Parameters:

  • face: -1 distributes equally, 0 disables diversion, 1-6 match front, back, left, right, up, down.
Shield:getDivertedFace()
Gets the face index that the shield is currently diverting power to.

Environment:

Server

Return values:

  1. (number | nil) The face index that is currently being diverted to, if the shield has faces and access is allowed. -1 indicates that power is being distributed evenly, 0 indicates no diversion, and 1-6 correspond to front, back, left, right, up, down respectively.
  2. (string | nil) If the face index is nil, the reason why.
Shield:getFaceCharge( face )
Returns the current charge of the given face.

Environment:

Server

Parameters:

  • face: The face to check, 1-6 match front, back, left, right, up, down.
Shield:getMaxCharge()
Returns the maximum possible charge of the shield emitter.

Environment:

Server
Shield:getRealTransferRate()
Returns the current rate energy can be transferred between faces per transfer tick.

Environment:

Server

Usage:

    -- To compute the current transfer rate per second: 
    local EnergyPerSecond = Shield:getRealTransferRate() / Shield:getTransferTickInterval()
Shield:getSizeMultiplier()
Returns the current size multiplier, if one is set. A zero-vector indicates no multiplier has been applied.

Environment:

Server
Shield:getTotalCharge()
Returns the current total charge of the shield emitter.

Environment:

Server
Shield:getTransferRate()
Returns the maximum base rate energy can be transferred between faces per transfer tick.

Environment:

Server

Usage:

    -- To compute the base transfer rate per second: 
    local EnergyPerSecond = Shield:getTransferRate() / Shield:getTransferTickInterval()
Shield:getTransferTickInterval()
Returns the time (in seconds) between shield facing power transfers (the transfer ticks).

Environment:

Server
Shield:getType()
Returns the type (number identifier) of the shield emitter.

Environment:

Server
Shield:hasFaces()
Returns whether the shield has faces or not.

Environment:

Server

Return value:

    (boolean) True if the shield has faces.
Shield:hasWhitelist()
Indicates whether the shield can whitelist certain players or not.

Environment:

Server

Return value:

    (boolean) True if the shield can whitelist players, false otherwise.
Shield:isActive()
Returns whether the shield is currently active.

Environment:

Server
Shield:removePlayersFromWhitelist( players )
Removes the given list of players from the shield's whitelist.

Environment:

Server

Parameters:

  • players: A list of players to be removed.

Usage:

    Shield:removePlayersFromWhitelist( { Player1, Player2, Player3 } )
Shield:setActive( active )
Sets whether the shield should be active.

Environment:

Server

Parameters:

  • active: Boolean to indicate whether to activate or deactivate the shield.
Shield:setSizeMultiplier( sizeMultiplier )
Sets the size multiplier to use on the shield emitter.

Environment:

Server

Parameters:

  • (Vector | nil) sizeMultiplier: The size multiplier to use. Each component is clamped to be between 0.75 and 1. A nil value resets the multiplier.

Return values:

  1. (boolean) True if the size multiplier was updated, false otherwise.
  2. (string) If the size multiplier was not updated, the reason why.

Valid XHTML 1.0!