Quick Modding Questions Thread

* If I make a national wonder that obsoletes, once it is obsolete, will it count against the total number of national wonders allowed in that city?

Yes. The obsolete wonder will still count, and thus can block you from building a new wonder to replace it.

(I haven't actually tested this; I just checked it in the code because I was curious about it.)
 
i just noticed my musketmen have the ability to gain the interception promotion. no other unit that isnt supposed to have the promotion is eligible to take it. as far as i can tell the promotion in my mod as well as the unit's unitinfo are exactly the same as vanilla BTS'. how can i remove the promtion from my musketmen? also what prevents unit's like the Infantry from being able to take that promotion seeing as its 'available' to gunpowder units according to the promotion's XML?

EDIT: ok it appears as though all the units who SHOULD get the promotion cant get it and vice-verse.... is this an SDK problem?
 
@DeathMaker900

Usually (ie. in vanilla BtS), musketmen and infantry are blocked from getting the interception promotion by the following rule in the dll:
Code:
	if (kUnit.getInterceptionProbability() == 0)
	{
		if (kPromotion.getInterceptChange() != 0)
		{
			return false;
		}
	}
This rule is checked along side all the other promotion eligibility rules. So, for a unit to be eligible for the interception promotion, it needs to have some non-zero chance of interception already. (Note: a negative inception chance would satisfy this rule.)
 
It does, just not immediately.
The cost of the settler is somewhere set in the SDK, so that it can scale better with the different map options. The iCost value is IIRC just a number of additional hammers which is needed, ontop of that calculation. So you'd need C++ coding to really change something there.
 
Ok I am investigating my food resource idea again, I have 1 and a half questions,

1. is there a good thread that shows what the different tags in the buildinginfos does and how to implement them?

2. Failing that I have looked at a few of the tags, and I am trying to figure out if or which is the one I want.

<Bonus>NONE</Bonus>
<FreeBonus>NONE</FreeBonus>
<BonusHealthChanges/>
<BonusHappinessChanges/>
<BonusProductionModifiers/>
<BonusYieldModifiers/>

So what I want to do is have 1 building that has a negative effect on food, but produces a food resource, then another building that uses food resources to add food to the city in which it is built, like a corporation building does.

I am just not sure which if any of the tags will help me achieve that and if they would how to properly write it?

Oh I get the health and happiness ones add that for a resource, I was just curious how to code it properly.
 
1) the modiki :mischief:?

2)
Bonus: You need a resouce for this building
FreeBonus: Hollywood, Rock'n Roll, Broadway
BonusHealth/BonusHappinessChanges: e.g. the wheat for the granary
BonusProductionModifiers: Building is build faster if resource is available (e.g. Statue of liberty with copper)
BonusYieldModifiers: More production if a resource is available, e.g. Iron Works

What you want is not available in standard BtS, but there is somewhere a SDK modcomp which would do it.
 
hey guys, i'm balancing some of the units right now and decided to make the archers available to perform a range attack but i don't want them to become too powerful so i was wondering:
is it possible to make them perform a ranged attack only if the enemy is standing on the 2nd tile away from them?
 
I'm going to add an "Utopia Project" into my mod 2100.
It will be very costly,but it has many positive effects.
I will need codes for this:
-Removes unhappiness from all cities in the WORLD
-All AIs become friendly to the player
-Nobody can declare war on anyone
Would that be possible?
Thank you!
 
1) Where i can change corporations (not XML) because this is in XML:
PHP:
			<PrereqBonuses>
				<BonusType>BONUS_CORN</BonusType>
				<BonusType>BONUS_SUGAR</BonusType>
				<BonusType>BONUS_RICE</BonusType>
			</PrereqBonuses>
			<HeadquarterCommerces>
				<iHeadquarterCommerce>4</iHeadquarterCommerce>
				<iHeadquarterCommerce>0</iHeadquarterCommerce>
				<iHeadquarterCommerce>0</iHeadquarterCommerce>
			</HeadquarterCommerces>
			<BonusProduced>BONUS_OIL</BonusProduced>
			<CommercesProduced>
