Python Question : Reveal plots ?

Sto

Should i code today ...
Joined
Dec 15, 2005
Messages
1,144
Location
Marseille (France)
Firstly, here how I integrate elements of the play in the map script :

Code:
import CvEventInterface
if hasattr(CvEventInterface.getEventManager(),'EventHandlerMap'):
        originalEventHandlerMap=getattr(CvEventInterface.getEventManager(),'EventHandlerMap')
        try:
                if 'GameStart' in originalEventHandlerMap.keys():
                        if originalEventHandlerMap['GameStart']==CvEventInterface.getEventManager().onGameStart:
                                def NewAttribFunc(b):
                                        import Sto_Chess
                                        Sto_Chess.StoAddGameElements()
                                        originalEventHandlerMap=getattr(CvEventInterface.getEventManager(),'EventHandlerMap')
                                        originalEventHandlerMap['GameStart']=CvEventInterface.getEventManager().onGameStart
                                        return CvEventInterface.getEventManager().onGameStart(b)
                                originalEventHandlerMap['GameStart']=NewAttribFunc
        except:
                pass

I will like to know if that can cause problems with MODS or Game ? ( CvEventInterface.py specify that you may not import it !)

I will also like to add a button to reveal parts of map. But I do not understand how that goes. Which are the functions python which make it possible to reveal plots with the players or change fog of war attributes ? (Those which I tested until now do not give anything ) . Or where I could find an example ? (I did not find any in the forum .)

Thanks !
 
anyone to help me ?
 
In the Code (CvPlot.h) that would be
Code:
DllExport bool isRevealed(TeamTypes eTeam, bool bDebug) const;                                                                                              
void setRevealed(TeamTypes eTeam, bool bNewValue, bool bTerrainOnly = false, TeamTypes eFromTeam = NO_TEAM);

Exposed to the Phyton via:
Code:
.def("setRevealed", &CyPlot::setRevealed, "void (int /*TeamTypes*/ eTeam, bool bNewValue, bool bTerrainOnly, int /*TeamTypes*/ eFromTeam)")

as something like
Code:
.setRevealed
This will have to be called for each Plot.
 
Thank you ! I will study that , i don't have understood all yet !
 
Back
Top Bottom