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

stryhf

Second Lieutenant
48 Badges
Jul 31, 2009
122
0
  • Crusader Kings II
  • Victoria 2: A House Divided
  • Sengoku
  • Semper Fi
  • Europa Universalis: Rome
  • Europa Universalis IV: Res Publica
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Heir to the Throne
  • Hearts of Iron III
  • For the Motherland
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • BATTLETECH: Season pass
  • BATTLETECH: Heavy Metal
  • Crusader Kings II: Holy Fury
  • Shadowrun: Dragonfall
  • Crusader Kings III
  • Shadowrun Returns
  • BATTLETECH - Digital Deluxe Edition
  • Crusader Kings II: Jade Dragon
  • BATTLETECH
  • 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
  • 500k Club
  • Rome: Vae Victis
  • Victoria 2
  • Cities in Motion
  • Sword of the Stars II
  • Sword of the Stars
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: Rajas of India
  • BATTLETECH: Flashpoint
  • Crusader Kings II: Sons of Abraham
  • Gettysburg
  • Europa Universalis III: Chronicles
  • Europa Universalis IV: Art of War
I want to put an additional hook into an on_action condition.

From looking at the on_actions.txt file the only examples I see are for percentage settings to determine the character_event to fire off. I want to be able to fire off 2 possible character_events based upon certain conditionals, but I don't think on_actions.txt will allow that.

I took a look at the specified character_events, and it follows a trigger / option format.

Is it possible to wrap an option based upon a limit? I don't think I can put conditionals within the trigger, since it appears to be a binary yes/no. From looking at all the files, I don't see a way to wrap the option itself into a limit, i.e. only present an option if certain conditionals are met. The other available recourse is to wrap the option internals into a limit, but that method won't really work with the AI.

Is there another way around this or cleaner way to implement this?

EDIT: I tried using immediate = { } to "shortcut" the event, but that just causes the events to fire in parallel, and doesn't prevent the first event from firing. Maybe I can push the entire event into a secondary event, and use immediate to do the conditional...
 
Last edited:
I don't have access to my computer right now, so i can't test anything but I'll see if this helps.

So, what you're trying to do is make an on_action fire one of two possible events based on whether a condition is true or not?

If so, what you could do is set up one general event which has as its option two limits. For example:
Code:
option = { 
THIS = {
limit = { condition = yes }
effect_1 = yes
}
THIS = {
limit = { condition = no } 
effect_2 = yes 
}
}
(I'm writing this from my phone so the formatting is probably out a bit. I'll fix later. I just noticed I missed the name and desc lines, but I'd have to re-type the whole thing to fix it.)

Hope that helps.
 
Thanks for the reply.

I tried the following:

Code:
option = {
       name = "EVTOPTA300000"

       THIS = {
             limit = { father = { is_ruler = yes } }
             set_character_flag = execute_yes
       }
       THIS = {
             limit = { father = { is_ruler = no } }
             set_character_flag = execute_no
       }
}

saved, then checked the save file, and the character had both flags set.

I also tried

limit = { father = { NOT = { is_ruler = yes } } }

And

limit = { NOT = { father = { is_ruler = yes } } }

Just in case the escalation of how the limit is returned to allow further execution within that statement block.

Finally I tried:

Code:
                THIS = {
                        limit = { is_ruler = yes }
                        set_character_flag = execute_yes
                }

                THIS = {
                        limit = { is_ruler = no }
                        set_character_flag = execute_no
                }

Since this binary test should be yes/no, and only one of the options should be run. No dice, both flags were set. Unless I'm missing something with the polish notation?
 
Interesting. Any chance of seeing the whole event?

I overloaded on_failed_assassination & on_bastard_birth, since those are the easiest events to replicate with a savegame file, and I can iterate often. I eventually want to make modifications to on_battle_won/lost with some custom titles, but it's harder to control when those outcomes will occur.

I only setup a skeletal event as a proof of concept.

Example of on_bastard_birth event:

Code:
character_event = {
        id = 300001

        major_character = yes

        is_triggered_only = yes
        trigger = {
                always = yes
        }

	title = "EVTNAME300001"
	desc = "EVTDESC300001"

	option = {
		name = "EVTOPTA300001"

		THIS = {
			limit = { father = { is_ruler = yes } }
			set_character_flag = execute_yes
		}
		THIS = {
			limit = { father = { is_ruler = no } }
			set_character_flag = execute_no
		}
	}
}

I even had a limit = { is_female = yes } check, and both flags were set.
 
After some testing, I haven't been able to find any way to limit = {} a single player identifier request.

Some queries return lists, and limit seems to work fine in reducing that list to 0. But other ID requests are single IDs and seem to always return, this includes THIS, mother, father and ruler. It ignores limit.

So I had an idea as a roundabout method... but found I can't find any way to loop back to THIS. I used country/any_character to generate a list, then limit that list to THIS with an AND boolean attached, this way it should generate an empty list if not true, and not execute.

Code:
        option = {
                THIS = {
                        country = {
                                any_character = {
                                        limit = {
                                                AND = {
                                                        any_child = { THIS } # Seriously WTF do I do with this?
                                                        has_title = { title_general }
                                                }
                                        }
                                        popularity = 20
                                        set_character_flag = A
                                }
                        }
                }
}

The other option, which I'm going to try is to just fire off 2 character events per option choice. Those events will have restrictive and contrary triggers so only 1 should fire...

Am I missing something obvious here?

EDIT: so I had the initial event fire off 2 characters events with opposing triggers, something really simply like is_ruler = yes/no, and both events still completely executed, totally ignoring what I had in the triggers. So calling character_event ignores the trigger conditionals? I'm starting to think this isn't possible, something as simple as binary negation doesn't exist?
 
Last edited:
I think I finally found a way around not being able to limit THIS.

I use immediate = { } to set a character flag of the proposed focus for the event.

Code:
        immediate = {
                set_character_flag = pick_me
        }

Then use country / any_character / limit on the has_character_flag.

Code:
option = {
        country = {
                any_character = {
                        limit = {
                                has_character_flag = pick_me
                                has_title = title_huntsman
                        }
                        popularity = 20

                        clr_character_flag = pick_me
                }
        }

        country = {
                any_character = {
                        limit = {
                                has_character_flag = pick_me
                                NOT = { has_title = title_huntsman }
                        }
                        popularity = -20

                        clr_character_flag = pick_me
                }
        }
}

Caveat is to make sure you clear the flag in some fashion within the event or you'll end up with garbage flags that could pollute later events. If you're trying to limit scope to 2 characters, you can call another event and then use from and this as the primary focus, without having to do with all the flags.
 
Last edited:
Funny thing happened while trying to figure this out... I came up with an idea to have "legitimate" bastards. I got the idea from reading the succession threads in the main forum, thinking, what if you didn't like your wife, and preferred better "Intelligent" women?

It's not a complete mod, there is a README.txt file included with notes I've added for all the files. Even the icon is a hack job, I just took the pro_ruler.tga and shrunk it.

Although not necessarily meant for "historical" accuracy, there were recorded instances of concubines within the ancient world, including biblical times, although in Ancient Rome concubini referred to young men according to wikipedia.
 

Attachments

  • concubine.zip
    4,8 KB · Views: 30