How to add extra industry or structure to a existing market as a mod?
Or change their faction allegiance?
I am taking about modifications that affect campaign start.
I know how to add it by modifying the files in main game folders(and it works well) but when I try to make it a separate mod(by taking file, add extra stuff) then I get wild results.
Like when switching faction ownership say from Path to pirate it still show as Path on big map and still spawn Path fleets instead of pirate one.
If any industry/structure is added it drop both production and accessibility to zero.
I suspect the econ files aren't merging properly; since the entries in star system economy JSONs don't have IDs (they're just placed in an array), the market is being duplicated instead of overriden.
You can use the replace tag in mod_info.json (look at Archean Order for an example) to make the game not load the vanilla JSON for the system, so only your file takes effect. The other way is to do the modifications to the market in code.
is it possible to have mercenaries needing credits instead of story points to renew contracts, WITHOUT removing the need to spend a point to hire em?
You'd need to override the rules.csv entries for merc contract extension. Look at the mercs_leavingOptions and mercs_convincedOpt rows.
Could remove the SetStoryOption call from that first rule (instead add a tooltip that displays the credit cost of extending the contract), then use AddCredits in the second rule to deduct the credits on selecting the option.