cybrxkhan
Asian Xwedodah
I second this being integrated with JARM.
I just noticed that you have put a dll in the new version, do you have to have that, cause if you do, that will STOP alot of people now from using this.
from CvPythonExtensions import *
import CvEventManager
[COLOR="red"]# import AIAutoPlay
# import ChangePlayer
# import Tester[/COLOR]
import InquisitionEvents
#INSERT IMPORTS
gc = CyGlobalContext()
#INSERT DEFINES
#################### INITIALIZER ###########################
class CvCustomEventManager(CvEventManager.CvEventManager, object):
def __init__(self, *args, **kwargs):
super(CvCustomEventManager, self).__init__(*args, **kwargs)
# map the initial EventHandlerMap values into the new data structure
for eventType, eventHandler in self.EventHandlerMap.iteritems():
self.setEventHandler(eventType, eventHandler)
# --> INSERT EVENT HANDLER INITIALIZATION HERE <--
[COLOR="Red"]# AIAutoPlay.AIAutoPlay(self)
# ChangePlayer.ChangePlayer(self)
# Tester.Tester(self)[/COLOR]
InquisitionEvents.InquisitionEvents(self)
Remember this?
If you don't want to use the DLL, this is all you have to do! All marked in Red...
Code:from CvPythonExtensions import * import CvEventManager [COLOR="red"]# import AIAutoPlay # import ChangePlayer # import Tester[/COLOR] import InquisitionEvents #INSERT IMPORTS gc = CyGlobalContext() #INSERT DEFINES #################### INITIALIZER ########################### class CvCustomEventManager(CvEventManager.CvEventManager, object): def __init__(self, *args, **kwargs): super(CvCustomEventManager, self).__init__(*args, **kwargs) # map the initial EventHandlerMap values into the new data structure for eventType, eventHandler in self.EventHandlerMap.iteritems(): self.setEventHandler(eventType, eventHandler) # --> INSERT EVENT HANDLER INITIALIZATION HERE <-- [COLOR="Red"]# AIAutoPlay.AIAutoPlay(self) # ChangePlayer.ChangePlayer(self) # Tester.Tester(self)[/COLOR] InquisitionEvents.InquisitionEvents(self)
...Then discard these files:
CvInfoScreen.py
AIAutoPlay.py
Tester.py
ChangePlayer.py
CvGameCoreDLL.dll
Orion Veteran![]()
cool stuff. anyway this can be integrated with JARM?
Does the inquisitor use espionage points (make sense since they spy on people to wipe them out)
Lots of religions AND a new version of OIM - we will be favoured!![]()
I plan on doing that plus a lot more. However, it will be a new mod pack written in WoC format. As real life issues call for my attention right now, it might be a while before I get to and complete the new project. As for now, you have a rock solid version of OIM to play with.
Respectfully,
Orion Veteran![]()
Here we go again, with the WoC stuff, YUCK, no offense to any of them, i just cant get ANY hang of it, WHATSOEVER.![]()
Hey, Orion, just a quick question here. I'm thinking of integrating this with WoL, but I wanted to remove the Holy Office building, and make the inquisitor require a different building - let's just say a cathedral. If I want to remove the Holy Office building, is there any python I may have to sort out through?
OK tried your new .B mod, and i believe i got it all correct (maybe) but when the game starts i get TWO Orions pop-ups on what is turned on or off??
Also I didnt get a pop-up when a religion was found by the civ i was playing??
I knew exactly what it was before I even opened your file. Please, take a long hard look at the InquisitionEvents.py file. This file is supposed to contain all of the functions you have modified in the CvEventManager.py file and only the modified functions. Once all of the modified functions have been moved over from the CvEventManager.py file into the InquisitionEvents.py file, then the CvEventManager.py is obsolete and should be deleted.
You didn't transfer all of your functions nor did you delete the file! The reason you get two popups is because the CvEventManager.py file still exists and the same function is being called twice.
Please do the following: This is the key to all of your python issues in your mod.
1. Move all of your modified functions from CvEventManager.py and put them into the InquisitionEvents.py file. Each modified function must be registered in the def __init__(self, eventMgr): function. Look at that function and you will see each modified function, in the order of it's appearance in the CvEventManager.py file. Each modified function should appear only once in the InquisitionEvents.py file.
2. Delete the CvEventManager.py file. I have faith you can do it this time!
Respectfully,
Orion Veteran![]()
OK in the other files then what do i do with the "import CvEventManager"? Do i change that to "import InquisitionEvents." Or just add that?
Import each of the respective functions into the InquisitionEvents.py file. Again, be make sure that you do not duplicate any of the existing functions already in the InquisitionEvents.py file. If you find the same modified function in both files, you will have to merge the code for that one function in the InquisitionEvents.py file.
Lastly, make sure that when you call these functions from other files, you must add: Import InquisitionEvents and refer to each of the functions with InquisitionEvents.*
Bottom Line: You don't need a CvEventManager.py file, when ever you have a CvCustomEventManager.py file.
Orion Veteran![]()
OK i am 9_.9% sure i got it right but now i get this error??
Traceback (most recent call last):
File "CvScreensInterface", line 703, in forceScreenUpdate
File "CvMainInterface", line 929, in updateScreen
AttributeError: 'CvCustomEventManager' object has no attribute 'lPlagueCities'
ERR: Python function forceScreenUpdate failed, module CvScreensInterface
Also i was wondering, (and i dont mean to be a SmartA_s or a DumbA_s, just for info is all, ok. Why must this be in the InquisitionEvents.py when everyone else can put their stuff in the CvEventManager.py and make it work correctly? Its puzzling to me and its really kind of hard to remember to put stuff just in YOUR py and when people make things its always in the CvEventmanager? (Now remember i know NOTHING about python, is why i am asking). Again no offense.
def cannotConstruct(argsList):
#CvUtil.pyPrint( "CvGameInterface.cannotConstruct" )
[B]return gameUtils().cannotConstruct(argsList)[/B]
def cannotConstruct(self,argsList):
pCity = argsList[0]
eBuilding = argsList[1]
bContinue = argsList[2]
bTestVisible = argsList[3]
bIgnoreCost = argsList[4]
pPlayer = gc.getPlayer(pCity.getOwner())
iPlayer = pPlayer.getID()
[B]MyHolyOffice = str(getReligionHolyOffice(iStateReligion))[/B]
MyHolyOffice = str([B]self.[/B]getReligionHolyOffice(iStateReligion))