Jump to content

CK2 Modding Quick Question Thread


Recommended Posts

I am thinking about a mod that allows to interact with the Guardian. Like asking opinion about the state affairs if during the regency. Would be very useful if the Guardian is of Another religion and Culture. Like asking opinion about clothes if they belong to Another Culture. Like the decision of starting the Holy War (the Guardian can be against it). Maybe add some racism and multiculture. How about religious freedom law? Or the possibility like Learning the language of the Guardian (I mean not by traditional education but as an Active interaction on the guardian's portrait. Adding a trait "Can speak additional language". How about showing obedience for the Guardian (like trying to make him or her glad)? I don't know how to make mods but I have some ideas.

Link to comment
11 hours ago, PRSTUV said:

I don't know how to make mods but..

Now is as good a time to start learning as any other.

 

CK2 mods are plain text, so feel free to look at other peoples' mods to see how they did things; there are several tutorials on youtube/forums/etc.; the ck2 official wiki also has a TON of useful information for modding. Organize your ideas; break them down into individual instructions/steps and you'll have a design document/checklist to follow before you know it.

 

11 hours ago, PRSTUV said:

..I have some ideas.

We all do. The real bottleneck is spending the requisite time and effort to make them a reality.

Link to comment
On 2/2/2020 at 8:16 AM, joemann said:

Thanks. It worked. I'm having another problem with the same event chain.

 

  Hide contents

narrative_event = {
id = ETRandom.552
picture = raping_guard_v
desc = ETRandom552desc
title = et_loser_pays
portrait = event_target:is_rape_victim
is_triggered_only = yes

    immediate = {
                event_target:is_rape_victim = { save_event_target_as = et_fuckee }
        
            event_target:et_guard = {
                                    
                                    set_variable = { which = size_differential_pussy  which = dick_size }
            }
            
                                    
            
                                            
            event_target:is_rape_victim = {
                                        set_variable = { which = size_differential_pussy value = 0 }
                                        change_variable = { which = size_differential_pussy which = event_target:et_guard }
            }
            
            custom_tooltip = {
                        text = et_evaluate_impact
                        hidden_tooltip = {
                                        event_target:is_rape_victim = {
                                                                pussy_impact_evaluation = yes
                                                                update_pussy = yes                                                                
                                                                character_event = { id = ETB.907 } # pregnancy check for woman
                                        }                        
                        }
            }
            character_event = { id = ETRandom.5521 }
            
                
    }
    option = {
            name = ETRAND552option
            ai_chance = {
                factor = 0
            }                            
            event_target:et_guard = {
                                    add_trait = rapist
                                    character_event = { id = ETO.100 } # sexual_pleasure check for man
            }
            event_target:is_rape_victim = {        
                                    random = {            # there is 5% chance you'll get a memento out of this
                                        chance = 5
                                        add_trait = syphilitic
                                        
                                    }
            character_event = { id = ETO.200 } # sexual_pleasure check for woman                        
            }
            
    
    }
    
            
            
}


character_event = {
id = ETRandom.5521
picture = raging_liege
desc = ETRandom5521desc

is_triggered_only = yes

    immediate = {
            if = {
                    limit = {
                            event_target:is_rape_victim = {
                                                        has_character_flag = et_amazing_sex
                            }
                    }
                    event_target:is_rape_victim = {
                                                opinion = {
                                                        modifier = et_opinion_amazing_fuck
                                                        who = event_target:et_guard
                                                }                                                                            
                    }
                    narrative_event = { id = ETRandom.5522 }
            }
            else_if = {
                    limit = {
                            event_target:is_rape_victim = {
                                                        has_character_flag = et_great_sex
                            }
                    }
                    event_target:is_rape_victim = {
                                                opinion = {
                                                        modifier = et_opinion_great_fuck
                                                        who = event_target:et_guard
                                                }                                                
                    }
                    narrative_event = { id = ETRandom.5523 }
            }
            else_if = {
                    limit = {
                            event_target:is_rape_victim = {
                                                        has_character_flag = et_good_sex
                            }
                    }
                    event_target:is_rape_victim = {
                                                opinion = {
                                                        modifier = et_opinion_good_fuck
                                                        who = event_target:et_guard
                                                }                            
                    }
                    narrative_event = { id = ETRandom.5524 }
            }
            else_if = {
                    limit = {
                            event_target:is_rape_victim = {
                                                        has_character_flag = et_indifferent_sex
                            }
                    }
                    event_target:is_rape_victim = {
                                                opinion = {
                                                        modifier = et_opinion_indifferent_fuck
                                                        who = event_target:et_guard
                                                }                            
                    }
                    narrative_event = { id = ETRandom.5525 }
            }
            else_if = {
                    limit = {
                            event_target:is_rape_victim = {
                                                        has_character_flag = et_bad_sex
                            }
                    }
                    event_target:is_rape_victim = {
                                                opinion = {
                                                        modifier = et_opinion_bad_fuck
                                                        who = event_target:et_guard
                                                }                            
                    }
                    narrative_event = { id = ETRandom.5526 }
            }
            else_if = {
                    limit = {
                            event_target:is_rape_victim = {
                                                        has_character_flag = et_depressing_sex
                            }
                    }
                    event_target:is_rape_victim = {
                                                opinion = {
                                                        modifier = et_opinion_sexual_disgust
                                                        who = event_target:et_guard
                                                }                            
                    }
                    narrative_event = { id = ETRandom.5527 }
            }    
    }
    option = {
            name = ETRAND5521option
    }        
    
}
narrative_event = {
id = ETRandom.5522
picture = raping_guard_v
desc = ETRandom5522desc
title = et_loser_pays

is_triggered_only = yes

    option = {
            name = ETRAND5522option
            ai_chance = {
                factor = 0
            }                            
            event_target:et_guard = {
                                prestige = 10
            }
            event_target:et_looser = {
                                prestige = -10
                                opinion = {
                                          modifier = et_opinion_rape_slut
                                          who = event_target:is_rape_victim
                                }
                                opinion = {
                                          modifier = et_opinion_humiliated_me
                                          who = event_target:is_rape_victim
                                }
                                opinion = {
                                          modifier = et_opinion_raped_spouse
                                          who = event_target:et_guard
                                }    
            }
            event_target:is_rape_victim = {
                                        prestige = -5                                        
                                        opinion = {
                                          modifier = et_opinion_dominated
                                          who = event_target:et_guard
                                        }
            }                            
            
    }
}

Event .552 and 5521 work fine but 5521 does not fire events .5522 to .5527. I checked that event_target:is_rape_victim has the appropriate flags so the conditions are met. Wat am I doing wrong?

Try moving everything from 5521's immediate block into the option block. Or put it in an after block.

 

At the end of the if/else_if chain, put in an else block that goes to a blank event. If this event fires, then it means that the conditions for the if/else_if aren't firing.

Link to comment

Thanks for your reaction. I got it working before reading your answer by making three changes to .5521 (don't know which one did the trick ).

I included a pre_trigger:

is_female = yes
age = 14

(would that really make a difference? the event is triggered by .552)

 

I added an else clause

else = {
                    event_target:is_rape_victim = {
                                                opinion = {
                                                        modifier = et_opinion_indifferent_fuck
                                                        who = event_target:et_guard
                                                }                            
                    }
                    narrative_event = { id = ETRandom.5525 }
            }

 

and finally I added the line:  portrait = event_target:is_rape_victim at the beginning

Does this only change the portrait or does it also pull the event target into the scope of event?

I believe the last modification made it work but haven't verified it yet.

Link to comment

I tried different options. The pre-triggers and the portrait do not make a difference. The else block does. I tried putting in a blank event as you suggested and it fires so the conditions in the if_else clauses are not firing. However, if I check, the required character flags are present.

I'll try your other solutions

 

Link to comment

I am completely stumped. I am working a targeted decision to take unlanded courtiers as a spouse.

Spoiler

potential = {											# Target Conditions						
			prisoner = no											# Target not in Jail
			is_marriage_adult = yes									# Target is an Adult
			is_married = no											# Target is not Married
			is_landed = no											# Target does not hold land
			OR = {													# Target does not belong to someone else
				is_consort = no
				is_consort = FROM
			}
			NOR = { 
				is_close_relative = FROM 							# Target is not closely related to Player
				trait = cannot_marry_trait							# Target is not blocked from marriage
			}
			
			#if = {													# Non-Deviant Female Player can only claim Males
			#	limit = {
			#		FROM = {
			#			is_female = yes
			#			NOR = {
			#				trait = WPOA_Futa
			#				trait = WPOA_Pervert
			#				trait = homosexual
			#				trait = lustful
			#				trait = hedonist
			#			}
			#		}
			#	}
			#	is_female = no
			#}
			#else_if = {											# Non-Deviant Male Player cannot claim Males
			#	limit = {
			#		FROM = {
			#			is_female = no
			#			NOR = {
			#				trait = WPOA_Pervert
			#				trait = homosexual
			#				trait = lustful
			#				trait = hedonist
			#			}
			#		}
			#	}
			#	is_female = yes
			#}
			#else = {
			
			#}
		}

 

The commented section invalidates the decision and I don't understand why. If I move it from potential to allow the ingame tooltip fails to list the conditions while still claiming ineligibility("(x) These conditions must be true: "). I've gone through each condition, replaced FROM with PREV and also commented that criteria out entirely(so it checks the target instead of the player), but it refuses to cooperate. The decision works perfectly while the section is commented out. 

 

Any help would be appreciated.

Link to comment
9 hours ago, Darsel said:

I am completely stumped. I am working a targeted decision to take unlanded courtiers as a spouse.

  Reveal hidden contents

The commented section invalidates the decision and I don't understand why. If I move it from potential to allow the ingame tooltip fails to list the conditions while still claiming ineligibility("(x) These conditions must be true: "). I've gone through each condition, replaced FROM with PREV and also commented that criteria out entirely(so it checks the target instead of the player), but it refuses to cooperate. The decision works perfectly while the section is commented out. 

 

Any help would be appreciated.

 

if/else_if/else are NOT valid for conditions (such as potential). They are used for effects. conditional_tooltip does what you need, but considering this is in the potential block and not the allow block, you'll not get much use out of it.

 

Instead, replace your if/else_if/else with an OR/AND.

 

 
 
?
 
Spoiler

    OR = {
        AND = {
            FROM = {
                is_female = yes
                NOR = {
                    trait = WPOA_Futa
                    trait = WPOA_Pervert
                    trait = homosexual
                    trait = lustful
                    trait = hedonist
                }
            }
            is_female = no
        }
        AND = {
            FROM = {
                is_female = no
                NOR = {
                    trait = WPOA_Pervert
                    trait = homosexual
                    trait = lustful
                    trait = hedonist
                }
            }
            is_female = yes
        }
    }

 

Link to comment
13 hours ago, lockeslylcrit said:

if/else_if/else are NOT valid for conditions (such as potential). They are used for effects. conditional_tooltip does what you need, but considering this is in the potential block and not the allow block, you'll not get much use out of it.

 

Instead, replace your if/else_if/else with an OR/AND.

D'oh!  Thank you so much; I was almost to the point of doing the dumb and making 3 variants of the same decision. Had to add a third omni-sexual 'condition', but it works like a charm now.

 

As a side query: Did they patch/change the game recently?

I could have sworn my impregnation system was working before(Nov/Dec), but after recent testing, it's looking like I'm going to have to rebuild it(from scratch).

Resolved.

Link to comment
Spoiler

I've got some quick questions I couldn't find clean answers to regarding the "pre-trigger" only_playable:

 

For targeted decisions, does it belong in potential or the root decision declaration itself(filters/etc.)?

 

Assuming the former, is this redundant, or will it help terminate ineligible candidates faster?


from_potential = {										# User Conditions
			ai = yes												# NPC Only
			only_playable = yes										# User is count+ and not rebel
			is_landed = yes											# User owns land
}

 

 

Edit: Another question: Do consort conditions work both ways, or to you need to check from both directions..


any_consort = {
	character = FROM
}

FROM = {
	any_consort = {
		character = PREV
	}
}

Paraphrase: Is the second part required?

(I'm building a tDecision that lets futas pork their impregnable spouse/lovers/consorts/master in the background like hetero pairs.)

In retrospect, I had/ve the dumb; feel free to ignore this post!

Link to comment

Is it possible to make a targeted_decision which the ai will only use against the player character?

 

For example if you play as a female ruler and you are captured by your enemy who imprisons you and takes you as a concubine, while you still remain the player (you get a regent ),

Is it possible to give the ai the ability to use the "visit" decision but only against you?

 

I tried the following but I'm not sure it will work. Has anybody already tried this?

 

Spoiler

## Allows a player to visit their lover, spouse, or consort
    et_spend_time_with = {
        filter = all # For those lovers who are outside of our realm
        ai_target_filter =home_ court  
        from_potential = {
            ai = yes
            prisoner = no
            NOT = { trait = in_hiding }
        }
        potential = {
            OR = {
                is_lover = FROM
                any_spouse = {
                    character = FROM
                }
                any_consort = {
                    character = FROM
                }
            }
        }
        allow = {
            prisoner = no
            NOT = { trait = in_hiding }
            in_command = no
            custom_tooltip = {
                text = et_visit_recovery
                NOT = { has_character_flag = et_visit_recovery }
            }
        }
        effect = {
            FROM = { character_event = { id = ETV.1 }}
            set_character_flag = et_visit_recovery
            character_event = { id = ETV.9999 days = 30 }
        }
        ai_will_do = {
            factor = 0.5
            modifier = {
                factor = 0
                    ROOT = {
                        NOT = {                        
                            any_player        ### Not sure about his any_player is a scope I don't know if I can use that here
                        }    
                    
                    }
            }
            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
                    }
                }
            }
            modifier = {
                factor = 2
                ROOT = {
                    OR = {
                        trait = fair
                        trait = bombshell
                        trait = virgin
                    }
                }
            }
        }
    }

 

