From StrategyWiki, the video game walkthrough and strategy guide wiki
Jump to navigation Jump to search
m (spelling)
m (Added a Python resource)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{drivel}}
{{drivel}}
{{Header Nav|game=Civilization IV}}
{{Header Nav|game=Civilization IV}}
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.
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 [http://forums.civfanatics.com/showthread.php?t=154130 Civilization Fanatics Center forum], and will provide basic information on how to modify the game.


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]
For an overview of Python, you will need to check [http://www.python.org the python website], and the [[wikipedia:Python_programming_language|the wikipedia entry]]


Just a brief rundown on what python is capable of in Civ 4 terms:
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:'''
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.  
* 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:'''
Additional tutorials for programming Python on general include [http://sthurlow.com/python/ GBM's python tutorial], which gives a brief outline of how to program in python.
* 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!
Another simple tutorial for beginners is [https://www.techbeamers.com/python-tutorial-step-by-step/ Python tutorial - Learn step by step] to learn elementary to advanced concepts of Python.
 
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.

Latest revision as of 04:31, 12 September 2018

drivel
drivel

This page contains unnecessary drivel. As our aim is to present helpful and complete guides for games, pages do not need to contain unnecessary information, such as the names of contributors, or mini guides for editing. If you are qualified, please edit it to remove the drivel, and then remove this template from the page.

If you need help with wiki markup, see the wiki markup page. If you want to try out wiki markup without damaging a page, why not use the sandbox?

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.