Jump to content

CK2 Modding Quick Question Thread


Recommended Posts

Posted

I can't seem to figure out what I am doing wrong. The on-action on_birth fires, traits work, the triggers work but I am not getting a half-elf when breeding a sun elf with a human. For some reason the child either gets sun_elf or moon_elf traits instead. There is no inherit chance from any of the trait, all the trait assigning is in this one event except Human so I know the child is being run through the event. The best I can come up with is the child is getting sent through the part meant for when sun and moon elves breed instead of being sent further down the line to the sun elf/human section.

 

Spoiler

character_event = {
 id = ala_FRCore.300
 is_triggered_only = yes
 hide_window = yes
 trigger = {
  OR = {
   mother_even_if_dead = {
    OR = {
     is_ala_purebreed = yes
     is_ala_halfbreed = yes
    }
   }
   father_even_if_dead = {
    is_father_real_father = yes
    OR = {
     is_ala_purebreed = yes
     is_ala_halfbreed = yes
    }
   }
   real_father_even_if_dead = {
    OR = {
     is_ala_purebreed = yes
     is_ala_halfbreed = yes
    }
   }
  }
 }
 immediate = {
  #### ELVES
  if = {          # SUN/SUN = SUN
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_sun_elf
     }
     father_even_if_dead = {
      trait = ala_sun_elf
     }
    }
    mother_even_if_dead = {
     trait = ala_sun_elf
    }
   }
   add_trait = ala_sun_elf
  }
  else_if = {         # MOON/MOON = MOON
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_moon_elf
     }
     father_even_if_dead = {
      trait = ala_moon_elf
     }
    }
    mother_even_if_dead = {
     trait = ala_moon_elf
    }
   }
   add_trait = ala_moon_elf
  }
  else_if = {         # DROW/DROW = DROW
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_drow
     }
     father_even_if_dead = {
      trait = ala_drow
     }
    }
    mother_even_if_dead = {
     trait = ala_drow
    }
   }
   add_trait = ala_drow
  }
  else_if = {         # DROW/SUN = 50-SUN/50-MOON
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_drow
     }
     father_even_if_dead = {
      trait = ala_drow
     }
     mother_even_if_dead = {
      trait = ala_sun_elf
     }
    }
   }
   random_list = {
    50 = { add_trait = ala_sun_elf }
    50 = { add_trait = ala_moon_elf }
   }
  }
  else_if = {         # SUN/DROW = 50-SUN/50-MOON
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_sun_elf
     }
     father_even_if_dead = {
      trait = ala_sun_elf
     }
     mother_even_if_dead = {
      trait = ala_drow
     }
    }
   }
   random_list = {
    50 = { add_trait = ala_sun_elf }
    50 = { add_trait = ala_moon_elf }
   }
  }
  else_if = {         # DROW/MOON = MOON
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_drow
     }
     father_even_if_dead = {
      trait = ala_drow
     }
    }
    mother_even_if_dead = {
     trait = ala_moon_elf
    }
   }
   add_trait = ala_moon_elf
  }
  else_if = {         # MOON/DROW = MOON
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_moon_elf
     }
     father_even_if_dead = {
      trait = ala_moon_elf
     }
    }
    mother_even_if_dead = {
     trait = ala_drow
    }
   }
   add_trait = ala_moon_elf
  }
  else_if = {         # SUN/MOON = 50-SUN/50-MOON
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_sun_elf
     }
     father_even_if_dead = {
      trait = ala_sun_elf
     }
    }
    mother_even_if_dead = {
     trait = ala_moon_elf
    }
   }
   random_list = {
    50 = { add_trait = ala_sun_elf }
    50 = { add_trait = ala_moon_elf }
   }
  }
  else_if = {         # MOON/SUN = 50-SUN/50-MOON
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_moon_elf
     }
     father_even_if_dead = {
      trait = ala_moon_elf
     }
    }
    mother_even_if_dead = {
     trait = ala_sun_elf
    }
   }
   random_list = {
    50 = { add_trait = ala_sun_elf }
    50 = { add_trait = ala_moon_elf }
   }
  }
  else_if = {         # HUMAN/SUN = HE
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_human
     }
     father_even_if_dead = {
      trait = ala_human
     }
    }
    mother_even_if_dead = {
     trait = ala_sun_elf
    }
   }
   add_trait = ala_half_elf
  }
  else_if = {         # SUN/HUMAN = HE
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_sun_elf
     }
     father_even_if_dead = {
      trait = ala_sun_elf
     }
    }
    mother_even_if_dead = {
     trait = ala_human
    }
   }
   add_trait = ala_half_elf
  }
  else_if = {         # HUMAN/MOON = HE
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_human
     }
     father_even_if_dead = {
      trait = ala_human
     }
    }
    mother_even_if_dead = {
     trait = ala_moon_elf
    }
   }
   add_trait = ala_half_elf
  }
  else_if = {         # MOON/HUMAN = HE
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_moon_elf
     }
     father_even_if_dead = {
      trait = ala_moon_elf
     }
    }
    mother_even_if_dead = {
     trait = ala_human
    }
   }
   add_trait = ala_half_elf
  }
  else_if = {         # HUMAN/DROW = HE
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_human
     }
     father_even_if_dead = {
      trait = ala_human
     }
    }
    mother_even_if_dead = {
     trait = ala_drow
    }
   }
   add_trait = ala_half_elf
  }
  else_if = {         # DROW/HUMAN = HE
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_drow
     }
     father_even_if_dead = {
      trait = ala_drow
     }
    }
    mother_even_if_dead = {
     trait = ala_human
    }
   }
   add_trait = ala_half_elf
  }
  else_if = {         # HE/HE = HE
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_half_elf
     }
     father_even_if_dead = {
      trait = ala_half_elf
     }
    }
    mother_even_if_dead = {
     trait = ala_half_elf
    }
   }
   add_trait = ala_half_elf
  }
  else_if = {         # HUMAN/HE = HE
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_human
     }
     father_even_if_dead = {
      trait = ala_human
     }
    }
    mother_even_if_dead = {
     trait = ala_half_elf
    }
   }
   random_list = {
    80 = { add_trait = ala_human }
    20 = { add_trait = ala_half_elf }
   }
  }
  else_if = {         # HE/HUMAN = HE
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_half_elf
     }
     father_even_if_dead = {
      trait = ala_half_elf
     }
    }
    mother_even_if_dead = {
     trait = ala_human
    }
   }
   random_list = {
    80 = { add_trait = ala_human }
    20 = { add_trait = ala_half_elf }
   }
  }
  #### DWARVEN
  if = {          # SHIELD/SHIELD = SHIELD
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_shield_dwarf
     }
     father_even_if_dead = {
      trait = ala_shield_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_shield_dwarf
    }
   }
   add_trait = ala_shield_dwarf
  }
  else_if = {         # HB/SHIELD = 80SHIELD/20HB
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_half_dwarf
     }
     father_even_if_dead = {
      trait = ala_half_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_shield_dwarf
    }
   }
   random_list = {
    80 = { add_trait = ala_shield_dwarf }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  else_if = {         # SHIELD/HB = 80SHIELD/20HB
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_shield_dwarf
     }
     father_even_if_dead = {
      trait = ala_shield_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_half_dwarf
    }
   }
   random_list = {
    80 = { add_trait = ala_shield_dwarf }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  else_if = {         # SHIELD/GOLD = 50SHIELD/50GOLD
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_gold_dwarf
     }
     father_even_if_dead = {
      trait = ala_gold_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_shield_dwarf
    }
   }
   random_list = {
    50 = { add_trait = ala_shield_dwarf }
    50 = { add_trait = ala_gold_dwarf }
   }
  }
  else_if = {         # SHIELD/GOLD = 50SHIELD/50GOLD
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_shield_dwarf
     }
     father_even_if_dead = {
      trait = ala_shield_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_gold_dwarf
    }
   }
   random_list = {
    50 = { add_trait = ala_shield_dwarf }
    50 = { add_trait = ala_gold_dwarf }
   }
  }
  else_if = {         # GOLD/GOLD = GOLD
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_gold_dwarf
     }
     father_even_if_dead = {
      trait = ala_gold_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_gold_dwarf
    }
   }
   add_trait = ala_gold_dwarf
  }
  else_if = {         # HB/GOLD = 80GOLD/20HB
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_half_dwarf
     }
     father_even_if_dead = {
      trait = ala_half_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_gold_dwarf
    }
   }
   random_list = {
    80 = { add_trait = ala_gold_dwarf }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  else_if = {         # GOLD/HB = 80GOLD/20HB
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_gold_dwarf
     }
     father_even_if_dead = {
      trait = ala_gold_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_half_dwarf
    }
   }
   random_list = {
    80 = { add_trait = ala_gold_dwarf }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  if = {          # DUERGAR/DUERGAR = DUERGAR
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_duergar
     }
     father_even_if_dead = {
      trait = ala_duergar
     }
    }
    mother_even_if_dead = {
     trait = ala_duergar
    }
   }
   add_trait = ala_duergar
  }
  else_if = {         # DUERGAR/SHIELD = 50DUERGAR/50SHIELD
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_shield_dwarf
     }
     father_even_if_dead = {
      trait = ala_shield_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_duergar
    }
   }
   random_list = {
    50 = { add_trait = ala_duergar }
    50 = { add_trait = ala_shield_dwarf }
   }
  }
  else_if = {         # DUERGAR/SHIELD = 50DUERGAR/50SHIELD
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_duergar
     }
     father_even_if_dead = {
      trait = ala_duergar
     }
    }
    mother_even_if_dead = {
     trait = ala_shield_dwarf
    }
   }
   random_list = {
    50 = { add_trait = ala_duergar }
    50 = { add_trait = ala_shield_dwarf }
   }
  }
  else_if = {         # DUERGAR/GOLD = 50DUERGAR/50GOLD
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_gold_dwarf
     }
     father_even_if_dead = {
      trait = ala_gold_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_duergar
    }
   }
   random_list = {
    50 = { add_trait = ala_duergar }
    50 = { add_trait = ala_gold_dwarf }
   }
  }
  else_if = {         # DUERGAR/GOLD = 50DUERGAR/50GOLD
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_duergar
     }
     father_even_if_dead = {
      trait = ala_duergar
     }
    }
    mother_even_if_dead = {
     trait = ala_gold_dwarf
    }
   }
   random_list = {
    50 = { add_trait = ala_duergar }
    50 = { add_trait = ala_gold_dwarf }
   }
  }
  else_if = {         # HB/DUERGAR = 80DUERGAR/20HB
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_half_dwarf
     }
     father_even_if_dead = {
      trait = ala_half_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_duergar
    }
   }
   random_list = {
    80 = { add_trait = ala_duergar }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  else_if = {         # DUERGAR/HB = 80DUERGAR/20HB
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_duergar
     }
     father_even_if_dead = {
      trait = ala_duergar
     }
    }
   }
   mother_even_if_dead = {
    trait = ala_half_dwarf
   }
   random_list = {
    80 = { add_trait = ala_duergar }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  else_if = {         # HB/HB = HB
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_half_dwarf
     }
     father_even_if_dead = {
      trait = ala_half_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_half_dwarf
    }
   }
   add_trait = ala_half_dwarf
  }
  else_if = {         # HB/HUMAN = 80HUMAN/20HB
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_half_dwarf
     }
     father_even_if_dead = {
      trait = ala_half_dwarf
     }
    }
    mother_even_if_dead = {
     trait = ala_human
    }
   }
   random_list = {
    80 = { add_trait = ala_human }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  else_if = {         # HUMAN/HB = 80HUMAN/20HB
   limit = {
    OR = {
     real_father_even_if_dead = {
      trait = ala_human
     }
     father_even_if_dead = {
      trait = ala_human
     }
    }
    mother_even_if_dead = {
     trait = ala_half_dwarf
    }
   }
   random_list = {
    80 = { add_trait = ala_human }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  #### Genetic Blocker
  if = {
   limit = {
    OR = {
     trait = elf
     trait = ala_sun_elf
     trait = ala_moon_elf
     trait = ala_half_elf
     trait = ala_drow
     trait = orc
    }
    OR = {
     trait = ala_shield_dwarf
     trait = ala_gold_dwarf
     trait = ala_half_dwarf
     trait = ala_duergar
    }
   }
   mother = { narrative_event = { id = DWCore.8007 days = 1 } }
  }
  if = {
   limit = {
    OR = {
     trait = elf
     trait = ala_sun_elf
     trait = ala_moon_elf
     trait = ala_half_elf
     trait = ala_drow
    }
    trait = orc
   }
   mother = { narrative_event = { id = DWCore.8007 days = 1 } }
  }
  #### Human Cleanup
  if = {
   limit = {
    OR = {
     #trait = ala_human
     #trait = elf
     trait = ala_sun_elf
     trait = ala_moon_elf
     trait = ala_half_elf
     trait = ala_drow
     trait = ala_shield_dwarf
     trait = ala_gold_dwarf
     trait = ala_half_dwarf
     trait = ala_duergar
     trait = orc
     trait = fairy
     #trait = lilith
     #trait = incubus
     #trait = werewolf
     #trait = werewolf_ancient
     #trait = werekin
     #trait = vampire
     #trait = vampire_ancient
     #trait = dhampir
     trait = angel
     trait = neko
     trait = kitsune
     trait = tentacle
     trait = genie
    }
    trait = ala_human
   }
   remove_trait = ala_human
  }
 }
}
 

 

EDIT: ok so I moved the human/sun and sun/human part to the top and it works perfectly, which leads me to believe there is a limit on else_if? Sun/human is 11 else_if = {} down but it seems to trip up and use the 8th else_if = {}  down every time, treating the 8th else_if = {} as an else = {}. I am pretty sure I can fix this, pretty easy now that I know the idea itself works right, but I am hoping for some kind of confirmation on this new idea since the wiki does not say anything about a limit.

 

EDIT2: I seem to have fixed this by changing all the else_if = {} 's into if = {}. So I guess there is a limit. Or something beyond my limited knowledge. Now everything I have tested seems to work except half-elf.

Posted

In the following event:

 

## Gift to Commoners
narrative_event = {
    id = RSLS.64
    desc = RSLS64desc
    picture = GFX_evt_rsl.usegift2
    title = rsl_abandon_her
    is_triggered_only = yes
    
    immediate = {
                location = { town_opinion = 5 duration = 60 }
    
            }
    option = {
        
        name = rsl_option1
        

    }
}

 

I would like to increase the town-folks opinion for a limited period of time. However, the above does not work. Any suggestions?

 

Posted
6 hours ago, joemann said:

In the following event:

 

## Gift to Commoners
narrative_event = {
    id = RSLS.64
    desc = RSLS64desc
    picture = GFX_evt_rsl.usegift2
    title = rsl_abandon_her
    is_triggered_only = yes
    
    immediate = {
                location = { town_opinion = 5 duration = 60 }
    
            }
    option = {
        
        name = rsl_option1
        

    }
}

 

I would like to increase the town-folks opinion for a limited period of time. However, the above does not work. Any suggestions?

 

town_opinion is a fixed modifier attached to traits, character (event) modifiers or technology only, and cannot be used from the province scope. You could define and add a character modifier with town_opinion in it to make all mayors like you better, if that is your objective, but if the idea is to just increase the opinion of mayors in a single province you'll have to use an opinion modifier and a bit of scripting to scope to them and add it. If the idea is to not only affect mayors but also anyone living in that province's cities, you'd need to the same MO, because town_opinion only affects mayors.

Posted

Do I have to use inherit_chance if I try to use both_parent_has_trait_inherit_chance in my traits? I can't figure out how I broke this but none of my traits with this in it will pass on. I don't really want to use inherit_chance, preferring to use events to handle it to better control which trait they get when mixing with each other, but when I ran into trouble with half-elf + half-elf = half-elf, I deleted it and those just like it from the event and put the both_parent_has_trait_inherit_chance into the traits and now none of them pass on when the parents have the same traits. I know the spelling is correct, I have checked several times lol. It works fine in DWR's elf trait so I know it's something I am doing, but even if I remove the entire event page from the mod and test just the traits it's still broken for my traits. But the traits work fine in game in any other way. I'm going bonkers over this, been a 2 day ordeal of trying to figure this out so I can get on to adding new stuff.

Posted
On 6/6/2018 at 11:31 AM, Alaratt said:

I am not getting a half-elf when breeding a sun elf with a human.  For some reason the child either gets sun_elf or moon_elf traits instead


  else_if = {         # DROW/SUN = 50-SUN/50-MOON
   limit = {
    OR = {
     real_father_even_if_dead = { trait = ala_drow }
     father_even_if_dead = { trait = ala_drow }
     mother_even_if_dead = { trait = ala_sun_elf }
    }
   }
   random_list = {
    50 = { add_trait = ala_sun_elf }
    50 = { add_trait = ala_moon_elf }
   }
  }
  else_if = {         # SUN/DROW = 50-SUN/50-MOON
   limit = {
    OR = {
     real_father_even_if_dead = { trait = ala_sun_elf }
     father_even_if_dead = { trait = ala_sun_elf }
     mother_even_if_dead = {  trait = ala_drow }
    }
   }
   random_list = {
    50 = { add_trait = ala_sun_elf }
    50 = { add_trait = ala_moon_elf }
   }
  }

First of the above else_if will be executed for sun_elf mothers second for sun_elf fathers, your half_elf else_if doesn't have a chance to be executed.

Posted

Thank you for your advice.

 

I tried the following:

 

immediate = {
            capital_scope = {
                            opinion = {
                            modifier = rsl_opinion_generous_man
                            who = ROOT
                            }
                    }
            }

 

The idea being that in the capital  the opinion of the player character increases, as defined in the opinion modifier. It doesn't seem to work but I am not sure how to check this. For example no tooltip shows up when browsing over the option bar.

 

Any suggestions?

Posted

Thanks but I did read it. That is how I came up with the above. I have put it in the option block of the event and it now shows up in a tool tip. However it cant seem to identify any characters to whom the modifier applies.

Posted

Opinion command needs to be used in a character scope (capital_scope is a province scope) and also need to ha ve a duration/days/months/years parsmeter. So... Probably the relevant link to the wiki is for the commands page.

Posted

Do you need a duration even if the opinion modifier itself includes a duration ?

 

In this case the opinion modifier is as follows:

rsl_opinion_generous_man = {
    opinion = 20
    months = 6
}

 

If I can't use a province scope, how can I increase or decrease   the variables of a province ( be it  manpower increase, revolt risk, its opinion of  its league etc, etc ) through an event?

 

Posted
16 hours ago, walperto said:

First of the above else_if will be executed for sun_elf mothers second for sun_elf fathers, your half_elf else_if doesn't have a chance to be executed.

Yeah I found that typo not long after posting, thanks for looking though. Fixed it by putting the mother {} outside of the OR = {} like it was supposed to be,  Doing that didn't actually fix anything, though. The only thing that did was changing all the else_if = {} into if = {}. I honestly think there is some kind of limit on else_if before it seems to use an else_if as an else instead,  despite not fulfilling the requirements, and forces you through anyway.

 

This is the current working script, I have tested plenty and this part does work fine.

 

Spoiler

character_event = {
 id = ala_FRCore.300
 is_triggered_only = yes
 hide_window = yes
 trigger = {
  OR = {
   mother_even_if_dead = {
    OR = {
     is_ala_purebreed = yes
     is_ala_halfbreed = yes
    }
   }
   true_father_even_if_dead = {
    OR = {
     is_ala_purebreed = yes
     is_ala_halfbreed = yes
    }
   }
  }
 }
 immediate = {
  #### ELVES
  if = {         #4 DROW/SUN = 50-SUN/50-MOON
   limit = {
    true_father_even_if_dead = {
     trait = ala_drow
    }
    mother_even_if_dead = {
     trait = ala_sun_elf
    }
   }
   random_list = {
    50 = { add_trait = ala_sun_elf }
    50 = { add_trait = ala_moon_elf }
   }
  }
  if = {         #5 SUN/DROW = 50-SUN/50-MOON
   limit = {
    true_father_even_if_dead = {
     trait = ala_sun_elf
    }
    mother_even_if_dead = {
     trait = ala_drow
    }
   }
   random_list = {
    50 = { add_trait = ala_sun_elf }
    50 = { add_trait = ala_moon_elf }
   }
  }
  if = {         #6 DROW/MOON = MOON
   limit = {
    true_father_even_if_dead = {
     trait = ala_drow
    }
    mother_even_if_dead = {
     trait = ala_moon_elf
    }
   }
   add_trait = ala_moon_elf
  }
  if = {         #7 MOON/DROW = MOON
   limit = {
    true_father_even_if_dead = {
     trait = ala_moon_elf
    }
    mother_even_if_dead = {
     trait = ala_drow
    }
   }
   add_trait = ala_moon_elf
  }
  if = {         #8 SUN/MOON = 50-SUN/50-MOON
   limit = {
    father_even_if_dead = {
     trait = ala_sun_elf
    }
    mother_even_if_dead = {
     trait = ala_moon_elf
    }
   }
   random_list = {
    50 = { add_trait = ala_sun_elf }
    50 = { add_trait = ala_moon_elf }
   }
  }
  if = {         #9 MOON/SUN = 50-SUN/50-MOON
   limit = {
    true_father_even_if_dead = {
     trait = ala_moon_elf
    }
    mother_even_if_dead = {
     trait = ala_sun_elf
    }
   }
   random_list = {
    50 = { add_trait = ala_sun_elf }
    50 = { add_trait = ala_moon_elf }
   }
  }
  if = {         #10 HUMAN/SUN = HE
   limit = {
    true_father_even_if_dead = {
     trait = ala_human
    }
    mother_even_if_dead = {
     trait = ala_sun_elf
    }
   }
   add_trait = ala_half_elf
  }
  if = {         #11 SUN/HUMAN = HE
   limit = {
    true_father_even_if_dead = {
     trait = ala_sun_elf
    }
    mother_even_if_dead = {
     trait = ala_human
    }
   }
   add_trait = ala_half_elf
  }
  if = {         #12 HUMAN/MOON = HE
   limit = {
    true_father_even_if_dead = {
     trait = ala_human
    }
    mother_even_if_dead = {
     trait = ala_moon_elf
    }
   }
   add_trait = ala_half_elf
  }
  if = {         #13 MOON/HUMAN = HE
   limit = {
    true_father_even_if_dead = {
     trait = ala_moon_elf
    }
    mother_even_if_dead = {
     trait = ala_human
    }
   }
   add_trait = ala_half_elf
  }
  if = {         #14 HUMAN/DROW = HE
   limit = {
    true_father_even_if_dead = {
     trait = ala_human
    }
    mother_even_if_dead = {
     trait = ala_drow
    }
   }
   add_trait = ala_half_elf
  }
  if = {         #15 DROW/HUMAN = HE
   limit = {
    true_father_even_if_dead = {
     trait = ala_drow
    }
    mother_even_if_dead = {
     trait = ala_human
    }
   }
   add_trait = ala_half_elf
  }
  if = {         #17 HUMAN/HE = HE
   limit = {
    true_father_even_if_dead = {
     trait = ala_human
    }
    mother_even_if_dead = {
     trait = ala_half_elf
    }
   }
   random_list = {
    80 = { add_trait = ala_human }
    20 = { add_trait = ala_half_elf }
   }
  }
  if = {         #18 HE/HUMAN = HE
   limit = {
    true_father_even_if_dead = {
     trait = ala_half_elf
    }
    mother_even_if_dead = {
     trait = ala_human
    }
   }
   random_list = {
    80 = { add_trait = ala_human }
    20 = { add_trait = ala_half_elf }
   }
  }
  #### DWARVEN
  if = {         #20 HB/SHIELD = 80SHIELD/20HB
   limit = {
    true_father_even_if_dead = {
     trait = ala_half_dwarf
    }
    mother_even_if_dead = {
     trait = ala_shield_dwarf
    }
   }
   random_list = {
    80 = { add_trait = ala_shield_dwarf }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  if = {         #21 SHIELD/HB = 80SHIELD/20HB
   limit = {
    true_father_even_if_dead = {
     trait = ala_shield_dwarf
    }
    mother_even_if_dead = {
     trait = ala_half_dwarf
    }
   }
   random_list = {
    80 = { add_trait = ala_shield_dwarf }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  if = {         #22 SHIELD/GOLD = 50SHIELD/50GOLD
   limit = {
    true_father_even_if_dead = {
     trait = ala_gold_dwarf
    }
    mother_even_if_dead = {
     trait = ala_shield_dwarf
    }
   }
   random_list = {
    50 = { add_trait = ala_shield_dwarf }
    50 = { add_trait = ala_gold_dwarf }
   }
  }
  if = {         #23 SHIELD/GOLD = 50SHIELD/50GOLD
   limit = {
    true_father_even_if_dead = {
     trait = ala_shield_dwarf
    }
    mother_even_if_dead = {
     trait = ala_gold_dwarf
    }
   }
   random_list = {
    50 = { add_trait = ala_shield_dwarf }
    50 = { add_trait = ala_gold_dwarf }
   }
  }
  if = {         #25 HB/GOLD = 80GOLD/20HB
   limit = {
    true_father_even_if_dead = {
     trait = ala_half_dwarf
    }
    mother_even_if_dead = {
     trait = ala_gold_dwarf
    }
   }
   random_list = {
    80 = { add_trait = ala_gold_dwarf }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  if = {         #26 GOLD/HB = 80GOLD/20HB
   limit = {
    true_father_even_if_dead = {
     trait = ala_gold_dwarf
    }
    mother_even_if_dead = {
     trait = ala_half_dwarf
    }
   }
   random_list = {
    80 = { add_trait = ala_gold_dwarf }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  if = {         #28 DUERGAR/SHIELD = 50DUERGAR/50SHIELD
   limit = {
    true_father_even_if_dead = {
     trait = ala_shield_dwarf
    }
    mother_even_if_dead = {
     trait = ala_duergar
    }
   }
   random_list = {
    50 = { add_trait = ala_duergar }
    50 = { add_trait = ala_shield_dwarf }
   }
  }
  if = {         #29 DUERGAR/SHIELD = 50DUERGAR/50SHIELD
   limit = {
    true_father_even_if_dead = {
     trait = ala_duergar
    }
    mother_even_if_dead = {
     trait = ala_shield_dwarf
    }
   }
   random_list = {
    50 = { add_trait = ala_duergar }
    50 = { add_trait = ala_shield_dwarf }
   }
  }
  if = {         #30 DUERGAR/GOLD = 50DUERGAR/50GOLD
   limit = {
    true_father_even_if_dead = {
     trait = ala_gold_dwarf
    }
    mother_even_if_dead = {
     trait = ala_duergar
    }
   }
   random_list = {
    50 = { add_trait = ala_duergar }
    50 = { add_trait = ala_gold_dwarf }
   }
  }
  if = {         #31 DUERGAR/GOLD = 50DUERGAR/50GOLD
   limit = {
    true_father_even_if_dead = {
     trait = ala_duergar
    }
    mother_even_if_dead = {
     trait = ala_gold_dwarf
    }
   }
   random_list = {
    50 = { add_trait = ala_duergar }
    50 = { add_trait = ala_gold_dwarf }
   }
  }
  if = {         #32 HB/DUERGAR = 80DUERGAR/20HB
   limit = {
    true_father_even_if_dead = {
     trait = ala_half_dwarf
    }
    mother_even_if_dead = {
     trait = ala_duergar
    }
   }
   random_list = {
    80 = { add_trait = ala_duergar }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  if = {         #33 DUERGAR/HB = 80DUERGAR/20HB
   limit = {
    true_father_even_if_dead = {
     trait = ala_duergar
    }
    mother_even_if_dead = {
     trait = ala_half_dwarf
    }
   }
   random_list = {
    80 = { add_trait = ala_duergar }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  if = {         #35 HB/HUMAN = 80HUMAN/20HB
   limit = {
    true_father_even_if_dead = {
     trait = ala_half_dwarf
    }
    mother_even_if_dead = {
     trait = ala_human
    }
   }
   random_list = {
    80 = { add_trait = ala_human }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  if = {         #36 HUMAN/HB = 80HUMAN/20HB
   limit = {
    true_father_even_if_dead = {
     trait = ala_human
    }
    mother_even_if_dead = {
     trait = ala_half_dwarf
    }
   }
   random_list = {
    80 = { add_trait = ala_human }
    20 = { add_trait = ala_half_dwarf }
   }
  }
  #### Genetic Blocker
  if = {
   limit = {
    OR = {
     trait = elf
     trait = ala_sun_elf
     trait = ala_moon_elf
     trait = ala_half_elf
     trait = ala_drow
     trait = orc
    }
    OR = {
     trait = ala_shield_dwarf
     trait = ala_gold_dwarf
     trait = ala_half_dwarf
     trait = ala_duergar
    }
   }
   mother = { narrative_event = { id = DWCore.8007 days = 1 } }
  }
  if = {
   limit = {
    OR = {
     trait = elf
     trait = ala_sun_elf
     trait = ala_moon_elf
     trait = ala_half_elf
     trait = ala_drow
    }
    trait = orc
   }
   mother = { narrative_event = { id = DWCore.8007 days = 1 } }
  }
  #### Human Cleanup
  if = {
   limit = {
    OR = {
     #trait = ala_human
     #trait = elf
     trait = ala_sun_elf
     trait = ala_moon_elf
     trait = ala_half_elf
     trait = ala_drow
     trait = ala_shield_dwarf
     trait = ala_gold_dwarf
     trait = ala_half_dwarf
     trait = ala_duergar
     trait = orc
     trait = fairy
     #trait = lilith
     #trait = incubus
     #trait = werewolf
     #trait = werewolf_ancient
     #trait = werekin
     #trait = vampire
     #trait = vampire_ancient
     #trait = dhampir
     trait = angel
     trait = neko
     trait = kitsune
     trait = tentacle
     trait = genie
    }
    trait = ala_human
   }
   remove_trait = ala_human
  }
 }
}
 

 

I still cant figure out why half-elf + half-elf = half-elf would not work though, even after I removed those entire sections of the scripting and tried putting both_parent_has_trait_inherit_chance = 100 directly into the traits. I get a human child every time.

 

 

for anybody that feels like looking through it themselves here is the entire mod, anything labeled Core, Elven or Dwarven is the new stuff, the rest is pieces of ABM and ACM, my other mods. For now, for the sake of my sanity, I am going to work on portraits and other stuff AFR still needs, and come back to it later I guess.

Ala's Forgotten Realms.zip

Posted

I'm slowly getting there

 

        
    option = {
                
        name = rsl_option1
        add_holding_modifier = { name = rsl_for_he_is_a_jolly_good_fellow  duration = 60 }
        
        
    }
}

 

the modifier is as follows:

 

rsl_for_he_is_a_jolly_good_fellow = {
    icon = 3
    local_revolt_risk = -0.1
    general_opinion = 5
    }

 

This seems to work but the tool tip doesn't indicate to which holding the modifier applies. It reads  "--- gets decreased revolt risk "

 

If I use add_province_modifier instead of add_holding_modifier the tool tip says " all provinces get a reduced revolt risk"  I don't want it to apply to all provinces but just to the capital's province.

 

How can I do this?

Posted

You're adding a holding modifier to a character. Use a scope (or scope chain) to point to the holding you want. Also, not sure if it makes sense to put opinion modifiers in holding modifiers at all.

Posted

tried this:

 

option = {
                
        name = rsl_option1
        capital_scope = {
                add_holding_modifier = { name = rsl_for_he_is_a_jolly_good_fellow  duration = 60 }
        
        }
    }
}

 

It seems to work but according to validator :

--- Error 1 of 1 ---
At <mod>\events\RSLBreak-inSlave.txt [narrative_event\option\capital_scope\add_holding_modifier] (Line 187, column 5):
Invalid node "add_holding_modifier" in scope ProvCommand (value is: <a complex type>)

 

 

I'm lost ?

Posted
15 hours ago, Alaratt said:

I honestly think there is some kind of limit on else_if before it seems to use an else_if as an else instead

I did a test with 10000 else_if and else was executed, so the problem was with your conditions not with limit on else_if.

15 hours ago, Alaratt said:

tried putting both_parent_has_trait_inherit_chance = 100 directly into the traits

That's not enough, if trait doesn't have inherit_chance>0 then there'll be no inheritance check

 

 

14 minutes ago, joemann said:

I'm lost ?

You're adding holding modifier to province scope.

use capital_holding instead of capital_province or add_povince_modifier instead of add_holding_modifier

Why don't you start with reading ck2 wiki though?

Posted
30 minutes ago, walperto said:

I did a test with 10000 else_if and else was executed, so the problem was with your conditions not with limit on else_if.

That's not enough, if trait doesn't have inherit_chance>0 then there'll be no inheritance check

 

good to know, thanks. I guess when I'm done with portraits I will find a new way to write that script then.?

Posted

Thanks Walperto. Capital_holding works!

 

I do read the wiki , believe me but I find it far from clear.

 

For example where can i find the scope capital_holding ? (it is a scope  ?) I did find capital_scope but that apparently is not the right scope for a holding_modifier. where in the wiki can I find that?

 

It would help if the wiki had more examples instead of just stating things that the authors find self evident but which are not always so for newbies.

This being said, I wouldn't even have started without the wiki.

Posted

I found it. Must have read over it a couple of times. My bad.

 

option = {
                
        name = rsl_option1
        capital_holding = {
                add_holding_modifier = { name = rsl_for_he_is_a_jolly_good_fellow  duration = 60 }
                            FROMFROMFROM = {            
                                        if = {
                                            limit = {
                                                prisoner = yes
                                            }
                                            add_character_modifier = {
                                                name = house_arrest
                                                duration = -1
                    }                            
                }
            }    
        }
    }

 

This works now. At least the first part does. Not sure if the prisoner now moves to house-arrest. Could be a scope issue.

 

As to using add_holding_modifier , it does seem a bit strange given that a holding_modifier has an icon. I have no clue where it goes since it applies to the capital and not the character.

However it works and Validator is happy as well.

Posted
2 hours ago, joemann said:

I found it. Must have read over it a couple of times. My bad.

 

option = {
                
        name = rsl_option1
        capital_holding = {
                add_holding_modifier = { name = rsl_for_he_is_a_jolly_good_fellow  duration = 60 }
                            FROMFROMFROM = {            
                                        if = {
                                            limit = {
                                                prisoner = yes
                                            }
                                            add_character_modifier = {
                                                name = house_arrest
                                                duration = -1
                    }                            
                }
            }    
        }
    }

 

This works now. At least the first part does. Not sure if the prisoner now moves to house-arrest. Could be a scope issue.

 

As to using add_holding_modifier , it does seem a bit strange given that a holding_modifier has an icon. I have no clue where it goes since it applies to the capital and not the character.

However it works and Validator is happy as well.

Holding modifiers appear in the lower part of the city/castle/temple/tribe's sprite in the province view.

Posted

Are offmap_decisions a separate category of decisions  (like targeted decisions) with their own block:  offmap_decisions { } ?

 

If so  the following should not be necessary:

 

decisions = {

              offmap_decisions = {

                                        decision_a = { }

                            }

               }

 

However, if I don't enclose my offmap decision  it in a decision block it doesn't show up in the intrigue menu.

Posted
On ‎6‎/‎11‎/‎2018 at 12:53 PM, joemann said:

Are offmap_decisions a separate category of decisions  (like targeted decisions) with their own block:  offmap_decisions { } ?

 

If so  the following should not be necessary:

 

decisions = {

              offmap_decisions = {

                                        decision_a = { }

                            }

               }

 

However, if I don't enclose my offmap decision  it in a decision block it doesn't show up in the intrigue menu.

yes, but these decisions are not supposed to show up in the intrigue menu, they are for adding options in the offmap screen itself. EX: giving china gold, or getting a strategist, etc.

Posted
On 6/10/2018 at 7:16 PM, joemann said:

This works now.

It works, you don't get warnings or errors, but all it does is addition of the modifier to the capital holding that has no effect in that scope.
Always check in which scope modifier works.
Here's your modifier
    rsl_for_he_is_a_jolly_good_fellow = {
        icon = 3
        local_revolt_risk = -0.1
        general_opinion = 5
    }
local_revolt_risk works only in province scope, so you have to use add_province_modifier in the province scope,
but in province scope general_opinion part of your modifier will have no effect, it works only in character scope
To get the result you wanted you have to add your modifier to character and province
    option = {
        name = rsl_option1
        add_character_modifier = { name = rsl_for_he_is_a_jolly_good_fellow duration = 60 }
        capital_scope = { add_province_modifier = { name = rsl_for_he_is_a_jolly_good_fellow duration = 60 } }
    }
and it's better to split your modifier into two to avoid adding stuff that will have no effect at best.

 

On 6/10/2018 at 7:16 PM, joemann said:

FROMFROMFROM = {            
                                        if = {
                                            limit = {
                                                prisoner = yes
                                            }
                                            add_character_modifier = {
                                                name = house_arrest

Did you try to move FROMFROMFROM out from the dungeon into house arrest?
Without knowing how do you fire your event i can't tell if FROMFROMFROM is scoping to any character, but even if it does
adding house_arrest modifier won't remove dungeon modifier, you have to do it with remove_character_modifier.

 

On 6/11/2018 at 7:53 PM, joemann said:

Are offmap_decisions a separate category of decisions

Yes they are, and they're shown in the offmap power view, not in the intrigue view.
Offmap powers have a list of interaction buttons and you assign offmap_decision to one of those buttons.
    offmap_china = {
        buttons = {
            offmap_gifts = {
    offmap_decisions = {
        chinese_grace_send_gift = {
            button_name = offmap_gifts

Posted
On 6/9/2018 at 6:23 PM, joemann said:

tried this:

 

It seems to work but according to validator :

--- Error 1 of 1 ---
At \events\RSLBreak-inSlave.txt [narrative_event\option\capital_scope\add_holding_modifier] (Line 187, column 5):
Invalid node "add_holding_modifier" in scope ProvCommand (value is: )

 

 

I'm lost ?

 

According to your questions and replies so dar, you seem to be working a bit in the dark when it comes to scopes. May I suggest you read this wiki article https://ck2.paradoxwikis.com/Scopes

 

More specifically, look up the "quick card" graphic. It will give you an understanding of how the various classes used in the CK2 model are inter-related. When using a command, look at the "used form scope" column. Basically, a given script always executes within a specific scope. This is your current object. Each object has a class (a type of object). Commands can only be used on the type of object they were designed to be used with.

 

For instance, you would not be able to call add_trait when calling it on an artifact. You could however, form the artifact, get the owner of said artifact (which would be a character) and call add_trait on that character.

 

I hope this helps.

 

Posted

Is it possible to have multiple events trigger from the same event? inside the same option. I haven't been able to find an example of anybody else doing it so up until now I have always assumed it acted as a break of sorts and added it last. Then I found on the event modding page on the wiki showed its example adding flags after launching the next event.

Hate to write it in the form of my example only to find it doesn't launch two events at once, though.

 

Example

 

character_event = { # triggered from previous events

option = { # choose to create character as your dynasty

character_event = { id = (eventID)  } # the character creation

narrative/character_event = { id = (eventID) years = 1 } # on to the next event in the chain

}

option = { # choose to create character as legitimate bastard

character_event = { id = (eventID)  } # the character creation

narrative/character_event = { id = (eventID) years = 1 } # on to the next event in the chain

}

option = { # choose to create character illegitimate bastard

character_event = { id = (eventID)  } # the character creation

narrative/character_event = { id = (eventID) years = 1 } # on to the next event in the chain

}

}

 

Nevermind-I found that I have done it before and it works fine, forgot I used to alter DWRs DWFairytales.90 to put all the princesses into my court at the same time instead of seeding them randomly. I haven't had to do that since making my cheat mod though.

Posted

Thanks Coleman1  and walperto for your help!

 

I need some help with the following:

 

narrative_event = {
    id = RSLS.82
    title = rsl_anal_rape
    desc = RSLS82desc
    picture = GFX_evt_rsl.rapeanal1W
    

    is_triggered_only = yes
    
    immediate = {
    
    if = {
        limit = {
                
                    event_target:rsl_rape_target = { trait = micro_anus }                        
                                
        
                    event_target:rsl_rapist = {
                                            OR = { trait = dick_horse
                                                   trait = dick_huge
                                                   trait = dick_large
                                       
                                                }
                                            }
                                            
                }    
                                        
                                        
        event_target:rsl_rape_target = { narrative_event = { id = RSLS.821 }} ## Damage
        
        }
        

        
    if = {
        limit = {
    
            event_target:rsl_rape_target = { trait = micro_anus }
                                
    
        
            event_target:rsl_rapist = { trait = dick_average }
                                    
                                    
                                                
                                                            
                                        
                }                    
                                    
        event_target:rsl_rape_target = { narrative_event = { id = RSLS.822 }} ## Painful
        }

<  etc etc >

if = {
            limit = {
            event_target:rsl_rape_target = { trait = gigantic_anus }
                                
        
                event_target:rsl_rapist = {
                                        OR = { trait = dick_horse
                                                trait = dick_huge
                                                trait = dick_large
                                                trait = dick_average
                                                trait = dick_small
                                                trait = dick_tiny
                                                }
                                            }                
                    }
                            
                    
                                        
                                        
        event_target:rsl_rape_target = { narrative_event = { id = RSLS.871 }} ## fit
            }
        
            
            
        }
        
        option = {
        name = rsl_option_further }
}

 

The follow-up  events don't fire , I just get the option screen of RSLS.82 (the present one). According to charinfo the event_targets scope to the correct characters. Is it not possible to set the combined traits of two different characters as a condition?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...