I have checked, and altering the perception value in an <AISettings> block for a playership seems to correctly change the distance at which stealth ships become visible to the player controlling said playership. As far as I can tell the game only checks that value once, then all future attempts to retrieve or modifiy it are ignored. My theory is that the perception value is moved to some alternative location once a ship is recognized as being a playership and then all AISettings for that ship are ignored for future functions. I have tried to access a perception value using shpGetDataField, objGetDataField and typGetDatafield but none of them return a value for a "perception" data-field.
I have included a copy of the xml data for the theoretical anti-stealth device in question. All names, descriptions and values are subject to change. I would greatly appreciate any help with getting this device to work for playerships or just confirmation that it is currently impossible and that all hope is lost and whatnot.
Code: Select all
<?xml version="1.0" ?>
<TranscendenceModule>
<!-- ================================================================ -->
<!-- DRADIS Base Device -->
<!-- ================================================================ -->
<!-- DRADIS Base Class -->
<ItemType UNID="&baCCDRADISBase;"
name= "(DRADIS base class)"
virtual= "true"
>
<Events>
<CanBeInstalled>
(switch
(not (not (objGetItems gSource "dI +cabbageDRADIS")))
(block Nil
(objSendMessage gSource Nil "You cannot install another DRADIS module as it will interfere with the one currently installed.")
"You cannot install another DRADIS module as it will interfere with the one currently installed."
)
True
)
</CanBeInstalled>
<OnEnable>
(block Nil
(objSetData gSource "CCShipBasePerception" (shpGetAISetting gSource 'perception))
(shpSetAISetting gSource "perception"
(max
(add
(objGetData gSource 'CCShipBasePerception)
(@ (itmGetStaticData gItem "CCDRADIS")'addPerception)
)
(@ (itmGetStaticData gItem "CCDRADIS") 'minPerception)
)
)
)
</OnEnable>
<OnDisable>
(shpSetAISetting gSource "perception" (objGetData gSource 'CCShipBasePerception))
</OnDisable>
</Events>
</ItemType>
<!-- ================================================================ -->
<!-- DRADIS Devices -->
<!-- ================================================================ -->
<!-- mark I DRADIS module -->
<ItemType UNID="&itCCMIDRADISModule;"
name= "mark I DRADIS module"
attributes= "cabbageCorp, cabbageDRADIS, majorItem, specialty"
inherit= "&baCCDRADISBase;"
level= "5"
frequency= "veryrare"
value= "6000"
mass= "4000"
description= "This device increases the effective perception of a ship's targeting systems, increasing the range at which it can detect hidden objects in space."
>
<Image imageID="&rsCCItems;" imageX="96" imageY="0" imageWidth="96" imageHeight="96"/>
<MiscellaneousDevice
powerUse= "20"
/>
<StaticData>
<CCDRADIS>
{minPerception:3 addPerception:1}
</CCDRADIS>
</StaticData>
</ItemType>
</TranscendenceModule>