User Tools

Site Tools


modding:xml:api_version

This is an old revision of the document!


Every extension declares the version of Transcendence that it is compatible with. This allows the Transcendence engine to maintain the greatest level of compatibility while still adding new features and evolving the API.

Starting with Transcendence version 1.08e, the method for declaring the compatibility version has itself changed. An extension using 1.1+ features must declare itself compatible by adding a new property in its root element:

<TranscendenceExtension ...
   apiVersion="{version}"
   ...
   >
...

Where {version} is a the version number of the API that the extension is compatible with. If the extension runs on an earlier engine that doesn't support the given API version, then the engine will refuse to load the extension. Conversely, if the extension runs on a later engine with a later API, the engine will try to preserve API compatibility with the extension's declared API version.

For example, an extension with apiVersion=“13” is declaring that it requires Transcendence 1.2 Alpha 1 to run. And that if it runs on a later version, it should use API version 13 compatibility (even if later versions change the API in some way).

Extensions may still use the older version property to specify that they wish to be compatible with older versions.

The following API versions are implemented:

API Version 14

[IN PROGRESS] Transcendence 1.2 Beta 1 and above.

Functions

  • (objGetArmorRepairPrice obj armorItem hpToRepair): Returns the price that a station (obj) will charge the player to repair the given number of hp on the given armor item. Returns Nil if the station cannot repair. This function uses the new <RepairArmor> sub-element in <Trade>. NOTE: This function includes price adjustments from called <GetGlobalPlayerPriceAdj>.
  • (objGetArmorReplacePrice obj armorItem): Returns the price to replace one of the player ship's armor segments with the given item. NOTE: This function calls <GetGlobalPlayerPriceAdj>.
  • (objGetPlayerPriceAdj obj [data]): Returns the player price adjustment (see <GetGlobalPlayerPriceAdj>).
  • (typeof exp): Returns the type.

Global Events

  • <GetGlobalPlayerPriceAdj>: Allows a type to adjust the price that a station will charge the player for a service or an item. The event may return Nil to skip price adjustment, or it may return an integer indicating the percent to adjust the price by. For example, returning 75 make the price 75% of the original price. The parameters for the event are:
    • aService: The service that the player is using. One of the following: priceOfferedToPlayer, priceForPlayerToBuy, valueOfDonation, priceToRefuel, priceToRepairArmor, priceToReplaceArmor, priceToInstallDevice, priceToRemoveDevice, customPrice.
    • aProviderObj: The object that is offering the service (e.g., the station selling the item).
    • gItem: The item involved in the service (if any).
    • gData: Any custom data passed in to (objGetPlayerPriceAdj).

Object Events

  • <OnPlayerBlacklisted>: Fires to a station when it blacklists the player. For example, if station A blacklists the player, it will get the <OnPlayerBlacklisted> event (gSource is the station).
  • <OnObjBlacklistedPlayer>: Fires when any registered object blacklists the player. You must call objRegisterForEvents to receive this event.

Object Properties

  • 'playerBlacklisted property: Returns True/Nil is the player is blacklisted by a station. E.g., (objGetProperty someStation 'playerBlacklisted) return True if someStation has blacklisted the player.
  • 'playerMissionsGiven: The number of missions that this object has assigned to the player.
  • 'underAttack property: Same as (objIsUnderAttack).
  • You may use the “property:” criteria to select objects that have a specific property. For example, (sysFindObject nil “T +property:immutable;”) finds all immutable stations in the system (e.g., stargates). Any boolean property for objGetProperty is accepted.

