Problems with mapscripts

Bringa

King
Joined
Jan 23, 2006
Messages
678
Hi,

I can't seem to run any modified mapscripts. I tried both SmartMap and STO's maps from this forum, and when they both didn't work (clicking "Single Player" immediately gives me a "Failed to load python module <name of mapscript>", I did some minimal changes on an exisiting mapscript to see what would happen. It crashed too. Also, when I change the line

HAPDebugger = 0

to = 1 in the .ini file, the Game stops loading when it hits "initializing Python". Is that normal?
 
Bringa said:
Hi,

I can't seem to run any modified mapscripts. I tried both SmartMap and STO's maps from this forum, and when they both didn't work (clicking "Single Player" immediately gives me a "Failed to load python module <name of mapscript>", I did some minimal changes on an exisiting mapscript to see what would happen. It crashed too. Also, when I change the line

HAPDebugger = 0

to = 1 in the .ini file, the Game stops loading when it hits "initializing Python". Is that normal?

First of all, the HAPDebugger is behaving normally. You actually have to run the hapdebugger (a downloadable application) from sourceforge. CivIV is waiting for you to 'start debug' in the HAPDebugger application.

http://hapdebugger.sourceforge.net/

Now as to why mapscripts aren't working for you, that's less clear.

First, make sure you didn't put smartmap in a sub directory, ie that you have:

civ iv directory\PublicMaps\SmartMap.py

and NOT:
civ iv directory\PublicMaps\SmartMap\SmartMap.py

If you've got that right, the next thing I'd say is to try turning on the cheat code:

; Move along
CheatCode = chipotle

in your civiv config.

If neither of those work ... well ... see if you can get the exact error message you're getting.
 
