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

WarmLemonade

Recruit
42 Badges
Nov 9, 2023
3
1
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Synthetic Dawn
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Humanoids Species Pack
  • Stellaris: Apocalypse
  • Stellaris: Distant Stars
  • Stellaris: Megacorp
  • Crusader Kings II: Holy Fury
  • Imperator: Rome Deluxe Edition
  • Imperator: Rome
  • Hearts of Iron IV: Death or Dishonor
  • Stellaris: Ancient Relics
  • Stellaris: Lithoids
  • Hearts of Iron IV: La Resistance
  • Stellaris: Federations
  • Imperator: Rome - Magna Graecia
  • Crusader Kings III
  • Battle for Bosporus
  • Stellaris: Necroids
  • Stellaris: Nemesis
  • Crusader Kings II: Conclave
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II
  • Stellaris
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Tyranny: Archon Edition
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Hearts of Iron IV: Together for Victory
  • Stellaris - Path to Destruction bundle
Could someone help me figure out why this code isn't working? This is the first mod I have ever tried to make. Its in common, on_action, yearly_on_actions.txt

Code:
yearly_global_pulse = {

    effect = {

         every_living_character = {


            limit = { age > 15 }


            set_diplomacy_skill = 5


            set_martial_skill = 5


            set_stewardship_skill = 5


            set_intrigue_skill = 5


            set_learning_skill = 5


            set_prowess_skill = 5
        }
    }
}
 
Last edited:
Unfortunately, set_diplomacy etc. are only available as console commands, so you'd have to do something like:

Code:
    every_living_character = {
        limit = { age > 15 }
        add_diplomacy_skill = {
            subtract = diplomacy
            add = 5
        }
        add_martial_skill = {
            subtract = martial
            add = 5
        }
        add_stewardship_skill = {
            subtract = stewardship
            add = 5
        }
        add_intrigue_skill = {
            subtract = intrigue
            add = 5
        }
        add_learning_skill = {
            subtract = learning
            add = 5
        }
        add_prowess_skill = {
            subtract = prowess
            add = 5
        }
    }

When you do it, it will look like nothing happened, but once the day advances all the stats should turn over to 5 (or whatever number you set).
 
  • 1
  • 1Like
Reactions:
Thank you so very much brother, I assumed that all console commands would work when writing code. While the code is not working how I intended it to, you have put me on the right track and at least given me a piece of code that does something instead of nothing like all my other numerous attempts. I will keep messing with it until I get my desired result. Still though, I remain confused on how you knew 'subtract = diplomacy add = 5' would do anything. Thanks again for your help.
 
  • 1Like
Reactions:
Thank you so very much brother, I assumed that all console commands would work when writing code. While the code is not working how I intended it to, you have put me on the right track and at least given me a piece of code that does something instead of nothing like all my other numerous attempts. I will keep messing with it until I get my desired result. Still though, I remain confused on how you knew 'subtract = diplomacy add = 5' would do anything. Thanks again for your help.
I've just spent a lot of time making a mess of things. I think most effects that accept a number can be made to do math with the operators, which are add, subtract, multiply, divide, modulo, and you can even do math inside of those things too, where the order of operations is always the order in which they appear.

Code:
    add_prestige = {
        value = 100
        subtract = {
            value = 50
            add = 20
            multiply = 0.33
        }
    }

So this, for example, gives you 76 prestige.

Good luck with it though. If you have any questions feel free to ask, either here, in the short questions/answers thread, or there's also the Modding discord. They're very friendly there (and probably more active too). The wiki is invaluable, too. Here is a list of the effects and triggers if you're ever lost or not sure what is/isn't valid in the script. I refer to it constantly myself when I forget the syntax of something or even what an effect/trigger is actually called (the number of times I've broken my script by writing remove_from_variable_list instead of remove_list_variable are too many to count).
 
  • 1
  • 1Like
Reactions: