Can this be done without DLL editing?

isnorden

Amnesiac Modder
Joined
Jul 6, 2012
Messages
608
Location
Madison, Wisconsin, USA
As soon as I get the kinks out of my new resources code, I'd like to update the brewery building that I've already modded in. Instead of just generating Gold the way it does now, I plan on making these changes:

  1. Have the Brewery turn out Beer (a new luxury resource) as long as there's a Barley farm within the city limits. (I was thinking of adding a fresh-water restriction too, since real-life brewers are picky about the water they use as a base ingredient--but having three restrictions would make a relatively common luxury too difficult to produce.)
  2. Add a second, hidden and indestructible freebie building to the Brewery (for now, I've christened it the Annex). This phantom building would generate Mead (a second luxury resource) as long as Honey plantations existed within the city limits.
  3. Improve the Brewery and its Annex when the player has researched Refrigeration: either product yield, a Gold bonus, or both. (A brew that stays cold longer stays fresh longer, and brings a higher price.)



Thanks to several of you, I learned where to check for some code that would help with upgrades #1 and #2. Upgrade #3, though, is another matter: can any existing manufactured resources be improved by mastering a technology? If any mod for Civ5 has code I could use as a starting point, please let me know!
 
1. What is a barley farm? You should be able to do this, since there are buildings in the base game that require upgraded resources. Just look at the table for that.

2. You should be able to add the annex with <FreeBuilding> (like wonders), <NukeImmune>, etc. tags. Making it invisible has been done before, see CivUP.

3. There is a table for increasing the yield of buildings based on tech researches. Cf. Mughal Fort, Petra, etc.
 
1. What is a barley farm? You should be able to do this, since there are buildings in the base game that require upgraded resources. Just look at the table for that.

Barley (a Farm-improved crop) and Honey (a Plantation-improved crop) will both be new resources in the upgraded mod. The Brewery building will need worked Barley for the Beer resource. Moving right along... :-)

trystero49 said:
2. You should be able to add the annex with <FreeBuilding> (like wonders), <NukeImmune>, etc. tags. Making it invisible has been done before, see CivUP.

Thank you--do you know which files in the Unofficial Patch have the code I need? I'd appreciate that help a lot!

trystero49 said:
3. There is a table for increasing the yield of buildings based on tech researches. Cf. Mughal Fort, Petra, etc.


Oh, good; another user told me that it couldn't be done without adding more SQL/Lua to the game. Since my SQL is nonexistent and my Lua is very rusty, I'm glad that there's pre-existing code to handle the building upgrade. Thanks so much! :goodjob:
 
You need the CityView.lua file (make sure you set VFS = true) and you'll need part of the NewColumns.sql (the part that adds the <IsVisible> column to the Buildings Table). Then you can set IsVisible to 0 (false) so that they don't show up in the city screen (1/true is default).

For making them invisible in the civilopedia, check out the thread that I started (it's called something like "Make Buildings Invisible in Civilopedia", in the main C and C forums.

Also, I make a mistake about <FreeBuilding>; I'm pretty sure the tag is <FreeBuildingInCity>, not <FreeBuilding>. Wonders (like the GL) use it, so it should work for your building too.
 
You need the CityView.lua file (make sure you set VFS = true) and you'll need part of the NewColumns.sql (the part that adds the <IsVisible> column to the Buildings Table). Then you can set IsVisible to 0 (false) so that they don't show up in the city screen (1/true is default).

For making them invisible in the civilopedia, check out the thread that I started (it's called something like "Make Buildings Invisible in Civilopedia", in the main C and C forums.

Also, I make a mistake about <FreeBuilding>; I'm pretty sure the tag is <FreeBuildingInCity>, not <FreeBuilding>. Wonders (like the GL) use it, so it should work for your building too.

Thanks again; I've spent literally hours tonight looking for the relevant code in CivUP. You've been a major help to a modder who's still learning the ropes. :thanx: :worship:
 
Back
Top Bottom