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

Swizzlewizzle

First Lieutenant
7 Badges
May 6, 2016
214
49
  • Magicka
  • Stellaris
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Stellaris: Megacorp
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
So here is the code:

Code:
event = {
    id = sth_pulse.2
    hide_window = yes
    is_triggered_only = yes
    immediate = {
        every_country = {
            limit = { exists = capital_scope }

            every_owned_ship = {
                solar_system = {
                   
                    destroy_fleet = prev.fleet
                }
               
               
            }
           
               
        }

    }
}

This is correctly destroying every fleet in the galaxy (from empires that have a capital_scope).

However, in the error log i'm getting the ugly:

Code:
[14:24:36][effect_impl.cpp:134]: Script Error: Invalid context switch[solar_system], file: events/STH_pulse_events.txt line: 35, Scope:
type=ship
id=2022
random={ 1732861370 1732861370 }
root={
    type=none
    id=0
    random={ 1732861370 1732861370 }
}
from={
    type=none
    id=0
    random={ 1732861370 1732861370 }
}
prev={
    type=country
    id=9
    random={ 1732861370 1732861370 }
    root={
        type=none
        id=0
        random={ 1732861370 1732861370 }
    }
    from={
        type=none
        id=0
        random={ 1732861370 1732861370 }
    }
    prev={
        type=none
        id=0
        random={ 1732861370 1732861370 }
    }
}

I don't understand how this error could be popping up... solar_system should be a valid scope under a ship...

Does anyone see what is causing the error here?