Ancestral Relics modding

Version

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

This article is for the PC version of Stellaris only.

The Relics, Minor Artifacts as well as Archaeological Sites are mechanics introduced since Stellaris v.2.3.

## Relics

Relics are defined at '`common/relics/xxx.txt`'.

### Data Structure

* **activation\_duration** – An integer of days for this Relic to "shine" if it’s activated.
* **portrait** – A reference to a GFX instance that indicates the icon of this Relic. This is defined in '`interface/relics_view.gfx'.`
* **sound** – A reference to a sound instance that indicates the sound to be played for activation.
* **resources** – An Economy Unit that determines the resource output and activation cost.
* **ai\_weight** – Determines how likely the AI will activate this relic.
* **triggered\_country\_modifier** – A block of Modifiers for the Passive Effect of this relic.
	+ **potential** – A block of Conditions that determines should the modifier apply. Vanilla relics always have '`always = yes`'. It is unclear if relics have **country\_modifier**.
* **score** – An integer of victory score should this Relic count.
* **active\_effect** – A block of Effects for the Activation Effect of this relic.
* **possible** – A block of Conditions that determines can this relic be activated.

### Relic Example

This is the "Ether Drake Trophy".

```
 r\_dragon\_trophy = {
 activation\_duration = @triumph\_duration
 portrait = "GFX\_relic\_dragon\_trophy"
 sound = "relic\_activation\_ether\_drake\_trophy"

 resources = {
 category = relics
 # Activation cost
 cost = {
 influence = @activation\_cost
 }
 }

 ai\_weight = {
 weight = 100
 }

 triggered\_country\_modifier = {
 potential = {
 always = yes
 }
 country\_unity\_produces\_mult = 0.10
 }

 score = 1000

 active\_effect = {
 add\_modifier = {
 modifier = "ether\_drake\_triumph"
 days = @triumph\_duration
 }
 custom\_tooltip = relic\_triumph\_cooldown
 hidden\_effect = {
 add\_modifier = {
 modifier = "relic\_activation\_cooldown"
 days = @triumph\_duration
 }
 }
 }

 # Possible check for activation
 possible = {
 custom\_tooltip = {
 fail\_text = "requires\_relic\_no\_cooldown"
 NOT = { has\_modifier = relic\_activation\_cooldown }
 }
 }
 }

```

All relics should add the modifier '`relic_activation_cooldown`' to the empire upon activation as well as they should be blocked from activating if the empire has this modifier in order to have the relics UI and "relics can be activted" alert message work properly.

## Artifact Actions

Artifact Actions are defined at '`common/artifact_actions/xxx.txt`'. Without the  Ancient Relics DLC, Artifact Actions are hidden from the UI and can't be used.

### Data Structure

* **resources** – An Economy Unit that determines the action cost. Vanilla actions always cost  Minor Artifacts.
* **ai\_weight** – Determines how likely the AI will use this action.
* **potential** – A block of Conditions that determines should this action be shown in the UI.
* **allow** – A block of Conditions that determines can this action be took by the empire.
* **effect** – A block of Effects to be executed upon action.

### Artifact Action Example

This is the "Reverse-Engineer Arcane Technology" Artifact Action.

```
 artifact\_arcane\_deciphering = {
 resources = {
 category = artifact\_actions
 cost = {
 minor\_artifacts = 5
 }
 }

 ai\_weight = {
 weight = 100
 modifier = {
 factor = 0
 has\_resource = { type = minor\_artifacts amount < 105 }
 }
 }

 potential = {
 has\_technology = tech\_arcane\_deciphering
 }

 allow = {
 custom\_tooltip = {
 fail\_text = "requires\_arcane\_deciphering\_no\_cooldown"
 NOT = { has\_modifier = arcane\_deciphering\_cooldown }
 }
 }

 effect = {
 custom\_tooltip = artifact\_arcane\_deciphering\_effect
 hidden\_effect = {
 if = {
 limit = {
 is\_ai = no
 NOT = { has\_country\_flag = arcana\_achievement }
 }
 set\_country\_flag = arcana\_achievement
 }
 add\_modifier = {
 modifier = "arcane\_deciphering\_cooldown"
 days = 720
 }
 owner = {
 country\_event = { id = ancrel.10000 }
 }
 }
 }
 }

