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

wtfraven

Recruit
69 Badges
May 28, 2019
2
0
  • Surviving Mars: Digital Deluxe Edition
  • Europa Universalis IV: Mare Nostrum
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Stellaris - Path to Destruction bundle
  • Knights of Honor
  • Europa Universalis IV: Third Rome
  • Tyranny - Tales from the Tiers
  • Age of Wonders: Shadow Magic
  • Age of Wonders II
  • Steel Division: Normand 44 - Second Wave
  • Haemimont Games Staff
  • Crusader Kings II: Jade Dragon
  • Cities: Skylines - Snowfall
  • DJ Plantage
  • DJ Plantage
  • Stellaris: Distant Stars Pre-Order
  • Crusader Kings II: Holy Fury Pre-order
  • Cities: Skylines Industries
  • BATTLETECH: Flashpoint
  • Stellaris: Megacorp
  • Hearts of Iron IV: Expansion Pass
  • Surviving Mars: First Colony Edition
  • BATTLETECH: Season pass
  • Battle for Bosporus
  • Leviathan: Warships
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Crusader Kings II
  • Magicka
  • Majesty 2 Collection
  • Europa Universalis IV: Res Publica
  • Sword of the Stars
  • Sword of the Stars II
  • Cities: Skylines Deluxe Edition
  • Europa Universalis IV: Pre-order
  • Magicka 2 - Signup Campaign
  • Magicka 2
  • Cities: Skylines - After Dark
I am attempting to make a bloodlines mod that allows for a chance to have mothers pass on the trait. I have found weight as a possible randomizer and I have seen random but that seems like it refers to a random variable in a set of variables. Is there a way to add in a simple rng and if statement to enable this?

Something like

Random { 1 4 }
if = 1 {
if = {
limit = {
mother = {
has_trait = alcimachid
}
NOT = {
has_trait = alcimachid
}
}
add_trait = alcimachid
}
}

or could I use
if random_attribute=charisma
{
if = {
limit = {
mother = {
has_trait = alcimachid
}
NOT = {
has_trait = alcimachid
}
}
add_trait = alcimachid
}
}

Im basically trying to put a 25% chance to pass the bloodline matrilineally.
 
Last edited:

Arsonius

Private
46 Badges
Dec 23, 2013
16
0
  • Crusader Kings II
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Res Publica
  • Pillars of Eternity
  • Age of Wonders III
  • Crusader Kings II: Conclave
  • Stellaris
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Crusader Kings II: Monks and Mystics
  • Europa Universalis IV: Mandate of Heaven
  • Surviving Mars
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Cradle of Civilization
  • Europa Universalis IV: Rule Britannia
  • Surviving Mars: Digital Deluxe Edition
  • Europa Universalis IV: Dharma
  • Shadowrun Returns
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Imperator: Rome
  • Crusader Kings III
  • Crusader Kings III: Royal Edition
  • Europa Universalis 4: Emperor
  • Europa Universalis IV
  • Europa Universalis IV: Common Sense
  • Magicka 2
  • Crusader Kings II: Way of Life
  • Mount & Blade: Warband
  • Magicka: Wizard Wars Founder Wizard
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Jade Dragon
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mare Nostrum
You can "roll" a random number like this:
Code:
set_variable = {
        name = d100_result
        value = {
            integer_range = { min = 0 max = 100 }
        }
}

if = {limit = {d100_result < 25} ... }

But in your case random list would probably be better:
Code:
random_list = {
            25 = {
                trigger = {            
mother = {
has_trait = alcimachid
}
NOT = {
has_trait = alcimachid
}
                }
                add_trait = alcimachid
            }
           75 = {}
}