Fractal Softworks Forum

Starsector => Bug Reports & Support => Bug Reports & Support (modded) => Topic started by: Histidine on June 07, 2017, 07:17:37 AM

Title: [0.8.1a RC8] Oddity with non-econ commodities appearing on market
Post by: Histidine on June 07, 2017, 07:17:37 AM
So I have a non-econ commodity:
Code: csv
name,id,demand class,base price,price variability,utility,decay,origin,tags,stack size,cargo space,icon,sound id,sound id drop,order,economyTier,econUnit,iconWidthMult
High Value Prisoner,prisoner,crew,5000,,5,0.25,,nonecon,1000,0,graphics/icons/cargo/crew3.png,ui_cargo_crew,ui_cargo_crew_drop,19,2.5,100,0.6
When I start a new game, the commodity appears in the list of commodities in circulation (between the organs and the drugs in this case):
Spoiler
(http://i.imgur.com/Hep8XO6.jpg)
[close]
I don't know if they actually exist in the market's stockpiles, but I do know that I didn't write any code to put them there.
The "met demand of X units in reserve" number is indeed the same as that of the vanilla commodity for that demand class (crew, in this case).

Was able to make them not appear in UI by setting econUnit to 10000.

PS: Why does econUnit affect the availability of the commodity for sale in submarkets (as in, if stockpiles are low then econUnit also needs to be low for any units to appear for sale), in addition to the display logic in the market info? This was quite confusing to deal with, given that its behavior wasn't documented anywhere that I know of.
Title: Re: [0.8.1a RC8] Oddity with non-econ commodities appearing on market
Post by: Alex on June 07, 2017, 08:33:27 AM
Not 100% sure on the econUnit question, but the issue here is the demand class of "crew". It should be something else, unique to the commodity. You can't have a mix of normal and nonecon commodities with the same demand class or things get weird.
Title: Re: [0.8.1a RC8] Oddity with non-econ commodities appearing on market
Post by: Histidine on June 08, 2017, 03:58:49 AM
Ah, okay, I'll try that.

(I recall game used to CTD if a commodity had an arbitrary demand class)
Title: Re: [0.8.1a RC8] Oddity with non-econ commodities appearing on market
Post by: Alex on June 08, 2017, 09:04:27 AM
Really? They're all arbitrary, though, so that'd be pretty odd.

Ahh - the demand class has to match the id of the "primary" commodity. That might be what you were seeing.