This is for Standard Ethanol and mean:
Consumes: Corn, Sugar, Rice.
Generate: Oil.
Where is "Competes with: Cereal Mills, Sid's Sushi Co" Python or SDK or game random make competes depending on what the other corporations generate and what is consumed?

2)In PythonCallbackDefines.xml i can see this for example:
PHP:
	<Define>
		<DefineName>USE_CANNOT_FOUND_CITY_CALLBACK</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>
	<Define>
		<DefineName>USE_CAN_FOUND_CITIES_ON_WATER_CALLBACK</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>
	<Define>
		<DefineName>USE_IS_PLAYER_RESEARCH_CALLBACK</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>
	<Define>
		<DefineName>USE_CAN_RESEARCH_CALLBACK</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>
but if i set USE_CAN_FOUND_CITIES_ON_WATER_CALLBACK on 1, settlers can build cities on water? And what does all this do in this file and what mean?
 
So Privateers were too much fun, I decided to make more units able to attack without a DOW.
This works fine for other Naval units (specifically, a new class of submarine units) - but I'm having a bit of trouble with land and air units.

I added a "drone" with a hidden nationality that can attack enemy units without a war dec... the problem is, I can't use it to bomb cities or improvments - just damaging enemy units - sure its a little useful... but not much - if there is no way, then I'll make the drones able to kill units, but thats not what I want ideally.

I also made a gunpowder unit (limited to a maximum of 5 per player), and made it such that it can go into enemy territory (invisible to most units, but not marines, spies, and workers), it will attack and kill enemy units, pillage improvements, etc...
But I don't want it to be able to capture cities (This would be OP'd I think), but now I can't even attack enemy units in cities - would this be resolved by removing the invisible condition? I want it to behave like a helicopter unit- can wipe out city defenders, can't capture a city.
 
1) Where i can change corporations (not XML) because this is in XML:
PHP:
			<PrereqBonuses>
				<BonusType>BONUS_CORN</BonusType>
				<BonusType>BONUS_SUGAR</BonusType>
				<BonusType>BONUS_RICE</BonusType>
			</PrereqBonuses>
			<HeadquarterCommerces>
				<iHeadquarterCommerce>4</iHeadquarterCommerce>
				<iHeadquarterCommerce>0</iHeadquarterCommerce>
				<iHeadquarterCommerce>0</iHeadquarterCommerce>
			</HeadquarterCommerces>
			<BonusProduced>BONUS_OIL</BonusProduced>
			<CommercesProduced>
This is for Standard Ethanol and mean:
Consumes: Corn, Sugar, Rice.
Generate: Oil.
Where is "Competes with: Cereal Mills, Sid's Sushi Co" Python or SDK or game random make competes depending on what the other corporations generate and what is consumed?

2 corporations compete with each other if they use the same resources. So you have to assign other resources if you want 2 corps in the same city.

2)In PythonCallbackDefines.xml i can see this for example:
PHP:
	<Define>
		<DefineName>USE_CANNOT_FOUND_CITY_CALLBACK</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>
	<Define>
		<DefineName>USE_CAN_FOUND_CITIES_ON_WATER_CALLBACK</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>
	<Define>
		<DefineName>USE_IS_PLAYER_RESEARCH_CALLBACK</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>
	<Define>
		<DefineName>USE_CAN_RESEARCH_CALLBACK</DefineName>
		<iDefineIntVal>0</iDefineIntVal>
	</Define>
but if i set USE_CAN_FOUND_CITIES_ON_WATER_CALLBACK on 1, settlers can build cities on water? And what does all this do in this file and what mean?

All entries in this file activate Python functions, which are deactivated (because the game is faster if they are deactivated).
If you activate them, additional Python can be added to the game.

Not sure if setting USE_CAN_FOUND_CITIES_ON_WATER_CALLBACK to 1 will allow you to found cities on water. Might need some Python, but you should try it first, if it works without other changes.

I added a "drone" with a hidden nationality that can attack enemy units without a war dec... the problem is, I can't use it to bomb cities or improvments - just damaging enemy units - sure its a little useful... but not much - if there is no way, then I'll make the drones able to kill units, but thats not what I want ideally.

