• 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.
Hey guys, I'm writing a bunch of decisions that will never be directly activated, but instead used as ways to display relevant information to the player.

Code:
event = { #Sphere of Influence Information
    id = 100002
    random = no
    persistent = yes
    
    decision = { AND = { ai = no local_flag = show_SOI } }

    decision_trigger = { ai = yes }

    trigger = { ai = yes }

    name = "Sphere of Influence"
    desc = "The following states are in our sphere:"
    style = 2
    picture = "Wehrmacht"
    decision_picture = "decision_grand_offensive"

    date = { day = 0 month = january year = 1914 }
    offset = 10
    deathdate = { day = 29 month = december year = 1999 }

    action = {
            name = "Afghanistan"
            trigger = { local_flag = AFG_in_SOI }
            command = { type = local_clrflag which = show_SOI }
    }
    action = {
            name = "Albania"
            trigger = { local_flag = ALB_in_SOI }
            command = { type = local_clrflag which = show_SOI }
    }
    action = {
            name = "Algeria"
            trigger = { local_flag = ALG_in_SOI }
            command = { type = local_clrflag which = show_SOI }
    }
}

In this example, I'm showing the player which countries are in their sphere of influence. Is there a better way to display this information as a single action rather than these individual actions I'm currently creating? Something like changing the displayed name or prompt based on a pile of triggers.
 
I don't suppose any of you fine people could help me write an event could you? Or at least give some pointers?

I'd like to add a generic decision for building nuclear power plants. Now when you build one I'd like the results to come back in about 3 years (depicted as energy added to a random province). However, I'd like for you to be able to trigger this decision monthly... so that you could have multiple power plants being produced rather than having to wait 3 years between building each plant. Is that possible?

Additionally is it possible for the energy production from the plant finished event to change based on your tech level? Like I'm planning on a gen 1, gen 2, and gen 3 nuclear power plant techs.
 
I know this forum is half dead, but it's late in night, and my savedebug say:
ERROR : (unknown lhs in game-event) 'event = {' Line = 315 file = Mods\Battle Cry of Old Empires\db\events\SWE_event.txt
About this:

event = {
id = 99999903
random = no
country = SWE
trigger = {

}

name = "People panic"
desc = "As army controlled by military junta is closer and closer, mass of refugees appeared on all roads leading away from Stockholm. It will not have a good impact on loyalists morale. We have to react."
style = 0
picture = "stockholm_refugees"


action_a = {
name = "We can do nothing"
ai_chance = 50
command = { type = dissent value = 10 }
command = { type = manpowerpool value = -100 }
command = { type = trigger which = 99999906 }
}

action_b = {
name = "State garrisons on the main roads"
ai_chance = 50
command = { type = manpowerpool value = -10 }
command = { type = add_division which = "STG" value = garrison }
command = { type = dissent value = 5 }
command = { type = trigger which = 99999907 }
}

}

Event. What the hell is wrong with it? I just add, that five minutes ago it was working.
 
I know this forum is half dead, but it's late in night, and my savedebug say:
ERROR : (unknown lhs in game-event) 'event = {' Line = 315 file = Mods\Battle Cry of Old Empires\db\events\SWE_event.txt
About this:

event = {
id = 99999903
random = no
country = SWE
trigger = {

}

name = "People panic"
desc = "As army controlled by military junta is closer and closer, mass of refugees appeared on all roads leading away from Stockholm. It will not have a good impact on loyalists morale. We have to react."
style = 0
picture = "stockholm_refugees"


action_a = {
name = "We can do nothing"
ai_chance = 50
command = { type = dissent value = 10 }
command = { type = manpowerpool value = -100 }
command = { type = trigger which = 99999906 }
}

action_b = {
name = "State garrisons on the main roads"
ai_chance = 50
command = { type = manpowerpool value = -10 }
command = { type = add_division which = "STG" value = garrison }
command = { type = dissent value = 5 }
command = { type = trigger which = 99999907 }
}

}

Event. What the hell is wrong with it? I just add, that five minutes ago it was working.
This type of error means that the game was expecting something but couldn't find it.
99% of the times it's a missing } (or one too many) in the PRECEDING event.
 
Hey, I want to make specific songs in the music folder play when a certain outcome occurs. I followed the event text from vanilla, but I'm having problems. The error message looks like:
ERROR : (Missing = in statement.) '.txt = Sfanta Tinerete Legionara' Line = 281 file = Mods\BITUSSA 2.00\db\events\Back in the USSA\Axis\Romania.txt

And the offending line(s) are:
action_b = {
name = "EVT_8012307_B" # We cannot hope to oppose them...
ai_chance = 1
command = { type = dissent value = 5 }
command = { type = relation which = GER value = 35 }
command = { type = set_domestic which = democratic value = 1 }
command = { type = set_domestic which = political_left value = 1 }
command = { type = set_domestic which = freedom value = 2 }
command = { type = set_domestic which = free_market value = 2 }
command = { type = set_domestic which = professional_army value = 8 }
command = { type = set_domestic which = defense_lobby value = 7 }
command = { type = set_domestic which = interventionism value = 7 }
command = { trigger = { not = { event = 6000003 }} type = headofgovernment which = 110035 }
command = { type = headofgovernment which = 110032 } # Horia Sima
command = { type = foreignminister which = 110048 }
command = { type = armamentminister which = 110065 } # Petre Tutea
command = { type = ministerofsecurity which = 110081 } # Constantin I. Gane
command = { type = ministerofintelligence which = 110085 } # Constantin Petrovicescu
command = { type = chiefofstaff which = 110105 } # Platon Chirnoaga
command = { type = chiefofarmy which = 110110 } # Ilie Steflea
command = { type = chiefofnavy which = 110117 } # Ioan Georgescu
command = { type = sleepminister which = 110027 } # Ion Antonescu
command = { type = sleepminister which = 110007 }
command = { type = sleepminister which = 110101 }
command = { type = sleepleader which = 110004 }
command = { type = songs which = Sfanta Tinerete Legionara.txt }
command = { type = sleepevent which = 8012308 }
command = { type = sleepevent which = 8012309 }
}
}

And yes, I have "Sfanta Tinerete Legionara.mp3" in the music folder and "Sfanta Tinerete Legionara.txt" as well.
 
Hey, I want to make specific songs in the music folder play when a certain outcome occurs. I followed the event text from vanilla, but I'm having problems. The error message looks like:


And the offending line(s) are:


And yes, I have "Sfanta Tinerete Legionara.mp3" in the music folder and "Sfanta Tinerete Legionara.txt" as well.
The problem is probably the space in the name.
The best solution would be to rename everything to Sfanta_Tinerete_Legionara or SfantaTinereteLegionara.
Another possibility, but I'm not sure if it would work, would be to try the following: command = { type = songs which = "Sfanta Tinerete Legionara.txt" }
 
What's wrong with this event? It works ok if I call it from the console, but it doesn't want to appear alone, even though the conditions are met (Germany and Brazil are allied, Brazil is not puppeted and hands over control to Germany).
Code:
event = {
    id = 190000017
    random = no
    persistent = yes
    country = BRA
       
    trigger = {
        alliance = { country = BRA country = GER }
        military_control = { country = BRA country = GER }
        NOT = { 
            puppet = { country = BRA country = GER }
        }
    }

    name = "Germany cannot control our forces!"
    desc = "evt_190000017"
    style = 2
    picture = "Wehrmacht"

    date = { day = 0 month = january year = 1933 }
    offset = 1
    deathdate = { day = 29 month = december year = 1969 }

    action = {
        ai_chance = 100
        name = "OK"
        command = { type = military_control which = GER where = BRA value = 0 }
    }
}
 
What's wrong with this event? It works ok if I call it from the console, but it doesn't want to appear alone, even though the conditions are met (Germany and Brazil are allied, Brazil is not puppeted and hands over control to Germany).
Code:
event = {
    id = 190000017
    random = no
    persistent = yes
    country = BRA
      
    trigger = {
        alliance = { country = BRA country = GER }
        military_control = { country = BRA country = GER }
        NOT = {
            puppet = { country = BRA country = GER }
        }
    }

    name = "Germany cannot control our forces!"
    desc = "evt_190000017"
    style = 2
    picture = "Wehrmacht"

    date = { day = 0 month = january year = 1933 }
    offset = 1
    deathdate = { day = 29 month = december year = 1969 }

    action = {
        ai_chance = 100
        name = "OK"
        command = { type = military_control which = GER where = BRA value = 0 }
    }
}
At a glance I can see nothing wrong.
If I understand correctly, you said that you play as BRA and the event doesn't fire even if all conditions are met?
Try turning this into a decision and see which trigger is failing:
Code:
decision = { exists = BRA }
decision_trigger = {
        alliance = { country = BRA country = GER }
        military_control = { country = BRA country = GER }
        NOT = {
            puppet = { country = BRA country = GER }
        }
    }
 
At a glance I can see nothing wrong.
If I understand correctly, you said that you play as BRA and the event doesn't fire even if all conditions are met?
Try turning this into a decision and see which trigger is failing:
Code:
decision = { exists = BRA }
decision_trigger = {
        alliance = { country = BRA country = GER }
        military_control = { country = BRA country = GER }
        NOT = {
            puppet = { country = BRA country = GER }
        }
    }
Actually I've made that event for my mod. What I want to achieve is to forbid Germany (player) to take military control over its allies unless they're German puppet. I'll try a decision, though it's strange that such a simple event doesn't work.
 
Actually I've made that event for my mod. What I want to achieve is to forbid Germany (player) to take military control over its allies unless they're German puppet. I'll try a decision, though it's strange that such a simple event doesn't work.
You misunderstood. I am not saying you should turn this event into a decision in your mod, I'm just saying to temporarily change it in a decision to debug it.
When you say "it doesn't work", what do you do to make it work and what do you expect to happen?
 
1. I play as Germany and it's only possible country to play in my mod.
2. I assume military control over my ally Brazil.
3. My event should trigger when Brazil and Germany are allied, Germany has military control over Brazil and Brazil is not German puppet.
4. My event should cancel German military control over Brazil.
5. I've checked triggers and command in event_commands.txt and it seems they're correct, yet the event still doesn't happen when conditions from point 3. are met.

