Hi, is there any way to config the mod to apply to all markets? I know that some modded markets have their own tariffs but Im a bit lazy to write every modded market.
The easiest way to do this manually (that I've found) is to use console commands, use the "list" command for "list markets", open the log in the starsector core folder, and copy every market listed there. (Tab out and do this immediately after entering the command, as the output will just be at the bottom on the plaintext log file, but any other actions in game will push it up)
I threw it all into notepad++ then did a few regular expressions to clean it up.
Keep in mind that wrap around will mess up regular expressions for this purpose depending on the expression and the document.
Keep in mind match case too.
Regular expressions will execute from your current document position onward until it reaches the end, unless wrap around is enabled in which it will do whatever it feels like. Execute these from the beginning of the document.
In my case as of starsector .95a-RC15 with console commands version 2021.4.10 for .95a-RC12, and Dynamic Tariffs version 1.3 for .095a-RC12 my starsector log outputs lines that look like this (For anyone from the future that might want to do this, in case the way console commands outputs to the log changes):
sphinx in Samarra Star System (Hegemony, Cooperative)
staloplanet in Rama Star System (Hegemony, Cooperative)
station_kapteyn in Isirah Star System (pirates, Vengeful)
There is white space in the front, and potentially at the back. The values we need are the first part which is the market id, the rest is just information.
1. ctrl + H to open Replace
Tick Regular Expression on the bottom left.
Find What: \in.*$
Replace with:
(Above field is deliberately blank)
Replace All
2. Edit -> Blank Operations -> Trim Leading and Tailing Space
3. ctrl + H to open Replace
Tick Regular Expression on the bottom left
Find What: ^
(Above is the regex anchor meaning the beginning of a line)
Replace with: "
Replace All
4. ctrl + H to open Replace
Find What: $
(Above is the regex anchor meaning the end of a line)
Replace with: ",
Replace All
5. Ctrl + A (Select All)
6. Ctrl + J (Edit -> Line Operations -> Join Lines)
(By default this will properly place a space inbetween each collapsed line on the single line. I do not know if notepad++ can be configured otherwise but keep this in mind if it doesn't)
7. Delete the extra comma at the very end of your finished single line.
There, now you have everything. Take that one line and neatly
Overwrite the whitelist in this mod's settings, as the existing whitelist is vanilla markets which this output will also have. I don't know what double listings will do and I'm not about to find out. Keep in mind the final market id will have a comma at the end which you need to delete if you haven't already.
Someone could probably make a .bat that does all this, but I do not know how to do that. Depending on the number of faction mods you are running and on your computer literacy level, it might be faster to just manually apply the market ids after fetching them with "list markets" instead of doing this set of instructions.
Keep in mind as the mod author stated, you do this at your own risk depending on what a mod does to its added markets, as it might create mustard gas or something.
Thanks for coming to my TedX Talk.