Jump to content

Help with Scopes(modding)


Recommended Posts

Posted (edited)

I am dipping my toes in with modding for the first time, and my understanding of Scope command seems to be really lacking. Here are my pitiful first attempts at event creation:

 

namespace = ptichka_femboi_events

#If you are reading it, hello Phaze Star, your are an inspiration
femboi_event.0001 = {
    type = character_event
	window = clear_event_window_v2
	title = femboi.0001.title
	desc = femboi.0001.desc
	theme = wedding_night_activity
	override_background = { reference = bedchamber }

trigger = {
		is_female = no
		is_ai = no
		has_trait = lustful
		NOT = { has_trait = femboi }
		NOT = { has_trait = eunuch }
		NOT = { has_trait = celibate }
		NOT = { has_trait = chaste }
	}

	immediate = {
		save_scope_as = spouse
		}
	

	 option = {
        name = femboi.0001.a
        add_trait = femboi
        scope:spouse = {
            add_opinion = {
                target = ROOT
                modifier = grateful_opinion
                opinion = 30
            }
        }
    }

    option = {
        name = femboi.0001.b
        add_stress = 50
        scope:spouse = {
            add_opinion = {
                target = ROOT
                modifier = upset_opinion
                opinion = -30
            }
        }
    }
}

 

The options here give me the classic Ck3 line "You gain 30 opinion of You" and no matter how much i seem to change it, it is either a blanc space or "You". So how does one go about gaining the opinion of a spouse or other specific characters?

Edited by PtichkaGo
Posted (edited)
19 minutes ago, PtichkaGo said:

I am dipping my toes in with modding for the first time, and my understanding of Scope command seems to be really lacking. Here are my pitiful first attempts at event creation:

 

namespace = ptichka_femboi_events

#If you are reading it, hello Phaze Star, your are an inspiration
femboi_event.0001 = {
    type = character_event
	window = clear_event_window_v2
	title = femboi.0001.title
	desc = femboi.0001.desc
	theme = wedding_night_activity
	override_background = { reference = bedchamber }

trigger = {
		is_female = no
		is_ai = no
		has_trait = lustful
		NOT = { has_trait = femboi }
		NOT = { has_trait = eunuch }
		NOT = { has_trait = celibate }
		NOT = { has_trait = chaste }
	}

	immediate = {
		save_scope_as = spouse
		}
	

	 option = {
        name = femboi.0001.a
        add_trait = femboi
        scope:spouse = {
            add_opinion = {
                target = ROOT
                modifier = grateful_opinion
                opinion = 30
            }
        }
    }

    option = {
        name = femboi.0001.b
        add_stress = 50
        scope:spouse = {
            add_opinion = {
                target = ROOT
                modifier = upset_opinion
                opinion = -30
            }
        }
    }
}

 

The options here give me the classic Ck3 line "You gain 30 opinion of You" and no matter how much i seem to change it, it is either a blanc space or "You". So how does one go about gaining the opinion of a spouse or other specific characters?

 

You are saving the ROOT scope into scope:spouse. Unless you specifically scoped to something else before effects, the effect will be triggered in root scope, which in events is universally the character the event is being fired for. So yes, effectively you are increasing opinion of you.

 

If you want to scope to, say, primary spouse, you would do "primary_spouse = { save_scope_as = spouse }". "random_spouse = {}" for random spouse (for polygamous) or "random_consort = {}" (for concubines).

Edited by Kieva
Posted
4 minutes ago, Kieva said:

 

You are saving the ROOT scope into scope:spouse. Unless you specifically scoped to something else before effects, the effect will be triggered in root scope, which in events is universally the character the event is being fired for. So yes, effectively you are increasing opinion of you.

 

If you want to scope to, say, primary spouse, you would do "primary_spouse = { save_scope_as = spouse }". "random_spouse = {}" for random spouse (for polygamous) or "random_consort = {}" (for concubines).

Thank you, it works!

Posted
14 minutes ago, PtichkaGo said:

I am dipping my toes in with modding for the first time, and my understanding of Scope command seems to be really lacking. Here are my pitiful first attempts at event creation:

 

namespace = ptichka_femboi_events

#If you are reading it, hello Phaze Star, your are an inspiration
femboi_event.0001 = {
    type = character_event
	window = clear_event_window_v2
	title = femboi.0001.title
	desc = femboi.0001.desc
	theme = wedding_night_activity
	override_background = { reference = bedchamber }

trigger = {
		is_female = no
		is_ai = no
		has_trait = lustful
		NOT = { has_trait = femboi }
		NOT = { has_trait = eunuch }
		NOT = { has_trait = celibate }
		NOT = { has_trait = chaste }
	}

	immediate = {
		save_scope_as = spouse
		}
	

	 option = {
        name = femboi.0001.a
        add_trait = femboi
        scope:spouse = {
            add_opinion = {
                target = ROOT
                modifier = grateful_opinion
                opinion = 30
            }
        }
    }

    option = {
        name = femboi.0001.b
        add_stress = 50
        scope:spouse = {
            add_opinion = {
                target = ROOT
                modifier = upset_opinion
                opinion = -30
            }
        }
    }
}

 

The options here give me the classic Ck3 line "You gain 30 opinion of You" and no matter how much i seem to change it, it is either a blanc space or "You". So how does one go about gaining the opinion of a spouse or other specific characters?

1

type = character_event
    title = ...
    desc = ...
    theme = ..
    left_portrait = {
        character = root
        animation = shock}
    right_portrait = {
        character = scope:spouse
        animation = happiness}
    immediate = {
        primary_spouse = {
            save_scope_as = spouse}}
    option = { #...
        name = ...
        add_opinion = {
            modifier = ...
            target = scope:spouse}
        stress_impact = {
            base = minor_stress_impact_gain
            paranoid = medium_stress_impact_loss
            trusting = minor_stress_impact_gain}
            ai_chance = {
            base = 25
            modifier = {
                has_trait = paranoid
                add = 75}
            modifier = {
                has_trait = diligent
                add = 35}

 

 

2

        add_prestige = -10
        scope:  ... = {
            add_opinion = {
                target = root
                modifier = disgusted_opinion
                opinion = -10

I'm certainly not a modding guru, but I think either through the modifier system or option 2

Posted
52 minutes ago, GreenZeer said:

1

type = character_event
    title = ...
    desc = ...
    theme = ..
    left_portrait = {
        character = root
        animation = shock}
    right_portrait = {
        character = scope:spouse
        animation = happiness}
    immediate = {
        primary_spouse = {
            save_scope_as = spouse}}
    option = { #...
        name = ...
        add_opinion = {
            modifier = ...
            target = scope:spouse}
        stress_impact = {
            base = minor_stress_impact_gain
            paranoid = medium_stress_impact_loss
            trusting = minor_stress_impact_gain}
            ai_chance = {
            base = 25
            modifier = {
                has_trait = paranoid
                add = 75}
            modifier = {
                has_trait = diligent
                add = 35}

 

 

2

        add_prestige = -10
        scope:  ... = {
            add_opinion = {
                target = root
                modifier = disgusted_opinion
                opinion = -10

I'm certainly not a modding guru, but I think either through the modifier system or option 2

The modifiers in ai_chance only makes it more/less likely for the AI to select an option by altering weighting. OP did the opinion part right but didn't manage to do the scoping.

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