View Full Version : Map Scripting Tutorial?


MadMage86
Sep 30, 2009, 08:13 AM
Hey all... I've been trying to figure out the fine art of CIV map scripting but I've been having trouble figuring out where to start. I've worked with code before (mainly LISP), so I can pretty much figure out enough of the syntax and functions to be dangerous but I'm drawing a blank when it comes to actually interacting with the CIV engine... I've opened up a few files with the IDLE and pretty much everything in black is a head scratcher to me.

Like, for example... what does CyFractal() do? And how exactly does the game go about generating terrain, features and resources? I'm not talking referencing back to the FractalWorld class - I want to know exactly what THAT thing does that creates a landmass.

Probably seems like stupid questions to someone who's been doing this for a while, I'm just havig a hard tiem gettig off the ground with my idea (and I'd like to do it myself and understand how it works).

cephalo
Sep 30, 2009, 09:00 AM
Read the comments in the file called CvMapScriptInterface.py. That has a rundown of all the python functions that the engine calls for map generation. Most of those functions that you don't put in your map script will be handled the default way, but a couple of them you do have to handle yourself, like generatePlotTypes().

civ editor11
Sep 30, 2009, 09:23 PM
Questions belong in the main C&C Forum.

MadMage86
Sep 30, 2009, 09:34 PM
Read the comments in the file called CvMapScriptInterface.py. That has a rundown of all the python functions that the engine calls for map generation. Most of those functions that you don't put in your map script will be handled the default way, but a couple of them you do have to handle yourself, like generatePlotTypes().

Hrm. That file is useful for figuring out the 'format' of the overall script and the basic functions, but it's still a very cursory guide to the process - most of the functions are rather self explanatory anyway. In all honesty, the Python Class Reference page for CIV is far more useful but the problem is I don't know what most of the parameters do (the hell is iFlags?!?!)... a few have brief desriptions but it's hardly useful as far as learning goes.

cephalo
Oct 01, 2009, 08:27 AM
Once you have read that file, then start browsing the SDK. In particular you will want to get familar with the CvPlot class for starters. Get Visual Studio express and just browse. You can do so many things in a mapscript and you can do it so many ways, that a 'how to' tutorial might be rather limiting. There is no right way. If you can provide those functions in the map interface the data they need, you can do it any way you want.