I just checked the DLL code and the only option I see is the state religion option. It can be done by giving the leader a certain trait. However vanilla doesn't offer the option of adding/removing traits from python, which mean this doesn't help either. The production modifier code for the player has no python callback.I don't think you can without moddifying civic .dll code. (Which is not a quick question/answer sort of job!)
I think this is only a vanilla option for state religion.
int CvCity::getProductionNeeded(BuildingTypes eBuilding) const
{
int iProductionNeeded = GET_PLAYER(getOwnerINLINE()).getProductionNeeded(eBuilding);
// Python cost modifier
if (GC.getUSE_GET_BUILDING_COST_MOD_CALLBACK())
{
CyArgsList argsList;
argsList.add(getOwnerINLINE()); // Player ID
argsList.add(getID()); // City ID
argsList.add(eBuilding); // Building ID
long lResult=0;
gDLL->getPythonIFace()->callFunction(PYGameModule, "getBuildingCostMod", argsList.makeFunctionArgs(), &lResult);
if (lResult > 1)
{
iProductionNeeded *= lResult;
iProductionNeeded /= 100;
}
}
return iProductionNeeded;
}
To be fair, I copy pasted code from the DLL. However I wrote that it should be able to be triggered from xml/python and being inexperienced in running python from C++ (I prefer going the other way for technical reasons), I asked for somebody to tell how to activate the callback.DIT: This isn't DLL, but I still have no idea how to get to that line of code.
How do I make a civic give +25 production for all buildings, irregardless of religion?
I AM NOT TO BLAME! How can I be to blame when:Well, unfortunately I have to contradict you in that it is not the mod to blame, but something you have done as I have just taken it out of the box and it works as advertised.
When the guantlet is thrown down an idiot shall arise, that idiot is me!
Germany and France are now at permanent war... The end of stinky cheese and large sausage is nie... God Help Us All!!!
Chances are you need to put it in the xml folder of your mod, not a customxml folder, and change the appropriate file paths as if you are running blue marble then it is not an unmodified state.
You are either running a mod with blue marble, or have changed the base structure of the game...(Never a good idea!)
if that is still not right, then you will need to start a thread and show your working, because you are clearly doing something that is incorrect, but no one can know what that is unless you show exactly what you are doing, then maybe someone will spot the error that you are making.
I AM NOT TO BLAME! How can I be to blame when:
1.I did not modify the mod, I just unzipped it and placed it RIGHT INTO my mod folder, not modifying anything.
2.I did not modify the base game, I'd bet my life on it
3. Blue Marble does not modify XML or Python files, only graphics
4. All other mod things by platyping work for me, except this one
def getBuildingCostMod(self, argsList):
iPlayer, iCityID, iBuilding = argsList
pPlayer = gc.getPlayer(iPlayer)
pCity = pPlayer.getCity(iCityID)
iCostMod = -1 # Any value > 0 will be used
# civic cost mod - start
iCivic = 0
if pPlayer.isCivic(iCivic):
return 75
# civic cost mod - end
return iCostMod
But the Blue Marble mod makes everything look better, I think I'd rather have that than a python component that I will probably use for only one mod, if it had worked.Remove the Blue Marble mod, or use a separate install version of the game, and put your new thing there - see if it works by itself, without anything else.
You are either running a mod with blue marble, or have changed the base structure of the game...(Never a good idea!)
if that is still not right, then you will need to start a thread and show your working, because you are clearly doing something that is incorrect, but no one can know what that is unless you show exactly what you are doing, then maybe someone will spot the error that you are making.
But the Blue Marble mod makes everything look better, I think I'd rather have that than a python component that I will probably use for only one mod, if it had worked.
IT'S THE UNMODIFIED VERSION! I repeat: the gold shiny hud is because of Blue Marble, which, as far as I'm aware of, modifies no XML or python.
I can't even get it to work by placing the mod straight into my mod folder. I repeat tjhat I'm not the one to blame, because a mod should be working by placing it in the mod folder. And it doesn't work, try to download the mod yourself so you can confirm that it doesn't work or does work.
It seems to be required if you custom assets or something like that. However I would recommend installing outside of Program Files due to write permission issues. Installing in C:\games works quite well and it allows git to write to the mod directory. This mean assuming you set up the git repository correctly, then you can pull changes directly into the mod and you instantly have updated your mod with changes made by other people.Breaking news: The mod DOES work if it's located in the Program Files directory of Civ4:BtS
That should do it for the code. Change iCivic to whatever number your civic has in xml. You could use "gc.getDefineINT("civic_type")", but that would slow down the game even more. For once I would recommend just hardcoding the number as I fear for the performance of this change.PHP:def getBuildingCostMod(self, argsList): iPlayer, iCityID, iBuilding = argsList pPlayer = gc.getPlayer(iPlayer) pCity = pPlayer.getCity(iCityID) iCostMod = -1 # Any value > 0 will be used # civic cost mod - start iCivic = 0 if pPlayer.isCivic(iCivic): return 75 # civic cost mod - end return iCostMod
I attached the modded file because tabs are essential to get correct in python. Experience tells that copy pasting from the forum causes issues.
Read what isenchine wrote on how to enable.
While this is completely untested, it should do what you ask for. Well sort of. It has -25% production requirements. You could set it to return 80, which would be -20% requirements, which is the same as +25% production if you ignore the rounding errors.
So I want to take the bonus that already exists for state religions and modify it so that it exists without, and this requires DLL editing? Please someone tell me why modding Civ IV is considered "easy?"
EDIT: This isn't DLL, but I still have no idea how to get to that line of code.
Because the original mechanic is coded in the DLL obviously. If you want to adapt and modify it that means you have to edit the DLL.I'll use this if I have to, but I don't understand why it isn't simpler to adapt a mechanic that already exists in the game, and only needs the state religion requirement removed. Even if I could only have one or the other, it's not as if I have any plans for the original mechanic.
What you are asking for is altering the existing feature to skip the religion check. Sure it's doable and it would likely be the best solution. However the change would have to be in the DLL itself. The DLL requires people to install and use a compiler and it seems most users really, REALLY want to avoid doing that, which is the reason for the python+xml solution.I'll use this if I have to, but I don't understand why it isn't simpler to adapt a mechanic that already exists in the game, and only needs the state religion requirement removed. Even if I could only have one or the other, it's not as if I have any plans for the original mechanic.
Yes, that will be great, maybe to add 2, max 3 INDEPENDENTS which will be at war with everyone, but they will be on global level, if my capital fall they will be revolt, and if neighbor capital fall they will revolt too, and if rebels are from same INDEPENDENTS they build some like global empire of rebels.The ideal solution would be to have one barbarian for each city as that would create complete anarchy with everybody attacking everybody, like the civil war in China 1800 years ago (the romance of the 3 kingdom event)
If i do that it will spawn a new civilization in game and that will take one slot for player, for example if i have 2 of 50 (2/50) players in game there will be 3/50 in game, but what if i have 50/50 players in game, this option is than not acceptable, there will not be more slots for any players. Your idea is good i can use this, but if i have 50/50 i will than must to use barbarians. Thank you Platy! But i will first try to add several new BARBARIAN PLAYERS, 50 + 1 barb = 51, i will try 50 + 3 barb = 53.Just set them as minor civs. Minor civs behave like barbs, at war with all and no diplomacy, but are not barbs.