This document details the changes in API 27 to be release with Transcendence 1.6.

Floating-Point Support

1.6 includes support for floating-point math in the core TLisp engine. New functions evaluate to floating-point values:

  • (+ 0.5 2) -> 2.5
  • (- 2.0 0.5) -> 1.5
  • (* 10 0.5) -> 5.0
  • (/ 5 2) -> 2.5
  • (mod 5.25 0.5) -> 0.25
  • (pow 2.0 0.5) -> 1.414213562373095
  • (sqrtn 2.0) -> 1.414213562373095
  • (typeof 0.5) -> real

Library References

Starting in API 26, you must explicitly reference the Human Space library if you refer to core UNIDs:

<Library unid="&unidHumanSpaceLibrary;"/>

If you get errors about an undefined entity, you can include this library to fix the problem.

Note: There is no harm in including libraries even if you don't need them (other than some minor additional load time).

Resources and Module Paths

Resource filespecs in a module are relative to the module's path. For example, imagine a module is loaded with:

<Module filename="foo\mymodule.xml"/>

Inside mymodule.xml we have the following image definitions:

<Image unid="..." bitmap="myimage.jpg"/>

In API 26, we will look for the image in foomyimage.jpg. In previous versions, we would have looked in the current directory.

Ship Classes

  • Added defaultSovereign= parameter for <ShipClass>. This can be accessed as a type property. This represents the sovereign that generally creates this class and is used mostly for documentation purposes.
  • Added dockServicesScreen= parameter for <PlayerSettings>. This specifies the UNID to use for dock services when docked with a station. I also added shipConfigScreen= which specifies the dock screen UNID for viewing ship configuration.

Station Types

  • Added <Communications> element to station.

Items

  • Starting in API 26, assigning a slot category to a device causes the engine to treat it as that category. Previously, it would sometimes treat it that way and other times not. To reflect this change, the parameter has been changed to category= (instead of deviceSlotCategory=). The previous version still works, but is deprecated.
  • Added interceptRange= to <AutoDefenseDevice>. Value is in light-seconds and defaults to 10.
  • Added chargeRegen= and decayRegen= to <Armor> types. These are boolean parameters that specify that armor will regenerate (or decay) as many hit points as it has charges left (consuming the charges in the process). The rate of regeneration (or decay) is given by the regen= parameter (or decay=).
  • Added deviceHPBonus= and deviceCriteria= to <Armor> types. This gives an HP bonus to either shields or weapons, depending on the criteria specified. Negative numbers are also valid to give penalties.

System Types

  • Added backgroundID= parameter to <SystemType> to specify a space background. If the parameter is omitted, we default to rsDeepSpace. If "none" (or 0) is specified for backgroundID, then we don't show any background screen (only stars, as in the prior versions).
  • Added spaceEnvironmentTileSize= parameter to <SystemType>. This parameter overrides the default nebula tile size for the system. The following values are supported:
    • small: 128-pixel tiles (this is the default).
    • medium: 256-pixel tiles.
    • large: 512-pixel tiles.
    • huge: 1024-pixel tiles.
  • Added erode= parameter to circular and arc <SpaceEnvironment> directive. This value is the probability that a tile a the very edge of the shape will be omitted. The probability decreases proportionally towards the center-line of the shape (and is 0 at the center). For example, erode="50" means that half the tiles at the edge of the shape will be randomly omitted, creating a ragged appearance.

AI

  • Added 'goToPos order, which takes a vector as parameter.

Dock Screens

  • Dock screens can inherit panes from base classes. The base class must be a <DockScreen> and the pane is inherited into the context of the child screen. That is, we keep the screen attributes (such as list options) from the child.
  • Actions may optionally have a description underneath them. The description can be set with the descID parameter on an <Action>. The descID is the ID of the language element to use for the description. The description may also be set programmatically with (scrSetActionDesc).

Overlays

  • Added flag counter type.

Events

  • API 26 changes the order of the <GetGlobalDockScreen> event. It now takes place after the <OnObjDocked> event. This allows things like missions to change state before determining what screen to show.
  • Added <OnObjGate> event. This is called on the gate object when a ship succeeds in entering the gate. The gate object may return nil to continue with default behavior (ship gets destroyed). Or the gate object may handle it and return true to override.
  • Added <OnDamageAbandoned> event for weapons to get called when they hit an abandoned station (including asteroids and planets).
  • Added <OnDebriefed> event for missions.
  • In API 27, <OnArmorDamage> has an additional parameter: aFullDamageHP, which is the damage received before adjusting for armor damage type resistance.
  • Added <OnCreateShot> and <OnDestroyShot> for weapons. These are called when a shot is created and destroyed. They are called after OnFireWeapon and for each shot created. gSource is the shot object.

TransLisp

  • Starting in 1.6 Beta 4, the engine undefines all <Globals> at the start of a new game (or when loading an old game). It then re-runs all the <Globals> in the appropriate extensions. This guarantees that we don't have stale definitions from previous runs.
  • Added (sysSetPOV ...) to set the display POV.
  • Added (sovMessage sovereignID text). This sends a message to the player. This is similar to plyMessage, except it might (someday) be used in a multiplayer game.
  • Added (sovMessageFromObj sovereignID obj text). Same as above, but the message comes from an object.
  • Added 'alwaysLeaveWreck property for ships.
  • Added 'paintLayer property for stations (can set to either 'overhang or Nil, for default).
  • Added 'barrier property (boolean) for stations.
  • Added 'installDeviceStatus and 'installItemStatus property for stations items (the latter works for armor items also).
  • Added 'removeDeviceStatus property for station items.
  • Added 'instalArmorMaxLevel property for stations.
  • Added 'defaultSovereign property for ships and ship class types.
  • Added 'destNodeID, 'destStargateID, and 'stargateID properties for stargate objects.
  • Added (gamEnd ...) function to end the game successfully (equivalent of entering final stargate).
  • typGetProperty supersedes typGetDataField and should be used instead. Also, objGetProperty defaults to typGetProperty if the property is not handled by the object (it previously used to default to typGetDataField).
  • Added (sysCalcStdCombatStrength level), which returns the standard combat strength for a single ship at the given level. This can be compared against the 'combatStrength property for ships and used to dynamically create encounters appropriate to a level.
  • (objCanInstallItem ...) now takes an optional 3rd parameter which accepts either an armor segment or a device slot. If a device slot is passed in, we assume that we are replacing the item in that slot (and can count on that device slot being freed).
  • Added (scrSetActionDesc...) to set an action description.
  • Starting in API 27, the 'hp property on items returns the current number of hit points, not the maximum. We introduce 'maxHP property to get the max number.
  • Added (scrIsActionEnabled...)
  • Added 'availableDeviceSlots property for ships.
  • Added (sysGetRandomLocation ...)
  • Added flag to (sysFindObject...) to include markers.
  • Added (sysOrbit...) to create an orbit object.
0xabcdef 19 Dec 2016:

decayRegen is a typo. Should be called chargeDecay.