I guess that means its not a quick modding question. I've edited python, xml, and I've got Visual C++ so I'm set up to recompile, just haven't given it a shot yet. But I haven't really tried to write code from scratch.Only via modding and recompiling the DLL. Have you done that before?
All the xml data is handled in CvInfo.cpp/.h. You copy a tag from one file to another by copying the variable, the get function and the read code in the Read function. Adding more tags is fairly simple once you know how to compile and have added a few tags. You also need to add the new tag to the xml schema file. If you add it with minOccur=0, then you don't have to fill out all the xml entries and they will get a default value if it's missing (makes life easier).How do I move something from a trait or a civic to a building? (and vice versa?) I see there is the TradeYieldModifiers option for traits & civics, but I'd like to add it to buildings. How do I do that?
You wouldn't need to write code entirely from scratch, since what you want already exists for a civic or trait, so you only need to transfer it from there to a building. The challenge mostly comes from knowing where those parts go so the functionality is entirely implemented. So I would encourage you to give it a try, but as I said the first step is to set up the compiler.I guess that means its not a quick modding question. I've edited python, xml, and I've got Visual C++ so I'm set up to recompile, just haven't given it a shot yet. But I haven't really tried to write code from scratch.
IMAGE_LOCATION = os.getcwd() + "\Mods\\RFC Dawn of Civilization\\Export"
That won't work if the player places the mod in my documents. Instead I will recommend asking the exe for the mod location.I use the following code in the map exporter of DoC:
Code:IMAGE_LOCATION = os.getcwd() + "\Mods\\RFC Dawn of Civilization\\Export"
os.getcwd() is the working directory of the process, which is the BTS folder in program files.
const char* CvDLLUtilityIFaceBase::getModName(bool bFullPath = true) const;
gDLL->getModName()
If you are asking for how to play a movie, I would look at Assets\Python\Screens\CvWonderMovieScreen.py. Add another iMovieType type and add code to get the movie file based on that type. After that I think it will just be a matter of calling the movie popup like any other popup, like the vanilla code here:Is it possible to play a movie when a certain event fires? I mean other than an "event built" building with a movie tag.
Did anyone ever create a python script for that?
def onProjectBuilt(self, argsList):
'Project Completed'
pCity, iProjectType = argsList
game = gc.getGame()
if ((not gc.getGame().isNetworkMultiPlayer()) and (pCity.getOwner() == gc.getGame().getActivePlayer())):
popupInfo = CyPopupInfo()
popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON_SCREEN)
popupInfo.setData1(iProjectType)
popupInfo.setData2(pCity.getID())
popupInfo.setData3(2)
popupInfo.setText(u"showWonderMovie")
popupInfo.addPopup(pCity.getOwner())
Looks like the proper way to do this is to edit CvGame to make it set m_paiBuildingClassCreatedCount to 0 for the wonder in question if it's destroyed. Vanilla only allows calling it to increment meaning you need to mod the DLL to allow resetting this counter.Is there a way to make a mod that allows rebuilding of destroyed world wonders?
The attached screenshot shows how (I think) it works on Windows 8.1. That's all under HKEY_CLASSES_ROOT and was created by the installer. The start of "value data" that didn't fit in the box is just the full path ("C:\ ...") to the BtS EXE.[...] I know that you can pass the mod you want to load as parameter to the exe but I don't know how to make the game infer that from the savegame or map file.
I'm on Windows 10 in case that matters.
I don't see anything called "screenshot" or "printscreen" in the DLL. Shift+Print brings up a popup saying "Enter screen shot name". That instruction string is actually not in any of the game text files but is hardcoded in the EXE. This reinforces my suspicion that screenshots are handled (entirely) by the EXE. So my best bet would be to simulate a print key press through the DLL.[...] Is it possible to programmatically take screenshots from the game? [...]
The Vanilla Civ 4 Africa scenario appears to work this way. I'd try to imitate that. (Or perhaps someone else can describe how it's done specifically.)I'm making a scenario and I need to know how do I make it so the starting location of the civs are defined, but not which civ/leader goes in that location. I want to be able to choose any leader/civ to play in any of the locations, and either pick your opponents on the game start screen or let the computer pick them randomly.
If I understand correctly*, this is a map that exploits that the keys are enum values from a fixed-size interval. "EnumMap"? Turns out that there is a Java SE class of that name.I'm making a new array class where you assign the size with templates, like ArrayClass<PlayerTypes, int> gives an int for each player, ArrayClass<UnitTypes, short> gives a short for each CvUnitInfo etc. It then contains code for memory allocation, length, savegames and whatever else can benefit from being a function for all arrays.
Can anybody think of a good name for such an array class?
Good coding practice is to pick names, which can be understood without comments. However all the names I can think of for this class fails this test.
Thanks. EnumMap is precisely what this is, even down to the internal implementation.If I understand correctly*, this is a map that exploits that the keys are enum values from a fixed-size interval. "EnumMap"? Turns out that there is a Java SE class of that name.
* I'm not quite sure that I understand correctly. I'm assuming that ArrayClass<PlayerTypes,int> will have to allocate a new int[MAX_PLAYERS]. How does it know how many enum values there are? Through a constructor argument?
inline unsigned int ArrayLength(PlayerTypes var)
{
return MAX_PLAYERS;
}