• 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.

AvatarPrime

Recruit
15 Badges
Jul 22, 2018
3
0
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Stellaris: Synthetic Dawn
This may be a bug, I wanted to check here first.

Running 2.1.2 170f, all dlc except distant stars.

I'm working on a mod and I'm unable to scope to any mining or research stations. I've tried random_mining_station and every_mining_station at country, system, and planet scopes and it never seems to find anything.

Here's an example. Inside the player's starting system scope, I've tried several variants of this code block:
Code:
every_system_planet = {

                        log = "[This.GetName]"
                        if = {
                            limit = { has_mining_station = yes }
                            log = "[This.GetName] has a mining station"
                            random_mining_station = { dismantle = yes }
                        }
                        if = {
                            limit = { has_research_station = yes }
                            log = "[This.GetName] has a research station"
                            random_research_station = { dismantle = yes }
                        }

                        random_mining_station = {
                            log = "[This.GetName] is a mining station"
                        }
}

The log calls are being used to check to see if any mining/research stations are being found. In the output, all of the planet names appear, but the stations never do. Likewise, effects applied to stations inside the code do not execute. The error log doesn't show any errors.
 

Courageous

Sergeant
43 Badges
Jan 1, 2011
66
0
  • Crusader Kings II
  • Europa Universalis IV
  • Rome: Vae Victis
  • Crusader Kings III: Royal Edition
  • Cities: Skylines
  • Pillars of Eternity
  • Cities: Skylines - After Dark
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Knights of Honor
  • Age of Wonders III
  • Stellaris: Humanoids Species Pack
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Sign Up
  • Age of Wonders: Planetfall - Revelations
  • Crusader Kings III
  • Supreme Ruler 2020
  • Victoria 2
  • Arsenal of Democracy
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Stellaris: Apocalypse
  • Hearts of Iron III
  • Heir to the Throne
  • Stellaris: Synthetic Dawn
  • Lead and Gold
  • The Kings Crusade
  • Majesty 2
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Ship Simulator Extremes
  • Sword of the Stars
I would say that if you are indeed successfully printing out the planet's name on that top log entry, and that the starting system does have orbital mining stations (which generally they do), you do appear to have a bug. Wierd, tho. Also, several vanilla files execute similar code.

What happens if you run this code against every_planet in the galaxy?
 

Courageous

Sergeant
43 Badges
Jan 1, 2011
66
0
  • Crusader Kings II
  • Europa Universalis IV
  • Rome: Vae Victis
  • Crusader Kings III: Royal Edition
  • Cities: Skylines
  • Pillars of Eternity
  • Cities: Skylines - After Dark
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Knights of Honor
  • Age of Wonders III
  • Stellaris: Humanoids Species Pack
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Sign Up
  • Age of Wonders: Planetfall - Revelations
  • Crusader Kings III
  • Supreme Ruler 2020
  • Victoria 2
  • Arsenal of Democracy
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • For The Glory
  • Stellaris: Apocalypse
  • Hearts of Iron III
  • Heir to the Throne
  • Stellaris: Synthetic Dawn
  • Lead and Gold
  • The Kings Crusade
  • Majesty 2
  • Victoria: Revolutions
  • Rome Gold
  • Semper Fi
  • Ship Simulator Extremes
  • Sword of the Stars
> iirc the stations in the starting system are created relatively late.

Fairly good point, that. Do we know when player on_actions are called relative to base game ones? Starting countries are inited from game_start.33, which is called from on_game_start_country (from vanilla/common/on_actions.txt).

I can imagine an edge case: if the game processess vanilla and player on_game start, and then processes vanilla and player on_game_start_country, then any event called from on_game_start (even if player) would precede all on_game_start_countries. That may be what we are seeing here.
 

AvatarPrime

Recruit
15 Badges
Jul 22, 2018
3
0
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Shadowrun: Hong Kong
  • Stellaris: Megacorp
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Stellaris: Federations
  • Stellaris: Synthetic Dawn
when do you call that script?
iirc the stations in the starting system are created relatively late.
Good catch. I think you're right. The event was originally placed at the start of on_game_start_country. I moved it to the end and was able to find the stations, but effects still aren't working.

Code:
               if = {
                   limit = { has_mining_station = yes }
                   log = "[This.GetName] has a mining station"
                   random_mining_station = {
                       log = "[This.GetName]"
                       dismantle = yes
                   }
               }

This block (now at the end of on_game_start_country) will show the station name in the log, but the dismantle effect doesn't seem to do anything. I've tried several other kill effects but the station always remains.