This record describes API changes in 1.8 Beta 1.
Buying Ships
In API 40 the dsRPGShipBroker
screen now requires ships to have the shipBroker
attribute to offer them for sale.
Ship Classes
<DeviceSlots>
In previous versions you could define device slots in the <Devices>
subelement of a <ShipClass>
. In API 40 you can specify device slots in a separate subelement. This allows subclasses to inherit device slots without inheriting device definitions.
<ShipClass ...
/>
...
<DeviceSlots>
<DeviceSlot criteria="w" posAngle="0" posRadius="3" posZ="14"/>
</DeviceSlots>
...
</ShipClass>
<Drive>
In previous versions you could define the properties of the ship's drive as attributes of the main element. In API 40 you can define them in a sub-element called <Drive>
. This allows subclasses to inherit drive properties. For example:
<ShipClass ...
/>
...
<Drive
maxSpeed= "20"
thrust= "250"
powerUse= "20"
/>
...
</ShipClass>
NOTE: When inheriting a <Drive>
element you should specify absolute thrust (with thrust=
) instead of thrustRatio=
. This is because we cannot calculate thrust ratio without knowing the total mass of the ship and we can't tell the mass until after we've figure out the subclass.
<Hull>
The <Hull>
subelement allows you to specify properties of the hull, such as size, mass, and armor limits in a way that can be inherited by subclasses. For example:
<ShipClass ...
/>
...
<Hull
size= "40"
mass= "100"
cargoSpace= "250"
maxReactorPower= "10000"
maxCargoSpace= "250"
maxDevices= "8"
maxWeapons= "1"
stdArmor= "4000"
maxArmor= "20000"
maxArmorSpeed= "10"
minArmorSpeed= "13"
/>
...
</ShipClass>
Named Device Slots
You may name a <DeviceSlot>
:
<ShipClass...>
...
<DeviceSlots>
<DeviceSlot id="topTurret" criteria="..." .../>
</DeviceSlots>
</ShipClass>
A named device slot can only be occupied by a single device. Once a device is placed in that slot, other device installations skip that slot.
You may specify that more than one device can fit in the slot with maxCount=
.
Miscellaneous
- You may now specify
eventHandler=
in a ship class. - Ship classes automatically compute a default hullValue.
ProtectWingman Equipment
By default, the player ship cannot harm its own wingmen. This protection is implemented as a default piece of <Equipment>
.
You may disable the protection using the <Equipment>
subelement in a ship class. Or you may call objChangeEquipmentStatus
to uninstall or damage it.
levelCheck
For devices that enhance other devices, you can use the levelCheck
parameter to specify that the enhancement only happens if the target device is of equal or lesser level that the device doing the enhancing.
In API 40, levelCheck=
may have the following values:
levelCheck="true"
: The target armor/device must be of equal or lesser level.levelCheck="level"
: Same as above.levelCheck="repairLevel"
: The target armor's repair level must be of equal or lesser level.
TLisp
- Added
thrustRatio
property for ships. - Added
hasVariants
property for ship classes, which returnTrue
if the class has randomized equipment. - Added
objGetCharacterData
andobjSetCharacterData
: These functions allow you to get and retrieve data from the character associated with a ship object. (objGetShipBuyPrice obj shipObj)
returns the price thatobj
will pay to buyshipObj
. Normally,shipObj
is a ship object, but you may also pass a structure of the form{ shipClass:xxxx }
to specify a ship class instead of a ship. The same thing applies toobjGetShipSellPrice
.- When an event handler is removed, we now invoke
<OnEventHandlerTerm>
to give the event handler a chance to clean up. - Objects now have the
namePattern
property which returns a struct with two fields.pattern
is the raw name pattern (including pluralization rules, etc.).flags
is the flags for the pattern. - Calling
(objSetName shipObj Nil)
now clears out the ship's name and resets it to the class name. - Characters are now stored on ship objects, not in the class. We've added the
character
property for a ship, which can be both get and set. - Added
+character:unid
as a special attribute insysFindObject
. - The
+systemLevel:nn
special attribute allows searching for types relative to the current system level. For example,+systemLevel:0
selects only types that are equal to the system level.+systemLevel:0-2
selects types that are between the system level and 2 levels above the system level (inclusive). - Added
objHasTradeService
, which returns whether a given object offers the given service. - Added
hullValue
property for ship classes. - Added
currency
property for ship classes. - Added
currencyName
property. - The
multiShot
property for weapons returnsTrue
if the weapon fires multiple shots (as in dual or triple shots). - The
repeating
property for weapons returns the repeating count. - The
msnFind
function now takesc
as a criteria to include missions that have been completed (successfully or not) but that may or may not have been debriefed. - Added
A
criteria tounvFindObject
to return only active objects. Also addedK
criteria to return only abandoned stations. - Added
dbgSet
anddbgGet
to enable various debugging options.