SERIOUS EDIT : OK, got some sleep and mulled over it. As far as I can reason, the best way to get the result you're looking for is the least elegant.
Make the Hardpoint outfit, say o200 again, grant o207. o207 is an invisible counter outfit, and for every instance of it you own, you can buy one launcher of any type. Each launcher takes 0 tons (since you already have the hardpoint), removes outfit 207 on buy and grants it on sell.
Also, you would need to make o200 unsellable, and instead make another outfit, o208, which, when bought, deletes itself and o200. It can only be bought if you have o207 (which would mean that you have fewer launchers than hardpoints). This will keep people from being able to exceed the typical number of launchers buy buying a hardpoint, buying a launcher, selling the hardpoint, then repeating.
My reasoning for offering this solution is as follows: in any other way I can figure, since they all involve invisible launchers (including the one I originally posted), the player would get too much of a benefit from having more than one type of hardpoint/launcher combo, or would not be able to get the benefit of two instances of the same launcher. To put it into more specific terms, if you had 2 hardpoints, then bought some, say, IR missiles, you would launch them at 2x normal speed. Fine; two launchers, 2x speed. However, then if you bought some Radar missiles as well, you would be able to launch both IR and Radar missiles at 2x speed each (so 2 hardpoints, but acting as 4 launchers). The only way I can figure of getting around this problem is by making the player specify how many of what types of launcher they want. It's not as elegant, but as far as I can figure it's the most reasonable solution.
_(old post, just here for posterity)
If you weren't talking about different types of ammunition (or anything depletable), it would be easy enough using sleeper outfits (or maybe even counter cröns). But since you are, it's going to take a bit more pontification.
OK, well, for fighters I don't think this would work, since Nova doesn't count launched fighters as aboard your ship, although they do contribute to the MaxAmmo field. But, for missiles, it should work all right.
- Make Hardpoint
- Make the 3 missiles
3 ****) Make 3 different launchers (one for each missile), make them invisible and not selected when there's no ammo. Furthermore, make the hardpoint grant them on purchase and delete them on sale
- Make each type of missile require that you don't own the other two types of missiles before you can buy them
Now, this will only work, however, if you only want the player to be able to buy one type of missile period, not one type of missile per hardpoint. If you wanted to do that, you'd need to follow steps 1-3, but omit 4. Then, you'd have to… do something that I can't come up with at 5:15 AM. Let me get back to you on that.
Oh well here's one that will work if the max number of hardpoints is 2. Make it toggle, say, b2000 when you buy it AND when you sell it. Now, I'm going to have to assign some arbitrary ResIDs for simplicity's sake:
Hardpoint = o200 (also grants one launcher for each missile on buy, and deletes them on sell)
Missiles 1-3 = o201-o203
Toggle Bit = b2000 (toggles on buying and selling o200)
Make the availability for the missiles read as follows:
Outfit 201:
o200 & (!(o202 | o203) | (!b2000 & !(o202 & o203)))
Then, do 202, replacing o202 with o201 and do the same for 203. What this means in essence is you can only buy the missiles if you have the hardpoint AND don't have either other type of missile OR if you have two hardpoints only ONE other type of missile.
For more than 2 max hardpoints I'll have to think of something else. I can kind-of see something a little bit, but I'm not entirely lucid at the moment.
There may be a way to do this using fewer resources or less mucking about, but that's a start._
This post has been edited by Archon : 04 April 2009 - 03:36 PM