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

bosman

Major
17 Badges
Jan 30, 2009
760
57
  • Arsenal of Democracy
  • Semper Fi
  • Rome Gold
  • Victoria: Revolutions
  • Majesty 2
  • Magicka
  • Iron Cross
  • Hearts of Iron III
  • For the Motherland
  • Age of Wonders III
  • Hearts of Iron IV Sign-up
  • 500k Club
  • Victoria 2
  • For The Glory
  • Darkest Hour
  • Crusader Kings II
  • Victoria 2: A House Divided
I've got some questions regarding events.
I tried to make simple mobilization events in "randomevents" file. However i don't know how to properly write triggers.
From what i know, it should be just like:

random = no
trigger = {
atwar = yes
}

to fire just at the start of war, but it doesn't, even after months.
Everything else should be right with this event, because i can fire it manually via console.
Also it's written in "event commands" file, that no specified country means this being played.
Anyone knows where the problem could be ?
 
Try to add date, deathdate and offset ?

Except of this...I don't know if that "no specified country" works this way...

event = {
id = xxxx
random = no
country = GER
trigger = {
atwar = yes
}

name = "xxxx"
desc = "xxxx"
style = 0
picture = "xxxx"

date = { day = 0 month = january year = 1936 }
offset = 1 #checks trigger conditions every day
deathdate = { day = 30 month = december year = 1999 }


action_a = {
name = "OK"
command = { type = manpowerpool value = 50 }
}
}
 
How stupid i am. I did try an offset but without dates. I see if it works though. As for the event it works fine if fired manually. I made added manpower value being a percentage of daily growth, so it could practically work for any country.
 
It still doesn't trigger itself. Unfortunately, i don't know if it's even possible to make an event like this with universal trigger, but i think it should be possible or in other words i don't see any reason why it may not be. Maybe i'm just missing something important in trigger. If someone has better knowledge about events could You please help me ? Please, please ! :)
 
#########################################################################
# Manpower mobilisation yay
#########################################################################
event = {
id = 663399
random = no
persistent = yes

trigger = {
ai = no
atwar = yes
}

name = "Mobilisation"
desc = "It's a bloody war out there."
style = 0
picture = "Soviet_reinforcments"

date = { day = 4 month = january year = 1936 }
offset = 1
deathdate = { day = 29 month = december year = 1999 }

action_a = {
name = "War? Not without us!"
command = { type = manpowerpool value = 50 }
}
}

That one fired in every time I declared war to random nation, tested in 1936 scenario as GER, SOV, and UK. If I omitted the ai = no line it refused to fire, so you could make two separate versions of the same event.
 
It must be country specific AFAIK. Here is an example from AoD V1.03's events\hoi2.txt file:

Code:
event = {
	 id = 919317 
	 random = no 
	 style = 0 
	 persistent = yes 
	 name = "Mobilization" 
	 desc = "With our nation at war, we must mobilize our military-age population." 
	 country = RSI 
	 date = { day = 1 month = january year = 1936 } 
	 offset = 120 
	 trigger = { 
		 atwar = yes 
		 NOT = { local_flag = DraftFlag }
	}
	 action_a = {
		 ai_chance = 90 
		 name = "Draft Manpower" 
		 command = { type = manpowerpool which = 1 value = 90000 } 
		 command = { type = industrial_modifier which = total value = -15 } 
		 command = { type = local_setflag which = DraftFlag } 
	 }

	 action_b = {
		 ai_chance = 10 
		 name = "Not yet. Ask me again later" 
		 command = { type = local_clrflag which = DraftFlag } 
	 }

	 action_c = {
		 ai_chance = 0 
		 name = "Do not draft" 
		 command = { type = local_setflag which = DraftFlag } 
	 }

}

There was such an event for every country separately.
 
Thank You very much Mjarr, You are my god :) , it fires now without problems. Now i have to try different solutions to find best way to properly simulate mobilization system. Maybe i can make something useful.
 
If The East is Red mod from HoI2 is familiar, it might be worth giving a look for ideas as it had fairly decent mobilisation system implemented within the game's own limits + the fact the mod allowed Germany to dictate whether it wants an early war or not.
 
I will take a look in the meantime. There is still a little problem i faced. I made 2 events - one for partial mobilization (id 1022) and another one for total mobilization
(id 1023). In second one I put condition to fire, if first event fired:

event = {
id = 1023
random = 100
trigger = {
ai = no
atwar = yes
event = 1022 }

bla bla bla
}

but it doesn't fire this way. Do i need to use an operator or maybe it won't fire if it's no country specific ?
 
I figured it out. I had to remove a command sleeping event 1022 in event 1022, in fact it's not necessary. It looks like sleeping events make them removed from memory and annihilated within game engine, so they no longer exist, therefore they cannot be used in triggers. I'm not sure if this should be considered as a bug, i suppose it shouldn't, however sometimes may be some limitation.

