Python (civ4 scripting language) tutorial thread

Gingerbread Man said:
I'd be careful where you say that word. Go to its article in wikipedia, and you will understand the sexual references behind it...

in french we have the same expression, and the sexual reference is there to. "branleur"

Gingerbread Man said:
kettle of fish
i have to remember this one
 
Gingerbread has it right, exactly the reason I didn't want to quote the dictionary reference to the English version of "branleur". Although I might be able to incorporate branleur into my vocab. You never know when you might use it...;)

As to the Kettle of Fish, never heard the saying, understand the meaning. Good one though, gotta quote it sometime.

Thanks for the Wikipedia ref Stgelven. Does your name 'stgelven' mean something in French or is it just random type?
 
borzi_767 said:
Does your name 'stgelven' mean something in French or is it just random type?

"stgelven" is in fact "saint gelven", the name of a very little village in bretany (250 persons) where we lived in bretany 1 years and 6 month ago


borzi_767 said:
Almost forgot, you French extremely dislike the English

why did you say that? i didn't know that frenchmen doesn't like english peoples.
 
Your right, probably not a lot of Frenh dislike the English but I heard that there was a sort if enmity between the 2 nations? SOmething about he English chopping off 2 the frenchmans fingers ages ago. Ah well, i wouldnt know, shoukld have asked when I was there shouldnt I!
 
Hiya all. I have been a Civ Fanatic since the beginning. I have never really gotten involved with the boards here or multiplayer because I just love to play. I download maps and read posts, get advice etc.

I am quite the moron when it comes to modding and would like to learn how. I have some really cool Ideas that I would love to see played out on CIV IV. I understand that Civ 4 is supposed to be a modders dream and that for the first time even I could possibly create a scenario or maybe even a completed mod pack.

I have enormous respect for all of you guys who have given your all to this game. Day after day coming up with new Ideas, mods, skins, maps, scenarios, etc. Because of you guys I can totally enjoy one of the main constants in my life since The CIV Franchise has been around.

I would like to attempt to give something back. I would like to learn how to create a scenario to offer up to others for their enjoyment. Unfortunatly My handicap strikes me... (the moron factor) I have read some of the Python tutorial and I kind of get it. Is there a hands on tutorial somewhere that will actually walk me through creating an actual scenario? I learn well by doing.

My final point is this even if I am never able to overcome my programming handicap (moronism LOL) I would like to at least share some of my Ideas with y'all so that maybe I could offer something back. I may not understand how to mod, but I do have some pretty neat Ideas, for some scenarios.

Anyway I want to thank y'all from the bottom of my heart for all of the work you have done for this Fantastic Game I have enjoyed it to no end.
 
Hello and Welcome Pckering,

This thread is about learning Python Script and troubleshooting when you come to a problem using it, Python is the third level of modding available to CIV users, the tiers being:1: World Builder, 2: XML editing 3: Python Editing and 4: The soon to be availiable SDK (Software Developers Kit) The whole ideas of all of these levels of modding is to give the player the ability to create something loosley based on Civilization. If you learn the tutorial and ask a few questions as you delve into trying to mod CIV then you should have no problems. Other Threads deal with learning XML script.

Gingerbread Man is in the process of creating a CIV based Python tutorial.

I don't know if we post ideas on this thread, so Gingerbread Man will have to answer that.

Howdy!

P.S: Don't worry about the moroninism, after a while it will wear off (I've still got the remnants of it)
 
I was wondering around in the Civ4 Forums when I discovered this thread and it really gave me an interest to learn Python. I know QBasic, VisualBasic, C++, HTML, and XML. So far I find that Python is a versatile but simple language with an easy learning curve. I don't have Civ4 so don't expect any Civ4 mods from me anytime soon, but I can see why Firaxis decided use Python for the game.

I can't believe I didn't find this thread earlier, I appreciate the work you put into this Gingerbread Man! :thumbsup:
 
THanks BOrzi.. I have found the manual for world builder and will start there. Then move on to the more difficult stuff. Like Python, XML, etc. Just giving you guys a warning I will be picking brains. LOL


Pickering
 
I know Python well, based on use outside of Civilization IV modding. However, I do not know how to actually use Python in Civilization IV. Is there a tutorial for a sort of "Hello, World!" program? What I mean is, though I know the syntax and semantics, where can I find out how to create and run the modifications?

