How to add a minor civilization?

Bonci

King
Joined
Oct 22, 2005
Messages
799
Location
Tridentum - Italia
I'm trying to add a minor civilization (like celtia/byzantium and independents) to the game, I've read Jarkov's guide on how to add a civilization and i tryed to change the minimum to get the civ to work.
So I added it in the wbs, in the consts.py and in rhyes.cpp and .h, i also increased the maxciv constant in CvDefines.h.

Now the civ shows up if i open the wb but if i add a city for them the game crashes...i also added a city spawn in barbs.py but it never happens.

What am I missing? :(
 
Okay, I know, that adding civs is quite annoying, I try to help as much as possible. From what I have understood, there could be several reasons: You didn't modify StoredData.py and RiseandFall.py (maybe Communications.py), did you? This could be necessary too... And just because it could be interesting for you: CvPlayer.cpp, CvInfos.cpp, CvGame.cpp (basically every file which has 'Rhye' in them) could be used for values modifying the minor civ (so it is weaker than regular players). For further diagnostic info, we would need a little bit more details :).
And as for Barbs.py, could you just post the code you used?
 
Sorry to play tech support in asking stupid questions, but did you recompile the DLL after you changed the C++ files?
 
yeah! so i managed to add a minor civiliziation (i forgot to add one initializer in one array in consts.py) and it worked until i tried to add ten more :P
then the game started crashing directly during the loading XD I guess i have to add them more gradually...

thanks for your help :D

oh and another quick question: i gave Jerusalem to the minor civ but when judaism should be founded the game crashes (i know the problem is this because if i give another city the game runs fine). Where can i remove the auto founding of judaism?

here the code for the spawn of jerusalem:

Code:
iIsrael = con.iIsrael
pIsrael = gc.getPlayer(iIsrael)

self.foundCity(iIsrael, lJerusalem, "Yerushalayim", iGameTurn, 2, con.iArcher, 3)
 
Have you enabled Python exceptions and logging? What messages appear in your error logs?
 
Have you enabled Python exceptions and logging? What messages appear in your error logs?

sorry for the question :( but where do i find them?

@Jarkov: thanks I found the code and commented it, but the game still crashes...there must be something else.

Now the civ spawns correctly but I wanted to let the player contact it so i put a 0 in the "MinorNationStatus" thing in wbs. But now when i meet the civ, all the interface messes up...isn't it possible to have a "Rhyes minor civ" behave like a normal civ? :cry:
 
Why make it a minor civ if you want it to behave like a normal civ? :confused:
 
not totally like a normal civ...i mean that i want it to conduct diplomacy like a normal civ. I don't want it to stay at war with everyone like a normal minor civ...
 
You enable exception pop-ups and logging in the CivilizationIV.ini file. This is where you set most game settings, by the way.

The actual logs are in \My Documents\My Games\Beyond the Sword\Logs\ and are called PythonErr.log and PythonErr2.log.

There might be logs for SDK errors also, but that is currently beyond my horizon.
 
Honest curiosity - what's the other difference between minor and major civs?
 
They aren't playable (of course, but this means they aren't represented in most of the lists or switches where the major civs are), they don't have spawn dates, they have most techs and units and buildings disabled, they will automatically make peace or declare war to major civs.
 
Okay, now that you say it :) The disabled diplomacy is just the aspect you notice most while playing.
 
additionally they aren't affected by stability, don't have warmaps,settlermaps etc...
My hope is that they don't need so much work as normal civs. So maybe if i add a bunch of minor civs they won't add too much to the loading times :)

thanks Baldyr, i found the logs and solved (i hope) the problem! (in StoredData.py added a field to lPlagueCountdown)
 
Can you please post the changes you made to add the minor civ? Also can you link to the guide by Jarkov that you mentioned? Thanks.
 
First I have to say that I'm still experiencing some random crashes so what I'm going to tell you is not complete (I still haven't found where the problem is).

SDK
- in cvrhyes.cpp add one field to turnPlayed and civSpreadFactor and increase the dimension of the arrays.
- in cvrhyes.h add a define for your civ (before barbarians) and increase the dimension of turnPlayed and civSpreadFactor.
- in cvdefines.h increase MAX_CIV_PLAYERS by one.
- i also added some cases in cvcity.cpp to prevent minor civ cities to flip too often.

PYTON
- in consts.py add a field to l0ArrayTotal and initialize a iciv variable for your civ (before barbarians but after mayor civs...should be in the same place where you defined the civ in cvrhyes.h), search all the file and add fields to the arrays where independents are mentioned.
- in storeddata.py add fields everywhere there should be the complete list of civs (not where only mayor should be in) pay attention because i suspect that my random crashes depend on something i forgot here.
- to spawn the minor civ i use Baldyr's PyScenario

WBS
add your civ in the same position you defined it in consts.py and add a new team

XML
i used modular civs from civgold here and they work fine (you should add tags for the embassy thing)

i hope this can help you...and sorry for my bad english *_*
 
- to spawn the minor civ i use Baldyr's PyScenario
You could mod a clean copy of RFC:E/M without the PyScenario application, just to make sure there is no incompatibility here with using additional minor Civs.

Minor civs can be spawned with the Barbs module - just follow the examples for the other spawns. You can always convert the actual spawn code into a PyScenario script later.
 
Thank you for the replies. As an experiment I will attempt to add Hittites to harass the Babylonians.
 
Back
Top Bottom