There is full text for mobilization events i made:
Code:
#########################################################################
#    Mobilization events
#########################################################################
event = {
    id = 1022
    persistent = yes
    random = 100
    trigger = {
        ai = no
        atwar = yes
        NOT = { local_flag = PartMob
            manpower = 200 }
        }
    
    name = "partial mobilization"
    desc = "Do we need to mobilize our army ?"
    picture = "Reinforcements"
    style = 0
    date = { day = 0 month = january year = 1936 }
    offset = 1
    deathdate = { day = 30 month = december year = 1999 }

    action_a = {
        name = "partial mobilization"
        command = { type = manpowerpool which = 1 value = 50000 }
        command = { type = belligerence value = 5 }
        command = { type = dissent value = 1 }
        command = { type = local_setflag which = PartMob }
            
    }
    action_b = { 
            name = "no need now"
            command = { type = local_setflag which = Mobstate }
            command = { type = local_setflag which = PartMob }
            }
}
event = {
    id = 1023
    persistent = yes
    random = 100
    trigger = {
        ai = no
        atwar = yes
        NOT = { manpower = 30 
            local_flag = TotalMob }
        }
    name = "total mobilization"
    desc = "Do we need total mobilization of our armies ?"
    picture = "Reinforcements"
    style = 0
        date = { day = 0 month = january year = 1936 }
    offset = 7
    deathdate = { day = 30 month = december year = 1999 }

    action_a = {
        name = "total mobilization"
        command = { type = manpowerpool which = 1 value = 200000 }
        command = { type = resource which = money value = -300 }
        command = { type = dissent value = 3 }
        command = { type = belligerence value = 5 }
        command = { type = local_setflag which = TotalMob }
    }
    action_b = {
        name = "no need now"
        command = {}
    }
}
event = {
    id = 1024
    persistent = yes
    random = 100
    trigger = {
        ai = no
        atwar = no
        OR = { local_flag = PartMob
               local_flag = TotalMob
                }
            }

    name = "demobilization"
    desc = "Is it time to demobilization ?"
    picture = "Reinforcements"
    style = 0
    date = { day = 0 month = january year = 1936 }
    offset = 10
    deathdate = { day = 30 month = december year = 1999 }

    action_a = {
        name = "demobilization"
        command = { type = manpowerpool which = 1 value = -200000 }
        command = { type = belligerence value = -5 }
        command = { type = manpowerpool which = 1 value = 10000 }
        command = { type = local_clrflag which = PartMob }
        }
    action_b = {
        name = "not yet"
        command = { type = dissent value = 1 }
    }
}

event = {
    id = 1025
    persistent = yes
    random = 100
    trigger = {
        ai = no
        atwar = yes
        local_flag = Mobstate
        }
    name = "partial mobilization"    
    desc = "Do we need to mobilize our army ?"
    picture = "Reinforcements"
    style = 0
    date = { day = 0 month = january year = 1936 }
    offset = 30
    deathdate = { day = 30 month = december year = 1999 }

    action_a = {
        name = "mobilize"
        command = { type = manpowerpool which = 1 value = 50000 }
        command = { type = belligerence value = 5 }
        command = { type = dissent value = 1 }
        command = { type = local_clrflag which = Mobstate }
        }
    action_b = {
        name = "not yet"
        command = {}
        }
}

just paste it to "randomevents.txt" file and You should be able check how it works.

Note, that those events are for human player only. I will try to add ai version soon. Also i recommend to lower both manpower growth and aging penalty for better effects in "misc.txt" file.
Feel free to write any suggestion about values used in triggers/events and of course about events itself.

I would forgot to add - there are conditions for events to fire:

for partial mobilization - manpower <= 200, demobilized or not mobilized, at war
for total mobilization - manpower <= 30, demobilized or not totally mobilized, at war
for demobilization - mobilized, at peace
 
Last edited:
Right, and this needs some discussion. For now, those events don't depend on government type, so it is another problem to solve. So far i just focused on strict manpower for dissent although there is some money payment in total mobilization, which may be bad idea, but You can always propose something better.
 
To add an event chain, say one for czech that triggers an event for SOV that triggers for POL (from SOV's) do I add them to hoi2.txt or add the events in each country file, and if so what ID's do I use, any random ones of a large number that being used?
 
AFAIK, it doesn't matter in which file You put events, it is for easier management, Just make sure the file is declared in "events.txt" file.
So, it can practically be done both ways You written.

As for ID's i suppose it would be best to add single numbers or tens to existing hundreds on the list in file like:

NNxx - where N contractually means type of event or country it is for and x identifies particular one.

This is of course not so strict in reality, but i hope You understand what i mean.
 
I updated Universal Mobilization/Demobilization Events adding government-specific factors (democratic/fascist/communist), and penalties.
View attachment mobilization.txt

Should work properly, but for better results it's advised to modify misc.txt file by replacing proper values with these lines:
Code:
# National Province Manpower Multiplier (income per day)
    0.005
# Non-National Province Manpower Multiplier (income per day.) Note: Some types of ministers can affect this value.
    0.0006

You get lower constant manpower growth, instead this makes virtual-like amount of manpower to use. Works for Human Player and AI.

To enable this file, add this line in events.txt file:
event = "db\events\mobilization.txt"
Using debugai cheat, you can check, if it works properly in different situations.
 
Last edited:
If You guys could check my work with Universal Mobilization/Demobilization Events and share your opinion, i would be very thankful. I try to make manpower management more realistic like in DH, but without plenty of files for every country or hundred of kilobytes essay :)