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

Arkady

Sergeant
26 Badges
Dec 10, 2002
75
0
www.arkady.cz
  • Victoria 2
  • Prison Architect
  • Shadowrun Returns
  • Steel Division: Normandy 44 Deluxe Edition
  • Steel Division: Normandy 44
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Reapers Due
  • Stellaris
  • Crusader Kings II: Conclave
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Way of Life
  • Pride of Nations
  • 500k Club
  • Crusader Kings II
  • Victoria: Revolutions
  • Heir to the Throne
  • Europa Universalis IV
  • Divine Wind
  • Europa Universalis III: Chronicles
  • Europa Universalis III
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: The Republic
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Charlemagne
Hi,
I just started creating of some events that reflect Liege - Vassal support

You can give your vassal money for build royal castle in his province...

Clarification needed
You can not check if your vassal has exact improvement build and then fire another event for him, right ?


events:
I check if ruler has vassals, enough money, advance and improvement build, MTTH is modified by martial stat, some traits and gold, you can then decide give money to random vassal (trigger event for him) or drop it

triggered event for vassal is with two options, build it, castle is build and loayalty is increased or defalcate money (not all) , this trigger another event back to liege

events are for small castle and antoher for medium castle
problem is when vassal has castle already build and accept it...you lose money and nothing more is build....

is possible in triggered event check improvement, if presented then fire event else fire another event ? probobly not , or is it?

....and please can you assign me some id range ?
 
Suggestion and feedback needed
EDIT: I finished those events, works fine and frequency seems to me right

for extra_text.csv add this
Code:
ACTIONNAME20500A;Build Small Castle!;;;;;;;;;;x
ACTIONNAME20500B;No, It Is Not Necessary!;;;;;;;;;;x
ACTIONNAME20501A;Let's Build It!;;;;;;;;;;x
ACTIONNAME20501B;I Need Money!;;;;;;;;;;x
ACTIONNAME20502A;Forgive!;;;;;;;;;;x
ACTIONNAME20502B;Hang The Entrepreneurs!;;;;;;;;;;x
ACTIONNAME20503A;Build Medium Castle!;;;;;;;;;;x
ACTIONNAME20503B;No, It Is Not Necessary!;;;;;;;;;;x
ACTIONNAME20504A;Let's Build It!;;;;;;;;;;x
ACTIONNAME20504B;I Need Money!;;;;;;;;;;x
ACTIONNAME20505A;Forgive!;;;;;;;;;;x
ACTIONNAME20505B;Hang The Entrepreneurs!;;;;;;;;;;x

this events put in existing event file or create new one and don't forgot add line to events paths
Code:
#########################################
#We can build Small Castle for our Vassal
#########################################
character_event = {
  id = 20500
  picture = "event_moneycollection"
  name = "Build Royal Castle"
  trigger = {
            condition = { type = has_vassal }
            condition = { type = has_advance value = small_castle }
            condition = { type = gold value = 3000 }
           }

  mean_time_to_happen = {
                     months = 16
                     modifier = {
                         condition = { type = gold value = 5000 }
                         factor = 0.9
                     }
                     modifier = {
                         condition = { type = gold value = 10000 }
                         factor = 0.9
                     }
                     modifier = {
                         condition = { type = has_law value = { feudal_contract_law = yes } }
                         factor = 0.9
                     }
                     modifier = {
                         condition = { type = not
                                       value = { type = martial value = 5 } 
                                     }
                         factor = 1.5
                     }
                     modifier = {
                         condition = { type = martial value = 10 }
                         factor = 0.95
                     }
                     modifier = {
                         condition = { type = martial value = 15 }
                         factor = 0.95
                     }
                     modifier = {
                         condition = { type = trait value = martial_cleric }
                         factor = 0.9
                     }
                     modifier = {
                         condition = { type = trait value = misguided_warrior }
                         factor = 1.2
                     }
                     modifier = {
                         condition = { type = trait value = tough_soldier }
                         factor = 1.05
                     }
                     modifier = {
                         condition = { type = trait value = knowledged_tactician }
                         factor = 0.85
                     }
                     modifier = {
                         condition = { type = trait value = brilliant_strategist }
                         factor = 0.75
                     }
                     modifier = {
                         condition = { type = trait value = schizofrenia }
                         factor = 2
                     }
                     modifier = {
                         condition = { type = trait value = suspicious }
                         factor = 1.5
                     }
           }

  action_a = { 
           ai_chance = 4 

           effect = { type = gold value = -860 }
           effect = { type = prestige value = 25 }
           effect = { type = random chance = 15 effect = { type = add_trait value = wise } }
           effect = { type = random chance = 5 effect = { type = add_trait value = generous } }
           effect = { type = trigger for = random_vassal value = 20501 } 
           }
  action_b = {
           ai_chance = 5

           effect = { type = random chance = 5 effect = { type = add_trait value = reckless } }
     }

}