HI ,I don't think this is normal !?
Some players have a problem of compatibility with python (they don't have the module random full) ,but you 're the first wich can't load a Sto_map .
Sorry but i can't help you .
I actually rewrote every map scripts ,using only civ4 function for more compatibility .i'll send you the map as soon as i finish to see if something change ...this is the only thing i can do to help you

Tcho
 
About that random.py issue. It was really getting to me, and it's some sort of pathing issue. I'm not sure exactly what's causing it because I found a workaround. I have Python24 (and 23) installed on my machine, so I copied the random.py file from the Lib directory and put it in the directory of the mod I'm trying to load. Random issues then go away.

This only affects python scripts which are using the random.py module. Not sure why. Something we've installed I bet. Anyone make a mod that changes the random.pyc in the Civ IV assets folder?
 
Hi! Thanks a lot for the info about the HAP Debugger. I should have googled that myself.

Now after turning on most of the other debug options, I get some errors:


Traceback (most recent call last):

File "<string>", line 1, in ?

ImportError: No module named Sto_Terra
ERR: Call function getModPath failed. Can't find module Sto_Terra.py
Traceback (most recent call last):

File "<string>", line 1, in ?

ImportError: No module named Sto_Terra
ERR: Call function isAdvancedMap failed. Can't find module Sto_Terra
Traceback (most recent call last):

File "<string>", line 1, in ?

ImportError: No module named Sto_Terra
ERR: Call function getModPath failed. Can't find module Sto_Terra.py

(I'm using STO's modified Terra mapscript right now; I have the mapscripts directly in the PublicMap directory, of course; I'm one of those strange users who believe in readme files ;P) The PythonErr2.log doesn't hold anything interesting for me:


sys.path = ['ASSETS\\PYTHON\\SYSTEM\\email', 'ASSETS\\PYTHON\\SYSTEM\\encodings', 'ASSETS\\PYTHON\\SYSTEM\\wx', 'ASSETS\\PYTHON\\SYSTEM\\wx\\build', 'ASSETS\\PYTHON\\SYSTEM\\wx\\lib', 'ASSETS\\PYTHON\\SYSTEM\\wx\\py', 'ASSETS\\PYTHON\\SYSTEM\\wx\\tools', 'ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\colourchooser', 'ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\editor', 'ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\floatcanvas', 'ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\masked', 'ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\mixins', 'ASSETS\\PYTHON\\SYSTEM\\wx\\lib\\ogl', 'ASSETS\\PYTHON\\SYSTEM\\wx\\py\\tests', 'ASSETS\\PYTHON\\SYSTEM\\wx\\tools\\XRCed', 'ASSETS\\PYTHON\\SYSTEM']

sys.modules = {'copy_reg': <module 'copy_reg' from 'D:\Python24\Lib\copy_reg.pyc'>, 'locale': <module 'locale' from 'D:\Python24\Lib\locale.pyc'>, '__main__': <module '__main__' (built-in)>, 'site': <module 'site' from 'D:\Python24\Lib\site.pyc'>, '__builtin__': <module '__builtin__' (built-in)>, 'encodings': <module 'encodings' from 'D:\Python24\Lib\encodings\__init__.pyc'>, 'os.path': <module 'ntpath' from 'D:\Python24\Lib\ntpath.pyc'>, 'encodings.codecs': None, 'ntpath': <module 'ntpath' from 'D:\Python24\Lib\ntpath.pyc'>, 'UserDict': <module 'UserDict' from 'D:\Python24\Lib\UserDict.pyc'>, 'encodings.exceptions': None, 'nt': <module 'nt' (built-in)>, 'stat': <module 'stat' from 'D:\Python24\Lib\stat.pyc'>, 'zipimport': <module 'zipimport' (built-in)>, 'warnings': <module 'warnings' from 'D:\Python24\Lib\warnings.pyc'>, 'encodings.types': None, '_codecs': <module '_codecs' (built-in)>, 'encodings.cp1252': <module 'encodings.cp1252' from 'D:\Python24\Lib\encodings\cp1252.pyc'>, 'sys': <module 'sys' (built-in)>, 'codecs': <module 'codecs' from 'D:\Python24\Lib\codecs.pyc'>, 'types': <module 'types' from 'D:\Python24\Lib\types.pyc'>, '_locale': <module '_locale' (built-in)>, 'signal': <module 'signal' (built-in)>, 'linecache': <module 'linecache' from 'D:\Python24\Lib\linecache.pyc'>, 'encodings.aliases': <module 'encodings.aliases' from 'D:\Python24\Lib\encodings\aliases.pyc'>, 'exceptions': <module 'exceptions' (built-in)>, 'CvPythonExtensions': <module 'CvPythonExtensions' (built-in)>, 'os': <module 'os' from 'D:\Python24\Lib\os.pyc'>}

sys.builtin_module_names = ('CvPythonExtensions', '__builtin__', '__main__', '_bisect', '_codecs', '_codecs_cn', '_codecs_hk', '_codecs_iso2022', '_codecs_jp', '_codecs_kr', '_codecs_tw', '_csv', '_heapq', '_hotshot', '_locale', '_multibytecodec', '_random', '_sre', '_subprocess', '_symtable', '_weakref', '_winreg', 'array', 'audioop', 'binascii', 'cPickle', 'cStringIO', 'cmath', 'collections', 'datetime', 'errno', 'exceptions', 'gc', 'imageop', 'imp', 'itertools', 'marshal', 'math', 'md5', 'mmap', 'msvcrt', 'nt', 'operator', 'parser', 'regex', 'rgbimg', 'sha', 'signal', 'strop', 'struct', 'sys', 'thread', 'time', 'xxsubtype', 'zipimport')
load_module CvEventInterface
load_module CvUtil
load_module traceback
load_module CvEventManager
load_module CvScreensInterface
load_module CvMainInterface
load_module ScreenInput
load_module CvScreenEnums
load_module time
load_module CvDomesticAdvisor
load_module PyHelpers
load_module CvTechChooser
load_module CvForeignAdvisor
load_module math
load_module CvMilitaryAdvisor
load_module re
load_module CvFinanceAdvisor
load_module CvReligionScreen
load_module CvCivicsScreen
load_module string
load_module CvVictoryScreen
load_module CvOptionsScreen
load_module CvReplayScreen
load_module CvHallOfFameScreen
load_module CvDanQuayle
load_module CvGameUtils
load_module CvUnVictoryScreen
load_module CvDawnOfMan
load_module CvTechSplashScreen
load_module CvTopCivs
load_module random
load_module CvInfoScreen
load_module CvIntroMovieScreen
load_module CvVictoryMovieScreen
load_module CvWonderMovieScreen
load_module CvEraMovieScreen
load_module CvPediaMain
load_module CvPediaScreen
load_module CvScreen
load_module CvPediaTech
load_module CvPediaUnit
load_module CvPediaBuilding
load_module CvPediaPromotion
load_module CvPediaUnitChart
load_module CvPediaBonus
load_module CvPediaTerrain
load_module CvPediaFeature
load_module CvPediaImprovement
load_module CvPediaCivic
load_module CvPediaCivilization
load_module CvPediaLeader
load_module CvPediaSpecialist
load_module CvPediaHistory
load_module CvPediaProject
load_module CvPediaReligion
load_module CvWorldBuilderScreen
load_module Popup
load_module CvWorldBuilderDiplomacyScreen
load_module CvDebugTools
load_module CvDebugInfoScreen
load_module CvMapGeneratorUtil
load_module CvGFCScreen
load_module CvPopupInterface
load_module CvScreenUtilsInterface
load_module CvScreenUtils
load_module CvWBPopups
load_module CvCameraControls
load_module CvAdvisorUtils
PY:OnInit
load_module CvAppInterface

PythonDbg.log shows this in the end:

load_module Sto_Terra

Sto_Terra

import failed

load_module Sto_Terra

Sto_Terra

import failed

load_module Sto_Terra

Sto_Terra

import failed

PY:OnUnInit
UnInit Python

So what I'm getting is that it's trying to load sto_terra.py somewhere but fails; then it complains that it can't get to the isAdvancedMap function in the sto_terra module (obviously, because the module didn't load). What I'm not getting is that there doesn't seem to be any error explaining WHY sto_terra.py didn't load.
 
I set the cheatcode now and also copied random.py from the lib dir of my python installation into the publicmaps folder. I get a little more in PythonErr.log now:


Traceback (most recent call last):

File "<string>", line 1, in ?

ImportError: No module named Sto_Terra
ERR: Call function getModPath failed. Can't find module Sto_Terra.py
Traceback (most recent call last):

File "<string>", line 1, in ?

ImportError: No module named Sto_Terra
ERR: Call function isAdvancedMap failed. Can't find module Sto_Terra
ERR: Call function getModPath failed. Can't find module random.py
ERR: Call function isAdvancedMap failed. Can't find module random
Traceback (most recent call last):

File "<string>", line 1, in ?

ImportError: No module named Sto_Terra
ERR: Call function getModPath failed. Can't find module Sto_Terra.py
ERR: Call function getModPath failed. Can't find module random.py

The same for SmartMap:


ERR: Call function getModPath failed. Can't find module random.py
ERR: Call function isAdvancedMap failed. Can't find module random
Traceback (most recent call last):

File "<string>", line 1, in ?

ImportError: No module named SmartMap
ERR: Call function getModPath failed. Can't find module SmartMap.py
Traceback (most recent call last):

File "<string>", line 1, in ?

ImportError: No module named SmartMap
ERR: Call function isAdvancedMap failed. Can't find module SmartMap
ERR: Call function getModPath failed. Can't find module random.py
Traceback (most recent call last):

File "<string>", line 1, in ?

ImportError: No module named SmartMap
ERR: Call function getModPath failed. Can't find module SmartMap.py

Putting random.py into civdir/Assets/Python/System (where it should be preferred over random.pyc, of course) didn't help either.
 
Hi!
There is something i don't understand with the log !
i don' t define 'getModPath' in the maps ,do you make it ?

Don't put another .py in public map folder ,they are all open at the beginning of the game to see if this is map scripts .Do you put Sto_terra in an other folder than publicmaps folder?
And it seems that the pb is not with the module random .because it support init of the maps and don't have time to run a random.function (the map chashed before).

Is there some other custom maps you can load?
 
There is something i don't understand with the log !
i don' t define 'getModPath' in the maps ,do you make it ?

I did not change anything about your mapscripts nor about the game. Pure untampered Civ4 1.52.

I removed random.py from the PublicMaps folder again, and as I said before, I'm putting my mapscripts in the right place ;) (that'll be directly into PublicMaps, not into any subfolder)

As for other mapscripts (custom MAPS load fine; it's just the mapSCRIPTS that don't), I've tried SmartMap and your scripts, and they seem to all create the same error.

I'll try reinstalling the game.
 
hi!
do the maps works after reinstalling?
 
Complete reinstall solved the problem. The only changes I had made on my previous version were in the .ini file, so I really cannot fathom how that might have kept the map scripts from working. Oh well; that mystery belongs to the past then.

Thanks a lot sto and surt for trying to help me sort this out! (and for your map scripts, of course ;))
 
Back
Top Bottom