群星
ParaWikis
最新百科
都市天际线2百科
英雄无敌3百科
维多利亚3百科
奇妙探险队2百科
罪恶帝国百科
英白拉多:罗马百科
热门百科
群星百科
欧陆风云4百科
十字军之王2百科
十字军之王3百科
钢铁雄心4百科
维多利亚2百科
ParaWikis
申请建站
ParaWikis
ParaCommons
最近更改
随机页面
加入QQ群
工具
链入页面
相关更改
特殊页面
页面信息
页面值
阅读
编辑
编辑源代码
查看历史
讨论
编辑“
Modifiers
”(章节)
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
== Economic Categories == Modifiers effecting resource costs, production and upkeeps are created using Economic Categories. Economic Categories are defined in "common\economic_categories". Every ''resource = { ... }'' block in the script is assigned one of these categories. For each categoory, modifiers can be created that multiply or add to the resource cost, upkeep or production of game objects. === Hierarchy === Most Economic Categories are assigned a ''parent''. This forms a hierarchical tree out of the modifiers. Any modifier created for that category or any of its parent categories will then effect the resource cost/production/upkeep of any resources in that block. For instance, ''planetary buildings'' are usually assigned to the resource category ''planet_buildings'', which is a child of ''planet_structures'' > ''planets'' > ''country''. So any modifier that starts with ''planet_buildings_xxxx'', ''planet_structures_xxxx'', ''planets_xxx'', or ''country_xxxx'' will effect that building. === Economic Type === Each category can effect the ''cost'', ''production'', and ''upkeep'' of a resource. '''Cost''' is the initial cost for that object. The cost to build a building, the cost to start the terraforming, etc. '''Production''' is the monthly resource production of the object. The monthly production of the pop job, the monthly production of the building, etc. '''Upkeep''' is the monthly upkeep cost for that object. The monthly upkeep cost of the pop job, the monthly upkeep cost of the building, etc. === Resource Type === A single modifier will either effect a single type of resource, or will apply to all of the resources of that Economic Type. ''planet_buildings_cost_mult'' will effect all the resource costs of buildings, while ''planet_buildings_minerals_cost_mult'' will only effect the mineral costs of buildings. So, if a building cost 400 minerals and 100 food to build, ''planet_buildings_cost_mult'' would effect the cost of both the minerals and food, while ''planet_buildings_minerals_cost_mult'' would only effect the minerals cost, leaving the food cost at 100. === Modifier Type === There are two types of modifiers created: ''mult'' and ''add''. === Triggered Economic Units === Sometimes you'll want more specific modifiers without actually creating a child category. For instance, ''planet_jobs'' breaks jobs into smaller categories, such as planet_farmers. So farmer jobs will assign ''planet_farmers'' as their category in their resource block. Now any ''planet_jobs_xxxx'' as well as any ''planet_farmers_xxxx'' modifiers will effect the farmers. But sometimes you want modifiers to only effect a job if some condition is met, or you might want a job to have more than one parent that effects it. These are both accomplished with ''triggered economic units'' What if you want a modifier that specifically only effects the resource production when a slave is working the job? Then you use ''triggered_produces_modifier'' blocks to trigger that modifier only when the trigger conditions are met. <nowiki> planet_jobs = { parent = planets triggered_produces_modifier = { key = planet_jobs_slave modifier_types = { mult } trigger = { is_pop_category = slave } } } </nowiki> What if you want a modifier that acts as if it is effected by more than one parent? For instance, Vanilla defines ''planet_districts_hab_industrial'' and ''planet_districts_industrial''. You decide you want to create a civic that makes all industrial districts 10% cheaper, so you have ''planet_districts_industrial'' generate ''mult'' modifiers for ''produces'', and in the civic use ''planet_districts_industrial_costs_mult = -0.10''. But, Habitat industrial districts are assigned to ''planet_districts_hab_industrial'' instead, so they aren't affected. Change their parent to ''planet_districts_industrial'' instead of ''planet_districts'', and the modifier now applies to them. But now you want to make the Voidborne Ascension Perk make all Habitat districts 10% cheaper. You could make a new Economic Category ''planet_districts_hab'' and assign all the ''planet_districts_hab_xxxx'' categories to it, but you already have assigned ''planet_districts_hab_industrial'' to ''planet_districts_industrial''. What you can do instead, is make ''planet_districts_hab'' a triggered econmic unit of ''planet_districts'', and ''planet_districts_hab_costs_mult = -0.10'' will now make all the districts on Habitats 10% cheaper, while maintaining the hierarchy of your habitat industrial districts. <nowiki> planet_districts = { parent = planet_structures triggered_cost_modifier = { key = planet_districts_hab modifier_types = { mult } trigger = { uses_district_set = habitat } } } </nowiki> === Localisation and Icons === Each new modifier you have generated and is used requires localisation and most also require an icon (stored in gfx/interface/icons/modifiers) with an identical key. But not all modifiers require an icon - and those that do require an icon require it only if they are used in code somewhere that applies them as a planet or country modifier (example: on buildings, a planet_class, an ethic etc.). The key for generated modifiers is ''mod_'' appended to the front of the modifier. So for our new ''planet_districts_hab'', you'd need to define the localisation for ''mod_planet_districts_hab_costs_mult: "Habitat District Cost"'' and create the icon in "gfx\interface\icons\modifiers\mod_planet_districts_hab_costs_mult.dds". === Data Structure === * '''<key> = {...}''' - The name of this category that will be used in the ''category'' entry of a ''resources = {...}'' block. :* '''parent = <key>''' - The parent category of this category. Most Economic Categories have the ultimate parent of ''country'' :* '''hidden = yes''' - ???? :* '''generate_mult_modifiers = {...}''' - Specify ''produces'', ''upkeep'', and/or ''cost'' to create ''<key>(_<resource>)_produces_mult'', ''<key>(_<resource>)_upkeep_mult'' and/or ''<key>(_<resource>)_cost_mult'' modifiers :* '''generate_add_modifiers = {...}''' - Specify ''produces'', ''upkeep'', and/or ''cost'' to create ''<key>(_<resource>)_produces_add'', ''<key>(_<resource>)_upkeep_add'' and/or ''<key>(_<resource>)_cost_add'' modifiers :* '''use_for_ai_budget = yes''' - This category has it's own entry in "common\ai_budget\" files :* '''ai_use_parent_for_resources_upkeep = {...}''' - Specify resource(s) that the AI uses the parent to manage upkeep for in the parent category in ''common\ai_budget\''. For instance, ''ships'' alloy upkeep is managed directly (''alloys_upkeep_ships'' in "ai_budget\00_alloys_budget.txt"), but ''ships'' energy upkeep is managed via ''ships'' parent ''country'' (''energy_upkeep_country'' in "ai_budget\00_energy_budget.txt"), as ''ships'' economic category has ''ai_use_parent_for_resources_upkeep = { energy }'' :* '''triggered_(cost/produces/upkeep)_modifier = {...}''' - Generate a ''cost'', ''produces'' or ''upkeep'' modifier that only applies to a subset of this category. ::* '''key = <key>''' - The <key> for this generated modifier category ::* '''use_parent_icon = yes''' - This triggered modifier won't have it's own icon set, so use the category's icon for it ::* '''modifyer_types'' - ''mult'' and/or ''add'', depending on which you want generated ::* '''trigger = {...}''' - The trigger conditions to form this subset. The scope depends on the resource block it is assigned to.
摘要:
请注意您对群星百科的所有贡献都被认为是在知识共享署名-非商业性使用-相同方式共享下发布,请查看在
群星百科:版权
的细节。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源。
未经许可,请勿提交受版权保护的作品!
为防止机器编辑,请完成下方验证
取消
编辑帮助
(在新窗口中打开)
×
登录
密码
记住登录
加入群星百科
忘记密码?
其他方式登录