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

SeeGee

Corporal
53 Badges
May 12, 2016
44
9
  • Dungeonland
  • Stellaris: Synthetic Dawn
  • The Showdown Effect
  • Crusader Kings II
  • Europa Universalis IV: Res Publica
  • Magicka
  • Leviathan: Warships
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV
  • Europa Universalis III
  • Europa Universalis IV: Call to arms event
  • Stellaris: Necroids
  • Cities: Skylines - Green Cities
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Cities: Skylines - Parklife Pre-Order
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Shadowrun Returns
  • Shadowrun: Dragonfall
  • Cities: Skylines Industries
  • BATTLETECH: Flashpoint
  • Stellaris: Megacorp
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Prison Architect
  • Stellaris: Ancient Relics
  • Age of Wonders: Planetfall
  • Age of Wonders: Planetfall Deluxe edition
  • Stellaris: Lithoids
  • Stellaris: Galaxy Edition
  • Teleglitch: Die More Edition
  • Warlock: Master of the Arcane
  • War of the Roses
  • Cities: Skylines
  • Cities: Skylines Deluxe Edition
  • Pillars of Eternity
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Stellaris
  • Surviving Mars
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Cities: Skylines - Natural Disasters
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Mass Transit
I'm working on a Babylon 5 mod (see my sig) and i would like to have a small nation spawn 100 years after game start, that acts as an diplomatic hub for all.

Here's a list of criteria:
  • Create nation in a specific system if unoccupied, otherwise choose another unoccupied system
  • Spawn Heavy Defence platform
  • Colonized planet not really wanted.
  • Station should have huge health to withstand attack (near invincible)
  • All nations with certain traits receive a large positive relationship modifier with this nation on spawn
  • Spawn a strong fleet to defend station
  • Will propose a federation to friendly nations
  • Nations who attack suffer a severe relationship penalty with Nations friendly to the station
  • AI favours diplomacy and offers generous trade
  • AI does not expand

I figured that the crisis_events_2.txt would be a good place to start looking. The first thing I'm doing is trying to create the race, station, and fleet when the event is triggered...

Ideas am new to modding so I'm certain that I'm doing something wrong, (syntax, I'm sure) but I don't know where to look...

You can trigger the event with "event babylon5.1000"

Here's my code. It'll always be up to date with where I'm at
https://github.com/seegee911/Babylo...project/events/babylon5_nation_init_event.txt
 
Last edited:
Yeah. It's only there as a placeholder. How does the game engine differentiate it's behavior with regards to fallen empires and normal civs? I'll look into creating a unique country type for this empire.
 
Look into .../common/country_types/00_country_types.txt. There you will find an example and the other country types. You can change a lot of things and really tailor the behaviour to what you need. However you can't currently create new modules and have to work with the ones present.
 
I think you are on the right track, but

1) There is no point in having both "is_triggered_only = yes" & "mean_time_to_happen". Remove one or the other. If you remove the first one you have to add an "trigger = { }" and specify under what circumstance it should fire. If you remove the second you need an on_action or event where you fire the even. So I think you need a "mean_time_to_happen" and the trigger. Note that mean time to happen can mean that it will fire in the first year, it is just unlikely. In addition the trigger needs to specify on what planet it should spawn. Currently the planet event will simply fire for every planet in your game. The easiest way is to add a system initializer that creates an custom system with a system flag. You might want to use a different type of event. I think just "event = {" instead of "planet_event" will work better for you. You will then of course first have to scope to the system you want to create the Station in.

2) The country type folder needs to go into the common folder. Also you need to check your brackets better and improve indentations it becomes much easier to read and maintain. I don't think there is a point in having both construction = yes & limited_construction = yes.

3) Does your galaxy generation work? Because last time I checked it was not possible to add new .lua files and you could only overwrite the existing ones.

4) ## random_title = { #No idea what this is for. It was pasted from the example code on the paradox forum

This should mean "random_tile = {". Otherwise the code makes no sense. You might even want to replace it with "best_tile_for_pop". However I thought that this would be the station? You can make the country not need a colony at all so you will not have to bother with colony creation. You can just create the Station in a system you like. You can even spawn a new system and then add the station either in orbit of a planet or as an ambient object. I think the easiest way is to create an invisible planet and then spawn the station in its orbit. You will need a ship_size and a global design for this.

For how to spawn a system check out the game_start.1 event. "random_system" is the scope you want. Look up the solar_system_initializer example on how to create the system. This process will pick a random system and overwrite everything in it and then you can add your station there.
 
