Resource icon

Modular Python Loading 2016-10-05

Modular Python Loading
(( for Fall from Heaven 2: Rise from Erebus modmod, svn rev 34 ))
this is only for developers which actually understand the code and will adapt this for their own usage;
those who have access to rife internal forum don't needed this since it's in svn since rev 35
this code has no use for normal users

[Python only]
Basically it checks modules' folders for python files and imports them.
So far it works for following:
PyResult(caster) --- spell
PyPreReq(caster) --- spell
onBeginGameTurn(self, argsList)
onEndGameTurn(self, argsList)
onBeginPlayerTurn(self, argsList)
onEndPlayerTurn(self, argsList)
onBuildingBuilt(self, argsList)
onProjectBuilt(self, argsList)
onUnitCreated(self, argsList)
onUnitBuilt(self, argsList)
onTechAcquired(self, argsList)
onCityBuilt(self, argsList)
onCityRazed(self, argsList)
onCityAcquired(self, argsList)
onCityDoTurn(self, argsList)

it's not that hard to add support for others ... only adding 6 lines to end of function where 4 are only comment lines :D

This file also include example with two spells imported this way and two onCityBuilt events.

This should be possible to port into other mods with some coding experience. All edited parts are marked with "# Modular Python Loading" and are in CvEventManager.py and CvSpellInterface.py whil these two parts are independent.
If you want to use this, just let me know.

note: diagram in picture is a little bit outdated, but you'll get the idea
note: discussion thread about this is in internal RifE developer forum, so it's not available for normal users, however i put this here so any developer could look at it and eventually find some bugs and/or use it ... if you use it, just send me PM, that you use it, just so I know :)

davidlallen created a thread for this: http://forums.civfanatics.com/showthread.php?t=366308
  • mpl_diagram_HN9.png
    mpl_diagram_HN9.png
    72.5 KB · Views: 118
Author
arcticnightwolf
Downloads
322
Views
326
First release
Last update

Ratings

4.00 star(s) 1 ratings
Back
Top Bottom