• 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.
A Pseudo-code for dynamic expansion I thought of a while back. It would be essentially repeated for industries exiting a market with a different action = { } for each province based on a resource type. This is based on the assumption of perfect competition and that if there is a resource shortfall, the value of a good goes up therefore firms will enter a market. Expansion rates can be controlled by adding randoms or increasing offsets. The idea is that each province owned will have a random = <value> so a country with 100 provinces will inherently have a higher chance of one of the triggers returning true (this is loosely based off my communist agitation event). I never had the time to research and complete this, but it is a nice mini-mod idea if anyone wants to work on it. They don't even need modding experience since I included snippets that can be copied+pasted.
Code:
# Dynamic Resource Allocation Script by Limith
# For Code Geass DH Total Conversion

# Resource Expansion
event = {
    id = 2000
    random = no
    persistent = yes
    one_action = yes
    
    trigger = {
        random = 25
        or = {
            and = {
                resource_shortage = oil
            }
            and = {
                resource_shortage = energy
            }                
            and = {
                resource_shortage = metal
            }
            and = {
                resource_shortage = rare_materials
                not = {
                    or = {
                        and = {
                            rare_materials = 50
                            ic = 5
                        }
                        and = {
                            rare_materials = 400
                            ic = 25
                        }
                        and = {
                            rare_materials = 650
                            ic = 45
                        }
                        and = {
                            rare_materials = 800
                            ic = 60
                        }
                        and = {
                            rare_materials = 1000
                            ic = 80
                        }
                        and = {
                            rare_materials = 1500
                            ic = 100
                        }
                    }
                }
                or = {
                    and = {
                    control = { province = 1086 }
                    not = { flag = 1086_RE } #Esfahan
                    }
                }
            }
        }
    }
    date = { day = 0 month = 0 year = 1930 }
    offset = 2                                    
    deathdate = { day = 0 month = 0 year = 1970 }
    
    name = "Resource Expansion"
    desc = "The current lack of strategic resources had resulted in a large price jump in the private market, with wealthy investors stepping in to increase our national production."
    picture = "resources"
    style = 2

    action = {
        trigger = {
            resource_shortage = oil
            or = {
            }
        }
    }
    
    action = {
        trigger = {
            resource_shortage = energy
            or = {
            }
        }
    }
    
    action = {
        trigger = {
            resource_shortage = metal
            or = {
            }
        }
    }
    
    #Esfahan
    action = {
        trigger = {
            resource_shortage = rare_materials
            not = {
                or = {
                    and = {
                        rare_materials = 50
                        ic = 5
                    }
                    and = {
                        rare_materials = 400
                        ic = 25
                    }
                    and = {
                        rare_materials = 650
                        ic = 45
                    }
                    and = {
                        rare_materials = 800
                        ic = 60
                    }
                    and = {
                        rare_materials = 1000
                        ic = 80
                    }
                    and = {
                        rare_materials = 1500
                        ic = 100
                    }
                }
            }
            and = {
                control = { province = 1086 }
                not = { flag = 1086_RE} #Esfahan
            }
        }
        name = "Our Rare Metal Industry has expanded"
        command = { trigger = {    and = {    control = { province = 1086 } not = { flag = 1086_RE} } } type = add_prov_resource which = 1086 value = 2 where = rare_materials } #Esfahan
        command = { trigger = {    and = {    control = { province = 1086 } not = { flag = 1086_RE} } } type = setflag which = 1086_RE } #Esfahan
    }
}

@ Burning: I have some re-updated files based off the current latest released version which integrates CCIP changes, do you want them? It'd be good to merge them into the official version so I don't need to reupdate them if you change the files (world_names.csv, revolt.txt, and country.csv).

I'm not sure if I will finish a release by 1/1/2012 anymore, but I'll try. I had a killer headache today staring at the computer screen. I'll be visiting my mom's in MA from the 5th to 12th though with nothing else to do but mod, so there should be a release soon regardless if I delay it or not, I've been trying to quash a bug with events not firing (well...they don't fire in offhand games anyway when not explicitly triggered).

Into which event file should we place this snippet of code to get it to run? Right now in my current Germany game the entire world is short on rares due to the massive IC buildup that everyone did including me. Thanks.
 
Hey all. I just got to 1936 as Ger and the mod is playing very well. Mussolini came up on time and the Hitler events fired ok. The invasion of Manchuria worked very well also. I do have a question about the Hitler events though. Before if you went Fascist before 1933 the Hitler events did not work right and you were without Hitler and the Anschluss and Munich, oh and Molotov. So the events leading to a Fascist Ger go Right wing move one to the right, then Authoritarian move one to the right. So since I was waiting for 1933 to come the move Right wing fired right after 1933 got here and the move Authoritarian did not come until 1934 so Hitler and his regime were a little late. My question is this. Does anyone know if you still have to wait until 1933 to go Fascist because of the event problem? I can experiment with it of course but, if anyone knows could you please tell me to save time. Thanks.

L I am ready when you are to test the new CCIP stuff. It is gonna be great.

Sorry for the sorta double post but the one above was not on my pc when I checked. I posted it last night before going to sleep and this one this morning.
d

No problem about Germany - Hitlers event will not fire too early, you will definitely get him on time. If you become Fascist too early, or if the Kapp-Putsch succeeds, you will just become GER earlier. In 1932, you might then get Hitler, if you made germany become fascist.


Into which event file should we place this snippet of code to get it to run? Right now in my current Germany game the entire world is short on rares due to the massive IC buildup that everyone did including me. Thanks.

Err, as far as i see, this is pseudo code, so it will need some refinement before it will actually work. Better wait for the great depression to kick in, and... solve the industrial collapse. However, I'll keep you updated on this, so you can try out what we were thinking about, and see if it works properly.

Congratulations for winning as Mod of the Month for January 2012!

Please write a short description of your Mod that will be used to advertise it. :)
Boa, cool! Thank you all, who have voted for the mod! That's really motivating for everybody who has put effort into the mod! I'll write something up!
 
Last edited:
I happen to experience in every AAR game that Germany charges deep into France during the year 1915 and over half of their army in the western front get trapped and destroyed. They're doing ok against the Russians, pocketing some dozens of their divisions but after suiciding 40 divisions in the west, the French soon are in Berlin and the war ends before there even was a revolution in Russia. :/
 
Err, as far as i see, this is pseudo code, so it will need some refinement before it will actually work. Better wait for the great depression to kick in, and... solve the industrial collapse. However, I'll keep you updated on this, so you can try out what we were thinking about, and see if it works properly.

Thanks for that. A thought has come to mind to me from playing Iron Cross. One of the things they have in the tech tree is the choice of some free (offmap) resources of all types aside from supplies. The other idea that comes out of there is probably more along the lines of what you are thinking, and just provides a smallish (+2%) bonus to resource production of one particular kind of resources.... but limited it to Africa to represent the finding of new resources. You might even want to provide a version of the random event as a decision... but just increase the resources/cost needed to implement it. Maybe like the sturdy/jungle/winter/desert equipment decision, but instead start/stop the conversion of metal and oil/coal to rare materials. I'm not a great coder but sometimes ideas help a lot. I've really enjoyed this mod so far.

EDIT:
Took a look at the modding documents and found this

# INDUSTRIAL MODIFIERS
#
# Industrial multipliers
# E.g. energy_to_oil 4 means four energy are needed to produce one oil. 0.5 means 1 energy produces 2 oil.
type = industrial_multiplier which = [energy_to_oil/oil_to_rare_materials] value = [X] }

Might help you guys out.
 
How many times does the "Disarming the Army" eveny occur? It's getting really annoying to have my units as the U.S. get destroyed every few months...

I have the same issue, and with the naval conference events.
 
Hey! Really excited to try this mod out, having a little trouble starting it however.
When I'm trying to launch the scenario, I get a problem saying something along the lines "error with line 'wakeminister' in the AAR-GEr-Germany.txt" file. That's not the exact wording but is it possible someone can help me out here? everytime i try to ignore or retry the action, it crashes the game.
Thank you!
 
Hey! Really excited to try this mod out, having a little trouble starting it however.
When I'm trying to launch the scenario, I get a problem saying something along the lines "error with line 'wakeminister' in the AAR-GEr-Germany.txt" file. That's not the exact wording but is it possible someone can help me out here? everytime i try to ignore or retry the action, it crashes the game.
Thank you!

Seems like your DH-installation is broken, if you are missing the minister 1 (adolf). What gameversion are you running? Please unpacked AAR on top of a copy of darkest-hour full, and check where your dh-installation is located.
 
I have the same issue, and with the naval conference events.

Same, though also when it comes to the disarmament events fire, they don't occur for the US and its airforce, therefore the US has an airforce almost the size of the British navy.
Also my game continually crashes when the Commonwealth of nations fires, particularly that of Egypt..
Otherwise good work, loving this mod!
 
Your not supposed to have an army.

It destroys all units, not just the "army" so what am I supposed to do, just build IC until 1930? I thought we were trying to stray from that, but I guess it's what has to be done to prevent a massive buildup in the interwar period.

Also, I hope that the Chinese Civil Wars after WWI get fixed in a future patch, it never seems to end, which hurts China considerably at the start of WWII due to the weird boundaries that form from constant Status Quos.
 
It destroys all units, not just the "army" so what am I supposed to do, just build IC until 1930? I thought we were trying to stray from that, but I guess it's what has to be done to prevent a massive buildup in the interwar period.

What you SHOULD be doing:
  • Expand your industrial base
  • Improve your infrastructure (huge task, for all nations!)
  • Build a decent airforce(warning, AAR currently does not deal with excessive airforce building!)
  • Improve your Army and navy within boundaries of the existing treaties and peacetime limitations (well, if you go beyond the boundaries, expect consequences to happen) ===> Improve does NOT mean Expand
  • Make your nation rich, collect resources
  • Increase your relations with foreign nations
  • Keep the interwar time a safer place, intervene in foreign conflicts, if you must.

Remember: The interwar period was a generally peaceful time, wars were not what you usually saw on a global scale. Usually you were at peace!


Also, I hope that the Chinese Civil Wars after WWI get fixed in a future patch, it never seems to end, which hurts China considerably at the start of WWII due to the weird boundaries that form from constant Status Quos.
The Civil war will end after the Long march is over, which is after 1934. However, i know this is kind of rough, Limith is doing something incredibly better with the CCIP!
 
Last edited:
Bump in case you forgot. :)
Nope, did not forget, just had no computer until yesterday evening. :)

How long should that text be, approximately? Just a paragraph or two, as in http://forum.paradoxplaza.com/forum/showthread.php?572567-Mod-of-the-Month-of-Darkest-Hour , or should it be a bit more detailed?

If just one or two paragraphs, then i rewrote the mods description in the main-posting:

Arms, Armistice and Revolutions (AAR) links the 1914-Scenario to the classical 1936 grand campaign, thereby offering half a century of pure political, economical and social turmoil to play. It takes care of guiding the major powers of WW2 so they can then pursue their individual, (a)historical paths in a new, Great War. Of course you may stray off the path of history and create a very different Second World War.

In contrast to many other mods, AAR aims to provide the essential parts of the scenario first, before providing a absolute historical accuracy of all the turmoil happening in the interwar period. Thus the mod initially offers a link based on a historical outcome of WW1 (Germany, Ottoman Empire & Austria-Hungary defeated), and adding all the eye candy things later on, like historical ministers and leaders. The primary objective always is to link the 1914 and 1936 scenarios and possible other alternative history timelines in an enjoyable, meaningful way to allow them function and play smoothly.
 
Last edited:
I'm enjoying some time off atm (mostly reading) while waiting for ministers (unless they are on the repo Burning?).

I'll be at my mom's from 5-12 with nothing to do but mod, so expect fun things when I get back (not sure if there will be a public release though).
 
In regards to the idea discussing dynamic resources I've been doing a little bit of coding to provide for the production of synthetic rare metals/materials through an event based on your countries ability to produce synthetic oil. Its not perfect and its not done, but I'm getting frustrated with the coding and perhaps it will help someone along.... even if it is still in the holiday season.


################################
# Rare Metals Conversion
################################

event = { #Start Rare Metals Conversion
id = 10000000
random = no
persistent = yes
TAG = { AFG ALB ALG ANG ARA ARG ARM AST AUS AZB BEL BEN BLR BOL BOS BRA BRU BUL BUR CAL CAM CAN CGX CHC CHI CHL CMB COL CON COS CRO CSA CSX CUB CXB CYN CYP CZE DDR DEN DFR EAF ECU EGY ENG EQA EST ETH EUS FIN FLA FRA GAB GEO GER GLD GRE GUA GUI GUY HOL HON HUN ICL IDC IND INO IRE IRQ ISR ITA JAP JOR KAZ KOR KUR KYG LAO LAT LBY LEB LIT LUX MAD MAL MAN MEN MEX MLY MON MOR MOZ MTN NAM NIC NIG NOR NZL OMN OTT PAK PAL PAN PAR PER PHI POL POR PRI PRK PRU QUE RHO ROM RSI RUS SAF SAL SAR SAU SCA SCH SCO SER SIA SIB SIE SIK SLO SLV SOM SOV SPA SPR SUD SWE SYR TAJ TAN TEX TRA TRK TUN TUR UKR URU USA UZB VEN VIE WLL YEM YUG U01 U02 U03 U04 U08 U09 U10 U11 U12 U13 U14 U15 U16 U17 U18 U19 U20 U21 U22 U26 U27 U28 U29 U30 U31 U32 U33 U34 U35 U40 U41 U42 U43 U44 U45 U46 U47 U48 U49 U50 U51 U52 U53 U54 U55 U56 U57 U58 U59 U67 UTC UER UPE U70 U71 U72 U73 U74 U75 U76 U77 U78 U79 U80 U81 U82 U83 U84 U85 U86 U87 U88 U89 U90 U91 U92 U93 U94 U95 U96 U97 U98 U99 }
decision = {
OR = {
money = 1
OR = {
technology = 53020
NOT = {local_flag = rare}
}
OR = {
technology = 5240
NOT = {local_flag = rare}
}
OR = {
technology = 5230
NOT = {local_flag = rare}
}
OR = {
technology = 5220
NOT = {local_flag = rare}
}
OR = {
technology = 5210
NOT = {local_flag = rare}
}
OR = {
technology = 5200
NOT = {local_flag = rare}
}
OR = {
technology = 5190
NOT = {local_flag = rare}
}

decision_trigger = {
OR = {
technology = 53020
NOT = {local_flag = rare_conversion}
}
OR = {
technology = 5240
NOT = {local_flag = rare_conversion}
}
OR = {
technology = 5230
NOT = {local_flag = rare_conversion}
}
OR = {
technology = 5220
NOT = {local_flag = rare_conversion}
}
OR = {
technology = 5210
NOT = {local_flag = rare_conversion}
}
OR = {
technology = 5200
NOT = {local_flag = rare_conversion}
}
OR = {
technology = 5190
NOT = {local_flag = rare_conversion}
}
trigger = {
NOT = {local_flag = rare_conversion}


name = "Conversion of Rare Materials"
desc = "Conversion of Rare Materials"
style = 2
picture = "ersatz_conversion"
decision_picture = "decision_ersatz_conversion"

date = { day = 1 month = january year = 1914 }
offset = 120
deathdate = { day = 30 month = december year = 1963 }

action = {
name = 10000000a
command = {trigger = { technology = 5320} type = free_rare_materials
type = metal = -
type = oil = -
 
In regards to the idea discussing dynamic resources I've been doing a little bit of coding to provide for the production of synthetic rare metals/materials through an event based on your countries ability to produce synthetic oil. Its not perfect and its not done, but I'm getting frustrated with the coding and perhaps it will help someone along.... even if it is still in the holiday season.



I was more thinking about having something along the lines of a discovery of new oilwells/mines/digsites, but still, please go ahead.
Here is what i've come up with by now, it's still a bit sketchy, but i guess you can see where this goes:

Code:
#Basics:
#================
#- make provinces countabel
#- currently only possible through VP-counting:
#  - vp = X						# Currently held Key Points + extra VP >= X
#  - range = { min = x max = x }			# true if vp is within (>= && <= the range)
#  - adjusted all provinces to have at least 1 VP, all existing VPs multiplied by 6-10 to preserve their value	
#- prevent rapid firing
#  - 60 day offset
#  - flag prevenging firing for another offset of 60 days
#  - take heavy use of 
    random = X
#    - todo: what happens if multiple randoms are set? what happens to their values?

#Trigger how:
#- priorities for certain important areas of the world, to prevent strategical areas from becoming unimportant
  area = { area = name [country = TAG/-1/-2/-3] [data = 1/2] [value = X] } # check if all provinces (value = 100 or no value) or percentage (value = X, 0..100%, cannot be less then 1 province) in the area are controlled (data = 1 or no data) or owned (data = 2) by the current country (country = -1 or no country), enemy countries (country = -2) or allied/friendly countries (country = -3)
  region = { region = name [country = TAG/-1/-2/-3] [data = 1/2] [value = X] } # check if all provinces (value = 100 or no value) or percentage (value = X, 0..100%, cannot be less then 1 province) in the region are controlled (data = 1 or no data) or owned (data = 2) by the current country (country = -1 or no country), enemy countries (country = -2) or allied/friendly (country = -3)
#- increase by resource shortages   
  resource_shortage = oil/energy/metal /rare_materials/supplies/money/all   # Returns true if there is resource shortage for that resource or for any resource when used with “all”. NOTE: This trigger is not very reliable because it is set correctly on the second game day on every game session.
#- dependant on economic policy:
#  - state controled
#    - reduced by export-only
      export = oil/energy/metal /rare_materials/supplies/money   # Returns true if Export is enabled for the given resource.
#    - increase by stockpile
      stockpile = oil/energy/metal /rare_materials/supplies/money   # Returns true if Stockpile is set for the given resource.
#  - free market
#    - increase by export
      export = oil/energy/metal /rare_materials/supplies/money   # Returns true if Export is enabled for the given resource.  
#    - reduction when high dissent
      import = oil/energy/metal /rare_materials/supplies/money   # Returns true if Import is enabled for the given resource.

#Triggger conditions:
#- individual events per resource
  - energy = x		(>=x)	#true if a nation have at least that amount of energy.
  - metal = x		(>=x)	#true if a nation have at least that amount of metal.
  - rare_materials = x	(>=x)	#true if a nation have at least that amount of rare materials.
  - oil = x			(>=x)	#true if a nation have at least that amount of oil.
  - random = X

#Event Effects
type = add_prov_resource which = [prov id/-1/-4] value = X where = [energy/metal/oil/rare_materials]  # -1 is random province, -4 is province with nuclear reactor.	
#Resource Types: 
#[oil, metal, energy, rare_materials, supplies, money, manpower]
 
3 games Ive started as Italy. All 3 WW1 failed to start. Im still in the alliance with AH. USA gets involved in Mexican Civil war and starts conquering various factions and their provinces which leaves weird borders post war.
 
What you SHOULD be doing:
Expand your industrial base
An obvious answer, but since the ic/day cost is effectively tripled not completely worthwhile.

[*]Improve your infrastructure (huge task, for all nations!)
There really is no point to this, infra has little game effect. Unless you just want to "gild the lily"

[*]Build a decent airforce(warning, AAR currently does not deal with excessive airforce building!)
Build airfields and naval bases both of which are severely lacking.

[*]Improve your Army and navy within boundaries of the existing treaties and peacetime limitations (well, if you go beyond the boundaries, expect consequences to happen) ===> Improve does NOT mean Expand
There is no army to improve. It keeps getting destroyed.

[*]Make your nation rich, collect resources
Meh

[*]Increase your relations with foreign nations
Or just annex them ;)

[*]Keep the interwar time a safer place, intervene in foreign conflicts, if you must.
Intervention is a must, of course. Gotta have my fun. :p