Logo Platform
logo amplifiers simplified

Proper Way to disable Market access?

Reply
Copied to clipboard!
7 years ago
Mar 20, 2018, 6:54:39 AM

Hello,


   As part of a Mod I am making I would like to use a trait to disable a faction's ability to access the Marketplace. While I realize that I could likely achieve this goal easier by overriding the tech with a custom one that has no Marketplace access, I am trying to keep this mod as an Extension and I imagine overriding a tech would put my mod into the Conversion category. Currently I am attempting to use:


     <Modifier TargetProperty="HasAccessToMarketplace"   Operation="Force"       Value="0"   Path="ClassEmpire" Priority="1" TooltipHidden="true"/>


within the SimulationDescriptor body of the trait in question,  and have had success with using a similar Modifier to block access to Buyout on the trait, but I cannot figure out what I am doing wrong in this case. When I shift the value to "1" instead of "0", I get access to the Marketplace along with notifications telling me I need the first market tech to access Strategics/Luxuries (and the second tech to access ships, as expected), which leads me to wonder if there's some other flag I need to set to block the market that I'm missing.




Additionally, I'm trying to set Scrap value on Ships to 0 Dust with this trait as well. I think I set Improvement scrap value to 0 with a Force on the ClassEmpire trait "ImprovementScrapValueModifier" but am unsure, as the scrap value of 0 may instead be an effect of my trait making all Improvement Upkeeps 0.

0Send private message
7 years ago
Mar 21, 2018, 8:52:46 AM

Hey Dartonus,


Extensions are mods which add over the original game data, and can override some of it; if it overrides existing data, it may not be compatible with other mods doing the same thing, but it is still an extension.

Conversions entirely redefine the game data: it starts from a blank slate and you have to re-define everything

If you override the technology, your mod will still be an extension.


As you have guessed, the access to the marketplace is based on the property HasAccessToMarketplace. 

If it is greater than 0, the screen will be accessible, but that's only for GUI feedback purposes. It is not used in gameplay...


The actual gameplay restrictions are defined by each marketable item category: they have specific prerequisites which will actually restrict buying/selling items in these categories.

These are defined in TradableCategoryDefinitions.xml, and their prerequisites check if you have either a technology or the Marketplace building on one of your systems.

You'll have to override these TradableCategoryDefinitions, to add a new prerequisite which checks if the property 'HasAccessToMarketplace' is really equal to 1.

0Send private message
7 years ago
Mar 21, 2018, 8:59:01 AM

As for the ships' scrap value, it is calculated as following:
- the SystemProduction cost of the ShipDesign is computed
- the value is used in the ResourceConverter 'SystemProduction' -> 'ScrapShip' (see file Simulation/ResourceConverterDefinitions.xml)
- the result is the scrap value in dust

If you want the ships to be worth 0 when scrapped, you can override this block from ResourceConverterDefinitions.xml:

<ToConverter To="ScrapShip">
    <!-- ((x -> money) ^ 1.2) * modifier * health ratio --> <!--Sale is another formula-->
    <InterpreterModifier>($(Input)) * 0.15 * Property(StockLocation, @../ClassEmpire, DustInflation)</InterpreterModifier>
</ToConverter>

replace it with:

<ToConverter To="ScrapShip">
    <InterpreterModifier>0</InterpreterModifier>
</ToConverter>

Note that instead of doing that you can improve the formula so that it is set to 0 only if a specific property on the empire is set to 0.

If you have more questions (especially regarding ResourceConverterDefinitions, they are rather complex to understand), feel free to ask!

Updated 7 years ago.
0Send private message
7 years ago
Mar 22, 2018, 2:47:14 AM

Thanks for the reply, it's good to know that I was misunderstanding how much I could change in my mod before it was no longer an extension. With that in mind it seems like the best solution is to just put a check for my custom Affinity into the Market techs (and similar).

0Send private message
?

Click here to login

Reply
Comment

Characters : 0
No results
0Send private message