Missing .py files

weakciv

Prince
Joined
Jul 15, 2005
Messages
469
Location
-1, -4
Well maybe my title is not completely correct but I cant seem to find them.

Anyway, looking through some of the .py files I find that one of the functions I am looking for comes from an "import from ... *". The problem is that I cant seem to find the "..." file it is importing from.

Unfortunatly I am at work right now and am not 100% sure of the file name. I am fairly sure that it was CvPythonExtentions. I was never able to find that file. The reason I wanted to see it was that I wanted to know what each of the arguments were for the function I was looking at.

Any help would be appreciated.
 
I think the module that you can't find is actually what's exported by the civilization C/Python interface from CvGameCore.dll
 
any idea how to look at a file like that?
 
Which file?

If it's CvPythonExtensions then rowr is correct. I think there's a way to make the game output a massive help list of all the functions available from the game that are available through that file but I forget how to do it... I'll see if I can figure it out. It's actually a VERY important file.
 
Trip said:
Which file?

If it's CvPythonExtensions then rowr is correct. I think there's a way to make the game output a massive help list of all the functions available from the game that are available through that file but I forget how to do it... I'll see if I can figure it out. It's actually a VERY important file.

Ok let me get specific. I am looking for the code associated with the "mouse over" handling. (ie when you get the information about a tile.)

I started with the CvMainInterface.py file and found this:
Code:
# Help Text Area
screen.setHelpTextArea( 350, FontTypes.SMALL_FONT, 7, yResolution - 172, -0.1, False, "", True, False, CvUtil.FONT_LEFT_JUSTIFY, 150 )

Ok so "setHelpTextArea" is a function of "screen". So let me find what "screen" is. I back up in the code and shortly above I find this:
Code:
screen = CyGInterfaceScreen( "MainInterface", CvScreenEnums.MAIN_INTERFACE )

Ok, looks like "screen" is an instance of "CyGInterfaceScreen". I look through the file I am in and do not find the def of CyGInterfaceScreen. So I begin looking for the import of it. Because it was not preceded by a parent reference (like screen.setHelpTextArea) I know it must be part of a "from ... import *". The only one I find is:
Code:
from CvPythonExtensions import *

So I begin hunting for CvPythonExtensions because I would like to know what the arguments mean for the setHelpTextArea function in CyGInterfaceScreen.
 
Yep, that's CvPythonExtensions for you...

Try this:

CvAppInterface.py

Set PythonHelp=0 from 0 to 1. Run the game (with Python installed). There should be a file called CvPythonExtensions.hlp.txt in your logs folder. If you need any help after that let me know. ;)
 
I have python installed (not boost python) and after changing PythonHelp to 1 I got a "failed initializing python" message. does it matter what python you have installed?
 
Hmmmm... so it seems.

There's a problem with the function. Sorry, I'll need more time to look into this. I'll try to have an answer for you tomorrow. In the meantime, you can ask me which functions you need the list of arguments for.
 
Hmm, is it possible for you to rar up your copy of CvPythonExtensions.hlp.txt file and attach it to the forum here? Assuming you have that file generated, of course ...
 
Trip,
I was able to get the file created by following this from GBM.

Im looking into it now.
 
Vorius: I would have, had it not been for the fact that it's not working here either and the most recent version of it that I might have would be over half a year old and excessively out of date. ;)

It seems that weakciv has found a way around this problem though! What thread is that weakciv? That should probably be posted in a stickied thread in this forum... all I can see is the post, not the thread.
 
ok looking at the arguments for setHelpTextArea
Code:
( float fWidth, FontTypes eFont, float fX, float fY, float fZ, bool bFloating, string szArtFile, bool bExpandRight, bool bExpandDown, uint uiFlags, int iMinWidth )

To move the location of the Help Text I need to set the "fX" , "fY" (and maybe "fZ") arguments to where I want the new location, correct?
 
ok (rubs hands together) now to identify the X,Y of the mouse pointer ....
 
found a function called getMousePos(). description says returns mouse coordinates.
 
I posted thread here with some Python info, including a link to an easy-to-naviate HTML version of the API Reference that l made, but noone cared apparently because it dropped like a brick. I can't find it now, but the same thread on Apolyton was much better received: http://apolyton.net/forums/showthread.php?s=&threadid=140611
 
Back
Top Bottom