Jump to content

Event Scripting help


redrustred

Recommended Posts

Hey guys, I am trying my hand at making a mod for CK2, and I am a little stuck.

 

I am trying to create an event where if the father has trait A and the mother has trait B, they produce a child that has trait C and another event where the father has trait A and the mother has either trait B or trait C, they produce a child with trait C.

 

I based it on the Saoshyant event in the oldgods_zoroastrian_events. I suppose I tweaked it without fully understanding what it did. I asked on the paradox mod forums, and I got one bit of advice, apparently I need to use "on_birth", this is what I have currently.

 

namespace = mymod
character_event = {
    id = mymod.001
    hide_window = yes
    on_birth
        trigger = {  father = { trait = A }
        NOR = {
        mother = { trait = B }
        mother = { trait = C }
        }
    }

    immediate = {
        add_trait = C
        }
    }

 

It didn't work, I also tried putting on_birth after trigger = {, that didn't work either, I don't know what to do at this point. if there are any script guru out there, I would love to hear any bit of advice you have to offer. thank you.

Link to comment

Brackets.

namespace = mymod
character_event = {
    id = mymod.001
    hide_window = yes
    trigger = {
        father = { trait = A }
        OR = {
             mother = { trait = B }
             mother = { trait = C }
        }
    }
    immediate = {
        add_trait = C
    }
}

First, NOR means neither. So for the second event you want to use OR.

Second, if you want the event to fire on birth, then you need to declare it not in the event file, but in on_actions. It's in the common folder.

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use