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

Termor

Recruit
21 Badges
Sep 22, 2016
3
0
  • Magicka
  • Stellaris: Synthetic Dawn
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Prison Architect
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Mass Transit
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris
  • Cities: Skylines - Snowfall
  • Magicka: Wizard Wars Founder Wizard
  • Cities: Skylines Deluxe Edition
  • Cities: Skylines
EDIT: Jesus Christ, I forgot the edit my title. I'm very, very sorry.

Hello!
I am currently having two problems with creating my Stellaris mod and I just cannot find any useful information of how to solve the issue in this forum(Or I've been too stupid to correctly use the search function) or anywhere else on the internet.

Anyway, here we go:

First of all I want to create spaceport modules that require another spaceport module to be present, which to my understanding could be achieved by using the "potential" entry in a spaceport module. However the spaceport modules end up always being valid for construction no matter of how I fiddle around with the settings.

Here is my code:
Code:
sm_test_0 = {
    icon = "GFX_spaceport_modules"
    icon_frame = 2
    initial = no
    initial_only = no
    replaceable = yes
    section = "CORE_SPACEPORT_SECTION"
    construction_days = 1
    ai_weight = {
        weight = 0
    }
    cost = {
        minerals = 1
    }
}
sm_test_1 = {
    icon = "GFX_spaceport_modules"
    icon_frame = 2
    initial = no
    initial_only = no
    replaceable = yes
    section = "CORE_SPACEPORT_SECTION"
    construction_days = 1
    ai_weight = {
        weight = 0
    }
    cost = {
        minerals = 1
    }
    potential = {
        planet = {
           limit = {
              has_spaceport_module = sm_test_0
            }
        }
    }
}
I have already read through this(https://www.reddit.com/r/StellarisMods/comments/4kelko/spaceport_module_requiring_another_module/) reddit post, but the posted solution does not work out for me.
My suspicion with the spaceport_module potential is that is somehow checks if the potential is valid once the spaceport has been constructed and then never again(but then that wouldn't that mean that the module is never valid?).
Code:
    potential = {
        planet = {
           limit = {
              has_spaceport_module = sm_test_0
            }
        }
    }
Code:
    potential = {
        planet = {
           limit = {
              has_spaceport_module = "sm_test_0"
            }
        }
    }
Code:
    potential = {
        planet = {
            has_spaceport_module = sm_test_0
        }
    }
Code:
    potential = {
        planet = {
            has_spaceport_module = "sm_test_0"
        }
    }
Code:
    potential = {
        has_spaceport_module = sm_test_0
    }
Code:
    potential = {
        has_spaceport_module = "sm_test_0"
    }
Obviously none of those worked out and one them even lead to a parsing error (don't remember which though)

My second problem is that I cannot find an effect to deal damage to a ship/fleet. One of my events is supposed to damage a ship/fleet, but I fail to find a way how to do it. I looked through the effects to this(http://www.stellariswiki.com/Effects) wiki page, but neither the search term "damage", "ship" or "fleet" have lead to useful results.

I'm sorry if thee questions may be very trivial but somehow the Scripting language(aswell as the API in some regards) used by Stellaris is very strange to me.

Thank you very much in advance! - Termor
 
potential doesn't work on spaceport modules. Much of the API that's available for buildings is only half implemented for spaceport modules. It also means you rarely get any errors logged telling you not to bother.

EDIT - Interestingly, you can have prerequisite modules for AI weight modifiers. So you can restrict the AI's choices but not the players. This part of the API got fixed after numerous complaints about the AI building inappropriate modules in sectors.
 
Last edited:
My second problem is that I cannot find an effect to deal damage to a ship/fleet. One of my events is supposed to damage a ship/fleet, but I fail to find a way how to do it. I looked through the effects to this(http://www.stellariswiki.com/Effects) wiki page, but neither the search term "damage", "ship" or "fleet" have lead to useful results.

You'll probably have to do this with a related aura. There might be a way to temporarily spawn an aura component on an object.
 
potential doesn't work on spaceport modules. Much of the API that's available for buildings is only half implemented for spaceport modules. It also means you rarely get any errors logged telling you not to bother.

EDIT - Interestingly, you can have prerequisite modules for AI weight modifiers. So you can restrict the AI's choices but not the players. This part of the API got fixed after numerous complaints about the AI building inappropriate modules in sectors.
That's too bad. I don't suppose that there is a way to magically scope from the AI modifier to the player? If not I'll just have to make do with having a little bit of clutter in the spaceport module construction screen.

You'll probably have to do this with a related aura. There might be a way to temporarily spawn an aura component on an object.
Okay, thank you, I'll give it a shot! Taking a quick glance at aura effects, I see that there are also S, M and L versions of aura, however in the ship designer I have never seen an option to pick between different sizes - What do these different sizes mean, and which one is actually used on a ship/station design? And how would I dynamically spawn an aura?
This is the Nanobot repair cloud:
Code:
utility_component_template = {
    key = "STATION_SMALL_AURA_NANOBOT_CLOUD"
    size = medium
    icon = "GFX_ship_part_aura_nanobot"
    icon_frame = 1
    power = 0
    cost = 0
  
    component_set = "station_small_aura_components"
  
    friendly_aura = {
        name = "aura_nanobot_cloud"
        radius = @stationSmallAuraRange
        apply_on = ships
      
        stack_info = {            #A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
            id = friendly_support_aura
            priority = 20
        }
      
        modifier = {
            ship_auto_repair_add = 0.05
        }
      
        graphics = {
            area_effect = {
                entity = "circle_area_entity"
                dynamic_scale = yes
            }
            ship_effect = {
                entity = "ship_aura_positive_entity"
                dynamic_scale = no
            }
        }
    }
  
    ai_weight = {
        weight = 2
    }
}

utility_component_template = {
    key = "STATION_MEDIUM_AURA_NANOBOT_CLOUD"
    size = medium
    icon = "GFX_ship_part_aura_nanobot"
    icon_frame = 1
    power = 0
    cost = 0
  
    component_set = "station_medium_aura_components"
  
    friendly_aura = {
        name = "aura_nanobot_cloud"
        radius = @stationMediumAuraRange
        apply_on = ships
      
        stack_info = {            #A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
            id = friendly_support_aura
            priority = 20
        }
      
        modifier = {
            ship_auto_repair_add = 0.05
        }
      
        graphics = {
            area_effect = {
                entity = "circle_area_entity"
                dynamic_scale = yes
            }
            ship_effect = {
                entity = "ship_aura_positive_entity"
                dynamic_scale = no
            }
        }
    }
  
    ai_weight = {
        weight = 2
    }
}

utility_component_template = {
    key = "STATION_LARGE_AURA_NANOBOT_CLOUD"
    size = medium
    icon = "GFX_ship_part_aura_nanobot"
    icon_frame = 1
    power = 0
    cost = 0
  
    component_set = "station_large_aura_components"
  
    friendly_aura = {
        name = "aura_nanobot_cloud"
        radius = @stationLargeAuraRange
        apply_on = ships
      
        stack_info = {            #A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
            id = friendly_support_aura
            priority = 20
        }
      
        modifier = {
            ship_auto_repair_add = 0.05
        }
      
        graphics = {
            area_effect = {
                entity = "circle_area_entity"
                dynamic_scale = yes
            }
            ship_effect = {
                entity = "ship_aura_positive_entity"
                dynamic_scale = no
            }
        }
    }
  
    ai_weight = {
        weight = 2
    }
}
 
Off the top of my head, I'm not sure if you can scope to player from AI. You're entering new territory that I've not taken much further. Same with auras. They just seem to be the best path to try.