Checking Retrofit Cost |
Hey Everyone,
I'm working on my mod, and I noticed ships trying to retrofit but the cost preventing them (error message) when the AI ships try to do this. Obviously this is annoying to have ships wasting their time and supplies trying to retrofit when they cant. I was wondering if anyone has a bright idea on how to check the cost of the retrofit?
The only thing I can think of is to check the total cost of the new design versus the old, and if above a certain percentage more than the old just skip the retrofit (say 15%). But this is obviously a weak solution at best. Either blocks some legitimate upgrades, or misses some too expensive ones, or both.
Any ideas?
-Unnamed

Re: Checking Retrofit Cost
You had the right idea. Look at the cost between the old and new design. If the new one is 50% more than the old one, don't retrofit. It's exactly what the hardcode is doing when a player attempts to retrofit a ship.

Re: Checking Retrofit Cost
I don't understand why you'd look at the individual components... The cost rule is based on the total cost in all resources of the design...




Re: Checking Retrofit Cost
Clarification: When I said to expensive, I meant the 50% cost rule.
-Unnamed
Unnamed Mod