```

Artifact Action cooldown is implemented through Static Modifiers.

There are some Artifact Actions that are not meant to be activated through this menu.

* Before acquiring the technology "Arcane Deciphering", relevant Artifact Actions are displayed as "???". Actually, those "???" actions are different actions that can only be seen if the empire doesn't have this technology and can never be activated.
* Some actions can only be done through planets. They are also Artifact Actions that can never be activated and actual effects are implemented through Decisions.

## Archaeological Sites

Archaeological Sites are defined at '`common/archaeological_site_types/xxx.txt`'. Full implementation of Archaeological Sites is largely dependent to Event modding as well as Dynamic modding.

### Data Structure

* **desc** – A localisation key (triggered event desc) that designates the description of this site (scope = site).
* **picture** – A reference to a GFX instance (sprite key) that indicates the picture of this site.
* **max\_instances**  – An integer of max stages instances of this type a galaxy can have, only checked when using '`create_archaeological_site = random`'
* **weight** – A scriptable value used for random weight, only used when using '`create_archaeological_site = random`'. Scriptable value type is defined either by an integer or 'mean time to happen'.
* **stages** – An integer of max stages of this site. It must be exactly match the number of **state** blocks of this site.
* **potential**  – A Trigger block (conditions) that determines if a scope (fleet) is potential to excavate this archaeological site (from = site, this will add/remove this option without giving the player a reason).
* **allow** – A Trigger block (conditions) that determines can a ship delve into this site (scope = fleet, from = site). All vanilla sites are only open to Science Ships with a Scientist (this will toggle enable/disabled mode on buttons etc).
* **visible** – A Trigger block (conditions) that determines can an empire see this site (scope = country, from = site).
* **stage** – Defines a stage of this site, order dependent
	+ **difficulty** – A 'min max interval type', interval is defined either by an integer or '`{ min = <int> max=<int> }`' where the later will randomize a value between min and max.
	+ **icon** – A reference to a GFX instance (rune icon gfx type) that indicates the picture of this stage.
	+ **event** – An 'fleet\_event' id to trigger on the delver fleet when this stage is cleared. A fleet is a 'container' of ships and can consist of one or more ships.
* **on\_roll\_failed** – An Effect block to be executed when a roll is failed (scope = fleet, from = site).
* **on\_create** – An Effect block to be executed upon site creation (scope = site).
* **on\_visible** – An Effect block to be executed upon site visible (scope = country, from = site).

### Archaeological Site Example

This is the first Zroni site:

```
 zroni\_digsite\_1 = {
 desc = zroni\_digsite\_1\_desc
 picture = GFX\_evt\_overgrown\_city
 stages = 3
 max\_instances = 1
 allow = {
 is\_ship\_class = shipclass\_science\_ship
 exists = leader
 }
 visible = {
 has\_country\_flag = zroni\_intro
 default\_site\_visible\_trigger = yes
 }
 stage = {
 difficulty = 1
 icon = GFX\_archaeology\_runes\_F1
 event = ancrel.2
 }
 stage = {
 difficulty = 1
 icon = GFX\_archaeology\_runes\_F2
 event = ancrel.3
 }
 stage = {
 difficulty = 2
 icon = GFX\_archaeology\_runes\_F3
 event = ancrel.4
 }
 on\_roll\_failed = {
 from = {
 standard\_archaeological\_site\_on\_roll\_failed = { RANDOM\_EVENTS = all\_random\_events }
 }
 }
 }

```

Note: '`standard_archaeological_site_on_roll_failed`' is a scripted effect.

**Modding**