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

erdrik

Corporal
15 Badges
Feb 25, 2010
39
1
  • Sword of the Stars
  • Sword of the Stars II
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Stellaris
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Synthetic Dawn
  • Age of Wonders III
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Shadowrun: Dragonfall
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
When using any_bordering_country how do you call the scope that called any_bordering_country?

For example:
Code:
solar_system =
{
       any_bordering_country = { is_at_war_with = ? }
}
How would I specify solar_system > owner for is_at_war_with ?

Ive tried :
owner
root
prev
prevprev
prevprevprev
from
fromfrom
fromfromfrom
root.owner
prev.owner
prevprev.owner
prevprevprev.owner
from.owner
fromfrom.owner
fromfromfrom.owner
 
Sounds like you're not quite familiar with how scopes work, so I would recommend reading this wiki article first if you haven't done so yet:

For the actual question though, when you're checking for is_at_war_with, you're in the scope of the bordering country via any_bordering_country, so prev will send you back a scope, to the solar_system. The owner of that solar system is what you want, so unless I'm missing something, prev.space_owner should return the country you're looking for.

prev.owner does not work, because from what I can tell the owner scope it is not valid for a galacic_object scope such as the solar_system (even though the documentation claims that it is).

To prevent errors, I would also check for whether a space_owner even exists if the rest of the code doesn't already check for it somewhere else:
Code:
solar_system = {
    exists = space_owner
    any_bordering_country = { is_at_war_with = prev.space_owner }
}