Ambrosia Garden Archive
    • Giving large quantities of an outfit and other stuff


      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)

    • Quote

      Originally posted by Jonathan Boyd:
      **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.
      **

      By any chance, could you clarify exactly what to do here? You want a cron for every ship, that is available every day, and that aborts all of those missions and returns the player to their original ship? I guess you would need to use contribute/require here...

      One problem I see, or rather, an inconvenience I see, would be if you wanted to grant these multiple outfits to the player after a mission is completed, you would need one version of that mission for every available ship, using the availShipType field. However, it will get the job done, especially if the amount of outfits you would Gxxx would exceed the character limit of the set field...

      This is an excellent solution to that problem!

      ~ SpacePirate

      ------------------
      Eat blazing electric death!

    • Quote

      Originally posted by SpacePirate:
      By any chance, could you clarify exactly what to do here? You want a cron for every ship, that is available every day, and that aborts all of those missions and returns the player to their original ship? I guess you would need to use contribute/require here...

      No. You need a misn for each ship that gets started when you acquire the ship and failed when you get rid of the ship. Each misn, when aborted, switches you to that ship. You then have a cron which switches you to another ship, the aborts all the misns. As only 1 misn is running, only 1 is aborted, firing off the operator to switch you back to the original ship.

      Hope that's a bit clearer.

      Quote

      One problem I see, or rather, an inconvenience I see, would be if you wanted to grant these multiple outfits to the player after a mission is completed, you would need one version of that mission for every available ship, using the availShipType field.

      Not quite. There's one misn for each ship, but running in the background already.

      Quote

      **However, it will get the job done, especially if the amount of outfits you would Gxxx would exceed the character limit of the set field...

      This is an excellent solution to that problem!**

      Or to garages, or anything else that requires a ship to be remembered. Similar things can be done with outfits. Or ranks. Or anything requiring memory.

      ------------------
      (url="http://"http://homepage.mac.com/jonathanboyd/evn/index.html")Classic4Nova plug-in(/url)

    • I think there's an easier way, to do this. I was just thinking about it, since I'll be doing it for the mass-thrust-accel system (along with a 16 bit BITEC counter with division).

      Basically, make outfits that a multiples. Use a cron to clear it up.
      1. Outfit1X
      2. Outfit10X

      A cron, with
      Enable: o2
      (Iterative) onStart: d2, g1 g1 g1 g1 g1 g1 g1 g1 g1 g1 g1

      You could also do as many multiples as you want, as long as the crons are in order.

      ------------------
      ~Charlie
      Sephil Saga Homepage: (url="http://"http://www.cwssoftware.com")www.cwssoftware.com(/url)

    • Here's a way to easily grant 1000 outfits:

      misn 128: onStart: A128 G1 G1 G1 G1 G1 G1 G1 G1 G1 G1
      misn 129: onStart: A129 S128 S128 S128 S128 S128 S128 S128 S128 S128 S128
      misn 130: onStart: A130 S129 S129 S129 S129 S129 S129 S129 S129 S129 S129

      To give the player 1000 of outf 1, just do a S130. This scales quite nicely, and still works if the number you want to give isn't divisible by nice numbers around 10 - just add a couple of G1's into misn130 for +1 or into misn 129 for +10, and so on.

      ------------------
      Get (url="http://"http://www.aznt.com/EVN/EVNEW")EVNEW(/url) - the free, open-source EVN plugin Editor for Windows!

    • Heh, there's always a simpler way...

      ------------------
      Here a slice, there a slice,
      everywhere a slice slice.