Link to comment
3 hours ago, joemann said:

Is it possible to make a targeted_decision which the ai will only use against the player character?

potential = {										# Target Conditions
	ai = no												# Player Only
}

If you want a tDecision the player can use that AI can also use only on the player:

potential = {										# Target conditions
	OR = {
		FROM = { ai = no }									# Player is the User
		ai = no												# Player is the Target
	}
}

 

Link to comment

I have made an event A (comparable to the pregnancy check in Dark World Reborn) that I would like to use within different events B, C etc and event chains. Usually the event A triggers as part of the   event B or C, but sometimes it doesn't.

I think it is a scope problem. The beginning of event A is as follows:

Spoiler

# Female event to determinate the level of sexual fulfillment  (ROOT = female, FROM = male)
character_event = {
    id = ETO.200
    
    hide_window = yes
    
    is_female = yes
    age = 14
    
    is_triggered_only = yes    
    
    immediate = {
    
    

                
    # Depending on ROOT's size increase (which incorporate elasticity and lubrication variables) and combining it with her current_sex_drive which incorporates body and mental input factors such as status,traits, age ,health, etc
    
                        if = {
                            limit = {
                                    ROOT = {
                                        has_character_flag = pussy_size_increase_5                                    
                                        check_variable = { which = current_sex_drive value = 5 }   # CSD = 4.5
                                    }
                            }
                            random_list = {    
                                            10 = {
                                                modifier = {
                                                        factor = 2
                                                        OR = {                         #status (vulnerability)
                                                            is_lover = FROM
                                                            is_mother = FROM        # incest
                                                            is_main_spouse = yes
                                                            num_of_lovers = 3
                                                            personal_opinion = { who = FROM value = 20 }
                                                        }
                                                }        
                                                modifier = {
                                                        factor = 0.25
                                                        OR = {                        #status ( woman is vulnerable )
                                                            trait = slave
                                                            prisoner = yes
                                                            trait = rape_trauma
                                                            personal_opinion = { who = FROM value <= 10 }    
                                                        }
                                                }
                                                set_character_flag = et_good_sex
                                                host = { character_event = { id = ETO.213 }}
                                            }
                                            51 = {
                                                modifier = {
                                                        factor = 1.5
                                                        OR = {                         #status (vulnerability)
                                                            is_lover = FROM
                                                            is_mother = FROM        # incest
                                                            is_main_spouse = yes
                                                            num_of_lovers = 3
                                                            personal_opinion = { who = FROM value = 20 }
                                                        }
                                                }
                                                modifier = {
                                                        factor = 0.5
                                                        OR = {                        #status ( woman is vulnerable )
                                                            trait = slave
                                                            prisoner = yes
                                                            trait = rape_trauma
                                                            personal_opinion = { who = FROM value <= 10 }    
                                                        }
                                                }
                                                set_character_flag = et_indifferent_sex
                                                host = { character_event = { id = ETO.212 }}
                                            }
                                            28 = {
                                                modifier = {
                                                        factor = 1
                                                        OR = {                         #status (vulnerability)
                                                            is_lover = FROM
                                                            is_mother = FROM        # incest
                                                            is_main_spouse = yes
                                                            num_of_lovers = 3
                                                            personal_opinion = { who = FROM value = 20 }
                                                        }
                                                }
                                                modifier = {
                                                        factor = 2
                                                        OR = {                        #status ( woman is vulnerable )
                                                            trait = slave
                                                            prisoner = yes
                                                            trait = rape_trauma
                                                            personal_opinion = { who = FROM value <= 10 }    
                                                        }
                                                }
                                                set_character_flag = et_bad_sex
                                                host = { character_event = { id = ETO.211 }}
                                            }
                                            11 = {
                                                modifier = {
                                                        factor = 0
                                                        OR = {                         #status (vulnerability)
                                                            is_lover = FROM
                                                            is_mother = FROM        # incest
                                                            is_main_spouse = yes
                                                            num_of_lovers = 3
                                                            personal_opinion = { who = FROM value = 20 }
                                                        }
                                                }
                                                modifier = {
                                                        factor = 2.5
                                                        OR = {                        #status ( woman is vulnerable )
                                                            trait = slave
                                                            prisoner = yes
                                                            trait = rape_trauma
                                                            personal_opinion = { who = FROM value <= 10 }    
                                                        }
                                                }
                                                set_character_flag = et_depressing_sex
                                                host = { character_event = { id = ETO.210 }}
                                            }
                                            
                            }                                        
                        } 

 

etc, etc.         

This works when ROOT is female and FROM is male. However I would like the event to also trigger in the following  event

 

Spoiler

# take virginity physical impact
narrative_event = {
    id = ETV.101
    desc = "ETV101"
    picture = virgin4
    title = et_deflowered
    
    desc = {    
        trigger = {
                event_target:visit_target = {
                                            trait = virgin
                                            trait = chaste
                }
                          
        }            
        text = "ETV101"
        picture = virgin_chaste    
    }
    desc = {    
        trigger = {
                event_target:visit_target = {
                                            trait = virgin
                                            trait = lustful
                }
                          
        }            
        text = "ETV101"
        picture = virgin1
    }
    desc = {    
        trigger = {
                event_target:visit_target = {
                                            trait = virgin
                                        
                }
                          
        }            
        text = "ETV101"
        picture = virgin
    }    
    
    
            
                
    
    is_triggered_only = yes # Triggered from .101
    
    immediate = {

    
        event_target:player = {
                            set_variable = { which = size_differential_pussy  which = dick_size }
        }
        
        event_target:visit_target = {        
                                set_variable = { which = size_differential_pussy  value = 0 }
                                change_variable = { which = size_differential_pussy which = event_target:player }
        }
        
    }
    
    option = {
            name = et_option_further
            
            event_target:player = {
                                if = {
                                    limit = { trait = virgin }
                                            remove_trait = virgin
                                            opinion = {
                                                    modifier = et_opinion_took_virginity
                                                    who = event_target:visit_target
                                            }
                                }    
            }
            event_target:player = {                                         
                                hidden_tooltip = { character_event = { id = ETO.100 }} #degree of sexual fulfillment for male
            }    
            event_target:visit_target = {
                                        remove_trait = virgin                                                     
                                        custom_tooltip = {
                                                    text = et_evaluate_impact
                                                    hidden_tooltip = {                                                                                                            
                                                                    pussy_impact_evaluation = yes
                                                                    update_pussy = yes
                                                                    hidden_tooltip = { character_event = { id = ETO.201 }} #degree of sexual fulfillment for female
                                                                    hidden_tooltip = { character_event = { id = ETB.907 }} # Pregnancy check
                                                                    
                                                    }
                                        }                                                                                
            }                            
            narrative_event = { id = ETV.1012 }
                    
    }
}   

The event ETV.101 works fine but ETO.201 refuses to trigger, although it does so in other comparable events. I checked the scopes in game and all the save_event_targets are correct.

However, in event .101 the female character is FROMFROMFROM all the other scopes are the male character. Could this be the problem seeing that in event .201 The female character is ROOT, If so how, do I get around this. I noticed that in Dark World Reborn the pregnancy check had two versions, one in which ROOT was female and one in which ROOT was male.

But if this is the solution I would need to write one for every combination which seem s a bit much. Anybody have an idea?

Link to comment
2 hours ago, joemann said:

The event ETV.101 works fine but ETO.201 refuses to trigger, although it does so in other comparable events. I checked the scopes in game and all the save_event_targets are correct.

However, in event .101 the female character is FROMFROMFROM all the other scopes are the male character. Could this be the problem seeing that in event .201 The female character is ROOT, If so how, do I get around this. I noticed that in Dark World Reborn the pregnancy check had two versions, one in which ROOT was female and one in which ROOT was male.

But if this is the solution I would need to write one for every combination which seem s a bit much. Anybody have an idea?

I wouldn't have a clue without seeing the code for 201 (you only showed 200).

 

But in general, if you're having scope issues, drop the normal scopes and just use the event targets.

e.g.: is_lover = FROM becomes is_lover = event_target:visit_player

Link to comment
Spoiler

I've got a hopefully straightforward question:

 

What is the best way to check if a character can take consorts/concubines? (building a tDecision to claim same-sex consorts/concubines)

 

I see there is a has_concubinage condition for religions, but I am not certain how to efficiently apply that to a character. Would it just be a religion = { has_concubinage = yes } line in potential, or is this a situation where I'm going to have to check against every valid religion?

Nevermind. This is clearly a rabbit hole not worth diving into.

Link to comment

I have a targetted decision which works as it should.

Spoiler

et_demand_sex = {
    
        filter = court_including_me #  
        from_potential = { # From is the person targeting the person to evoke the decision
            prisoner = no #
            NOT = { trait = in_hiding }
            is_marriage_adult = yes
        }
        potential = { # This is where we check the target to ensure they're valid            
            OR = { # Should be a prisoner or slave                
                prisoner = yes
                trait = slave
                trait = trained_pleasure_slave
                trait = trained_warrior_slave
                is_lover = FROM
                any_spouse = {
                    character = FROM
                }
                any_consort = {
                    character = FROM
                }
            }
            host = { character = FROM }
        }
        
        allow = {
            NOT = { trait = in_hiding } # The target shouldn't be in hiding
            in_command = no # The target shouldn't be off leading troops somewhere
            
        }
        effect = {
            # Our initial check event for further routing
            
                if = {
                    limit = {
                        ROOT = {
                            prisoner = yes
                        }
                    }    
                    FROM = { narrative_event = { id = ETR.2 }}
                }
                if = {
                    limit = {
                        ROOT = {
                            OR = {
                                trait = slave
                                trait = trained_pleasure_slave
                                trait = trained_warrior_slave
                            }    
                        }    
                    }    
                    FROM = { narrative_event = { id = ETR.2 }}
                }
                if = {
                    limit = {
                        ROOT = {
                            OR = { # Should be a lover, spouse, or concubine
                                is_lover = FROM
                                any_spouse = {
                                        character = FROM
                                }
                                any_consort = {
                                            character = FROM
                                }
                            }
                        }
                    }    
                    FROM = { narrative_event = { id = ETR.8 }}
                }
                
        }
        ai_will_do = {
                    factor = 1                
        }
        
    }

 I would also like ai characters to use it, hence the ai_will_do. However it doesn't work.

I tested it on event ETR8 which also works normally.

 

Spoiler

narrative_event = {
    id = ETR.8
    title = et_quickie
    desc = ETR8desc
    picture = "take_spouse"    
    is_female = yes    
    
    is_triggered_only = yes   #targeted_decision et_demand_sex
    immediate = {
        ROOT = {
                save_event_target_as = et_rapist
        }
        FROM = {
                save_event_target_as = et_rape_target
        }
        random_list = {
                    60 = {                    
                        modifier = {
                                factor = 1
                                event_target:et_rape_target = {                    
                                                            check_variable = { which = current_sex_drive value >= 3 }    #she likes it herself                
                                }
                        }        
                        modifier = {
                                factor = 0.5
                                event_target:et_rape_target = {                    
                                                            check_variable = { which = current_sex_drive value < 3 } # has no desire                    
                                }
                        }
                        narrative_event = { id = ETR.81 }  # She concedes
                    }
                    40 = {                        
                        modifier = {
                            factor = 1
                            event_target:et_rape_target = {                    
                                                        check_variable = { which = current_sex_drive value < 3 } # has no desire                    
                            }
                        }
                        modifier = {
                            factor = 0.5
                            event_target:et_rape_target = {                    
                                                        check_variable = { which = current_sex_drive value < 3 } # has no desire but willing to please.....
                                                        OR = {
                                                            trait = kind
                                                            trait = charitable
                                                            trait = humble
                                                        }
                            }
                        }    
                        modifier = {
                                factor = 0.4
                                event_target:et_rape_target = {                    
                                                            check_variable = { which = current_sex_drive value < 3 } # has no desire                    
                                }
                                event_target:et_rapist = {                                                            # but is afraid
                                                        OR = {
                                                            trait = cruel       # she knows him                                                            
                                                            trait = impaler
                                                            trait = rapist        # he's done it before
                                                            trait = horse_dick    # you don't want one of these up your ass
                                                            trait = huge_dick
                                                            trait = zealous
                                                            }
                                }
                        }
                            narrative_event = { id = ETR.82 }    # She resists                            
                    }
        }
    }    
    option = {
    name = option8
    }
}

Is there something wrong with the decision, or must I look elsewhere?

Link to comment

I have been working on the targeted decision. It works for ai characters if I add the following modifiers to the ai_will_do block

 

Spoiler

ai_will_do = {
            factor = 0.5
            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
                    }
                }
            }
            modifier = {
                factor = 2
                ROOT = {
                    OR = {
                        trait = attractive
                        trait = bombshell
                        trait = virgin
                    }
                }
            }
        }

