[BTS] Mongol Camp

That particular line gets the ID for CIVILIZATION_MONGOL which is used further on in the script to match the civ which can have camps. If you want other civs to also have the camp functionality, you have to make some more changes to the Python.

What changes? How would you do that?

Also, why is that line necessary? Can the civ check stuff just be removed?
 
That line is not necessary, but makes the script faster to execute. Looping through all the units of 1 civ is much faster than looping through all units of all civs. The script is run every turn, so that might lead to lag between turns.

If you could tell me what you want, like camp for several civs or all civs, I can make a suggestion for changing the script.
 
The quickest (but not the most optimal) way to change it would be:

Code:
def onBeginGameTurn(self, argsList):
    'Called at the beginning of the end of each turn'
    iGameTurn = argsList[0]

    for iPlayer in range(gc.getMAX_PLAYERS()):
	    pPlayer = gc.getPlayer(iPlayer)
		if pPlayer.isAlive():
			if pPlayer.hasTrait(gc.getInfoTypeForString('TRAIT_NATIVE')):
                
				pTeam = gc.getTeam(player.getTeam())

				apUnitList = pPlayer.getUnitList()

				# Loop through all units

A more optimal way would be to create a list of civ ID's with the Native trait in initValues and use that list in onBeginGameTurn, instead of looping through all civs in the example above.

On the other hand, this way you could ensure that when a civ gets the Native trait later on in the game (by some other script), it would be included in the civs to check for the camp.

EDIT: added attachment for Ozzy
 

Attachments

Great job on your mod component . I know the thread is a bit dead but i hope someone with programming experience can help me a little since i got none into this domain. I started expanding the Charlemagne mod that came with civ IV to a europe medieval mod, since recently its been mostly graphics (Danrell, Bakuels units which are A+ ) and XML but now i wanted to give it even more flavour. The problem is i dont know how excatly to merge the EntryPoints/CvEventInterface.py files ( the other 2 are not met inside the charlemagne so i guessed it was ok to leave them as they are )but this file i think might be the problem although im not that sure since like i said im a noob in these prgramming stuff. Well hope someone can provide some help and waiting for a response :)
 
Back
Top Bottom