UFO:Alien Invasion
General => Discussion => Topic started by: nemchenk on February 19, 2008, 02:00:08 pm
-
I'm looking at fixing bug #1890695 (http://sourceforge.net/tracker/index.php?func=detail&aid=1890695&group_id=157793&atid=805242), where craftitems mounted on an aircraft that is sold disappear from the player's inventory.
The bug poster wants these items to be added to the base Stores, but it occurs to me that this would make for an exploit! Normally, it takes several hours to remove items from an aircraft. This would allow the player to do it instantly! Say I decide I can't wait 24 hours to take the armour off my Firebird and put it on my Stiletto -- I sell the Stiletto, then buy it back. Hey presto, I have armour ready to install, instantly.
Do we care? Should I submit a patch that pops up a "You cannot sell this aircraft as it has equipment installed. You must remove all equipment before sale."? This solution is simpler to code :P and has the merits of using existing "game rules" instead of introducing new ones. However, it means more micro-management for the player :(
Or shall we just let this slight workaround exist, given that stuff sells for 90% of its value at the moment? This lets the player have what he wants, and NOW, but at the risk of creating a slight "bug" in the game.
Perhaps the third solution is best, but the most difficult? :D The aircraft is "queued" for decommissioning -- it is sold once all gear is removed from it. Is the craft available for use while gear is being stripped from it? Or does it disappear from the inventory straight away, and some hours later money and craft items appear?
Or even: do it XCOM3-style. Add the price of the items to the craft sale price?
What do you think?
-
The bug poster wants these items to be added to the base Stores, but it occurs to me that this would make for an exploit! Normally, it takes several hours to remove items from an aircraft.
You're right, I didn't think about that when I commited this bug.
I think the best solution is to sell items at the same time than the aircraft. Anyway, we will probably need to add some delay in the futur when you buy items before being able to use them (at the moment, there's no point in transfering items. For example: if you sell an item in one base and buy it in another one, you will manage to perform an immediate transfer)
You can't sell items at 90% of their price because this is not what is done when you sell them directly. The "queue for decommissioning" seems difficult IMHO.
-
Hi Kracken :)
You can't sell items at 90% of their price because this is not what is done when you sell them directly.
Beg your pardon, but it is: try buying something, then selling it immediately. You will loose 10% of its value :) I think it is undocumented, but it is happening.
-
Hi Kracken :)
Beg your pardon, but it is: try buying something, then selling it immediately. You will loose 10% of its value :) I think it is undocumented, but it is happening.
Sorry, I can't try it at the moment, but I didn't know that :P
Anyway, you should sell it at the same amount than if you sell the item in the airequip menu.
-
Ok, I see :)
Would anyone else care to comment, so we can build an idea of everyone's thoughts on the matter?
-
I will implement what kracken suggested in the next day or two, then. :)
i.e. sell the equipment on the craft at the same time it is being sold.
-
Patch #1897990. Have a nice day :)
-
Incidentally, I see that when an aircraft is sold, it is sold for 100% of its price. Is that desirable behaviour, or a bug? Namely:
CL_UpdateCredits(ccs.credits + ccs.eMarket.bid[craftitemID]);
vs
CL_UpdateCredits(ccs.credits + aircraft_samples[aircraftID].price);
Let me know which way you want it and I will submit a patch :)
-
imo the market bid value - but i haven't looked at the code
-
When the item is mounted at another aircraft the delay for remounting is taken into account. The question is whether the item should be unavailable for some time, right?
I would say unmounting is faster than mounting since you do not need to test its operability etc. Too complicated and too little effect imho.
Just put it into the storage where it belongs. ;D
-
imo the market bid value - but i haven't looked at the code
Well, the quick'n'easy hack is just to multiply the price by the BID_FACTOR. Shall I do this as a WIP-type solution?
It seems aircraft are not handled as part of the market -- is there a reason for this other than it has not been implemented yet? It seems odd to exclude them like this -- shall I have a look at adding them?
-
It seems aircraft are not handled as part of the market -- is there a reason for this other than it has not been implemented yet?
What do you mean ? What would you want to do ? Sorry, I don't understand
-
Oh, sorry :) I'll explain more.
Aircraft don't behave like craftitems or items -- they are not specified in campaign_market (in equipment.ufo), their costs are not adjusted in cl_campaign.c#CL_CampaignRunMarket(), there is always MAX_AIRCRAFT of them, etc.
-
Oh, sorry :) I'll explain more.
no problem ;)
Aircraft don't behave like craftitems or items -- they are not specified in campaign_market (in equipment.ufo), their costs are not adjusted in cl_campaign.c#CL_CampaignRunMarket(), there is always MAX_AIRCRAFT of them, etc.
Yes, it should probably be changed so that number and prices of aircraft are adjusted during the game.
Zenerka mentioned that he wanted to remove aircraft from objDef_t. So you should ask him what he plans to do, to make sure that you don't code something for nuts ;)
-
SF Feautre Request #1904561 posted.
Should I commit my "nasty hack" to SVN?