I am new to python and Civ4 modding, so I hope I'm not to off base, but here goes
I finally figured out how to get pyDoc help for the Civ4 modules. The following is the output for pyDoc help for my CvCustomEventManager:
As you can see it prints out all the method documention of the parent. If I had a clean mod and then just copied CvEventManager to my mod I could get clean documention of the original module.
I managed this my turning on the logs, then inserting
help("CvCustomEventManager")
into the __init__ method.
Here is my proposal (actually two):
1. I would be glad to get clean pyDoc help texts for all the modules that I can. In fact I'll probably do it myself for my own purposes. Would anyone be interested in a copy? Is there any place for me to upload this.
2. The documention is somewhat sparse. For example, there is no explanation of what is expected in argList for all the events. Now I am brand new to this and really can't add much good documention. But with the help of some of you experts, you could put in more complete documentation (comments) in the modules, I could then print out help docs that are much more complete and helpful. Perhaps even Firaxis would be interested in incorporating more complete comments into their original versions? I don't know who to ask about this or to get it started.
Any comments or further ideas along this line? Has the whole thing already been done somewhere?
I finally figured out how to get pyDoc help for the Civ4 modules. The following is the output for pyDoc help for my CvCustomEventManager:
Code:
load_module pydoc
Help on module CvCustomEventManager:
NAME
CvCustomEventManager
FILE
c:\program files\firaxis games\sid meier's civilization 4\assets\python\cvcustomeventmanager.py
CLASSES
CvEventManager.CvEventManager
CvCustomEventManager
class CvCustomEventManager(CvEventManager.CvEventManager)
| Methods defined here:
|
| __init__(self)
|
| onGameStart(self, argsList)
|
| ----------------------------------------------------------------------
| Methods inherited from CvEventManager.CvEventManager:
|
| applyEvent(self, argsList)
| Apply the effects of an event
|
| beginEvent(self, context, argsList=-1)
| Begin Event
|
| handleEvent(self, argsList)
| EventMgr entry point
|
| onBeginGameTurn(self, argsList)
| Called at the beginning of the end of each turn
|
| onBeginPlayerTurn(self, argsList)
| Called at the beginning of a players turn
|
| onBuildingBuilt(self, argsList)
| Building Completed
|
| onChangeWar(self, argsList)
| War Status Changes
|
| onChat(self, argsList)
| Chat Message Event
|
| onCityAcquired(self, argsList)
| City Acquired
|
| onCityBuildingBuilding(self, argsList)
| City begins building a Building
|
| onCityBuildingUnit(self, argsList)
| City begins building a unit
|
| onCityBuilt(self, argsList)
| City Built
|
| onCityDoTurn(self, argsList)
| City Production
|
| onCityGrowth(self, argsList)
| City Population Growth
|
| onCityLost(self, argsList)
| City Lost
|
| onCityRazed(self, argsList)
| City Razed
|
| onCityRename(self, argsList)
| City is renamed
|
| onCombatLogCalc(self, argsList)
| Combat Result
|
| onCombatLogHit(self, argsList)
| Combat Message
|
| onCombatResult(self, argsList)
| Combat Result
|
| onCultureExpansion(self, argsList)
| City Culture Expansion
|
| onEndGameTurn(self, argsList)
| Called at the end of the end of each turn
|
| onEndGoldenAge(self, argsList)
| End Golden Age
|
| onEndPlayerTurn(self, argsList)
| Called at the end of a players turn
|
| onEndTurnReady(self, argsList)
|
| onFirstContact(self, argsList)
| Contact
|
| onGameEnd(self, argsList)
| Called at the End of the game
|
| onGameUpdate(self, argsList)
| sample generic event, called on each game turn slice
|
| onGoldenAge(self, argsList)
| Golden Age
|
| onGoodyReceived(self, argsList)
| Goody received
|
| onGreatPersonBorn(self, argsList)
| Unit Promoted
|
| onImprovementBuilt(self, argsList)
| Improvement Built
|
| onInit(self, argsList)
| Called when Civ starts up
|
| onKbdEvent(self, argsList)
| keypress handler - return 1 if the event was consumed
|
| onLoadGame(self, argsList)
|
| onMouseEvent(self, argsList)
| mouse handler - returns 1 if the event was consumed
|
| onPlotRevealed(self, argsList)
| Plot Revealed
|
| onPreSave(self, argsList)
| called before a game is actually saved
|
| onProjectBuilt(self, argsList)
| Project Completed
|
| onReligionFounded(self, argsList)
| Religion Founded
|
| onReligionSpread(self, argsList)
| Religion Has Spread to a City
|
| onRouteBuilt(self, argsList)
| Route Built
|
| onSaveGame(self, argsList)
| return the string to be saved - Must be a string
|
| onSetPlayerAlive(self, argsList)
| Set Player Alive Event
|
| onTechAcquired(self, argsList)
| Tech Acquired
|
| onTechSelected(self, argsList)
| Tech Selected
|
| onUnInit(self, argsList)
| Called when Civ shuts down
|
| onUnitBuilt(self, argsList)
| Unit Completed
|
| onUnitCreated(self, argsList)
| Unit Completed
|
| onUnitKilled(self, argsList)
| Unit Killed
|
| onUnitLost(self, argsList)
| Unit Lost
|
| onUnitMove(self, argsList)
| unit move
|
| onUnitPromoted(self, argsList)
| Unit Promoted
|
| onUnitRename(self, argsList)
| Unit is renamed
|
| onUnitSelected(self, argsList)
| Unit Selected
|
| onUnitSetXY(self, argsList)
| units xy coords set manually
|
| onUpdate(self, argsList)
| Called every frame
|
| onVictory(self, argsList)
| Victory
|
| onWindowActivation(self, argsList)
| Called when the game window activates or deactivates
|
| reportEvent(self, entry, context, argsList)
| Report an Event to Events.log
DATA
__loader__ = <__main__.myImportHandler instance>
__version__ = '$Revision: 1.3 $'
false = 0
gc = <CvPythonExtensions.CyGlobalContext object>
localText = <CvPythonExtensions.CyTranslator object>
true = 1
VERSION
1.3
As you can see it prints out all the method documention of the parent. If I had a clean mod and then just copied CvEventManager to my mod I could get clean documention of the original module.
I managed this my turning on the logs, then inserting
help("CvCustomEventManager")
into the __init__ method.
Here is my proposal (actually two):
1. I would be glad to get clean pyDoc help texts for all the modules that I can. In fact I'll probably do it myself for my own purposes. Would anyone be interested in a copy? Is there any place for me to upload this.
2. The documention is somewhat sparse. For example, there is no explanation of what is expected in argList for all the events. Now I am brand new to this and really can't add much good documention. But with the help of some of you experts, you could put in more complete documentation (comments) in the modules, I could then print out help docs that are much more complete and helpful. Perhaps even Firaxis would be interested in incorporating more complete comments into their original versions? I don't know who to ask about this or to get it started.
Any comments or further ideas along this line? Has the whole thing already been done somewhere?