I've rewritten the code to simplify it from the start. Hoping this will be an easier example to work with while trying to figure out what I'm doing. Lol. Please check the link again and see what you think so far... Am I even on the right track?
https://github.com/seegee911/Babylo...project/events/babylon5_nation_init_event.txt

I cloned your repository to take a look SeeGee, looks like this is going to be a Babylon 5/Alliance faction? Is this supposed to be playable?
 
I cloned your repository to take a look SeeGee, looks like this is going to be a Babylon 5/Alliance faction? Is this supposed to be playable?

At the moment, I'm looking at just making it an ai controlled country that pops up 100yrs after game start. Once I get it working, I might set it up to be Playable, and skip the event if it is player controlled.
 
But yes, I would ultimately like to spawn the nation WITHOUT a planet, just a heavy defence platform named "Babylon 5" (with a huge max health) in orbit of a planet named Epsilon III, in a system named "Epsilon Eridani". I would also like to have a fleet spawn with the station to act as defenders, and possibly have that fleet respawn again once it's nearly destroyed. Without planets, there's no production capacity, so it can't build reinforcements
 
But yes, I would ultimately like to spawn the nation WITHOUT a planet, just a heavy defence platform named "Babylon 5" (with a huge max health) in orbit of a planet named Epsilon III, in a system named "Epsilon Eridani". I would also like to have a fleet spawn with the station to act as defenders, and possibly have that fleet respawn again once it's nearly destroyed. Without planets, there's no production capacity, so it can't build reinforcements

Never tried spawning a nation without a planet, should be possible the pirates do not control planets. Let me see what I can come up with
 
I think you are on the right track, but

1) There is no point in having both "is_triggered_only = yes" & "mean_time_to_happen". Remove one or the other. If you remove the first one you have to add an "trigger = { }" and specify under what circumstance it should fire. If you remove the second you need an on_action or event where you fire the even. So I think you need a "mean_time_to_happen" and the trigger. Note that mean time to happen can mean that it will fire in the first year, it is just unlikely. In addition the trigger needs to specify on what planet it should spawn. Currently the planet event will simply fire for every planet in your game. The easiest way is to add a system initializer that creates an custom system with a system flag. You might want to use a different type of event. I think just "event = {" instead of "planet_event" will work better for you. You will then of course first have to scope to the system you want to create the Station in.

Ok. I'm very new at event scripting so I'm hoping to take this one step at a time.
So I should make it a trigger={ event, and add an on_action line that fires off babylon5.1000 when months = 1200 correct? This should ensure that it always fires at the appropriate time, whereas mean_time... Causes it to fire sometime between year 1 and 100. Just trying to understand the syntax and order of operations
 
Actually what would be better is this:

Code:
.../common/on_actions/<your_file_name>.txt

on_game_start = {
    events = {
        babylon5.1
    }
}

...events/babylon5_nation_init_event.txt

event = {
    id = babylon5.1
    hide_window = yes
    is_triggered_only = yes

    immediate = {
         event = {
             id = babylon5.1000 
             days = 32400  # 90 years
             random = 7200 # + 0 - 20 years
         }
    }
}

event = {
    id = babylon5.1000
    hide_window = yes
    is_triggered_only = yes
    

    immediate = {
        random_system = {
            limit = {
                  -- LIMIT THE TYPE OF SYSTEM THAT SHOULD BE CHOSEN ---
            }
                    ---  FILL IN YOUR EVENT ----
        }
    }
}

This way ensures that the event will always fire after 90 to 110 years.
 
  • 1
  • 1
Reactions:
ok, i've built the event structure based on your example. however I DO want it to fire exactly 100 yrs after game start, no variable, so i set a static value and skipped the random= line.

From what I understand, the limit = { is where I identify which system I want to trigger the event. Considering that I would like it to spawn in the "Epsilon Eridani" system IF it's unowned, I guess i need to

  1. make a custom system_initializer for the star system (Epsilon Eridani) to set up the star system
  2. attach a flag to that star so that this event can Identify the star
  3. evaluate whether or not it's owned by someone
  4. If unowned, populate it with the station
  5. If owned, choose another unowned system at random
There are other factors I would like to include, such as creating the star system fairly far from any other races at game start to minimize the odds that the system will be occupied, but that's a minor detail that I suspect is handled by the star system initializer, not the event.

I've updated my code to where I'm at right now, but again, it's not fully working yet. I am working on this while I'm at work, when I should be doing other things... But who wants to do that when you can mod stellaris! lol