• 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:
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 = {}
}