Jump to content

I want to make my own cuckolding mod but I'm 0 at modding


Recommended Posts

In short, I'd like to ask for your help. I sort of know the code for the action (in any case should it come to that, I can just copy this feature from some other mod :) ) but what I don't know is how to select targets. I want to create (for myself at least) a mod where after a war, the winner takes the loser's wife/wives/concubine(s)/daughter(s) as spoils of war and cucks him, maybe to his face, maybe something like the Slavery mod in which case the winner would take the 'victims' to his court and dom/train them. What I don't know is how to select the winner, the loser and the women and how to make it so that everything happens when the war is over. As far as I know there is no on_war_win or anything like that. Thanks so much.

 

Link to comment

So I've tried my hand at it and now I get a blank event a few days after start. I know something's wrong with this but I don't know what. Can I get some help again?

I wrote the events inside the above mentioned slavery so please keep that in mind.

The files that I've modified are attached. The last 3 events in sl_offering and the last 4 lines or so in sl_corrupt.

 

EDIT: With charinfo I see the event ID is sl_corrupt.106, an already existing one (but not the start of the chain).

02_sl_corrupt.csv 02_sl_offering.txt

Link to comment

My coding skills for CK2 are rusty but some things I noticed:

 

Your stuff will absolutely not work as is. on_war_ended_victory is an on_action, not a trigger, and needs to go into the on_action file so that when the game detects that situation happened, it will fire sl_corrupt_51 automatically.

 

Unless you want this event firing after every war for every npc who won and lost you need the pre-trigger ai = no around line 869

 

Line 886 is missing an =

Line 902, 903, 921, and 922 are all using an event target scope, so they need to have event_target: like 886 does. This should still matter inside a custom tooltip, I believe.

 

There is more than one way to code CK2, and the style being used here is not something I have seen done like this before, so I have no idea if your scoping to the wife/daughter in this manner is going to work inside a random_list without triggers and such, personally I would detect if the defeated has a wife/daughter first and set flags on them or save them as an event target and then use random_list with triggers to decide which you want to grab. You might want to consider a failsafe too, as it is entirely possible the defeated has no wife/daughter, or is female themselves.

 

When you fire events for npcs, the player will not see them. If your method of scoping to the wife or daughter actually works, you need to send them a hidden event that scopes back to you with the next seen event. This is called Pinging, and will automatically put their portrait in the event window with yours and will last for 3 or 4 events in the chain. Any event that needs to be seen by you has to be sent to you though. During these hidden events is probably the best time to save them as an event target, like defeated_wife or defeated_daughter.

 

The next event is a bit of a mess. You only need to save an event target once in an event chain. Scopes can change when using multiple events, FROM can become FROMFROM, ROOT can become FROM, etc. The point of saving an event target is to bypass this stupidity, so you will always be scoped to the right person without having to figure out if their scope changed in the next event. Event targets that are saved, stay saved until the entire event chain ends.

 

Never use any_character, it will literally check every single character in the game, which can give huge lag when it runs, or crash a low-end PC.

 

A trigger is unneeded in these follow-up events, as they should already have fulfilled the right conditions in the first event to get this far.

 

options do not need to be inside a scope, either the event is sent to you, or you wont see it at all. If you add miltiple options and only want to see one depending on if your the winner or loser, put a trigger inside the options block.

 

There are several other problems I see, based on the last issue I noted. If you want to have different desc for if your the winner or loser, you should probably set a flag in the first event on yourself

if = {
	limit = {
		ROOT = { ai = no }
	}
	ROOT = { set_character_flag = player_lost }
}
else = {
	FROM = { set_character_flag = player_won }
}

 

 

Another issue, and why you may be getting blank events for 106, is the fact you are using someone elses code without using the event targets they set. Write your own events using theirs as a template, but use your event targets and/or flags.

 

Link to comment

Again, thanks so very much. I realised I'm absolutely crap at modding and not much of a chance to get this mod done. 

 

This is my latest try since it triggers a few days after game start and is blank, perhaps the first event option target should have been ROOT? If anyone wants to take over my idea and create a real mod, go ahead, feel free. 

 

