Thinking aloud here. If anyone has any insight, don't shy away from chiming in.
Decided to Keep It Simple, Stupid, and came up with this:
Code: Select all
<do_if value="this.station.units.count lt this.station.units.maxcount">
<set_value name="$MICT_StDrTradeFreeCapacity" exact="this.station.units.maxcount - this.station.units.count"/>
<set_value name="$MICT_StDrTradeWare" exact="ware.drp_interceptor_mk1"/>
<set_value name="$MICT_StDrTradePrice" exact="ware.drp_interceptor_mk1.averageprice"/>
<create_trade_offer amount="$MICT_StDrTradeFreeCapacity" buyer="this.station" object="this.station" name="$MICT_StDrTrade" ware="$MICT_StDrTradeWare" price="$MICT_StDrTradePrice" unbundle="true" playeronly="false" />
<show_notification caption="'=== MICT Drone Project ==='" details="'%1 placed order for \n %2 units of %3 \n at %4Cr per unit.'.[this.station.knownname, $MICT_StDrTradeFreeCapacity, $MICT_StDrTradeWare, $MICT_StDrTradePrice / 100]" queued="false" priority="8"/>
<write_to_logbook category="tips" text="'%1 placed order for \n %2 units of %3 \n at %4Cr per unit.'.[this.station.knownname, $MICT_StDrTradeFreeCapacity, $MICT_StDrTradeWare, $MICT_StDrTradePrice / 100]"/>
</do_if>
Works, sort of. All of the player-owned stations place orders on the market for interceptor mk1s, and NPCs trade with them, and everyone's happy.
HOWEVER, NPC stations do
not place orders. Could verify that it fires: <create_trade_offer ... /> is run by NPC-owned stations, but it doesn't generate actual trade orders.
Now, adding <add_tradeware ware="$MICT_StDrTradeWare" object="this.station" allowbuy="true"/> DOES result in NPCs generating a trade order for that ware, however they do not then equip the drones that they buy! Rather, <add_tradeware ... /> appears to be a general-purpose command to get stations to trade in that ware with amount governed by how much storage they have, and price governed by supply and demand -- itself interesting, but not what I'm trying to do at this time.