However, I have some different modifiers I would like to add and with those it doesn't work. The current_sex_drive variables are present in the characters so it must be the script

Spoiler

ai_will_do = {
                factor = 1.0
                modifier = {
                factor = 0.25
                FROM = {                    
                        check_variable = { which = current_sex_drive value < 2 }                    
                }
            }
            modifier = {
                factor = 0.40
                FROM = {                    
                        check_variable = { which = current_sex_drive value = 2 }
                    OR = {    
                        trait = rapist
                        trait = cruel
                    }
                }
            }
            modifier = {
                factor = 1
                FROM = {                    
                        check_variable = { which = current_sex_drive value < 3 }                    
                }
            }
            modifier = {
                factor = 1.5
                FROM = {                
                        check_variable = { which = current_sex_drive value = 3 }                    
                }
                ROOT = {
                    OR = {
                        trait = fair
                        trait = bombshell
                        trait = virgin
                    }
                }
            }
            modifier = {
                factor = 1.75
                FROM = {
                        check_variable = { which = current_sex_drive value < 4 }                        
                }
            }
            modifier = {
                factor = 2
                FROM = {                
                        check_variable = { which = current_sex_drive value = 4 }                    
                }
                ROOT = {
                    OR = {
                        trait = fair
                        trait = bombshell
                        trait = virgin
                    }
                }
            }
            modifier = {
                factor = 0
                FROM = {
                    OR = {
                        check_variable = { which = current_sex_drive value = 0 }
                        trait = infirm
                        trait = celibate
                    }
                }
            }
        }

