Simple Python Things

Things the AI does, or things that are automatically applied without player intervention, are usually MP compatible. One of the main things you need to do for this is to be sure you use the synchronized random number generator for any random numbers (the getSorenRandNum function) rather than a local, non-synchronized, random number generator.

Usually (but not necessarily always) the things that are not MP compatible are things where a human player is given a choice. The computers other than the one that the specific player is making their choice on have no way of knowing what the choice was - unless, of course, they are told. That is what the ModNetMessage stuff is for. Any time there is a human choice involved in something that the DLL was not set up to manage, such as clicking on a button in the interface that was added via Python, the MP compatible way to do it is via CyMessageControl().sendModNetMessage(...) and having the onModNetMessage event handler do the actual stuff instead of doing it in the function where the message was sent. Everybody, including the sender, receives the mod net message which results in the same thing being done everywhere.

Things with player choices that the game already understands don't have this problem, one example being the random event system, since they already communicate with the other computers in the MP game to provide the required data.
 
:dunno:
The Palace replacing after conquering capital is probably not MP compatible, as well as the TechTree - New icons and effects and Spawn A Civ, but that's all more or less an educated guess. No real idea, since I don't play MP :/.

Spawnaciv works in hotseat (I think)
Of course, hotseat isn't really MP
 
Quick question:
Could you make a python mod that lets a unit with one promotion get a bonus against units with another?
Example: Longbowmen with "Sharpshooter" get a 25% Combat bonus against units with Cover.
Basicly a promotion canceller.
 
someone should make a CyCombat class :p that could be fun to work with. I would but thats beyond my C++ abilities :(
 
If you could do that in C++, I'd not see a reason not to directly implement the wanted changes in C++ ;).

Though exposing stuff to Python would still be good :D
 
A quick question regarding Spawn a Civ, apologies if it's been asked before. I understand that there has to be a 'slot' available for a civ to spawn, but is the number of slots 18 or is the maximum determined by world size? i.e, on a Standard map with 7 civs still alive can an 8th civ be spawned or does one of the existing ones have to die first?
 
mmhh...just checked the older version of your mod which I have here. There it definitely worked :dunno:.

Did you change anything in the cannotDoCivic function, which might maybe lead to an earlier exit of the function?



-----------
Unrelated: Reuploaded my SpawnACiv mod component.
By request from Daryl95 I added tags to spawn a civ on a specific turn, year (incl. optional month) and only by human tech research. Has now also 6 changes in the CvEventManager, in contrast to only 5 before.
 
-----------
Unrelated: Reuploaded my SpawnACiv mod component.
By request from Daryl95 I added tags to spawn a civ on a specific turn, year (incl. optional month) and only by human tech research. Has now also 6 changes in the CvEventManager, in contrast to only 5 before.

:D Yay.
 
tststs, then we can long search for the cause :D.

The whole cannotDoCivic function would look like this:
PHP:
	def cannotDoCivic(self,argsList):
		ePlayer = argsList[0]
		eCivic = argsList[1]
###can't change language - start
		cvCivic = gc.getCivicInfo(eCivic)
		if cvCivic.getCivicOptionType ()==gc.getInfoTypeForString("CIVICOPTION_LANGUAGE"):
                        return True
###can't change language - end		
		return False
 
Back
Top Bottom