Ethics modding

Version

Please help with verifying or updating older sections of this article. At least some were last verified for version 3.0.

This article is for the PC version of Stellaris only.

This page is about how to modify existing or add new Ethics to the game.

## Data Structure

Ethics are defined at "common/ethics/xxx.txt".

### Ethics

* **playable** - A block of Modifiers that determines should this ethic appear in the empire creation view.  Gestalt Consciousness is hidden this way.
* **cost = <int>** - Number of ethic points this ethic cost.
* **category = <ethic category key>** - Category of this ethic.
* **category\_value = <int>** - Index of this ethic under its category.
	+ If there is an ethic axis called "A - B", so we have FA, A, B, and FB and their "category\_value" will be: 0, 1, 3, 4.
	+ Vanillas:
		- : 0, 1, 3, 4
		- : 0, 1, 3, 4
		- : 0, 1, 3, 4
		- : 0, 1, 3, 4
		- : **0** *(not 2)*
* **use\_for\_pops = <yes/no>** - Default yes. Should be no if fanatic or gestalt.
* **regular\_variant = <ethic key>** - Fanatic ethics only. Designates the regular variant of this fanatic ethic.
* **fanatic\_variant = <ethic key>** - Regular ethics only. Designates the fanatic variant of this ethic.
* **country\_modifier** - A block of Modifiers that applies to the empire with this ethic.
* **tags** - A list of localisation keys for a tooltip of ethic principles.
* **random\_weight** - The higher the weight, the more likely the randomly generated AI will have this ethic. Random empires will choose ethics at very first.
	+ Vanilla fanatic ethics have 150 and regular ethics have 100, except  Militarist have **250/150** and  Pacifist have **33/66**.
	+ Gestalt Consciousness has 100 for each of the following DLC installed:  Utopia,  Synthetic Dawn
* **pop\_attraction\_tag** - An entry that adds tooltip in the faction view to show the player what factors are affecting ethics attraction. Multiple allowed, **use\_for\_pops** ethics only.
	+ **desc = <localisation key>** - The text.
	+ **trigger** - A block of Conditions to determine should this attraction tag appear. (Country scope)
* **country\_attraction** - An entry that modifies the empire wide ethic attraction, **use\_for\_pops** ethics only.
	+ **value = <number>** - Default attraction. Vanilla always have 1.
	+ **modifier** - A block of Conditions with a **factor = <float>** entry. Multiple allowed. (Country scope)
* **pop\_attraction** - An entry that modifies the ethic attraction for each pop, **use\_for\_pops** ethics only.
	+ **value = <number>** - Default attraction. Vanilla always have 1.
	+ **modifier** - A block of Conditions with a **factor = <float>** entry. Multiple allowed. (Pop scope)

### Ethic Categories

There is only one entry that defines ethic categories. New ethic categories can be added to this.

```
ethic_categories = {
	col = {}

	xen = {}

	mil = {}

	spi = {}

	hive = {}
}

```

## GUI Modding

Empire creation view is "interface/customize\_species\_editor.gui". There is a window that contains all buttons for ethic options. New ethics can't be made visible without modding this file.

```
		containerWindowType = {
			name = "ethics"
			size = { width = 230 height = 230 }
			position = { x = 20 y = -25 }

			instantTextBoxType = {
				name = "ethic_points_left"
				position = { x = -130 y = 95 }
				font = "malgun_goth_24"
				maxWidth = 310
				maxHeight = 20
				text = "POINTS_LEFT_ETHICS"
				orientation = center_down
				format = center
				#alwaysTransparent = yes
			}

			### NON-FANATIC ETHICS ###

			buttonType = {
				name = "ethic_militarist"
				spriteType = "GFX_ethics_militarist"
				position = { x = 125 y = 125 }
				clicksound = interface
			}

			... (repeat once for each regular ethic)

			### FANATIC ETHICS ###

			buttonType = {
				name = "ethic_fanatic_militarist"
				spriteType = "GFX_ethics_fanatic_militarist"
				position = { x = 125 y = 90 }
				clicksound = interface
			}

			... (repeat once for each fanatic ethic)

			buttonType = {
				name = "ethic_gestalt_consciousness"
				spriteType = "GFX_ethics_gestalt_consciousness"
				position = { x = 125 y = 170 }
				clicksound = interface
			}

			### SELECTED ETHICS ###

			iconType = {
				name = "ethic_col_selected"
				spriteType = "GFX_ethic_selected"
			}

			... (repeat once for each ethic category)
		}

```

**Modding**