Sid Meier's Civilization V

Sid Meier's Civilization V

评价数不足
Buildings require empire resources [snippet for mod makers]
   
奖励
收藏
已收藏
取消收藏
文件大小
发表于
更新日期
2.653 KB
2014 年 6 月 15 日 上午 7:38
2014 年 7 月 30 日 下午 3:38
2 项改动说明 ( 查看 )

订阅以下载
Buildings require empire resources [snippet for mod makers]

在 Machiavelli 的 1 个合集中
Machiavelli's snippets for mod makers
6 件物品
描述
For mod makers.

What it does
This mod contains code that defines two new XML tables. By adding entries to these tables mod makers can have Buildings that can only be built if the player has access to resources somewhere in their empire. Unlike the "Building_LocalResource" tables the resources do not have to be within the city's limits. Unlike "Building_ResourceQuantityRequirements" the resource is not consumed.

If an end-user is playing with multiple mods that use this snippet it will work properly.

Compatibility
This code is compatible with Vanilla, Gods & Kings, and Brave New World.

How to incorporate into your mod
Copy the "Building_EmpireResources" directory and all its contents to your mod. Have the XML file update the database (via the Action tab) and set the LUA file as an "InGameUIAddin" (via the Content tab).

Make sure the XML files from this snippet that create the table update the database before any files attempt to add entries into the tables for this snippet.

How to use
Add entries to one of the tables: Building_EmpireResourceAnds, Building_EmpireResourceOrs.

How it works
The LUA adds a PlayerCanBuild check that tests to see if the player has the required resources to build the building.

Known limitations
If the player does not have the required resources to build a specific building, that building will not show up on the list at all. As opposed to showing up but greyed out.

CivFanatics Download[forums.civfanatics.com]
8 条留言
Xarsus 2015 年 2 月 26 日 上午 6:45 
Hey, is it possible to make Buildings that using Building_EmpireResourceOrs to show up at City Building Panel when civ does not have the resources? Just like Building_LocalResourceOrs when your city has the resource near but not the improvement for it
ciblin 2014 年 8 月 11 日 上午 3:08 
I lied I cannot figure it out.
ciblin 2014 年 6 月 16 日 下午 1:20 
Yes that sounds easy enough. I'll try it in my mod MAD.
Machiavelli  [作者] 2014 年 6 月 16 日 上午 7:51 
In most cases the answer would be no (or at least not without DLL modding). There isn't a structure in place for turning on or off the effects of buildings. Depending on what conditions could turn a building on or off, it could be mimicked by adding or removing a second building that had the special advanced effect.
zArkham4269 2014 年 6 月 16 日 上午 7:45 
Is there a way that a building could be built but would only have it's special "powers" active if certain conditions where met. In the recent Blackfoot mod, their shrine requires a river or oasis which can put them at a disadvantage. I thought it would be nice if you could always built it (like a normal temple) but it's special attirubutes would only apply if there was fresh water.
Machiavelli  [作者] 2014 年 6 月 16 日 上午 5:39 
A unit that can only be built if a player has a specific resource but the unit itself does not use up any quantities of that resource? That would be simple, it would be 90% the same code with a PlayerCanTrain check at the end. Using the existing code in this mod as a starting point do you think you would be able to implement it yourself?
ciblin 2014 年 6 月 16 日 上午 3:38 
Can you make this apply to units?
Ulixes 2014 年 6 月 15 日 下午 2:56 
I've no words, amazing...