This page is about modding of Economy.
Resources[编辑 | 编辑源代码]
Resources are defined at "common/strategic_resources/xxx.txt." More can be added but will not be shown without GUI modding.
Data Structure[编辑 | 编辑源代码]
- tradable = yes/no - If this resource is diplomatically tradable. Not in the market!
- max = int - The initial storage capacity of this resource.
- fixed_max_amount - yes/no - Default no. If yes, the storage capacity of this resource can't be modified by Modifiers.
- tooltip_decimals = int - Sets the decimals shown in tooltips.
- deficit_modifier = <static modifier key> - A static modifier to be applied if empire is in deficit of this resource.
- market_amount = int - Sets the minimal tradable market bulk for this resource.
- market_price = int - Sets the base price of the minimal tradable market bulk for this resource. Vanilla has 100 for each.
- ai_weight - How valuable should the AI consider this resource to be.
- ai_wants - How much the AI wants this resource.
- prerequisites - A list of technology keys to be researched before the empire can exploit this resource.
- visibility_prerequisite - A block of Conditions that determines if the empire should see this resource. Vanilla resources always have "always = yes".
How to Make my Resources Shown[编辑 | 编辑源代码]
The most easy way is to head to "interface/resource_groups/xxx.txt" and add the new resources to existing groups.
If more resource groups were added through mods, the new resource groups won't be shown without modding "interface/main.gui".
Resource Example[编辑 | 编辑源代码]
minerals = { tradable = yes market_amount = 100 market_price = 100 max = 15000 deficit_modifier = minerals_deficit #found in static modifiers ai_weight = { weight = 1 } ai_wants = { base = 1000 } }
volatile_motes = { tradable = yes market_amount = 10 market_price = 100 max = 15000 prerequisites = { "tech_mine_volatile_motes" } deficit_modifier = volatile_motes_deficit #found in static modifiers ai_weight = { weight = 10 } ai_wants = { base = 10 } }
Economy Categories[编辑 | 编辑源代码]
Economy Categories are defined at "common/economic_categories/xxx.txt." More can be added but many existing ones were hard-codely required. An economy category may determine ai behaviors or cost modifiers to apply to an economy unit. See Modifiers#Economic_Categories for a complete description.
For instance, the following economy category
rare_edicts = { use_for_ai_budget = yes parent = edicts generate_mult_modifiers = { cost } }
allows to modify cost of the following edict (only resources field below)
terraforming_gas = { resources = { category = rare_edicts cost = { exotic_gases = 25 } } }
based on the empire size : for an empire size of X, cost of the terragorming_gas edict will be 25*X
Economy Units[编辑 | 编辑源代码]
Many game objects do have a resource block called Economy Units of the following structure which determines its resource production, upkeep, and/or cost.
- category = <economy category key> - What economy category should this economy unit fall into. This economy will also be affected by modifiers related to the economy category.
- produces/upkeep/cost - Production/Upkeep/Cost statement. Multiple allowed. Depending on the game object, some of them might make no sense, for example, an empire edict do not need the produces and upkeep statements.
- trigger - A block of Conditions to determine should this statement block apply.
- <resource key> = <float> - Multiple allowed.
Economy Unit Example[编辑 | 编辑源代码]
For example, the
resources = { category = planet_researchers produces = { physics_research = 4 engineering_research = 4 society_research = 4 } produces = { trigger = { exists = owner owner = { has_valid_civic = civic_technocracy } } unity = 1 } upkeep = { consumer_goods = 2 } }
For this statement, a researcher will always produce
Trade Route[编辑 | 编辑源代码]
Trade value collection is implemented through Starbase Modifiers while piracy suppression is implemented through Ship Modifiers.
Trade Value Conversion policy is defined at "common/policies/00_policies.txt". It doesn't directly affect actual trade route conversion rate.
Trade Value Conversion rates are abstract game objects defined at "common/trade_conversions/xxx.txt".
- potential - A block of Conditions to determine should this conversion type apply. (Country scope)
- weight - If multiple conversions are valid to an empire, one with the highest weight wins.
- economic_category = <economy category key> - Economy category of this conversion. Vanilla always use "trade_routes".
- conversion_rate - A list of "<resource key> = <float>" pairs. Resource of this kind generated from trade routes every month is equal to the number provided here * collected empire trade value total.
Branch Office[编辑 | 编辑源代码]
Branch Office value algorithm is hard-coded but some parameters are defined at "common/defines/00_defines.txt".
Branch Office resource production is implemented through a Static Modifier, namely "branch_office_value". Vanilla has planet_branch_offices_energy_produces_add = 1
, which means the branch office produces
Branch Office Buildings are special buildings with the field "branch_office_building = yes". See Building modding for details.
帝国 | 帝国 • 思潮 • 政府 • 国民理念 • 起源 • 承诺 • 议程 • 传统 • 飞升天赋 • 法令 • 政策 • 遗珍 • 科技 • 自定义帝国 |
人口 | 岗位 • 派系 |
领袖 | 领袖 • 领袖特质 |
物种 | 物种 • 物种特质 |
行星 | 行星 • 行星特征 • 轨道矿藏 • 建筑 • 区划 • 行星决议 |
星系 | 星系 • 恒星基地 • 巨型结构 • 虫洞 • 星门 • 地图 |
舰队 | 舰队 • 舰船 • 部件 |
地面战 | 陆军 • 轰炸姿态 |
外交 | 外交 • 联邦 • 星海共同体 • 评价修正 • 宣战理由 • 战争目标 |
事件 | 事件 • 异常现象 • 特殊项目 • 考古遗址 |
游玩 | 游玩 • 定义 • 研究 • 经济 • 游戏开局 |
动态修改 | 动态 • 指令效果 • 触发条件 • 作用域 • 修正 • 变量 • AI |
媒体/本地化 | Maya 导出器 • 图形 • 肖像 • 旗帜 • 事件图片 • 界面 • 图标 • 音乐 • 本地化 |
Other | 控制台命令 • 存档编辑 • Steam 创意工坊 • 模组制作教程 |