EDIT: I've moved on from this, don't need anymore help with this. Thanks for checking out the post though. 
So for context, I'm working on a mod in anticipation for Landless Adventurers, which will allow a landless player to proselytize to characters in the same location.
Now this is the first ever time I've tried my hand at an event and also with the duel system. I couldn't find a tutorial anywhere online on how the code for dueling works so I've just been looking over the vanilla files.
I copied the Literalist Debate duel and just attempted to rework it into what I want. Currently, it's supposed to just be a straight 1:1 learning challenge with some RNG thrown in. I eventually want titles, traits, relationships, opinions, dread, tenets, religious fervor, etc to be accounted for.
So, for any modders who know how duel modding works, does this seem right to you? Again, it should just be an equal footing learning challenge. So 15 learning Actor VS 10 learning Recipient should be in favor of the actor winning the duel, but there should still be a chance of losing.
So for context, I'm working on a mod in anticipation for Landless Adventurers, which will allow a landless player to proselytize to characters in the same location.
Now this is the first ever time I've tried my hand at an event and also with the duel system. I couldn't find a tutorial anywhere online on how the code for dueling works so I've just been looking over the vanilla files.
I copied the Literalist Debate duel and just attempted to rework it into what I want. Currently, it's supposed to just be a straight 1:1 learning challenge with some RNG thrown in. I eventually want titles, traits, relationships, opinions, dread, tenets, religious fervor, etc to be accounted for.
So, for any modders who know how duel modding works, does this seem right to you? Again, it should just be an equal footing learning challenge. So 15 learning Actor VS 10 learning Recipient should be in favor of the actor winning the duel, but there should still be a chance of losing.
Code:
#Based off of the Literalist Debates and then modified for my own purposes.
adventure_missionary_interaction.0001 = {
type = character_event
title = adventure_missionary.0001.t
desc = adventure_missionary.0001.desc
theme = faith
override_background = {
reference = council_chamber
}
left_portrait = scope:actor
right_portrait = scope:recipient
option = {
name = adventure_missionary.0001.a
duel = {
skill = learning
target = scope:actor
50 = { #Defender wins the toss.
compare_modifier = {
value = scope:duel_value
multiplier = 1
}
desc = adventure_missionary.0001.a.tt_success
hidden_effect = {
random_list = {
100 = {
scope:actor = {
trigger_event = {
id = adventure_missionary_interaction.0002 #Failed to Convert Recipient
days = 7
}
}
scope:recipient = {
trigger_event = {
id = adventure_missionary_interaction.0003 #Reject Actor's Conversion
days = 7
}
}
}
}
}
}
50 = { #Attacker wins the toss.
compare_modifier = {
value = scope:recipient.learning
multiplier = 1
}
desc = adventure_missionary.0001.a.tt_fail
hidden_effect = {
random_list = {
100 = {
scope:actor = {
trigger_event = {
id = adventure_missionary_interaction.0004 #Successfully Converted Recipient
days = 7
}
}
scope:recipient = {
trigger_event = {
id = adventure_missionary_interaction.0005 #Successfully Converted by Actor
days = 7
}
}
}
}
}
}
}
#No stress, as AI is forced to pick this.
ai_chance = { #The AI always pick this.
base = 100
}
}
}
Last edited: