desrtucted Posted October 12, 2020 Posted October 12, 2020 You know how in CK2 there are body trait mods assigned to all characters of specific gender? I'm looking for something like it for reference to create a mod of my own.
bunt776 Posted October 12, 2020 Posted October 12, 2020 Try this: Â potential = { is_female = x } birth = 100 Â Â Â Â Â Â Â Â Â Â Â - How many characters out of 100 are born with this trait (when not inherited). Can have decimals random_creation = 100 Â Â Â Â Â - How many characters out of 100 are created with this trait? (As opposed to actually being born; this is for things like generated characters, script characters, etc.) Â
desrtucted Posted October 12, 2020 Author Posted October 12, 2020 16 minutes ago, bunt776 said: Try this: Â potential = { is_female = x } birth = 100 Â Â Â Â Â Â Â Â Â Â Â - How many characters out of 100 are born with this trait (when not inherited). Can have decimals random_creation = 100 Â Â Â Â Â - How many characters out of 100 are created with this trait? (As opposed to actually being born; this is for things like generated characters, script characters, etc.) Â Where do I put it? Can I set it so the trait is assigned at a certain age?
bunt776 Posted October 12, 2020 Posted October 12, 2020 inside the trait. Have a look at other traits to see how it is used usually. Â Assigning at a certain age works like rhipeen wrote here: https://www.loverslab.com/topic/154818-how-to-cerate-a-gender-based-trait/?do=findComment&comment=3162625
desrtucted Posted October 12, 2020 Author Posted October 12, 2020 7 minutes ago, bunt776 said: inside the trait. Have a look at other traits to see how it is used usually.  Assigning at a certain age works like rhipeen wrote here: https://www.loverslab.com/topic/154818-how-to-cerate-a-gender-based-trait/?do=findComment&comment=3162625 So I created a trait in trait file called Woman that lowers health, then created a txt file in on_action folder with the next contents: on_specific_birthday = {    first_valid_on_action = {       on_30th_birthday    }    add_trait = woman  How is it?
bunt776 Posted October 12, 2020 Posted October 12, 2020 Well, with that syntax you'd need to add a new on_action as well that is called on_30th_birthday. Â You can do that, but it is not clearly the better solution with regards to complexity. add_trait should be placed inside a effects = { } bracket. Â I fixed something up with the use case of the other thread, have a look at that. oldPrune.zip
desrtucted Posted October 12, 2020 Author Posted October 12, 2020 25 minutes ago, bunt776 said: Well, with that syntax you'd need to add a new on_action as well that is called on_30th_birthday.  You can do that, but it is not clearly the better solution with regards to complexity. add_trait should be placed inside a effects = { } bracket.  I fixed something up with the use case of the other thread, have a look at that. oldPrune.zip 2.17 kB · 1 download Not funcioning. I changed the .mod file so it would be compatible with 1.1 but nothing really changed. I tracked women's health via debug and it doesn't drop by 1 to 5, no traits got assigned. Well, that's the biggest leap I ever saw in achieving the goal thus far.
bunt776 Posted October 12, 2020 Posted October 12, 2020 There is no trait being assigned, I did that with modifiers (didn't want to bloat the trait area). Compatibility is just a warning, not an error. I can confirm the exact code works fine for me, just tested it. Have the game run for a year so people get the birthday trigger, then see if older women (40 and above, feel free to change that) do have two red swords crossed in the modifiers area next to religion and culture.
desrtucted Posted October 12, 2020 Author Posted October 12, 2020 37 minutes ago, bunt776 said: There is no trait being assigned, I did that with modifiers (didn't want to bloat the trait area). Compatibility is just a warning, not an error. I can confirm the exact code works fine for me, just tested it. Have the game run for a year so people get the birthday trigger, then see if older women (40 and above, feel free to change that) do have two red swords crossed in the modifiers area next to religion and culture. It does. Thank you for the mod. loverslab is a lot better than reddit.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.