The spoiler contains the latest code regarding the events themselves. This is fairly simple. On_war_ended_defeat (as you pointed out, ROOT is .. well, me and FROM is the opponent and this is an offensive war, which means I was attacked  - as far as I get it - and lost) event sl_corrupt.51 is called that sets me as event target loser and he is the winner and if the winner is male (guys getting cucked by women is ... non existant?), I am male and I have a wife and/or daughter the winner decides to take her but I see the event (check sl_corrupt.100 - I take the decision to sell a female acquintance to a powerful ruler and enter a non-offensive agreement, the event target is the ruler that I chose, but I see the event and choose what happens next.

Spoiler

#war cuckolding
character_event = { #war ended
	id = sl_corrupt.51
	
	ROOT = { save_event_target_as = defeated }
	FROM = { save_event_target_as = defeatee }

	desc = EVTDESC_sl_core_13
	picture = GFX_evt_war_lose
	window = "BiggerEventWindow"
	portrait = defeatee

	if = {
		limit = {
			defeatee = {
				is_female = no
			}
			defeated = {
				is_female = no
			}
			any_courtier = {
				is_female = yes
				is_married = yes
				any_liege = { who = ROOT }
				any_spouse = { who = ROOT }
				age < 40
				set_character_flag = sl_wife_to_be_fucked
				save_event_target_as = wife
			}
			any_courtier = {
				is_female = yes
				any_liege = { who = ROOT }
				any_child = { limit = { is_child_of = ROOT } }
				set_character_flag = sl_daughter_to_be_fucked
				save_event_target_as = daughter
			}
		}
		option = {
			name = "I wonder, what will he take?"
			event_target:defeatee = {
				random_list = {
					50 = { #wife
						mult_modifier = {
							factor = 2
							wife = {
								trait = lustful
							}
							custom_tooltip = {
								text = EVTTOOLTIP_sl_corrupt.49b
								defeated = { set_character_flag = sl_winner_wants_wife }
								defeatee = { set_character_flag = sl_takes_wife }
							}
						}
						character_event = { id = sl_corrupt.49 }
					}
					50 = { #daughter
						mult_modifier = {
							factor = 2
							wife = {
								trait = lustful
								trait = polyamorous
							}
							custom_tooltip = {
								text = EVTTOOLTIP_sl_sl_corrupt.50b
								defeated = { set_character_flag = sl_winner_wants_daughter }
								defeatee = { set_character_flag = sl_takes_daughter }
							}
						}
						character_event = { id = sl_corrupt.50 }
					}
				}
			}
		}
	}
}

character_event = {
	id = sl_corrupt.49
		
	picture = GFX_evt_cuck_15
	desc = EVTDESC_sl_corrupt.49a
	window = "BiggerEventWindow"
	portrait = event_target:defeated
	
	event_target:defeated = {
		option = {
			name = "He's fucking my wife"
			custom_tooltip = {
				text = EVTTOOLTIP_sl_corrupt.49a
				defeated = { 
					prestige = -400 
					set_character_flag = sl_winner_fucked_wife
					add_trait = sl_sub
					add_trait = lf_submissive
				}
				wife = {
					impregnate_cuckoo = defeatee
					add_lover = defeatee
					add_trait = sl_sub
					add_trait = lf_submissive
				}
				defeatee = {
					add_trait = sl_dom
					add_trait = lf_dominant
				}
			}
		}
	}
}

character_event = {
	id = sl_corrupt.50
	
	picture = GFX_evt_cuck_15
	desc = EVTDESC_sl_corrupt.50a
	window = "BiggerEventWindow"
	portrait=event_target:defeated
	
	event_target:defeated = {
		option = {
			name = "He's fucking my daughter"
			custom_tooltip = {
				text = EVTTOOLTIP_sl_corrupt.50a
				defeated = { 
					prestige = -400
					set_character_flag = sl_winner_fucked_daughter
					add_trait = sl_sub
					add_trait = lf_submissive
				}
				daughter = {
					impregnate_cuckoo = defeatee
					add_lover = defeatee
					add_trait = sl_sub
					add_trait = lf_submissive
				}
				defeatee = {
					add_trait = sl_dom
					add_trait = lf_dominant
				}
			}
		}
	}
}

 

 

This is the section I wrote for on_actions:

on_war_ended_defeat = {
	events = {
		sl_corrupt.51
	}
}

02_sl_offering.txt

Link to comment

Don't worry, we all start at rock-bottom. Take a look at these page:

https://ck2.paradoxwikis.com/Scripting (VERY important)

https://ck2.paradoxwikis.com/Event_modding (VERY important for events)

https://ck2.paradoxwikis.com/Scopes (really nice to have)

 

Your problem was in wrong syntax. I fixed the first event as an example:

 

#war cuckolding
character_event = { #war ended
	id = sl_corrupt.51
	
	immediate = { #PUT THE CODE YOU NEED TO EXECUTE IN THE IMMEDIATE/OPTION BLOCK.
		ROOT = { save_event_target_as = defeated }
		FROM = { save_event_target_as = defeatee }
		
		if = { #spouse is one of those scopes where you can't put a limit block inside
			limit = {
				is_married = yes
				spouse = {
					is_female = yes
					practical_age < 40
					is_vassal_or_below_of = ROOT
				}
			}
			spouse = {
				set_character_flag = sl_wife_to_be_fucked
				save_event_target_as = wife
			}
		}
		random_child = { #more efficient
			limit = {
				is_female = yes
				practical_age < 40
				is_vassal_or_below_of = ROOT
			}
			set_character_flag = sl_daughter_to_be_fucked
			save_event_target_as = daughter
		}
	}
	
	trigger = {
		is_female = no
		FROM = { is_female = no }
	}
	
	desc = EVTDESC_sl_core_13
	picture = GFX_evt_war_lose
	window = "BiggerEventWindow"
	portrait = event_target:defeatee
	
	option = {
		name = "I wonder, what will he take?"
		random_list = {
			50 = { #wife
				mult_modifier = { #this is a condition type block
					factor = 2
					spouse = { trait = lustful }
				}
				custom_tooltip = {
					text = EVTTOOLTIP_sl_corrupt.49b
					event_target:defeated = { set_character_flag = sl_winner_wants_wife }
					event_target:defeatee = { set_character_flag = sl_takes_wife }
				}
				character_event = { id = sl_corrupt.49 }
			}
			50 = { #daughter
				mult_modifier = {
					factor = 2
					spouse = { #???
						trait = lustful
						trait = polyamorous
					}
				}
				custom_tooltip = {
					text = EVTTOOLTIP_sl_sl_corrupt.50b
					defeated = { set_character_flag = sl_winner_wants_daughter }
					defeatee = { set_character_flag = sl_takes_daughter }
				}
				character_event = { id = sl_corrupt.50 }
			}
		}
	}
}

 

Take a look at the articles I linked you; it should elucidate quite a few things. CK2's wiki is very useful for modders. There is also a number of forums where you might get faster responses - the official pdx forum, for one, has a massive questions/answers thread.

Link to comment

Again, thank you. 

1) I'll look into what you linked in more details. Appreciate it.

