raystuttgart
Civ4Col Modder
Ok guys, I am going to post screenshots here in this thread.
I will try to teach you how to add a simple XML tag that can later be used in DLL and Python.
To try this tutorial yourself get:
1. Our Source Code and Project Setup (coming with the download)
2. A good editor like Notepad++ and a good Development IDE like Visual Studio
I am not going to explain how to setup these because @Nightinggale already did.
----------
This is the content of the tuorial:
(Special Rules for Storage Capacity considering Food, Lumber and Stone)
----------
Objectives / Goals:
A) Remove hardcoded Yield Logic for Food, Lumber and Stone by making it XML configurable.
B) Visualizing the Special Rules for Storage Capacity considering Food, Lumber and Stone in Colopedia
----------
Most Important Steps:
1. XML attribute (CvYieldInfos.xml): bIgnoredIForStorageCapacity
(Do not forget to adjust the Schema accordingly: CIV4TerrainSchema.xml)
2. DLL method: CvYieldInfo:: isIgnoredForStorageCapacity()
Use it in the internal logic that currently hardcodes Food, Lumber and Stone for Storage Capacity.
(Just search for "YIELD_STONE" to find it.)
3. Making it accessible for Python (CyInfoPythonInterface3)
.def("isIgnoredForStorageCapacity", &CvYieldInfo::isIgnoredForStorageCapacity, "bool ()")
4. Using that Logic in Pedia Screen of Yields
(Well of course you also need a TXT_KEY in XML to display the message.)
I will try to teach you how to add a simple XML tag that can later be used in DLL and Python.
To try this tutorial yourself get:
1. Our Source Code and Project Setup (coming with the download)
2. A good editor like Notepad++ and a good Development IDE like Visual Studio
I am not going to explain how to setup these because @Nightinggale already did.
----------
This is the content of the tuorial:
(Special Rules for Storage Capacity considering Food, Lumber and Stone)
----------
Objectives / Goals:
A) Remove hardcoded Yield Logic for Food, Lumber and Stone by making it XML configurable.
B) Visualizing the Special Rules for Storage Capacity considering Food, Lumber and Stone in Colopedia
----------
Most Important Steps:
1. XML attribute (CvYieldInfos.xml): bIgnoredIForStorageCapacity
(Do not forget to adjust the Schema accordingly: CIV4TerrainSchema.xml)
2. DLL method: CvYieldInfo:: isIgnoredForStorageCapacity()
Use it in the internal logic that currently hardcodes Food, Lumber and Stone for Storage Capacity.
(Just search for "YIELD_STONE" to find it.)
3. Making it accessible for Python (CyInfoPythonInterface3)
.def("isIgnoredForStorageCapacity", &CvYieldInfo::isIgnoredForStorageCapacity, "bool ()")
4. Using that Logic in Pedia Screen of Yields
(Well of course you also need a TXT_KEY in XML to display the message.)
Last edited: