Quick Modding Questions Thread

And it doesnt has a scenario in it but for the time being does work, but im definatly going to put scenarios in, but i still want custom games to work. Ik how to do it for scenarios, but not for default custom games.
You define the starting year - and the number of turns in the scenario - in the WBS file. Documentation.
Spoiler :
You need StartYear and MaxTurns under BeginGame.

Also one more thing, where do you edit the unit categories?Im like blind i cant seem to find it
You mean UnitClassTypes? That would be the Unit Class Info XML. Or do you mean like new UnitCombatTypes or DomainTypes?
 
You can find the UnitCombatTypes in ...\Sid Meier's Civilization 4\Beyond the Sword\Assets\XML\BasicInfos\CIV4UnitCombatInfos.xml

The only thing you can edit seems to be the text key tag and the button art. I guess you can add a new UnitCombatType, but I'm not sure if that does anything without also editing the Core Game Engine (the SDK).

What exactly are you looking to do?
 
You can find the UnitCombatTypes in ...\Sid Meier's Civilization 4\Beyond the Sword\Assets\XML\BasicInfos\CIV4UnitCombatInfos.xml

The only thing you can edit seems to be the text key tag and the button art. I guess you can add a new UnitCombatType, but I'm not sure if that does anything without also editing the Core Game Engine (the SDK).

What exactly are you looking to do?

Well i changed it to modern, so obviously i want to remove the old ones like archery melee mounted etc, and put in a couple others like submarine and split air units to bombers and fighters. Also change seige to artillery
 
You define some number of turns of some amount of months. Like: "The first 100 turns should be 24 month increments, then the next 50 turns should be 12 month increments, and the last 100 should be 6 months." So the first entry would have the values 100 and 24, the next would have 50 and 24, and the third would have 100 and 6.

I dunno about weeks though. You might need to define your own CalendarType also. :dunno:
 
You define some number of turns of some amount of months. Like: "The first 100 turns should be 24 month increments, then the next 50 turns should be 12 month increments, and the last 100 should be 6 months." So the first entry would have the values 100 and 24, the next would have 50 and 24, and the third would have 100 and 6.

I dunno about weeks though. You might need to define your own CalendarType also. :dunno:

Haha ill forget about the weeks cuz im still confused, ill just pop those numbers in and change it to the way i like, thanks for all the help, i really apreciate it!
 
Well i changed it to modern, so obviously i want to remove the old ones like archery melee mounted etc, and put in a couple others like submarine and split air units to bombers and fighters. Also change seige to artillery
The simplest way to achieve this would probably be to keep the current UnitCombatTypes but simply rename some of them in the text XML. So Siege would be renamed artillery, Archery would be renamed Submarine, while Melee and Mounted would be Bombers and Fighters.
 
Is there a way to relax the terrain restrictions for harbor, lighthouse and levee? What I'm thinking is as long as the appropriate tile is in the city's BFC, they should be available.
 
From a quick file check, it looks like you'd need to make DLL changes to do that.

The functions in CvCity.cpp to change would be "isValidBuildingLocation". I think what you'd need to do is change the function to check all tiles within the city radius for being coastal, replacing the current method where it checks if the city tile is on a coast. Am not sure exactly how to do this, though.
 
I guess you could enable the canConstruct call-back to CvGameUtils and have a Python fix for this. It would slow the game down, however.
 
First you should set the value iMinAreaSize for the water buildings to something lower.
Currently it's 10, so you can only build a harbor, when the city is at "water body" with at least 10 tiles. Set it to 1, then you're already able to build a harbor, when the city has 1 water tile directly to it. That's not exactly the same like 1 water tile in the FC, but at least closer.
 
Is there anyway to have buildings be able to be built more then one, thinking someway in the buildingclass xml file, where buildings i add to my mod like office building or apartment building, i can build a certain number or an unlimited number of times in 1 city

(the <bnolimit> doesnt do this, that only works for wonders being able to be replaced, like palaces)
 
AFAIK the core game engine supports more than one instance of any building in a city. So its not a binary True/False situation, but really a "number of buildings" sort of thing, as far as the actual code is concerned. But I guess you'd have do some programming in order to actually enable multiple instances of buildings in the game. :dunno:
 
I think you'll find that allowing multiples of each building is just changing one value in GlobalDefines.xml (or GlobalDefinesAlt.xml). Specifically, the CITY_MAX_NUM_BUILDINGS setting. If you change that to 2, you should be able to build each building twice in each city. (Not wonders, since those are limited elsewhere - unless you increase those limits on a building class by building class basis.) Note that this applies to all the regular buildings.

Final Frontier allows you to build a copy of each building on each planet in the star system (which is the FF name for a city). So the per-city limit is set to be a number that is actually 1 bigger than the maximum number of planets a system can have, as per the above. It is limited to 1 per planet via the Python cannotConstruct callback.

So if you want to be able to build some buildings more than once, you have to set it to allow all buildings more than once via the global define and then apply restrictions to make it only actually work for specific building types or classes via the callback.

You could also do the limit via DLL changes, perhaps by adding a tag to the building info and checking that in the appropriate place. (Final Frontier Plus has been migrating things to the DLL, but the star system data about planets is still in Python so the DLL does not know much about it, like how many planets a system has, therefore it still uses the Python callback for this.)
 
I guess you could enable the canConstruct call-back to CvGameUtils and have a Python fix for this. It would slow the game down, however.

Got confused in my previous answer (Got the CanConstruct and Cannotconstruct callbacks confused when reading the DLL, and thought the order was wrong to do this.), but this would also work.

To do it in Python, you'd need to check whether the building had the property of, I'm guessing, being coastal, than checking the city radius for water tiles. Again, am not exactly sure how to do this.
 
To do it in Python, you'd need to check whether the building had the property of, I'm guessing, being coastal, than checking the city radius for water tiles. Again, am not exactly sure how to do this.
There is a CyCity.getCityIndexPlot() method and by looping through the values 0-19 as the parameter (argument, for methods) you get the CyPlot instances of all the tiles around the city. By checking each one for CyPlot.isWater() you might or might not get the go-ahead for allowing the building, by returning True.
 
Back
Top Bottom