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

IceQ4

Corporal
27 Badges
Jan 23, 2020
45
18
  • Cities: Skylines - Mass Transit
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Stellaris: Federations
  • Stellaris: Lithoids
  • Stellaris: Ancient Relics
  • Stellaris: Megacorp
  • Stellaris: Distant Stars
  • Cities: Skylines - Parklife
  • Stellaris: Apocalypse
  • Stellaris: Humanoids Species Pack
  • Cities: Skylines - Green Cities
  • Age of Wonders III
  • Stellaris: Synthetic Dawn
  • Crusader Kings II
  • Stellaris - Path to Destruction bundle
  • Cities: Skylines - Natural Disasters
  • Stellaris: Leviathans Story Pack
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris
  • Cities: Skylines - Snowfall
  • Cities: Skylines - After Dark
  • Cities: Skylines
  • Europa Universalis IV
Hey there i am trying to mod a trait that scales with whatever, for now i would like it to be with Skills Each time a skill gets selected a counter counts up. I have checked how the Robo Hive mind handles this and i kinda have smth similar but i don't know how to make a trait itself scale with that.

If anyone would be so kind to enlighten me it would be greatly apprechiated. I read the modding wiki but am ngl i don't truly feel comfy and i really would like to have the same design approach as the original game as i belive the original devs probably know best how and why they did that system the way it is done.

Script_Variable
leader_arael_additional_skills = {
modifier = {
check_variable_arithmetic = {
which = value:leader_arael_initial_skill
add = value:leader_arael_skill_modifier
value > value:culled_arael_skill
}
add = value:leader_arael_skill_delta
}
modifier = {
check_variable_arithmetic = {
which = value:leader_arael_initial_skill
add = value:leader_arael_skill_modifier
value <= value:culled_arael_skill
}
add = value:leader_arael_skill_modifier
}
min = 0
}

leader_arael_skill_delta = {
add = value:culled_arael_skill
subtract = value:leader_arael_initial_skill
}

leader_arael_initial_skill = {
base = 0
add = trigger:has_skill
}

leader_arael_skill_modifier = {
base = 0
modifier = {
exists = owner
add = owner.modifier:leader_arael_bonus_skill
}
}

culled_arael_skill = {
base = 0
add = event_target:culled_arael.trigger:has_skill
}

This as it seems takes the original Skill and saves it so we know what the number is we need.
It also counts the skills that got selected.
Now as i've discussed with ai it seems traits don't truly update so i need a country thingsy that applies the trait on the leader? If possibel i would like to do this without making a new Gov to keep compability high.

I also have this:
scripted_modifiers
leader_arael_bonus_skill = {
icon = "mod_leader_skill_levels"
good = yes
category = country
}
Now i'm not exactly sure i understand how this scripted_modifiers work but as far i understand, it makes a dummy object that basically a variable?
traits/....txt
leader_trait_arael = {
inline_script = {
script = trait/icon
CLASS = scientist
ICON = "GFX_leader_trait_inspired"
RARITY = common
COUNCIL = yes
TIER = none
}


councilor_modifier = {
empire_size_pops_mult = -0.03
}

leader_class = { scientist }
initial = yes
randomized = no
}

This is the trait and its effect i'm trying to scale. Since many mods are used Roboters have a hugeeee endgame boost with this trait and i'd like to apply it trough a trait.

the event that sets the trait:
events/.....txt
country_event = {
id = arael.9
hide_window = yes
is_triggered_only = yes
trigger = {
has_origin = origin_overtuned
}
immediate = {
leader = {
add_trait = leader_trait_arael
set_leader_flag = culled_arael
}
}
}

And smth i tried since the ai thought it was a good idea but i'm not sure if that really does what i want.
scripted_effect/....txt
set_arael_leader_modifier = {
event_target:culled_arael = {
add_skill_without_trait_selection = value:leader_arael_additional_skills
}
}

the idea was to apply this with a scripted effect like the governour trait. since i wasn't sure if traits get updated this should maybe do the trick? I honestly don't know.

For any help i would be gratefull.

Kindly
Ice