#########################
#Vassal can build Castle
#########################
character_event = {
  id = 20501
  name = "Liege fund Small Castle"
  picture = "event_techspread"
  action_a = {
           ai_chance = 7

           effect = { type = add_improvement value = small_castle  }
           effect = { type = random chance = 5 effect = { type = add_trait value = honest } }
           effect = { type = loyalty value = 0.2 } 
           }
  action_b = {
           ai_chance = 2

           effect = { type = gold value = 500 }
           effect = { type = prestige value = -50 }
           effect = { type = random chance = 15 effect = { type = add_trait value = selfish } }
           effect = { type = random chance = 10 effect = { type = add_trait value = deceitful } }
           effect = { type = trigger for = liege value = 20502 }
           }
}
#########################
#They steal our money
#########################
character_event = {
  id = 20502
  name = "They defraud our money"
  picture = "event_moneycollection"
  action_a = {
           ai_chance = 5
 
           effect = { type = prestige value = -30 }
           effect = {type = random chance = 25 effect = { type = add_trait value = forgiving } }
           effect = {type = random chance = 15 effect = { type = add_trait value = trusting } }
           effect = {type = random chance = 5 effect = { type = add_trait value = coward } }
           }
  action_b = {
           ai_chance = 4

           effect = { type = prestige value = 100 }
           effect = { type = intrigue value = 1 }
           effect = { type = death value = random_courtier }
           effect = { type = death value = worst_courtier }
           effect = {type = random chance = 25 effect = { type = add_trait value = reckless } }
           effect = {type = random chance = 15 effect = { type = add_trait value = suspicious } }
           effect = {type = random chance = 5 effect = { type = add_trait value = cruel } }
           }
}
#########################################
#We can build Medium Castle for our Vassal
#########################################
character_event = {
  id = 20503
  picture = "event_moneycollection"
  name = "Build Royal Castle"
  trigger = {
            condition = { type = has_vassal }
            condition = { type = has_advance value = medium_castle }
            condition = { type = gold value = 5000 }
           }

  mean_time_to_happen = {
                     months = 24
                     modifier = {
                         condition = { type = gold value = 10000 }
                         factor = 0.9
                     }
                     modifier = {
                         condition = { type = gold value = 20000 }
                         factor = 0.9
                     }
                     modifier = {
                         condition = { type = has_law value = { feudal_contract_law = yes } }
                         factor = 0.9
                     }
                     modifier = {
                         condition = { type = not
                                       value = { type = martial value = 5 } 
                                     }
                         factor = 1.5
                     }
                     modifier = {
                         condition = { type = martial value = 10 }
                         factor = 0.95
                     }
                     modifier = {
                         condition = { type = martial value = 15 }
                         factor = 0.95
                     }
                     modifier = {
                         condition = { type = trait value = martial_cleric }
                         factor = 0.9
                     }
                     modifier = {
                         condition = { type = trait value = misguided_warrior }
                         factor = 1.2
                     }
                     modifier = {
                         condition = { type = trait value = tough_soldier }
                         factor = 1.05
                     }
                     modifier = {
                         condition = { type = trait value = knowledged_tactician }
                         factor = 0.85
                     }
                     modifier = {
                         condition = { type = trait value = brilliant_strategist }
                         factor = 0.75
                     }
                     modifier = {
                         condition = { type = trait value = schizofrenia }
                         factor = 2
                     }
                     modifier = {
                         condition = { type = trait value = suspicious }
                         factor = 1.5
                     }
           }

  action_a = { 
           ai_chance = 4 

           effect = { type = gold value = -1450 }
           effect = { type = prestige value = 50 }
           effect = { type = random chance = 20 effect = { type = add_trait value = wise } }
           effect = { type = random chance = 10 effect = { type = add_trait value = generous } }
           effect = { type = trigger for = random_vassal value = 20504 } 
           }
  action_b = {
           ai_chance = 5

           effect = { type = random chance = 5 effect = { type = add_trait value = reckless } }
     }

}

