I made a mod that spawns a character, and later, if the character has been imprisioned, I wanted to fire an event, which I understand is what these two commands are for.
I tried this;
character_event = {
id = BobEvents.1
hide_window = yes
is_triggered_only = yes
immediate = {
create_character = {
random_traits = no
name = "Bob"
dynasty = 4100001
religion = ROOT
culture = ROOT
race = swedish
dna = ckhbbhacaai
female = no
age = 20
historical = yes
attributes = {
martial = 2
diplomacy = 3
stewardship = 5
intrigue = 5
learning = 5
}
health = 6
fertility = 0.50
trait = thrifty_clerk
}
new_character = {
set_character_flag = is_bob
set_global_flag = gr_bob_created
set_global_flag = bob_is_alive
save_persistent_event_target = { name = gr_bob_character scope = event_target:ROOT }
imprison = ROOT
}
}
}
I know most of the code works because bob immeditally goes to prison on spawning, but then later I tried this narrative event;
narrative_event = { #EscapesFromPrison
id = BobEvents.1011
desc = BobEscapes
title = BobEscaping
picture = EmptyDungeon
ai = no
#is_triggered_only = yes
trigger = {
persistent_event_target:gr_bob_character = { prisoner = yes }
had_global_flag = {
flag = bob_is_imprisioned days >=60
}
}
immediate = {
persistent_event_target:gr_bob_character = {
imprison = no
banish = yes
}
}
option = {
name = BobEscapesF
narrative_event = { id = BobEvents.1012 }
}
}
And nothing works? I want Bob to leave prison and be banished immediatelly, but nothing happens. The event doesn't even pop up.
When I use the console to fire it manually, the even visually works just fine, but Bob still doesn't leave the prison and get banished. All I can think off it that I'm not using the event target function correctly
I tried this;
character_event = {
id = BobEvents.1
hide_window = yes
is_triggered_only = yes
immediate = {
create_character = {
random_traits = no
name = "Bob"
dynasty = 4100001
religion = ROOT
culture = ROOT
race = swedish
dna = ckhbbhacaai
female = no
age = 20
historical = yes
attributes = {
martial = 2
diplomacy = 3
stewardship = 5
intrigue = 5
learning = 5
}
health = 6
fertility = 0.50
trait = thrifty_clerk
}
new_character = {
set_character_flag = is_bob
set_global_flag = gr_bob_created
set_global_flag = bob_is_alive
save_persistent_event_target = { name = gr_bob_character scope = event_target:ROOT }
imprison = ROOT
}
}
}
I know most of the code works because bob immeditally goes to prison on spawning, but then later I tried this narrative event;
narrative_event = { #EscapesFromPrison
id = BobEvents.1011
desc = BobEscapes
title = BobEscaping
picture = EmptyDungeon
ai = no
#is_triggered_only = yes
trigger = {
persistent_event_target:gr_bob_character = { prisoner = yes }
had_global_flag = {
flag = bob_is_imprisioned days >=60
}
}
immediate = {
persistent_event_target:gr_bob_character = {
imprison = no
banish = yes
}
}
option = {
name = BobEscapesF
narrative_event = { id = BobEvents.1012 }
}
}
And nothing works? I want Bob to leave prison and be banished immediatelly, but nothing happens. The event doesn't even pop up.
When I use the console to fire it manually, the even visually works just fine, but Bob still doesn't leave the prison and get banished. All I can think off it that I'm not using the event target function correctly