Could you paste the python code? It may just be a missing indentation which then causes a Python exception which then in turn causes the rest of the script execution to be aborted.
To set yourself up for success
with respect to Python modding, observe the following tips:
- Ensure that your code editor is set up to use either tabs or spaces, depending on what the py
file does
- Keep an eye on the Python exception logs ( Logs\PythonErr2.log )
- Turn on (i.e. "unhide) python exception popups in the ini file:
Code:
; Set to 1 for no python exception popups
HidePythonExceptions = 0
Code editor? Why I use notepad strictly
I just changed the values suggested by Sephi:
## Sid Meier's Civilization 4
## Copyright Firaxis Games 2005
import CvUtil
from CvPythonExtensions import *
class PyPopup:
############## S E T U P F U N C T I O N S ###################
def __init__(self, popupID=-1, contextType=EventContextTypes.NO_EVENTCONTEXT, bDynamic = True):
self.ID = popupID
self.popup = CyPopup(popupID, contextType, bDynamic)
# Misc!
def isNone(self):
"verifies valid instance"
return self.popup.isNone()
def launch(self, bCreateOkButton = True, eState = PopupStates.POPUPSTATE_IMMEDIATE):
"sets attributes to the popup launch"
self.popup.launch(bCreateOkButton, eState)
def setUserData(self, userData):
"sets userData that is passed to OnOkClicked"
self.popup.setUserData(userData)
def setPosition(self, iX, iY):
"set the location of the popup"
self.popup.setPosition(iX, iY)
def setSize(self, 512, 512):
"sets the popups size"
self.popup.setSize(iXS, iYS)
It resulted in a "blank" interface, I realise that other values probably have to be adapted:
I am thinking maybe the position would have to be adapted, it seems like if I enlarge event picture as I did, it created a scroll bar vertically, but the popup was "locked" horizontally
which is interesting.
Edit: I didn't register a python error in the logs as far as I can tell