• 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.
I still don't understand how it works.
I've created a events/remove_fleet.txt with

Code:
namespace = removefleet

### Remove all fleets for all countries at start
event = {
    id = removefleet.1
    hide_window = yes
    is_triggered_only = yes  


    immediate = {
        capital_scope = {  
                    random_owned_ship = {                    
                                fleet = { destroy_fleet = THIS }                  
                                }      
                        }
                   }          
    }

And a common/on_actions/SIAo_On_actions.txt

Code:
on_game_start = {
    events = {
        removefleet.1
    }
}
This does not work.

I tried various things with no effect.

So I have afew questions; What is namespace? is it a class, a dictionnary of something different?
 
If that does not work, there is something wrong with the code likely the brackets are out of place or you have too many. The namespace is simply what you define, what is the error you are getting in the log?
 
This. Basically I'm doing it wrong :XD:
Code:
[21:54:28][effect.cpp:313]: Invalid Scope type for effect random_owned_ship in events/remove_fleet.txt line : 12

[21:54:40][effect_impl.cpp:134]: Script Error: Invalid context switch[capital_scope], file: events/remove_fleet.txt line: 11, Scope:
type=none
id=0
random={ 1359683402 588888084 }
 
Revan, that wont work with those scopes.

This is from my mod. It removes the 3 starting corvettes, but leaves the science ship, construction ship, starport and wormhole station untouched. Any fallen empire will also be untouched.
(Changed the name to yours, so you can just copy paste it)
Code:
namespace = removefleet

# Removes all military ships for every country except fallen empires
event = {
  id = removefleet.1
  hide_window = yes
  is_triggered_only = yes
  fire_only_once = yes
 
   immediate = {
     every_country = {
       limit = {
         NOT = { is_country_type = fallen_empire }
       }
       every_owned_ship = {
         limit = { is_ship_class = shipclass_military }
         fleet = { destroy_fleet = this }
       }
     }
   }
}
 
Revan, that wont work with those scopes.

This is from my mod. It removes the 3 starting corvettes, but leaves the science ship, construction ship, starport and wormhole station untouched. Any fallen empire will also be untouched.
(Changed the name to yours, so you can just copy paste it)
Code:
namespace = removefleet

# Removes all military ships for every country except fallen empires
event = {
  id = removefleet.1
  hide_window = yes
  is_triggered_only = yes
  fire_only_once = yes

   immediate = {
     every_country = {
       limit = {
         NOT = { is_country_type = fallen_empire }
       }
       every_owned_ship = {
         limit = { is_ship_class = shipclass_military }
         fleet = { destroy_fleet = this }
       }
     }
   }
}

And we have a winner! ;)

If u want to just destroy only the players ships replace the limit with is_ai = no, and if u want to do it to everyone but the player ADD is_ai = yes to the limits.
 
Works like a charm
B9FE469BC1EC7028A30734E8B4D383C507576862