• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.

FaithfulCrusader

Second Lieutenant
79 Badges
Jul 15, 2017
101
538
  • A Game of Dwarves
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Mare Nostrum
  • Stellaris - Path to Destruction bundle
  • Knights of Honor
  • Hearts of Iron IV: Expansion Pass
  • Stellaris: Megacorp
  • Shadowrun: Dragonfall
  • Europa Universalis IV: Dharma
  • Stellaris: Distant Stars
  • Cities: Skylines - Parklife
  • Europa Universalis IV: Rule Britannia
  • Crusader Kings II: Monks and Mystics
  • Stellaris: Humanoids Species Pack
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Cradle of Civilization
  • Hearts of Iron IV: Death or Dishonor
  • Surviving Mars
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mandate of Heaven
  • Stellaris: Federations
  • Hearts of Iron 4: Arms Against Tyranny
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: By Blood Alone
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Europa Universalis 4: Emperor
  • Battle for Bosporus
  • Crusader Kings III
  • Imperator: Rome - Magna Graecia
  • Hearts of Iron IV: Together for Victory
  • Hearts of Iron IV: La Resistance
  • Stellaris: Lithoids
  • Age of Wonders: Planetfall
  • Stellaris: Ancient Relics
  • Prison Architect
  • Hearts of Iron IV: Expansion Pass
  • Imperator: Rome
  • Europa Universalis IV: Golden Century
  • Stellaris: Leviathans Story Pack
  • Europa Universalis IV: Call to arms event
  • Victoria 2
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Stellaris
  • Cities: Skylines - Natural Disasters
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.


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:
Here are also the four events that occur depending on the results. Two for failure(one for actor and one for recipient) and Two for success(one for actor and one for recipient).



Code:
# Failed Conversion Event for Actor
adventure_missionary_interaction.0002 = {
    type = character_event
    title = adventure_missionary.0001.t
    desc = adventure_missionary.0002.desc
    theme = faith
    override_background = {
        reference = council_chamber
    }
    left_portrait =    scope:actor
    right_portrait = scope:recipient

    #The result.
    option = {
        name = adventure_missionary.0002.a
        #No stress, as the AI is forced to get here.
        ai_chance = {    #No other options available.
            base = 100
        }
    }
}

Code:
# Failed Conversion Event for Recipient
adventure_missionary_interaction.0003 = {
    type = character_event
    title = adventure_missionary.0001.t
    desc = adventure_missionary.0003.desc
    theme = faith
    override_background = {
        reference = council_chamber
    }
    left_portrait =    scope:actor
    right_portrait = scope:recipient

    #The result.
    option = {
        name = adventure_missionary.0003.a
        #No stress, as the AI is forced to get here.
        ai_chance = {    #No other options available.
            base = 100
        }
    }
}

Code:
# Successful Conversion Event for Actor
adventure_missionary_interaction.0004 = {
    type = character_event
    title = adventure_missionary.0001.t
    desc = adventure_missionary.0004.desc
    theme = faith
    override_background = {
        reference = council_chamber
    }
    left_portrait =    scope:actor
    right_portrait = scope:recipient

    #The result.
    option = {
        name = adventure_missionary.0004.a
        #No stress, as the AI is forced to get here.
        ai_chance = {    #No other options available.
            base = 100
        }
    }
}

Code:
# Successful Conversion Event for Recipient
adventure_missionary_interaction.0005 = {
    type = character_event
    title = adventure_missionary.0001.t
    desc = adventure_missionary.0005.desc
    theme = faith
    override_background = {
        reference = council_chamber
    }
    left_portrait =    scope:actor
    right_portrait = scope:recipient

    #The result.
    option = {
        name = adventure_missionary.0005.a
        scope:recipient.faith = {
            set_character_faith = scope:actor.faith
        }
        #No stress, as the AI is forced to get here.
        ai_chance = {    #No other options available.
            base = 100
        }
    }
}