This record describes changes to the API in 1.7 Beta 5.

Encounter Block Override

In API 34, an adventure can override any station type's encounter definition:

<AdventureDesc unid="...">
   ...
   <EncounterOverrides>
      <Encounter unid="&stTinkerGathering;"  minAppearing="1"/>
   </EncounterOverrides>

</AdvendureDesc>

The <Encounter> element above supports any of the attributes of a station type's encounter definition. Any attributes not specified are not overridden.

Checking for Overlap

The engine is now better about making sure that stations do not spawn on top of worlds or asteroids. In addition, there is a new parameter for specifying how satellite spawning should check for overlap:

<Satellites overlapCheck="asteroids">
   <Orbitals ...>
      ...
   </Orbitals>
</Satellites>

By default, when satellites are placed, we don't check to see if they overlap an asteroid or other station. This can be overridden by the overlapCheck= parameter. The possible values are:

  • asteroids: When set to overlapCheck="asteroids", satellites will attempt to avoid being placed near any natural object of asteroid size or larger (>= 1 km diameter).
  • planetoids: With this setting, satellites avoid being placed near natural objects of 1,000 km or larger.

The parameter currently only works with <Orbitals>, which will try various random arrangements until it finds one that does not overlap. If no non-overlapping arrangement can be found, overlapping stations will not be created.

Sentry Order

API 34 adds the sentry order for ships. This should be used for stations that use ships as fixed turrets (instead of the hold order used previously).

Stealth

API 34 stretches out the stealth scale so that we have a finer granularity. The distance at which an object is detected depends on the difference between its stealth and the detector's perception.

If stealth == perception, then the object can be detected from 100 light-seconds away. For every point of stealth above perception, the detection range decreases by 83%. The following table shows the detection range for various differences:

STEALTH
DIFFERENCE   NEW RANGE     OLD RANGE
--------------------------------------------
 -4           250 ls        500 ls
 -3           175 ls        340 ls
 -2           145 ls        225 ls
 -1           120 ls        150 ls
  0           100 ls        100 ls
  1            83 ls         50 ls
  2            69 ls         25 ls
  3            58 ls         13 ls
  4            48 ls          6 ls
  5            40 ls          6 ls
  6            33 ls          6 ls
  7            28 ls          6 ls
  8            23 ls          6 ls
  9            19 ls          6 ls
 10            16 ls          6 ls
 11            13 ls          6 ls

I've adjusted all stealth values appropriately, though in some cases (like Pteravores) I've decreased the stealth value. For example, nebulae use to add 2 points to stealth; now they add 6 points.

TLisp

  • Added sysAddTypeRangeEvent which fires an event on a type when an object gets within some distance of another object. For example, you can use it to get an event when the player ship gets within a certain distance of an enemy station. NOTE: This is currently a one-time event.
  • sysCreateEncounter now takes a ship table to create an encounter. This uses the same methods as sysAddEncounterEvent.
  • Added 'removeDeviceMaxLevel property for objects. Returns the maximum level of device that the object can remove (or Nil if it cannot remove devices).
  • Added (objCalcBestTarget obj [objList]). With a single argument, this function returns the nearest visible target to obj. With the optional list, it returns the nearest visible target in objList. We never return friends (even if in objList). This is designed to be used with aOrderGiver and aAttacker. For example:

  • (objCalcBestTarget gSource (list aOrderGiver aAttacker))

    This makes it easier to decide (e.g.) whether to attack the player or one of the player's autons.

  • The operatingSpeed property for ship now takes two additional values. 'quarter makes the ship move at quarter speed. 'emergency makes the ship move at 50% faster than its maximum speed.
  • Added rotationSpeed property for ships, which gets/sets the rotation speed in degrees per tick. Positive numbers are clockwise rotations; negative numbers are counter-clockwise. Ship (including the player ship) will automatically attempt to slow their rotation.