View Full Version : Python Question (Mapscript)


GRM7584
Aug 30, 2006, 10:14 AM
I'm sure if I had used a tutorial to learn python from scratch I would know what was going on, but after searching the forums and scanning through the tutorial provided in GM's thread, I'm still a bit lost.

What I am trying to do is create a random earth type mapscript in the same vein as terra, but with a lot more regions and a lot less regional randomization (eg boundary-moving). So, I used the Terra mapscript as a starting point, replacing everything under the TerraMultiLayeredFractal subclass while leaving almost everything else alone. I've tried a number of different alterations of the basic idea, but it always produces the same result, which is: no plot generation. At all. It only generates terrain, and completely ignores the MultiLayeredFractal class which should be generating plots (and is the only point of the script, at that); I even deleted the entire subclass from the 'script', and it produced the exact same kind of map (all terrain, no plots - as in, no Ocean, no Hills, No Peaks). In any case, no error messages or exceptions while generating the map.

So: I'm assuming its something painfully simple about python that I don't understand from a lack of self-tutoring, and I've spaced somewhere I should have tabbed, or deleted something vital in the subclass. I haven't altered any other file that mapscripts are dependent on.
Edit: I forgot a proper question. The proper question is: Any idea what I've done wrong and how to fix it?

Sto
Aug 30, 2006, 12:31 PM
check this link to enable the debugger :
http://forums.civfanatics.com/showthread.php?t=172480

you will be able to check your synthax error .

or this one , for info :
http://forums.civfanatics.com/showthread.php?t=172767

there is also a lot of tutorial in this forum for python
Do not hesitate to post your file if you want further help .

Tcho !

GRM7584
Aug 30, 2006, 01:06 PM
That is exactly the sort of thing I was looking for; not having error messages was throwing me completely, it didn't occur to me that the game would have them innately turned off for python. The script looks to be working as intended (now that 2 spelling errors are corrected), so now I just have to fix all the intentional mistakes.

Edit: Thanks! (http://forums.civfanatics.com/showthread.php?t=184377)