Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Normaly, you can't have the sell button check for requirements the same way you can for availability.
Say in your scenario, you have special class of long range weapons. In order to use them, you must first purchase an upgrade outfit. Say, a long range targeting system. But you only need one, and it will allow you to have as many long range weapons as you can hold. The point is that the player shouldn't be able to sell the targeting system as long as he has the weapons.
There are a couple ways around this that I can see.
1) Use the limited ammo function that prevents you from selling a weapon if it has ammo left to act as the control.
The weapon outfits have a test condition (or require bit) to see if you have the targeting system in order for you to buy them.
The targeting system is actually placeholder weapon that has an ammo limit (in the weap resource) The weapon does not actually fire. (fire only with key carried, and never give a key carried)
When you buy any long range weapon, have it also Gxxx an ammo outfit for the placeholder weapon. When you sell it, Dxxx a placeholder weapon ammo. Give this ammo outfit a player info name of "long range weapon"
So, when you try to sell the targeting system and you still have long rage weapons, Nova will prevent you and tell you that you have to sell a "long range weapon" first.
Pros: Looks very clean in the outfitter. Cons: Uses extra weap and outf resources. Adds complexity to the ship resource. Need to set up the extra weapons and ammo in case the player captures or buys a ship that stocks them. Also requires the player to sell items in a particular order - could be annoying to find them all.
2) Make it so you can't sell the targeting system. And instead use a another outfit to sell it. Such as "Sell Long Range Targeting System" outfit. This way you can use the buy button functionality to test for the presence of the weapons first.
Give this item a negative cost (I don't remember if negative cost works. If not, simply start an auto-aborting mission that gives credits)
Pros: Less resource usage. Simpler to set up (especially so in NPC ships) Cons: Very cluttered looking in the outfitter. You can hide and show bassed on availability, or use the supress higher RIDs for the same display weight to cover up uneeded buttons. But this will have the effect of the outtfitter re-scrolling to the top every time the layout changes. Very annoying with lots of outfits. Also, you still have to hunt for the items you need to sell off first.
3) Use the targeting system's onSell field to set a bit and start a mission that dateposts. The set bit starts a series of crons that check for the presence of the weapons. Then, if no weapons are present it will Dxxx the targeting system, then run a credit giving misn.
If weapons are detected it doesn't Dxxx the item and presents a dialogue. You could have this run a mission that tells the player he needs to sell off the weapons first. In theory, a misn could run asking if they should automatically be sold now. This can lead to a series of iterative crons (one for each weapon) that Dxxx and grant credits.
I thought this was going to be the winning soluting. As it is both clean in the outfitter, and the extra resource usage is placed in the misns and crons. There is extra complexity there, but also makes the ship resources much cleaner. The problem is that the item is sold off instantly when you click sell. Not a problem itself, since you can Gxxx item in the onSell field and take away the refunded credits as you begin the misn/cron sequence.
The problem is that Nova gives you full credit for the item if you haven't left the outfitter yet. But only gives you half credit later on. (Dateposting in the outfitter doesn't affect this)
This being the case, I can't see how i'm going to use misns to take back the credits, since there's no way to tell how much Nova automatically refunded.
I could make the items cost 0, and charge money using misns, but that will allow the player to go into massive debt. Very possibly abusive debt. (Also means the cost needs to be in the description field.)
Right now, I'm using a combination of options 1 and 2, depending on the nature of the outfits.
Have I been dumb and missed a simpler way of doing this? Does anyone else have usefull thoughts here?
Try using the IncreaseMax modtype. From memory, although you can buy up to the standard max for any outfit anyway and then buy one outfit set to increase its max, you can't sell the IncreaseMax outfit back again until you sell off all of the first outfit. Of course, doing it this way would mean you would have to set the max of the long-range weapon to 1 else you would be able to buy multiple targetting systems by buying multiple weapons.
Oooh. Very nice.
This works, but for only up to 4 items. But still very good for many situations.
You can have more if those items grant a placeholder and the increaseMax points to that... but then the trick is very close to the max ammo trick, but without the weap resource. So that's still a bonus.
Edit: Wait, your last sentence didn't parse. I would set the targeting system to max 1, how would buying more weaps allow more? The link points the other way.
128 Weapon 1 - Max 1000 - Require 131 to buy 129 Weapon 2 - Max 1000 - Require 131 to buy 130 Weapon 3 - Max 1000 - Require 131 to buy
131 Targeting System - Max 1 - IncreaseMax of 128 129 130
This makes it so 131 can't be sold until weapons 128 129 130 are gone first.
This post has been edited by Desprez : 25 March 2006 - 09:20 AM
Ah yes, I seem to have confused myself a bit. :rolleyes:
Heh, just tried something stupid: An outfit that increases its own max. This allowed me to buy up to 8192 (2^13) of them when the max was only 5. Of course, I couldn't do it all in one go and it was equally annoying to sell them all off again. The best part is, you can't sell the last one.
@guy, on Mar 28 2006, 06:20 AM, said in Special requirements for selling outfits:
Huh.
What if it increases and decreases its own max?
But come to think of it, you could probably increase/decrease another outfit to gain the requirement of not selling one while having the other and at the same time not actualy increasing it's max.
Or pehaps you can increase by 0
Things to try, I suppose.
Edit: Ok, I'm an idiot. That's not how IncreaseMax works. Never mind.
Your approach might be a tool to have an outfit that you could get multiples of, but can't completely recover back to the original state, without resorting to all kinds of fancy links and multiple outfits.
This post has been edited by Desprez : 09 April 2006 - 09:28 AM
Ok, I guess method 3 is still viable. True, you can go into massive debt if buying it runs a credit subtracting misn. But you can't buy fuel while in debt. And that seems to be a pretty good safeguard against abusing it. Seeing as how your game is basicaly over if you can't buy fuel.
So for items that won't work with IncreaseMax, which method do you like the best?
I'm leaning towards 3 despite the relatively heavy setup, but one other thing that I'm a bit warry about is that it takes 2 days to click the sell button, regardless if you can actualy sell the item or not.