#########################
#Vassal can build Castle
#########################
character_event = {
  id = 20504
  name = "Liege fund Medium Castle"
  picture = "event_techspread"
  action_a = {
           ai_chance = 7

           effect = { type = add_improvement value = medium_castle  }
           effect = { type = random chance = 10 effect = { type = add_trait value = honest } }
           effect = { type = loyalty value = 0.25 } 
           }
  action_b = {
           ai_chance = 2

           effect = { type = gold value = 1000 }
           effect = { type = prestige value = -100 }
           effect = { type = random chance = 25 effect = { type = add_trait value = selfish } }
           effect = { type = random chance = 15 effect = { type = add_trait value = deceitful } }
           effect = { type = trigger for = liege value = 20505 }
           }
}
#########################
#They steal our money
#########################
character_event = {
  id = 20505
  name = "They defraud our money"
  picture = "event_moneycollection"
  action_a = {
           ai_chance = 5
 
           effect = { type = prestige value = -60 }
           effect = {type = random chance = 35 effect = { type = add_trait value = forgiving } }
           effect = {type = random chance = 25 effect = { type = add_trait value = trusting } }
           effect = {type = random chance = 15 effect = { type = add_trait value = coward } }
           }
  action_b = {
           ai_chance = 4

           effect = { type = prestige value = 180 }
           effect = { type = intrigue value = 1 }
           effect = { type = death value = best_courtier }
           effect = { type = death value = random_courtier }
           effect = { type = death value = worst_courtier }
           effect = {type = random chance = 30 effect = { type = add_trait value = reckless } }
           effect = {type = random chance = 25 effect = { type = add_trait value = suspicious } }
           effect = {type = random chance = 25 effect = { type = add_trait value = cruel } }
           }
}
[COLOR=Slate Gray]
MTTH modifiers should include some martial education too (decrease time) and maybe increase for some traits

from action_b (30001) should be fired another event to liege

similar events should be for medium castle

What do you think ?
[/COLOR]
 
Last edited:
Arkady said:
Hi,
Clarification needed
You can not check if your vassal has exact improvement build and then fire another event for him, right ?

No, there's no way to test if the vassal has any improvement built in any of his demesne provinces. Nor for any other information about the vassal.

is possible in triggered event check improvement, if presented then fire event else fire another event ? probobly not , or is it?
No, if an event is triggered by event, there's no way to put additional decision conditions in the event.

What you might want to consider is making these province events, where a vassal can request aid from his liege to build it, decide to pay for it himself, or choose not to build it. That way you can be sure that you won't be trying to build a small castle in a province that already has one. Trigger on:
Code:
trigger = {
  condition = {
    type = is_vassal
  }
  condition = {
    type = gold
    for = liege
    value = 2000
  }
  condition = {
    type = not
    value = {
      type = gold
      value = 500
    }
  }
  condition = {
    type = has_advance
    value = {
      hill_fort = yes
      small_castle = yes
    }
  }
  condition = {
    type = has_improvement
    value = {
      hill_fort = yes
    }
  }
  condition = {
    type = not
    value = {
      type = has_improvement
      value = {
        small_castle = yes
      }
    }
  }
}
....and please can you assign me some id range ?
Done.
 
How about events for the other things the AI never bothers to build?

  • Courts of justice
  • training grounds
  • civilian harbors
  • churches
  • schools
etc.
 
richvh: yep, it is better solution check it from "bottom", from vassal ...but there is a problem that when I trigger event for liege I can not return it back when liege choose yes or not.... :(


this events should reflect building royal castles in vassals provinces...no other improvements...(ok, brewery should be , rights was always granted by ruler)
 
ai_chance works a bit weird in 1.02. To get a 50/50 split you have to set ai_chance for action_a to 4 and ai_chance for action_b to 5. 80/20 would be action_a 7 and action_b 2. In short, divide desired percentage by 10 and, for action_a only, subtract 1 from the result. I did some extensive testing on ai_chance, which you can find in the thread of that name in the bug forum.
 
richvh said:
ai_chance works a bit weird in 1.02. To get a 50/50 split you have to set ai_chance for action_a to 4 and ai_chance for action_b to 5. 80/20 would be action_a 7 and action_b 2. In short, divide desired percentage by 10 and, for action_a only, subtract 1 from the result. I did some extensive testing on ai_chance, which you can find in the thread of that name in the bug forum.

ok, thx

:rolleyes: