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.