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

Archael90

Field Marshal
18 Badges
Nov 30, 2017
4.171
4.796
  • Stellaris: Humanoids Species Pack
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Stellaris: Apocalypse
  • Surviving Mars
  • Stellaris - Path to Destruction bundle
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Majesty 2
  • Stellaris: Synthetic Dawn
  • Stellaris: Galaxy Edition
It seems, it is not a quick question :x

I was trying to create new reactor that used on a ship reduces power usage of specific components.
But first i wanted to check how power usage works.
I have two files:
"scripted_variables_component_costs" where i can adjust power usage for all components that use this specific variable:
@power_S1 = -15
@power_M1 = -30
@power_L1 = -60

@power_S2 = -20
@power_M2 = -40
@power_L2 = -80

@power_S3 = -25
@power_M3 = -50
@power_L3 = -100

@power_S4 = -35
@power_M4 = -70
@power_L4 = -140

@power_S5 = -45
@power_M5 = -90
@power_L5 = -180

@power_S6 = -55
@power_M6 = -110
@power_L6 = -220

@power_S7 = -75
@power_M7 = -150
@power_L7 = -300

And "Utilities_shields", where i can directly change those values for either fixed value or change variable like from @power_L5 to @power_M6
utility_component_template = {
key = "SMALL_PSI_SHIELD"
size = small
icon = "GFX_ship_part_psi_shield"
icon_frame = 1
power = @power_S7
resources = {
category = ship_components
cost = {
alloys = @shield_s_t7_cost
sr_zro = 0.111
}
upkeep = {
energy = @shield_s_t7_upkeep_energy
alloys = @shield_s_t7_upkeep_alloys
}
}
modifier = {
ship_shield_add = @shield_S7
ship_shield_regen_add_static = @regen_S7 #Regeneration per day
}
prerequisites = { "tech_psionic_shield" }
component_set = "PSI_SHIELD"

ai_weight = {
weight = @T5_weight
modifier = {
factor = 0.0
no_resource_for_component = { RESOURCE = sr_zro }
}
modifier = {
factor = 0.0
is_ai = yes
}
inline_script = {
script = ship_components/weights/roles_stealth
MULT = 0
}
}
}

Tho changing anything or even in both of those changes nothing in game...
My question is Why?
Is there anything else i should change? I forgot about something? Or it is not where power consumption is placed?

And another question
If i want to introduce variable that changes power usage, which code i should use? I will finally figure it out (i hope) or find it somewhere else, maybe on wiki, but once im here asking i can also ask for this ;)
like in here:
utility_component_template = {
key = "SMALL_PSI_SHIELD"
size = small
icon = "GFX_ship_part_psi_shield"
icon_frame = 1
power = {
IF CORVETTE_DARK_MATTER_REACTOR = @power_S3
IF NOT CORVETTE_DARK_MATTER_REACTOR = @power_S7
resources = {
category = ship_components
cost = {
alloys = @shield_s_t7_cost
sr_zro = 0.111
}

Is stellaris code understanding variable "if" "if not" or should i use something else?
Is name of the reactor valid way to do this?
 
I was trying to create new reactor that used on a ship reduces power usage of specific components.
Can't do that. Modifiers to affect component power usage don't exist.

And component stats are static when the game is loaded. You can't change them at runtime.