Jump to content
Mr_Treason

CK2 Modding Quick Question Thread

Recommended Posts

So I tried:

hidden_tooltip = {
			if = {
				limit = {
					is_married = no
				}
				random = {
					chance = 10
					impregnate = 0
				}
			}
		}
		hidden_tooltip = {
			if = {
				limit = {
					is_married = yes
				}
				random = {
					chance = 10
					impregnate_cuckoo = 0
				}
			}
		}

Still no events... But upon revisiting unholy impregnation, I realize that there are no events and pregnant trait as well. So, I think I will need to have "on_pregnancy" in my own on_actions?

Link to post
27 minutes ago, manicpixxxie said:

So I tried:


hidden_tooltip = {
			if = {
				limit = {
					is_married = no
				}
				random = {
					chance = 10
					impregnate = 0
				}
			}
		}
		hidden_tooltip = {
			if = {
				limit = {
					is_married = yes
				}
				random = {
					chance = 10
					impregnate_cuckoo = 0
				}
			}
		}

Still no events... But upon revisiting unholy impregnation, I realize that there are no events and pregnant trait as well. So, I think I will need to have "on_pregnancy" in my own on_actions?

Did you wait two months?

Link to post
1 hour ago, lockeslylcrit said:

Did you wait two months?

I resorted to creating events for the "on_pregnancy" trigger in my mod's on_actions file, and that seemed to fix it, because the game doesn't seem to recognize non-existent fathers as an actual father. That is probably the reason why the events don't fire. 

Link to post
12 minutes ago, manicpixxxie said:

I resorted to creating events for the "on_pregnancy" trigger in my mod's on_actions file, and that seemed to fix it, because the game doesn't seem to recognize non-existent fathers as an actual father. That is probably the reason why the events don't fire. 

You can probably solve that by using create_character for the father, doing the impregnate command, and then silently killing him off afterwards.

Link to post
1 hour ago, lockeslylcrit said:

You can probably solve that by using create_character for the father, doing the impregnate command, and then silently killing him off afterwards.

The current method that I am using seems to work just fine, but I will also consider that. 

 

Is there any reason why my on_birth event is not firing? I mean, it does add and remove flags that I have set, however the description and such does not pop up. The ID and namespace is correct as well. The Validator isn't returning any specific issues. 

Link to post
17 minutes ago, manicpixxxie said:

The current method that I am using seems to work just fine, but I will also consider that. 

 

Is there any reason why my on_birth event is not firing? I mean, it does add and remove flags that I have set, however the description and such does not pop up. The ID and namespace is correct as well. The Validator isn't returning any specific issues. 

on_action events happen to the character that triggered the action. You're not getting the description because you're not the one being born.

Link to post
32 minutes ago, lockeslylcrit said:

on_action events happen to the character that triggered the action. You're not getting the description because you're not the one being born.

Oh, oops... Then how would I be able to trigger an event for the mother upon the birth of her child?

Link to post

Just thinking out loud here. Since secret societies, by definition, don't advertise the identities of their members, wouldn't it make more sense for a character to be able to join one even after being accepted into another recruiting openly, provided the two don't have clashing membership requirements?

 

Is the "one character, one society" rule hardcoded or is there a way to make what I thought about possible?

Link to post
1 hour ago, manicpixxxie said:

Oh, oops... Then how would I be able to trigger an event for the mother upon the birth of her child?

immediate = {
	mother = {
		character_event = { id = blahblah }
	}
}

 

35 minutes ago, AlexWyrmin said:

Just thinking out loud here. Since secret societies, by definition, don't advertise the identities of their members, wouldn't it make more sense for a character to be able to join one even after being accepted into another recruiting openly, provided the two don't have clashing membership requirements?

 

Is the "one character, one society" rule hardcoded or is there a way to make what I thought about possible?

No, once you click the button to join a society, you then have a hardcoded flag on your character that utilizes the interested_in_society condition (among others). This is what the game checks when doing the society join events. Once you join, it (again) adds a hardcoded flag on your character that utilizes society_member_of condition.

