From StrategyWiki, the video game walkthrough and strategy guide wiki
Jump to navigation Jump to search

Python can be used to modify the behavior of Civilization IV, and is essential if you want to create a new game. This tutorial for python originated from the Civilization Fanatics Center forum, and will provide basic information on how to modify the game.

For an overview of Python, you will need to check the python website, and the the wikipedia entry.

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.
  • 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 Civilopedia, change the way the tech tree is generated... and even radical changes such as a small dancing pig in the corner of your screen, with music. There are limitation to this - mouseover texts, for example, are far better suited to the SDK.
  • Generate new map types. I haven't tried this myself, so it might not be covered too well in this tutorial.
  • Edit the AI behavior. However, the SDK may be more suitable for this task.

Python can't be used exactly how you might want to use it. While the amount of things you can do in it is quite large, there are limitations on Python section of the code.

Additional tutorials for programming Python on general include GBM's python tutorial, which gives a brief outline of how to program in python.

Another simple tutorial for beginners is Python tutorial - Learn step by step to learn elementary to advanced concepts of Python.