Code questions.

elistor

Warlord
Joined
Jan 12, 2008
Messages
111
First question is "Is there a way to add a resource to the game that's is only available throguh a building?"

Example: Say I wanted to add a unit to the game called the "tax collector" but wanted to limit the number of units in the game to three per "Tax office". Now I know I could just use the Building_FreeUnits to simply give them the units but I don't really want them to be a freebie. So I figured I could have the unit require a new resource the "Resource_Audit" and then introduce the resource through the tax office. That way for every tax office the player built they would get 3 "Resource_Audit" and thus be able to build 3 "tax collector". Unfortunately I can't see a way to have a building actually GIVE you a new resource, increase the number you are already getting yes but not give you a new one. Can anyone thing of another way to do what I want(Scale the number of units buildable with the number of buildings owned) or how to introduce a new resource through a building and not a plot of land.


Second question is much simpler to ask but I think much harder to do. "Is there a way to allow two unit's to work one tile, IE a Worker building a farm and a Legion building a road." I think my answer is "not until they release the code" and even then "not with XML". But I figure I may as well ask.
 
i dont see anything in any of the building tables that give a resource, so more than likely you'll have to add the resource on a plot

for workers, i'd have to say it's in the code that limits one improvement being built on a plot at a time
 
Someone did claim a while back to be able to make a building give you a resource, but when asked to explain how they did it, not reply was forthcoming... it's something I want as well.
 
This was done all the time in Civ IV mods, maybe its the same thing. I'll look at how it was done there.
 
In CIV4 buildings had the fields "FreeBonus" and "iNumFreeBonuses", where you could define a resource and the number of that resource which a building would provide. So if you did:
Code:
<FreeBonus>BONUS_IRON</FreeBonus>
<iNumFreeBonuses>1</iNumFreeBonuses>
then the building would provide you one civ-wide iron resource. But I dont see those fields in Civ5 so guess not.
 
In CIV4 buildings had the fields "FreeBonus" and "iNumFreeBonuses", where you could define a resource and the number of that resource which a building would provide. So if you did:
Code:
<FreeBonus>BONUS_IRON</FreeBonus>
<iNumFreeBonuses>1</iNumFreeBonuses>
then the building would provide you one civ-wide iron resource. But I dont see those fields in Civ5 so guess not.

Considering how much other leftover code there is from Civ4 I'll try it when i get home but I'm not expecting it to work since it's nowhere in the XML. ;-/
 
Back
Top Bottom