Sid Meier's Civilization V

Sid Meier's Civilization V

Policies Grant Buildings [snippet for mod makers]
18 Comments
Lunar Magister 22 Oct, 2019 @ 4:21pm 
Nevermind. I got it to work. It was either I had to copy the name/description, or my method of testing (Using the ingame-editor) that was faulty. When I adopted the policy without ingame editor it worked.
Lunar Magister 21 Oct, 2019 @ 9:23pm 
I have 4 lua files from your mod. Policies grant Buildings.lua, Policy_PGB_FreeBuildingClass_Table.lua, Policy_PGB_FreeBuildingClassCapital_Table.lua, and Policy_PGB_FreeBuildingClassCityState_Table.lua. I have set them all as InGameUIAddin in the content tab. All four are in a folder I called LUA.

I believe the problem must be how I arranged the folders? I don't have to import them into vhs do I? When I open your mod I see a folder called "Shared." Am I just supposed to import that into my mod?
Lunar Magister 21 Oct, 2019 @ 9:23pm 
Hello, Machiavelli. I am having difficulty incorporating this into my mod.

I have made sure to have the xml file, (PGB_TABLES.xml) update the database, and I also made it first. My mod just has 2 folders, xml and lua. PGB_TABLES.xml I have put in the xml folder.
I also put 2 GoldMerchant_Example.xml in this folder and had it update the database. The building shows up in game when spawning it with ingame editor, and I confirm that its effect works, however adopting entrepreneurship does not spawn it.

Machiavelli  [author] 27 Aug, 2019 @ 7:33am 
Yes
SuperJedi224 26 Aug, 2019 @ 5:48pm 
Does the Policy_PGB_FreeBuildingClass tag apply to cities that are founded after selecting the policy?
VICTOR 29 Oct, 2017 @ 3:21pm 
Thank you, BTW a friendly reminder, buidings granted by policies have ignored commands like prerequisite buildings (Building_ClassesNeededInCity), which makes me having a PGB in every city even w/o the prerequisite building, hope you may fix it if you have spare time ;)
Machiavelli  [author] 27 Oct, 2017 @ 8:54pm 
The 3 examples are inserted into the table by a file not in the "Policies grant buildings" directory. Delete that file, or leave it behind when you copy the "Policies grant buildings" directory into your mod to disable them.
VICTOR 27 Oct, 2017 @ 12:29pm 
How can I deactivate the default three examples?
Civitar 5 Jun, 2014 @ 12:31am 
OK. Thanks for the reply!
Machiavelli  [author] 4 Jun, 2014 @ 1:18pm 
Ender, if you want a building or unit that can not be constructed until a player has a specific policy you can use the "CanConstruct" and "CanTrain" lua functions. Just add a player.HasPolicy check if the building/unit is of the restricted class.
Civitar 4 Jun, 2014 @ 10:37am 
Very useful, thank you! Could you do a similar thing that (a) unlocks but does not grant new buildings and (b) does the same thing for units? Thank you!
ProphetSteve 28 May, 2014 @ 6:10pm 
Okay, thanks for your reply anyway :) I'll be using this code to buff up the Piety and Honor trees!
Machiavelli  [author] 28 May, 2014 @ 5:07pm 
Steve, due to some different assumptions the game makes about social policies it would be trickier to make a traits->social policies framework. I can think of a few workaround that would minimize the framework messing up a normal social policy branch but I am not sure off hand if it would be possible to do it completely cleanly.
ProphetSteve 28 May, 2014 @ 3:58pm 
I'm a beginner modder, but could you do a similar thing for this to make traits be able to use social policy xml?
HiddenSquire 27 May, 2014 @ 11:40pm 
Reform & Rule is still my favorite out of all your mods. Thanks for sharing the love.
calcul8or 24 May, 2014 @ 6:43pm 
Looks great, thank you!
Ulixes 24 May, 2014 @ 6:35pm 
Thank you. Very valuable for a mod maker, thank you again for sharing it
UncivilizedGuy 24 May, 2014 @ 4:42pm 
Thanks for this. I may use it.