Gingerbread Man
Dark Magus
Go to my python tutorial website for updated versions of all the lessons posted in this thread. The site also contains some other things that may be useful for your Civ Python modding adventures, so feel free to have a look, and ask questions in this thread if they arise.
Lesson Index:
(Opens in a new window. Post number Next to link)
Lesson 1 - What is Python, and how do I install it? Post 25
Lesson 2 - One-liners - very simple 'programs' Post 43
Lesson 3 - Programs in a file, and variables Post 70
Lesson 4 - Loops, Loops, Loops, Loops, Loops, Loops... Post 85
Lesson 5 - Oh, how functional! Post 105
Lesson 6 - Tuples, Lists, and Dictionaries Post 120
Lesson 7 - another loop, and a simple game Post 134
Lesson 8 - Let the classes begin! Post 153
Lesson 9 - 'Borrowing Other People's Stuff (with Modules) Post 187
Lesson 10 - File I/O Post 189
Lesson 11 - Exception Handling: dealing with the dumb Post 197
Firaxis made a daring and interesting move when they announced that much of the modding in cIV will be in Python and XML. Python is a well established language that is well known among server-side scripting and open-source communities. XML is a relatively new markup language, often mistaken for something like HTML, but actually has an entirely different purpose.
with Firaxis making this move, the civ modding community has an unprecidented opportunity - they can learn the modding language before the game evn comes out!
So, I'm thinking, with at least a year until cIV comes out, we should start learning python an XML now! By learning python, and focusing on the logic aspects of it that will be used in the AI, we may only need a slight learning curve to adapt it to cIV.
Here, I am periodically posting very easy, interactive, tutorials in python. Anybody can join, from a person with no programming experience, to a full-blown professional developer. Python and XML are both free, and easy to obtain.
And remember - This is a living tutorial, not some lifeless, static text book. Ask questions, share thoughts, grow your knowledge!
Lesson Index:
(Opens in a new window. Post number Next to link)
Lesson 1 - What is Python, and how do I install it? Post 25
Lesson 2 - One-liners - very simple 'programs' Post 43
Lesson 3 - Programs in a file, and variables Post 70
Lesson 4 - Loops, Loops, Loops, Loops, Loops, Loops... Post 85
Lesson 5 - Oh, how functional! Post 105
Lesson 6 - Tuples, Lists, and Dictionaries Post 120
Lesson 7 - another loop, and a simple game Post 134
Lesson 8 - Let the classes begin! Post 153
Lesson 9 - 'Borrowing Other People's Stuff (with Modules) Post 187
Lesson 10 - File I/O Post 189
Lesson 11 - Exception Handling: dealing with the dumb Post 197
Firaxis made a daring and interesting move when they announced that much of the modding in cIV will be in Python and XML. Python is a well established language that is well known among server-side scripting and open-source communities. XML is a relatively new markup language, often mistaken for something like HTML, but actually has an entirely different purpose.
with Firaxis making this move, the civ modding community has an unprecidented opportunity - they can learn the modding language before the game evn comes out!
So, I'm thinking, with at least a year until cIV comes out, we should start learning python an XML now! By learning python, and focusing on the logic aspects of it that will be used in the AI, we may only need a slight learning curve to adapt it to cIV.
Here, I am periodically posting very easy, interactive, tutorials in python. Anybody can join, from a person with no programming experience, to a full-blown professional developer. Python and XML are both free, and easy to obtain.
And remember - This is a living tutorial, not some lifeless, static text book. Ask questions, share thoughts, grow your knowledge!