What am I doing wrong?

Link to comment
8 hours ago, joemann said:

I would also like ai characters to use it, hence the ai_will_do. However it doesn't work.

AI characters who are not landed will never use decisions. They are essentially just set pieces. Once they have a title, then they will get an intelligence assigned to them. Maybe that's the problem?

Link to comment

I didn't know that, thanks. However, I don't think that is the issue. I have used both versions on the same characters, each time starting up a new game. The first version works and the character acts accordingly, the second version doesn't. I thought it might have something to do with the variables. I still can't get my head around how the ai deals with a succession of overlapping conditions ( <=, = ,>= ). If you didn't see anything wrong there, I'll tinker around with it some more. Thanks for the help.

Link to comment

I solved it.

Spoiler

ai_will_do = {
                factor = 1.0
            modifier = {
                factor = 0.25
                FROM = {                    
                        check_variable = { which = current_sex_drive value = 1 }
                        NOT = {
                            check_variable = { which =  current_sex_drive value = 2 }
                        }    
                }
            }
            modifier = {
                factor = 0.50
                FROM = {                    
                        check_variable = { which = current_sex_drive value = 2 }
                        NOT = {
                            check_variable = { which =  current_sex_drive value = 3 }
                        }    
                }
            }
            modifier = {
                factor = 0.80
                FROM = {                    
                        check_variable = { which = current_sex_drive value = 2 }
                        NOT = {
                            check_variable = { which =  current_sex_drive value = 3 }
                        }
                        OR = {    
                        trait = rapist
                        trait = cruel
                    }
                }
            }
            modifier = {
                factor = 1.2
                FROM = {                    
                        check_variable = { which = current_sex_drive value = 3 }
                        NOT = {
                            check_variable = { which =  current_sex_drive value = 4 }
                        }    
                }
            }
            modifier = {
                factor = 1.5
                FROM = {                    
                        check_variable = { which = current_sex_drive value = 4 }
                        NOT = {
                            check_variable = { which =  current_sex_drive value = 5 }
                        }    
                }
            }
            modifier = {
                factor = 1.8
                FROM = {                    
                        check_variable = { which = current_sex_drive value = 4 }
                        NOT = {
                            check_variable = { which =  current_sex_drive value = 5 }
                        }
                        OR = {
                        trait = fair
                        trait = bombshell
                        trait = virgin
                    }
                }
            }
            modifier = {
                factor = 2
                FROM = {                    
                        check_variable = { which = current_sex_drive value = 5 }                            
                }
            }    
            modifier = {
                factor = 0
                FROM = {
                    OR = {
                        check_variable_equal = { which = current_sex_drive value = 0 }
                        trait = infirm
                        trait = celibate
                    }
                }
            }
        }