2) I'm not sure the official PDX forum would allow talks about these kind of mods :)  They aren't loverslab.

3) I never thought about setting the immediate thing. In my React-ed mind, if (a == b) console.log(this);

 

I'll make the changes and if they work, add some more content/events, this is very very short.....

Link to comment
On 3/31/2021 at 12:59 AM, S0ul_K1ller said:

Again, thank you. 

1) I'll look into what you linked in more details. Appreciate it.

2) I'm not sure the official PDX forum would allow talks about these kind of mods :)  They aren't loverslab.

3) I never thought about setting the immediate thing. In my React-ed mind, if (a == b) console.log(this);

 

I'll make the changes and if they work, add some more content/events, this is very very short.....

In response to 2: obviously not, but you can still ask questions on basic scripting mechanics. If nothing else, forcing yourself to come up with ways to rephrase your problem in an oblique enough manner may well help you better learn scripting.

In response to 3: Yeah, pdx's script can be rather annoying. As far as i know, there is no way to directly generate a random variable (though there is random and random_list), and i sorely miss functions after being stuck with scripted effects. Still, it's serviceable and actually lets you do more stuff than you'd think.

Link to comment
  • 1 month later...

This is perfect, I always thought the game could be spiced up with a little more danger. Most mods allow you to do things with other characters, but few affect 'you' or your 'family'. So yes, having your daughters kidnapped could be cool, then perhaps the victor sends you even taunting letters about the things they did to them while captive to say spark your anger.

 

Example: your daughter is kidnapped/taken after a castle siege. The enemy lord sends you a lewd letter with picture showing her in a uncomfortable situation example tied up with letter reading, 'your kid is quite feisty, yelling and spitting at us stating her mommy or daddy's gonna make us pay, we'll have fun breaking her'. then a few months later some other letter stating 'she's no longer fighting as much but appear to have become receptive of the men around.. ' (with another more lewd picture attached illustrating the situation).

Then say a year later if you havent managed a rescue yet with a siege of your own or rescue plot via events you get another letter with further news on her situation, for instance. 'your daughter's now a couple months pregnant by the way' and later, 'she has given birth, we now hold a heir/claimant to your kingdom..' 

Things like that.

Or, if you are the imprisoned, the enemy lord occasionally performs these actions on you and so on.

 

Similarly, when you hold another lords daughter captive there's currently no care from the enemy kingdom, no wars or plot to rescue, no strongly worded threat letter, no care. they might have a bad opinion over your enslavement of a family member, but that's it, no retaliation.

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