In the process of testing a plug, I decided I wanted to grant the pilot 1000 of an item part of the way through. Chucking a bunch of Gxxx operators into a cron/misn would take absurdly wrong and quite possibly do bad things to Nova, so I came up with a solution:
Have a stripped out dummy ship, with no weapons and outfits, aside from the outfit you want to give and the appropriate quantity of the item. Use the Exxx operator to give the player that ship, then the Cxxx operator to switch back to their original one. Problem solved.
Or is it? Works fine if you know what ship the player will be flying, but if you want them to have any choice, you need dozens of crons.... right?
Actually, no. For each ship the player can have, provide a unique misn that doesn't end and gets triggered by Sxxx when the ship is purchased or captured and fail - important to use fail instead of abort - it when the ship is retired. Each mission, when aborted, will Cxxx to the relevant ship and Sxxx the misn again.
You then need a cron/misn/whatever that uses Exxx to switch to the outfit giving ship, then aborts every single one of the other misns. Only one will be active, so only one will be aborted, restoring the player to their original ship.
If you're using lots of variants on ships you could cut down on the number of misns required by setting up the variants as follows:
Variant has outfits which would adjust the stats of the baseline model to agree with variant. Capture of variant fires trigger which uses Cxxx to give the player the basline ship, but with performance and weaponry/equipment of the variant. Capture of the variant must also fire the Sxxx trigger for the baseline ship because its OnPurchase/OnCapture fields don't fire when switched using Cxxx, Exxx, etc.
------------------
(url="http://"http://homepage.mac.com/jonathanboyd/evn/index.html")Classic4Nova plug-in(/url)