Unit type production bonus

Baskedyt

Concerned citizen
Joined
Nov 22, 2005
Messages
130
Location
The Kingdom of Denmark
Is it possible to change to code so that you can make buildings that give production bonus to certain unit types? (ie. melee, archer, tracked etc.)

Background.
I was looking for a way to use current resources as strategic resources, and my first choice was Hemp which were/are used for ropes that are a very significant part of sail ships. So I made a Ropemaker building (based on shipyard) which req Hemp, but I wanted it only to give bonus to wooden ship types. But at this time you can only give unit production bonus to either all military units or domain based (land/sea/air).
So is the a way to change the code so that you can make unit production bonus to certain unit types? Other ideas for the use of this feature is listed below.

Ideas:
(only the unit type is listed. The amount of production bonus or other properties of the building can be discussed later)
Ropemaker - wooden ships
Armorer - Melee
Archery range - Archer
Stable - Mounted
Gunsmith - Gunpowder
Manufacturing Plant (Steel Mill?) - Wheeled, Tracked
Nanofactory - Hightech,
Cloning Factory - Clone Units

Of course it would increase the need for these buildings if the cost of units were elevated a bit ;)
 
There already is a function pretty similar to what you want. I just grabbed the shipyard's code, since I remembered that it had it, but here's the line you might be looking for.

Code:
			<DomainProductionModifiers>
				<DomainProductionModifier>
					<DomainType>DOMAIN_SEA</DomainType>
					<iProductionModifier>50</iProductionModifier>
				</DomainProductionModifier>
			</DomainProductionModifiers>
 
@Afforess

He said that domain production modifier is not specific enough. He wanted building that gives bonus only to Wooden ships, not all the other ship types and for this purpose the domain production modifier doesn't work.

@Baskedyt

There's no xml modifiers for what you request but there is unit cost python function which is in RoM used for specific civics to achieve just about the same what you are asking. Though making the same thing work with cities with specific buildings might be bit trickier to make but certainly not impossible.
 
Is it possible to change to code so that you can make buildings that give production bonus to certain unit types? (ie. melee, archer, tracked etc.)

Ideas:
(only the unit type is listed. The amount of production bonus or other properties of the building can be discussed later)
Ropemaker - wooden ships
Armorer - Melee
Archery range - Archer
Stable - Mounted
Gunsmith - Gunpowder
Manufacturing Plant (Steel Mill?) - Wheeled, Tracked
Nanofactory - Hightech,
Cloning Factory - Clone Units

Of course it would increase the need for these buildings if the cost of units were elevated a bit ;)

One way to do it is make new resources. rope example : you make a new resource called rope (Bonusinfos.xml). it is a manufactured resource and is produced by your ropemaker building (Buildinginfos.xml). Then you add the resource to the units the same way I added gold etc to my warlords (Unitinfos.xml)

Code:
	<BonusProductionModifiers>
		<BonusProductionModifier>
			<BonusType>BONUS_ROPE</BonusType>
			<iProductonModifier>25</iProductonModifier>
		</BonusProductionModifier>
	</BonusProductionModifiers>

This will give the unit a 25% production bonus from Rope.


This is not an fast and simple way though. Takes hours of work for all your examples. But can all be done in xml (which makes it fairly easy IMO compared to python/sdk) ;)
 
Why not just make each of the wooden ship have a construction bonus from hemp directly? Saves the trouble of new resources, gives the production speed bonus and makes hemp a very attractive resource.
 
Why not just make each of the wooden ship have a construction bonus from hemp directly? Saves the trouble of new resources, gives the production speed bonus and makes hemp a very attractive resource.


Because his request was:

"I want to make new buildings that add to production speed."
 
Well, the idea about hemp giving a production bonus towards each wooden ship is certainly useful - I didn't think of that until I remembered the bonuses towards Spearman.

But is it then possible to make a resource only available in the city, where the building producing, it is located? I know it's possible with corporations.
Because then, for instance, with the wheeled/tracked units I can then make manufacturing plant make a resource, lets call it "Armour", that gives a production bonus towards all the wheeled/tracked units. But the resource won't be available to all other cities, only the cities that has build a manufacturing plant.

P.S. I'm on vacation until Friday 17th, so I won't reply until next weekend.
 
Well, the idea about hemp giving a production bonus towards each wooden ship is certainly useful - I didn't think of that until I remembered the bonuses towards Spearman.

But is it then possible to make a resource only available in the city, where the building producing, it is located? I know it's possible with corporations.
Because then, for instance, with the wheeled/tracked units I can then make manufacturing plant make a resource, lets call it "Armour", that gives a production bonus towards all the wheeled/tracked units. But the resource won't be available to all other cities, only the cities that has build a manufacturing plant.

P.S. I'm on vacation until Friday 17th, so I won't reply until next weekend.

In Civ 4 all resources are available to all connected cities. In Civ 3 there were two types of resources national and local which allowed this sort of thing. There is a mod "Vicinity Bonus" which sort of allows what you want but it has not been merged as it is SDK.
 
Well, the idea about hemp giving a production bonus towards each wooden ship is certainly useful - I didn't think of that until I remembered the bonuses towards Spearman.

But is it then possible to make a resource only available in the city, where the building producing, it is located? I know it's possible with corporations.
Because then, for instance, with the wheeled/tracked units I can then make manufacturing plant make a resource, lets call it "Armour", that gives a production bonus towards all the wheeled/tracked units. But the resource won't be available to all other cities, only the cities that has build a manufacturing plant.

P.S. I'm on vacation until Friday 17th, so I won't reply until next weekend.

Could this not be achieved with a national wonder which gives a production bonus for units of that type produced in the city its built in?
 
Buildings and (National) Wonders is from the same BuildingInfo.xml file, so a wonder will not do any difference. I've looked through the file and I can't find any parameter that would give a resource only to the city the building its produced in. There is a <nobonus> that removes a certain resource from the city - which is used in the NW National Park.

But the corporation Aluminum Co and Standard Ethanol gives a resource (Aluminum and Diesel) only in the city were the corporation is located.
So the function exist, but my problem is now how this function can be transfered from corporations to buildings/wonders.

But until then I'll just make some expensive building that produces a resource which gives a production bonus.
 
Back
Top Bottom