 |
|  |
 |
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:18
|
|
There are many places to learn about Python, one that I like myself is the tutorial on the official website: http://www.python.org/moin/BeginnersGuide (it should be noted that it covers most aspects of Python, it's quite extensive). This one is particularly good for people with zero programming experience.
I would indeed recommend that everyone who wants to get into Python for Civilization 4 start looking into tutorials like these before the game's release. You now have all the time in the world anyway, so you can see what it's like and if it would be something for you (not everyone will be into it). Then, when you get your hands on Civilization 4, you only need to learn the Civ4-specific parts of Python before you can start writing scripts.
As far as XML goes, if you want to see an example of XML, go to the menu View of your browser and select Source or Page Source or something like that (depending on your browser). You'll see the HTML source of this page, that's a fine example of what XML looks like (it's not actually XML, but very, very similar; XML is based on HTML). XML allows programmers to make up their own 'language', so there's no way to predict what XML for Civilization 4 will look like, that's entirely up to the programmers at Firaxis. However, all XML languages look alike. The portion of XML that stores the unit data might look something like this:
<Unit>
<Type>Spearman</Type>
<Class>Melee</Class>
<CostToBuild>240</CostToBuild>
<MaintenanceCostShield>2</MaintenanceCostShield>
<MaintenanceCostFood>0</MaintenanceCostFood>
<MovementPoints>1</MovementPoints>
<StrengthValue>4</StrengthValue>
<BonusAgainstHorse>100</BonusAgainstHorse>
<BonusAgainstTank>0</BonusAgainstTank>
</Unit>
Of course, the details such as exact names and stats will be different and presumably there will be many, many more stats, but the basic idea is always the same. All other in-game data will be stored using a similar pattern.
As you can see, providing Firaxis uses meaningful naming conventions XML should be pretty easy and intuitive to use, and at least for simple modding the learning curve is almost much flat (you only need to figure out where everything is located)...
|
|
|  |
 |
|
Locutus
|
|
ACS CTP1/2 Manager & Civ4 Co-Manager
|
 |
Hengelo, The Netherlands
Nov 1999 time: 06:18
|
|
By that I mean that the pattern in XML is always the same:
<SomeDataType>
<SomeProperty>SomeValue</SomeProperty>
<SomeProperty>SomeValue</SomeProperty>
<SomeProperty>SomeValue</SomeProperty>
<SomeProperty>SomeValue</SomeProperty>
</SomeDataType>
However, all the details of an XML language, such as the exact names of the datatypes, properties, etc and the exact values that are allowed, and of course what impact they will have when you use the language, those differ per language. E.g. in HTML <b> displays text in bold, in Civ4 it will probably mean nothing and generate an error. In Civ4 <StrengthValue> might indicate the unit strength, in HTML it means nothing. Thus, exactly what XML for Civ4 will be like is impossible to predict, but it will still follow the same pattern that all XML languages use.
To compare it to natural languages: knowing that Civ4 will be XML is like knowing a language is Germanic. But to be able to speak that language, you will still need to know whether it is English or Dutch or German or Swedish or Frisian, etc. Without knowing that you still won't be able to make yourself understandable in that language. All those languages may have a lot in common, but they also have a lot of differences.
|
|
|  |
 |
|
Senethro
|
|
I'm not so interested in a fantasy mod but in a Alpha Centauri recreation mod. I've whispered here and there that it would be a good idea. I don't think anyone would object to having working Social Engineering or Unit Workshop code available for incorporation into their own mods and it would be a mod for gathering experience with Civ4.
Any thoughts?
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:18
|
|
Locutus, your xml examples are only one possibility of doing xml. There's also this one:
<Unit name="Spearman" strength="2" someProperty="someValue"/>
I don't think Soren showed an example of what the actual format would look like? Although I definitely perfer the more verbose one using <x>value</x> instead of x="value" since you can't do everything with the latter format but can with the former.
[edited the lt; > stuff]
Last edited by LDiCesare on 04-05-2005 at 23:26
|
|
|  |
 |
|
LDiCesare
|
|
La Ferté sous Jouarre France
Jan 2001 time: 05:18
|
|
You can even make forms to help fill out xml automatically. Richard Burns had done that for the tech model in Clash (where all resources are xml). It was nice, even though we didn't use it a lot, and I'm sure that people will create some helper tools fast if firaxis doesn't provide any (after all, we've got modswapper for CtP2 and Galciv had an player-created editor for text resources - this should be even easier).
|
|
|  |
All times are GMT. The time now is 05:18. Apolyton Time is 00:18. |
top of page
|
|
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|