I am using the rpgInstallDevicePrep function in my upgradeable wingmen mod to check if the wingmen should be able to install upgrades at stations. As objCredit does not work for non-player ships yet I also need to use totalPrice or installPriceAdj to make the upgrade free. However, using either of these two fields will bypass the default install check on the station’s trade section using objGetItemProperty and will only check if the device can be installed against the legacy fields: maxTechLevel, techCriteria, techCriteriaOverride

I think it would be more useful if the price override was independent of the tech override. e.g.:
https://github.com/gcabbage/TranscendenceMods/blob/master/UpgradeableWingmen/RPGCode.xml
(this also adds calls to scrTranslate)

This change should have no impact on behavior of the core game. The only uses of the totalPrice field I could find were:
dsInstallSpecificDevice used by Blackmarket and Heritic, but these already set the maxTechLevel to 25
dsRPGInstallDeviceFromList used for the legacy reactor upgrade screens. These may stop working if called from a station without a Trade section. This could be fixed by adding the maxTechLevel field.

The totalPrice argument is used in the CC AutonBay - which would also need the maxTechLevel field adding.

Also, currencyUsed defaults to the currency of the target object, this should probably be the currency of the installerObj? Everytime this function is called currencyUsed is explicitly set to the currency of the installerObj

george moromisato 28 Oct 2016:

Good code, thanks!

I took your code and made one change to handle the Auton Bay: if the installerObj is the player ship and if the player ship doesn't have a Trade section, then we allow everything (as before).

I also changed the currencyUsed default to what you suggested.

Thanks again!