On my Aquila playership, there are two turrets (a port turret and a starboard turret). I want the player to be able to choose where they install weapons - whether it be as a main weapon or on a particular turret. Here is the device slot code:
Code: Select all
<DeviceSlots>
<DeviceSlot id="mainWeapon" criteria="w" maxCount="1" posAngle="0" posRadius="48" posZ="0" minFireArc="345" maxFireArc="15"/>
<DeviceSlot id="portTurret" criteria="p +property:singlePointOrigin;" linkedFire="whenInFireArc" minFireArc="355" maxFireArc="175" posAngle="90" posRadius="24" posZ="8"/>
<DeviceSlot id="starboardTurret" criteria="p +property:singlePointOrigin;" linkedFire="whenInFireArc" minFireArc="160" maxFireArc="5" posAngle="-90" posRadius="24" posZ="8"/>
<DeviceSlot criteria="l" posAngle="0" posRadius="48" posZ="0" omnidirectional="true"/>
</DeviceSlots>
<Devices>
<Device slotID="mainWeapon" deviceID="&itLamplighter;" />
<Device slotID="portTurret" deviceID="&itStarCannon;" />
<Device slotID="starboardTurret" deviceID="&itStarCannon;" />
<Device deviceID="&itNAMIHeavyLauncher;"/>
<Device deviceID="&itR9Deflector;"/>
<Device deviceID="&it1GWReactor;"/>
<Device deviceID="&vtDamageControlParty;"/>
</Devices>
Question:
Is there a way to check if a device slotID (eg. "portTurret") has a weapon installed on it? If so, can we determine which weapon it is and choose to uninstall it? I've tried using something like (objCanInstallItem gPlayerShip (itmCreate &itLaserCannon; 1) "portTurret") to check. However it always returns 'replacementRequired even if no weapon is installed... help me please!
Thanks in advance!