Ship Orders

  • (shpOrder shipObj 'fireEvent targetObj event): To execute this order we fire the given event to the given object. This is useful to program a ship to notify some other object that it has reached a certain point in its orders. For example, you could order a ship to attack a target and follow up with an order to fire an event. When the order to attack is complete, the next order will fire an event, allowing you to execute whatever script you want.
  • (shpOrder shipObj 'sendMessage targetObj string): This order sends the given message to the given targetObj. For example, you may use this to send a message to the player from the ship.
  • (shpOrder shipObj 'waitForUndock targetObj): This order keeps the ship waiting until the given targetObj undocks from its station.

API Version 13

Trascendence 1.2 Alpha 1 and above.

Devices

  • Added hpBonus to <Device> and <DeviceSlot>

Stations

  • Added maxLightRadius= parameter to stars (<StationType>)
  • Added <FilterColorize> element to station <Image> tags.
  • Added <AcceptDonation> tag to <Trade>
  • Added <Refuel> tag to <Trade>
  • Added <InstallArmor> tag to <Trade>
  • Added <InstallDevice> tag to <Trade>
  • Added <RemoveDevice> tag to <Trade>
  • Added maxAppearing parameter to <StationType>

System Definition

  • Added aOrbit variable to <Code> in system definitions.
  • Added <OrbitalDistribution> as <SystemType> directive
  • Added radius= and angle= to <Offset> directive in <SystemType>
  • Added minDist= and maxDist= to <RandomLocation>
  • Added minDist= and maxDist= to <FillLocations>
  • Added count= to <FillLocations> (used if percentFull is omitted).
  • <RandomStation> directive in <SystemType> takes parameters valid for <Station>
  • Added “systemLevel:…” syntax to levelFrequency in <RandomItem>
  • Deprecated <FillRandomLocation>; use <FillLocations> instead.

New and Changed Functions

  • (msnFireEvent)
  • (msnGetProperty): Added 'acceptedOn property to missions
  • (msnGetProperty): Added 'description property to missions
  • (msnGetProperty): Added 'name property to missions
  • (msnGetStaticData)
  • (objGetProperty): Added 'orbit to station properties
  • (objGetProperty): Added 'repairArmorMaxLevel property to stations.
  • (objGetProperty): Added 'installDeviceMaxLevel property to stations.
  • (sysOrbitPos)
  • (typFind): Added isEnemyOf:{unid} to typFind (for station types)
  • (typTranslate)
  • (unvFindObj)

Miscellanous

  • Added <Type> to create generic types (for holding global data, etc.)
  • <Language> elements parse and translate escape sequences (e.g., %name%).

Core Libraries

  • Added stK-TypeStar to Universe library
  • Added stNebulaStar to Universe library
  • Non-random star systems now create extra stargates if needed.
  • Only nodes with “huaramarcaGate” attribute are eligible for gate to Huaramarca.
  • Added “BasicFuel” attribute to all basic fuels (all except uranium, Heliotrope fuel, and longzhu)
  • Added dsPRGReful screen
  • srvFindRepairArmor checks for <RepairArmor> tag, so “NPCService” data is deprecated
  • Added dsRPGDeliveryMission

API Version 12

Transcendence 1.08e and above.

  • apiVersion property used to specify compatibility version.
  • Player ship classes must use “00200000_PlayerShip” attribute in order to appear as a player ship in Stars of the Pilgrim adventure.
  • Engine validates existence of sound references. I.e., types cannot refer to non-existent sound UNIDs.
  • An extension/adventure cannot define multiple types of the same UNID (an error will be reported). In previous versions one of the types was silently ignored.

API Version 1.1

Transcendence 1.04 and above.

NOTE: You must use version=“1.1” to access this API version.

API Version 1.0

Transcendence 1.0 and above.

NOTE: You must use version=“1.0” to access this API version.

  • For version 1.0 and below, when defining weapons, passthrough should not equal “0” (or it will default to “50”).
  • For version 1.0 and below, when defining <SmokeTrail> effects there was a bug with emitSpeed. Double the normal speed for compatibility.
  • For version 1.0 and below, when defining weapons, the shield damage modified used a different calculation because we only allocated 3 bits for the damage range.e.
modding/xml/api_version.1378096427.txt.gz · Last modified: 2014/12/27 04:40 (external edit)