I am sorry if this question has already been answered, but I have been searching through the stickies in this forum to no avail.
 
Hey this looks good, I have Windows and found Python, did a few lessons, taught my computer how to "talk" to me....

>>>Hello="Have a nice day"

Considered that is far as I want to get, now about editing with Python, how do I do that?
 
Hello. I'm new here to this site and everything. I just got Civ 4 for Xmas and haven't even had that much time to play it. (I had to upgrade my computer to play and so didn't get to start till after the new semester began). Anyway, I'm pretty excited about the modding options even though I like many others I see here don't have almost any programming experience. I did basic years ago and I have done some very limited HTML. I guess I have a couple of soft questions to start off. 1) What exactly is the difference as far as modding goes between the XML stuff and the Python stuff? 2) Is there a separate thread for XML stuff related to Civ 4? 3) It looks like there is alot of info in the thread and all the new people ask for intro so I will try to look around myself but if there's anything in particular it would be good to know, I would appreciate the pointers. In that vein, at the beginning this thread looked more directly interactive with a kind of "teacher" "class" format, etc. Is that still how things are now, or is more like it's all been done, read for yourself and we're here to help and answer questions model? 4) I'm looking to go slow as I just started getting into the game, and I've got plenty of other stuff to keep me busy, so I'm not in a hurry with the modding though I might download something to try out. One question that may seem silly, but I just want to make sure that if I download some of these mod packs etc. that I am only adding something, not actually changing the core game I have installed? (I know that will be a possibility, I just want to make sure it's on my terms :)
Ok, thanks for any feedback!
 
Hey Jabot!:)

Welcome to the thread. In regards to your questions about XML and Python Stgelven posted Wikipedia shortcuts to the defenitions of both. They can be located on this page. There are seperate threads for XML editing. At the beggining of the thread there are links to Gingerbread Mans tutorial for Python. Although you would be better off going through the links on his posts as the tutorial and version of python it offers on the first post are now out of date. As of the moment the tutorial only covers python modding in general while gingerbread man is working on a CIV based tutorial of it.

When you download a mod it needs no installing and changes no system files. Most good mods will contain readme's on how to place the included files but after a while you will learn what to do. When we edit Python and XML script we simply copy the CIV files we want to edit and edit them as something seperate. They do NOT replace normal CIV files. I'm not sure exactly how the next step functions so you will have to ask a more experienced person on the matter, but what I think happens is that you package your mod and place it in the MOD section of the CIV files. When you next run CIV you can go into the menu:

Main Menu>>>Advanced>>>>Load Mod>>>> (Example Mod)

If you have done it correctly CIV will restart and load the changed files so it plays differently. If you read the post I welcomed pckering with it explains the levels of modding available and what you will be able to do eventually. But for now, my fingers hurt so I'm going to say:
Welcome to the Club

P.S: When I got the game my computer wouldn't run it correctly either but after installing the patch which was specifically designed for lower spec comps i was able to run it correctly. (I have a 32mb graphics gard, what was yours? And what wasnt supported?)

I hope I didn't miss any of your questions!!!! If so tell me!!!!!
 
Thanks for the reply Borzi. :) I've started to find my way around the forums more now. I think I realized it's probably better for me to start of with the simpler level of modding at this point and then work up to the python if I'm able! It's pretty amazing all the things that people are doing! Thanks again and see you around!
 
@ borzi
If you want a mod to runs every time you load civ without having to choose load a MOD in civ there is also a customassests folder under mygames/Civilization4. When you runs civ4 in will as a first proriety use any of the files that are in this folder and if it cant find the file it will use the defalt file loacated in the assets folder where you installed civ. When you mod civ4 the typical aproach is to make a copy of the file you want to cange and then place it in the appropriate place in the custom assets folder. Then you can easily change the new file.
 
Gingerbread Man, I read post number 120 (lesson 6) about dictionaries, which The Great Apple was helpful enough to direct me to.

My next question is: how do you assign multiple values to the same key? In the phone book example, is it possible to give each entry multiple phone numbers? And is it possible to give each key multiple values of different types? For example, let's say I wanted to give each member of the phone book 3 phone numbers, plus the names of 2 emergency contacts. If this can be done, how can it be done?
 
Thanks vbraun, that helps. :)
 
And don't be afraid to stop there, you can nest dictionaries, lists, and tuples as far as you want. The more you have, the more confusing it could get.
 
Back
Top Bottom