Editing Civilization IV/Python Tutorial
From StrategyWiki, the video game walkthrough and strategy guide wiki
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
{{drivel}} | {{drivel}} | ||
{{Header Nav|game=Civilization IV}} | {{Header Nav|game=Civilization IV}} | ||
Python can be used to | Python can be used to achieve a surprising amount of things in Civ 4, but only if you know how. Now, while I'm probably not the best person to be writing this tutorial, I feel I am quite familiar with the sort of things you can do to the game with it. Please feel free to edit anything I've got here, as the tutorial is far from complete. The tutorial is also on CFC [http://forums.civfanatics.com/showthread.php?t=154130| here]. Any updates on the wiki I will attempt to update there, though obviously the format is a bit stricter there. | ||
If you want to know a little bit about python, I'd check out [http://en.wikipedia.org/wiki/Python_programming_language| the wikipedia entry] and [http://www.python.org| the python website] | |||
Just a brief rundown on what python is capable of in Civ 4 terms: | |||
Python can' | '''Python can:''' | ||
* be used to make complex scripts causing events to happen on a trigger. For example, you can make it so that if you take the holy city of a religion, all Civs following that religion will declare war on you. | |||
* be used to edit the interface. Pretty much all of the game interface is generated dynamically by python, and can be edited in python. You can make new buttons, alter the layout of the Civelopedia, change the way the tech tree is generated... and even, if you so desire make a small dancing pig in the corner of your screen - with music (though I don't believe anybody has tried this, I'm pretty sure it's doable). There are limitation to this - mouseover texts, for example, are far better suited to the SDK. | |||
* be used to generate new map types. I haven't tried this myself, so it might not be covered too well in this tutorial. | |||
* be used to edit the AI... I'd do it with the SDK though, as it'll probably save a lot of time! | |||
'''Python can't:''' | |||
* be used exactly how you might want to use it. While the amount of things you can do in it is really quite large, there are several things you just can't do. This is really quite annoying, but it's something you've got to learn to live with. The amount of things you ''can'' do is staggering, so don't complain. Hopefully with the release of the SDK more experienced coders will enhance the ability of python to change the way the game works. | |||
Still reading? Good! | |||
Now my suggestion for first steps would be to browse through [http://sthurlow.com/python/ GBM's python tutorial], which gives a brief outline of how to program in python. Also, if you have not done so, check out [http://www.python.org the python website] which has lots of information about python (unsurprisingly). Finally, I'd check out [http://modiki.apolyton.net/index.php?title=Guide_to_Python_in_CIV this python tutorial ''by Jon (Trip) Shafer, Firaxis''], who's tutorial you may find better than mine, after all, he is the guy who coded a lot of it in the first place. |