• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

hyperjoe

Second Lieutenant
62 Badges
Sep 17, 2003
176
32
  • Stellaris
  • Supreme Ruler 2020
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • 500k Club
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Cities: Skylines - Snowfall
  • Europa Universalis IV: Mare Nostrum
  • Semper Fi
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Stellaris: Synthetic Dawn
  • Europa Universalis 4: Emperor
  • Europa Universalis IV: Art of War
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III Complete
  • Divine Wind
  • Europa Universalis IV
  • Cities in Motion
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For the Motherland
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Hearts of Iron III Collection
  • Heir to the Throne
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
I need a little help figuring what I'm doing wrong in creating what I thought was a simple mod to the game.

I wanted to change a couple of entries in the defines.lua, including but maybe not 100% limited to:

LEADER_AGE_MIN
LEADER_AGE_MAX
CORE_SECTOR_PLANET_CAP

So I go into the Stellaris launcher. Use the mod tools to create my mod, put in the folder name, and the game version. That part works fine.

Load the modded (admittedly not actually modded yet) game to test it. Game loads fine.

Copy the "common" folder over from the Steam directory.

Load the modded (again, nothing modified yet) game to test it. Game loads fine.

Delete every file and folder inside the mod/common folder EXCEPT for the "defines" folder.

Load the modded (not yet modified still) game to test it. Game loads fine.

Open up the defines.lua and change the 3-5 entries that I want to change.

Load the modded (yes, finally modded) game to test it. Game crashes on load.

I heard that naming the modded defines.lua the same as the vanilla defines.lua is a bad thing to do. So I change the name of my defines.lua to something like "Hypermod_defines.lua" (underscore not a space).

Load the modded game to test it. Game crashes on load.

Can anyone enlighten me as to what I'm doing wrong and what I need to do to get this working?
 
Hyperjoe don`t copy the whole defines lua, that wont work.

Create an empty text file in your mod folder ( .../documents/Stellaris/mod/ YOURMODNAME / common/defines/ ) call it maybe 01_defines.lua or modname_defines.lua .

Your entries have to look like this:

NDefines.NGameplay.LEADER_AGE_MIN = 70 -- Min age of generated leaders
NDefines.NGameplay.LEADER_AGE_MAX = 180 -- Max age of generated leaders
NDefines.NGameplay.CORE_SECTOR_PLANET_CAP = 10 -- Too many planets in core sector will apply modifier inefficient_planet_management.

As you can see you have to think of the defines lua structure like a table in excel and keep the structure in your mod, with a spacing dot. Keep in mind to delete the " , " on the end of each entry, it is not needed as you target directly a specific entry. It won`t work if you keep the " , " at the end.

Greetings