I think the problem was the condition <check_variable = { which = current_sex_drive value = 0 }> it had a factor = 0 and therefore killed every instance of current_sex_drive of 0 and above, i.e. , everything. It should be check_variable_equal limiting the condition to only those situations where the current_sex_drive is equal to zero.

Link to comment

Another question. Is it possible to make a "dynamic" tool tip ? I would like the tool tip for the trait (or alternatively a character_modifier) <rape_trauma> to identify the rapist.

So if I hover over the icon it would say "raped by Duke Asshole".

 

I have thought of doing the following.

 

create a dynamic flag in the rape event

Spoiler

narrative_event = {
    id = ETR.2011
    title = et_vaginal_rape
    desc = ETR2011desc
    picture = rape_prisoner_womb3MW
    

    is_triggered_only = yes
    
    immediate = {    
            event_target:et_rapist = {
                                    set_variable = { which = size_differential_pussy  which = dick_size }
            }
        
            event_target:et_rape_target = {
                                        set_variable = { which = size_differential_pussy  value = 0 }
                                        change_variable = { which = size_differential_pussy which = event_target:et_rapist }
            }
            
    }
    
    option = {
            name = et_option_further
            
            event_target:et_rapist = {
                                    remove_trait = virgin                                    
            }
            event_target:et_rape_target = {
                                        hidden_tooltip = {
                                                        pussy_impact_evaluation = yes
                                                        update_pussy = yes
                                        }                
            }
            event_target:et_rape_target = {     
                                            hidden_tooltip = { character_event = { id = ETB.907 }} # Pregnancy check
                                            hidden_tooltip = { character_event = { id = ETO.200 }} #degree of sexual fulfillment for female    
            }
            event_target:et_rapist = {
                                    set_character_flag = is_rapist_of_@event_target:et_rape_target
                                    add_character_modifier = {
                                                            modifier  = et_rape_trauma
                                                            years = 10
                                    }                        
                                    hidden_tooltip = { character_event = { id = ETO.100 }} #degree of sexual fulfillment for male                                        
            }
            host = { narrative_event = { id = ETR.2012 }}   ## take out host ?
    }        

}

Then in a follow up hidden character event create a persistent event target

Spoiler

# create a persistent event target
charcter_event = {
id = ETR.21
hide_window = yes

is_triggered_only = yes

    immediate = {

        if = {
            limit = {
                    has_character_flag = is_rapist_of_@event_target:et_rape_target
            }
            save_persistent_event_target_as = { name = event_target:et_rapist = event_target:et_rapist_of }
        }    
    }
}

and use this persistent_event_target target in the localization for the rape_trauma_desc

Spoiler

et_rape_trauma_desc;the psychological damage suffered after having been sexually violated by [et_rapist_of.GetTitledNameWithNick];;;;;;;;;;;;;;;x

I haven't been able to test it yet.

Does anybody know if this will work?

Link to comment

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use