As I wrote before, I called that event from console and it worked properly (i.e. cancelled German military control over Brazil).
 
1. I play as Germany and it's only possible country to play in my mod.
2. I assume military control over my ally Brazil.
3. My event should trigger when Brazil and Germany are allied, Germany has military control over Brazil and Brazil is not German puppet.
4. My event should cancel German military control over Brazil.
5. I've checked triggers and command in event_commands.txt and it seems they're correct, yet the event still doesn't happen when conditions from point 3. are met.

As I wrote before, I called that event from console and it worked properly (i.e. cancelled German military control over Brazil).
By using the console you're bypassing the trigger, so the problem could be there. Try making it into a decision for GER as I wrote and see if it's green or red.
BTW, persistent events are not shown IIRC, are you sure it isn't really working for BRA? Because if you play as GER you may not see it unless you check the diplomacy screen.
 
By using the console you're bypassing the trigger, so the problem could be there. Try making it into a decision for GER as I wrote and see if it's green or red.
BTW, persistent events are not shown IIRC, are you sure it isn't really working for BRA? Because if you play as GER you may not see it unless you check the diplomacy screen.
I'll check the decision, though I still don't understand why regular event doesn't work. I think 'persistency' of event is not an issue here, because military control was never cancelled by Brazil, so the event couldn't happen.
 
By using the console you're bypassing the trigger, so the problem could be there. Try making it into a decision for GER as I wrote and see if it's green or red.
BTW, persistent events are not shown IIRC, are you sure it isn't really working for BRA? Because if you play as GER you may not see it unless you check the diplomacy screen.
Ok, it seems there is a mistake in event commands.txt file:
Code:
military_control = { country = TAG1 country = TAG2 }# check if TAG2 has military control over TAG1
When I used trigger below...
Code:
military_control = { country = BRA country = GER }
... in game it means that Brazil has military control over Germany, in contrast to what is written in event commands.txt. Swapping tags in trigger resolved issue.
 
There is another mistake in event_commands.txt file:
Code:
military_control = { country = TAG [country = -1] } # check if country in question has military control over TAG
military_control = { country = -1 country = TAG } # check if TAG has military control over country in question
In both cases trigger checks if country in question has military control over TAG.
 
Hello, tried to create a chain of events for Manchukuo and got a crash on the very first one. I had some experience with events in EU4 (I created whole new ones and they worked) and in DH (well, here I only edited pre-existing ones), yet still I have absolutely no idea why this one crashes all the time. There was a lot of stuff I was trying to change, yet still, it always crashes no matter what. Well, here is the current version I have:

event = {
id = 2048100
random = no
country = MAN
decision = { AND = { war = { country = JAP country = CHI } puppet = { country = MAN country = JAP } } }
decision_trigger = { AND = { war = { country = JAP country = CHI } puppet = { country = MAN country = JAP } army = 50 } }
trigger = { army = 50 }
name = EVT_2048100_NAME #A chance at independence
desc = EVT_2048100_DESC #A chance at independence.
style = 2
picture = "ccip_cw"
action_a = {
name = EVT_2048100_ACTION1 # There is no chance
ai_chance = 80
command = { type = domestic which = defence_lobby value = -1 }
}
action_b = {
name = EVT_2048100_ACTION2 # We must try our luck!
ai_chance = 20
command = { type = war which = JAP }
command = { type = domestic which = defence_lobby value = 2 }
command = { type = relation which = JAP value = -100 }
command = { type = dissent value = -5 }
}
}

Any help would be appreciated. I really want to get this working. Thank you.
 
Hello, tried to create a chain of events for Manchukuo and got a crash on the very first one. I had some experience with events in EU4 (I created whole new ones and they worked) and in DH (well, here I only edited pre-existing ones), yet still I have absolutely no idea why this one crashes all the time. There was a lot of stuff I was trying to change, yet still, it always crashes no matter what. Well, here is the current version I have:

event = {
id = 2048100
random = no
country = MAN
decision = { AND = { war = { country = JAP country = CHI } puppet = { country = MAN country = JAP } } }
decision_trigger = { AND = { war = { country = JAP country = CHI } puppet = { country = MAN country = JAP } army = 50 } }
trigger = { army = 50 }
name = EVT_2048100_NAME #A chance at independence
desc = EVT_2048100_DESC #A chance at independence.
style = 2
picture = "ccip_cw"
action_a = {
name = EVT_2048100_ACTION1 # There is no chance
ai_chance = 80
command = { type = domestic which = defence_lobby value = -1 }
}
action_b = {
name = EVT_2048100_ACTION2 # We must try our luck!
ai_chance = 20
command = { type = war which = JAP }
command = { type = domestic which = defence_lobby value = 2 }
command = { type = relation which = JAP value = -100 }
command = { type = dissent value = -5 }
}
}

Any help would be appreciated. I really want to get this working. Thank you.
You should check savedebug.txt to understand the real error.
In this case: defenSe_lobby, not defenCe_lobby