Stellaris

Stellaris

Optimized Trade (Less Trade Lag)
 This topic has been pinned, so it's probably important
Olympia  [developer] 3 Jul, 2024 @ 2:29pm
Quick Guide for Patching
For those who are unfamiliar with making their own patches, I can guide you through a simple one specifically for this mod and making it compatible with another mod that adds trade policies, in this case, Stellaris Evolved.

If you don't already have it, you'll need Notepad++[notepad-plus-plus.org].

  1. Open the Stellaris Launcher. On the left hand side, select All installed mods.

  2. At the top, click Upload Mod.

  3. Click Create a Mod

  4. Name it whatever you like, version doesn't matter, and for the directory just put whatever you want (this will be the name of the folder). Tags won't, since you won't be putting it on the workshop, just pick one. For example, you could do: Name: Personal Patches, Version: 1.0, Directory: mod/PersonalPatches, Tags: Fixes.

  5. You should see a screen that confirms your mod has been created. Select ok. Close the launcher.

  6. Navigate to your Stellaris Mods documents folder. For me, this is in documents/Paradox Interactive/Stellaris/mod (depending on your install setup, it may be elsewhere, it is in the same location as your save games. It is NOT where the exe file is located.)

  7. You should see your mod Personal Patches, along with a txt file with the same name. Open the Personal Patches folder (or whatever you named it).

  8. Inside, you should just see a descriptor text file. Ignore it. Add a new folder and name it: common

  9. Open the common folder. Add another folder in common called megastructures

  10. Great. Now, you need to find where all of your workshop mods have been downloaded. For most, this is: Program Files (x86)/Steam/steamapps/workshop/content/281990. Once there, you should see a number of numbered folders. These are all of your workshop mods.

  11. We need to locate this mod's folder, Optimized Trade. It is 3278430102. Open it. Once inside, you should see four folders. Click on common.

  12. Once inside common, you should see a number of folders. Open megastructures. Inside, you should see a text file named market_capital. Copy it.

  13. Return to your Personal Patch mod. Open your common folder, then your megastructure folder. Paste the market_capital text file in it.

  14. Right click on the market_capital text file and open it with Notepad++.

  15. This is the only file you need to edit to make your patch. Scroll down until you see the note I left: Vanilla Trade Policies. If you scroll down further, you'll also see I left a blank section that starts with: Start Modded Trade Policies Start Here and ends with: End Modded Trade Policies. Leave this file open.

  16. Now we need to go find the mod files that you want to make a patch for. In this example, I am using Stellaris Evolved - Alpha. We first need to know the mod's ID number. This is the 8 to 10 number that follows the url of the mod.

  17. You need to find this mod's ID. This is located in the url for the mod. If you do not have it enabled in steam, you can just Google your mod and look at the URL. Stellaris Evolved - Alpha, for example, is: https://steamhost.cn/steamcommunity_com/workshop/filedetails/?id=2602025201 We only need the last numbers after id=. In this case, 2602025201

  18. Navigate back to the steam workshop folder, in the same place you found Optimized Trade's folder. Again, for most, this is Program Files (x86)/Steam/steamapps/workshop/content/281990 And look for a folder named 2602025201. Once located, open it. Then open common then trade_conversions. Open the file there, in this case, it is zz_evolved_trade_conversions. Open it with notepad++. Note: If the mod folder does not have a trade_conversions folder, it doesn't need a patch!

  19. Now, go back to the market_capital file you have opened (this one should be the one from your Personal Patches mod). Copy the Mutual Aid section right above the Start Modded Trade Policies section. Paste it below the Start Modded Trade Policies section.

  20. We now need to setup the new modded trade polices, using the Mutual Aid one we just copied as a framework. Let's go back to Stellaris Evolved - Alpha's trade conversions file, zz_evolved_trade_conversions. In this file, we only need the modded ones, which are at the bottom under the #Evolved note. Take a look at the first modded one: food_conversion. Let's start copying information over.

  21. The first thing to copy is whatever comes after has_policy_flag = XXX. In this case, it is trade_conversion_food. Return to your market_capital file. Find your new mutual aid example. Let's change it from #Mutual Aid to #Food Conversion - Evolved for your own note taking. Then, below that, find the "has_policy_flag =" line. Replace trade_conversion_mutual_aid with trade_conversion_food

  22. Then, you'll need to find the conversion rates. Return to the mod's trade conversion file (in this case, zz_evolved_trade_conversions). Look at what is below conversion_rate = {. In this case, it is energy = 0.25 and food = 0.5. Copy those two lines. Paste them where I noted #Resources, over the energy, minerals, food, and unity lines that were already there.

  23. Last step! Scroll up in your personal market_capital file until you find the Vanilla Trade Policies section. I left a note that states:

    #Adding modded trading policies?
    #Make sure to add any modded policy flags below here, otherwise, you'll get double energy.

    Now add: has_policy_flag = trade_conversion_food (or whatever your trade policy flag was named).
  24. [/list]You're all set! Load up the game and ensure the conversions are working correctly.
< >
Showing 1-2 of 2 comments
Star Dragon 9 Jul, 2024 @ 11:10am 
Should this be loaded before or after the base mod and the mod you're making the patch for?
Olympia  [developer] 10 Jul, 2024 @ 12:44pm 
Your personal patch should be loaded after this mod to overwrite it.
< >
Showing 1-2 of 2 comments
Per page: 1530 50