Link to post
province_event = {
	id = CB.1471
	desc = EVTDESCCB.1471
	picture = GFX_evt_stone_church
	border = GFX_event_normal_frame_diplomacy
	
	trigger = {
		has_global_flag = cb_culture_breakdown
		year >= 1000
		OR = {
			culture = norse
		}
		OR = {
			kingdom = { title = k_norway }
			duchy = { title = d_finnmark }
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = EVTOPTACB.1471
		culture = norwegian
	}
}

Would I be reading this code correctly if I said this event would fire regardless of there being an already established Empire of Scandinavia?

Link to post
45 minutes ago, AlexWyrmin said:

province_event = {
	id = CB.1471
	desc = EVTDESCCB.1471
	picture = GFX_evt_stone_church
	border = GFX_event_normal_frame_diplomacy
	
	trigger = {
		has_global_flag = cb_culture_breakdown
		year >= 1000
		OR = {
			culture = norse
		}
		OR = {
			kingdom = { title = k_norway }
			duchy = { title = d_finnmark }
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}

	option = {
		name = EVTOPTACB.1471
		culture = norwegian
	}
}

Would I be reading this code correctly if I said this event would fire regardless of there being an already established Empire of Scandinavia?

The only restriction is that the province has to be either in the Kingdom of Norway or the Duchy of Finnmark. The presence of an empire doesn't matter.

Link to post
12 minutes ago, lockeslylcrit said:

The only restriction is that the province has to be either in the Kingdom of Norway or the Duchy of Finnmark. The presence of an empire doesn't matter.

Just as I thought. I just wanted to make sure I was reading things correctly.

Link to post
Spoiler

rsl_break_will = {

    filter = sub_realm  ## filters all characters below the decision taker employer, not including the decision taker themselves
    ai_target_filter = self
    third_party_filter = court ## filter for third parties
    ai_third_party_filter = court
    
    show_third_party_potential = yes
    
        from_potential = {  ai = no
                            capital_scope = {
                                            OR = {
                                                has_building = rsl_torture_chamber
                                                has_building = rsl_torture_hut
                                            }    
                            }            
        }
        
        potential = {
                                                                   
                    is_marriage_adult = yes                #  Conditions on the party to be broken                                    
                    prisoner = yes
                  
        }

        
        third_party_potential = {                     # Conditions on the torturer to appear    
                FROMFROM = {
                        is_marriage_adult = yes
                        prisoner = no
                        has_minor_title = rsl_court_torturer

                
                        NOR = { trait = incapable
                                trait = trained_warrior_slave
                                trait = trained_pleasure_slave
                                trait = broken_in
                                trait = slave
                        }
                    
                }
                    
                    
        }
                                
        allow = {
            always = yes
        }
        
        third_party_allow = {
                        always = yes
        }
                        
        effect = {
            FROM = { character_event = { id = RSLCourt.5100 }}
        
        }
        revoke_allowed = {
                    always = no
        }
        ai_will_do = {
            factor = 0.2 # 10% base chance
            modifier = {
                factor = 0.2
                FROM = {
                    OR = {
                        trait = chaste
                        trait = virgin
                    }
                }
            }
            modifier = {
                factor = 2
                FROM = {
                    OR = {
                        trait = lustful
                        trait = hedonist
                        trait = rapist
                        trait = cruel
                    }
                }
            }
            modifier = {
                factor = 0
                    FROM = {
                    OR = {
                        trait = celibate
                        trait = infirm
                    }
                }
            }
        }
}

 

This third_party targeted decision works when the potential block and the third_party_potential block are switched ( clicking on the torturer rather than the prisoner to have the decision appear). I don't understand why it won't work this way. I thought maybe the filters are blocking but court explicitly includes prisoners.

Link to post
19 minutes ago, joemann said:
  Hide contents

rsl_break_will = {

    filter = sub_realm  ## filters all characters below the decision taker employer, not including the decision taker themselves
    ai_target_filter = self
    third_party_filter = court ## filter for third parties
    ai_third_party_filter = court
    
    show_third_party_potential = yes
    
        from_potential = {  ai = no
                            capital_scope = {
                                            OR = {
                                                has_building = rsl_torture_chamber
                                                has_building = rsl_torture_hut
                                            }    
                            }            
        }
        
        potential = {
                                                                   
                    is_marriage_adult = yes                #  Conditions on the party to be broken                                    
                    prisoner = yes
                  
        }

        
        third_party_potential = {                     # Conditions on the torturer to appear    
                FROMFROM = {
                        is_marriage_adult = yes
                        prisoner = no
                        has_minor_title = rsl_court_torturer

                
                        NOR = { trait = incapable
                                trait = trained_warrior_slave
                                trait = trained_pleasure_slave
                                trait = broken_in
                                trait = slave
                        }
                    
                }
                    
                    
        }
                                
        allow = {
            always = yes
        }
        
        third_party_allow = {
                        always = yes
        }
                        
        effect = {
            FROM = { character_event = { id = RSLCourt.5100 }}
        
        }
        revoke_allowed = {
                    always = no
        }
        ai_will_do = {
            factor = 0.2 # 10% base chance
            modifier = {
                factor = 0.2
                FROM = {
                    OR = {
                        trait = chaste
                        trait = virgin
                    }
                }
            }
            modifier = {
                factor = 2
                FROM = {
                    OR = {
                        trait = lustful
                        trait = hedonist
                        trait = rapist
                        trait = cruel
                    }
                }
            }
            modifier = {
                factor = 0
                    FROM = {
                    OR = {
                        trait = celibate
                        trait = infirm
                    }
                }
            }
        }
}

 

This third_party targeted decision works when the potential block and the third_party_potential block are switched ( clicking on the torturer rather than the prisoner to have the decision appear). I don't understand why it won't work this way. I thought maybe the filters are blocking but court explicitly includes prisoners.

Have you tried filter = home_court ?

Link to post

Just tried. I now get the decision in the decision menu when right clicking on the prisoner but it is greyed out because the FROMFROM conditions (which apply to the torturer are not met) The torturer meets these criteria but the prisoner does not. Scope problem?

Link to post

This'll work right? To reduce the impregnation chance based on current children?


 

            random = {
                chance = 90
                modifier = {
                    factor = 0.84     #75% chance at this point
                    any_child = { is_alive = yes count = 2 }
                }
                modifier = {
                    factor = 0.67     #50% chance at this point
                    any_child = { is_alive = yes count = 4 }
                }
                modifier = {
                    factor = 0.5     #25% chance at this point
                    any_child = { is_alive = yes count = 6 }
                }
                modifier = {
                    factor = 0.2     #5% chance at this point
                    any_child = { is_alive = yes count = 8 }
                }
                impregnate = spouse
            }

 

Link to post
12 minutes ago, dwjlien said:

This'll work right? To reduce the impregnation chance based on current children?


 


            random = {
                chance = 90
                modifier = {
                    factor = 0.84     #75% chance at this point
                    any_child = { is_alive = yes count = 2 }
                }
                modifier = {
                    factor = 0.67     #50% chance at this point
                    any_child = { is_alive = yes count = 4 }
                }
                modifier = {
                    factor = 0.5     #25% chance at this point
                    any_child = { is_alive = yes count = 6 }
                }
                modifier = {
                    factor = 0.2     #5% chance at this point
                    any_child = { is_alive = yes count = 8 }
                }
                impregnate = spouse
            }

 

Looks fine to me, except that "spouse" isn't a proper character. It will accept boolean operators, character IDs, or event targets.

 

Link to post

Ive been using spouse in a simple

 


 

            random = {
                chance = 65
                impregnate = spouse
            }

for ages and i swear its been working...

 

EDIT it deffo works :) try it

targetted_decisions = {
			
	Preg_dec = {
		filter = court
		from_potential = {
			ai = no	
		}
		potential = {
			age =13
		}
		allow = {
		}
		effect = { 
			root = {	
				random = {
                chance = 100
					impregnate = spouse
				}
			}		
		}
	}
	
}

 

Link to post

I'm having a bit of a problem with my events. Sometimes, after I would add a few events to a page, the game would no longer recognize the events anymore (as in, the game can't find them when I try to use the console to force them to start). However, if I cut and paste the events not being recognized into a new event file, they will suddenly work. My current event that I'm working on is suffering from this, but it's even worse than the other times I've had this happen. The file will now ONLY recognize the first event on the page, anything else will not . I've checked the event brackets to make sure that I didn't add another event inside of one that already existed and there is a unique namespace given to the events.

 

Here is an example of what I'm struggling with. The download has two files, one is the script that is fully functioning because it only has one event on it, and the other is the same file but with a really small event after the main one that only has one option that doesn't do anything. The second event on the other file doesn't get recognized by the game's console.

Broken Event Files.zip

Link to post

Interesting, It's only causing problems when the file is installed in my mod. I tried running the validator, but I couldn't see anything that would be causing a problem like this. It's not giving me many parsing issues, It's been pretty much all just been a small error I made a few times when giving a special boarder to events. I'm getting a lot of invalid Char id notifications, but I'm not sure why since the events are as a whole working.

 

EDIT : Somehow fixing that one parsing issue resolved the problem, I have clue why exactly.

Link to post

I tried to automate the handling of the check_for_stats character flag, but the event failed to fire. Am I missing something?

character_event = {
	id = checkfordeath.0
	hide_window = yes
	is_triggered_only = yes
	ai = no
	trigger = {
		is_liege = yes
		is_save_game = no # Only on new games
	}
	immediate = {
		any_vassal = {
			set_character_flag = check_for_stats
		}
	}
}

 

Link to post

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