The problem: If you pillage an improvement, then somebody will get money from the pillaging. And that doesn't make sense if the unit has hidden nationality.
:)hmm: I'm not sure if the privateer can pillage fishing boats)

I guess to change that, you'd have to make some modifications in the SDK.

I also made a gunpowder unit (limited to a maximum of 5 per player), and made it such that it can go into enemy territory (invisible to most units, but not marines, spies, and workers), it will attack and kill enemy units, pillage improvements, etc...
But I don't want it to be able to capture cities (This would be OP'd I think), but now I can't even attack enemy units in cities - would this be resolved by removing the invisible condition? I want it to behave like a helicopter unit- can wipe out city defenders, can't capture a city.

Yes, the invisible condition should be the cause of your problem.
 
Thank you The_J

CIV4ProjectInfo.xml:
Spoiler :
<Type>PROJECT_MANHATTAN_PROJECT</Type>
<Description>TXT_KEY_PROJECT_MANHATTAN_PROJECT</Description>
<Civilopedia>TXT_KEY_PROJECT_MANHATTAN_PROJECT_PEDIA</Civilopedia>
<Strategy>TXT_KEY_PROJECT_MANHATTAN_PROJECT_STRATEGY</Strategy>
<VictoryPrereq>NONE</VictoryPrereq>
<TechPrereq>TECH_FISSION</TechPrereq>
<AnyonePrereqProject>NONE</AnyonePrereqProject>
<iMaxGlobalInstances>1</iMaxGlobalInstances>
<iMaxTeamInstances>-1</iMaxTeamInstances>
<iCost>1500</iCost>
<iNukeInterception>0</iNukeInterception>
<iTechShare>0</iTechShare>
<EveryoneSpecialUnit>NONE</EveryoneSpecialUnit>
<EveryoneSpecialBuilding>SPECIALBUILDING_BOMB_SHELTER</EveryoneSpecialBuilding>
<bSpaceship>0</bSpaceship>


CIV4BuildingInfos.xml:
Spoiler :
<BuildingInfo>
<BuildingClass>BUILDINGCLASS_BOMB_SHELTER</BuildingClass>
<Type>BUILDING_BOMB_SHELTER</Type>
<SpecialBuildingType>SPECIALBUILDING_BOMB_SHELTER</SpecialBuildingType>
<Description>TXT_KEY_BUILDING_BOMB_SHELTER</Description>
<Civilopedia>TXT_KEY_BUILDING_BOMB_SHELTER_PEDIA</Civilopedia>
<Strategy>TXT_KEY_BUILDING_BOMB_SHELTER_STRATEGY</Strategy>
<Advisor>ADVISOR_MILITARY</Advisor>
<ArtDefineTag>ART_DEF_BUILDING_BOMB_SHELTER</ArtDefineTag>
<MovieDefineTag>NONE</MovieDefineTag>
<HolyCity>NONE</HolyCity>
<ReligionType>NONE</ReligionType>
<StateReligion>NONE</StateReligion>
<bStateReligion>0</bStateReligion>
<PrereqReligion>NONE</PrereqReligion>
<PrereqCorporation>NONE</PrereqCorporation>
<FoundsCorporation>NONE</FoundsCorporation>
<GlobalReligionCommerce>NONE</GlobalReligionCommerce>
<GlobalCorporationCommerce>NONE</GlobalCorporationCommerce>


I can't build bomb shelter while I do not finish MANHATTAN_PROJECT. I can do similar like this for some magic project and magic buildings.

Where is defined Nuclear weapon ban/unban?

When i finish MANHATTAN_PROJECT i can build NUKES, where i can change that, for example need some another project for nukes?
 
Not sure if setting USE_CAN_FOUND_CITIES_ON_WATER_CALLBACK to 1 will allow you to found cities on water. Might need some Python, but you should try it first, if it works without other changes.

It is set to false by default.
Setting the callback to 1 will just activate it, which still returns false.
Still have to change it to true
 
Top Bottom