[TUTORIALS]Diary of a Mod-Intro

TheBrit

Chieftain
Joined
Sep 29, 2009
Messages
12
I. Series Introduction
II. XML
III. Modding Introduction (Modular Modding)
IV. New Units
Appendix I. Tutorials I used






I. Series Introduction

This will be a series of tutorials following my progress on creating a mod using a combination of SDK programming, Python and XML. I call it

a series though considering my ability to keep to a schedule, your grandchildren will probably be the first to read part two of the

tutuorial, but I'll try :). I won't be changing any graphics (I'd love to, but I don't have the skills to create the graphics, so unless

someone randomly decides to drop me some for which I'd be immediately grateful, I'll be stea--borrowing the existing CivIV graphics :)).

Target Audience, I hope is for those with zero programming experience or little, to people with little CivIV experience. I will try to

define, where I can, the parts which will need to be the same for every change and what changes, if any, need to be made on an individual

basis.

The last thing I should explain is the particular mod I'm working on. I'm creating (extremely relaxedly, and never to be finished), a mod

based on Discworld. What this will mean for you, readers is the following: As I am creating a total conversion mod, I will be changing many

features, from new units, new terrain types, new civilisations, new menus and entirely new gamplay features. I won't explain every unit I

make, but I will explain a simplified version of each type of change and I may make modifications to old parts of the tutorials as I learn

more of the SDK in the process.

You're also going to have to forgive me, I will be using British spellings of words, wherever I forget. If anything stands out as

indecipherable (I hope nothing) you'll have to let me know :)

Don't ask me about: Monty, Quantum Physics, Particle Electrons, Monty, The descent of man, Plato's Republic or Monty. Anything else I'll be

happy to answer if I can :)

EDIT - All changes will be as modular as I can make them. If you don't understand what this means, don't worry, I'll explain it as we go

through. They are also for CivIV:BTS, but some will be applicable, though you may have to determine how to change the tutorials

independently. I will -eventually- be adding an introduction to XML, there is a short introduction to modding (there's better out there, look

at some in my Appendix I, or the Modiki) and an introduction to compiling the SDK, but these will be coming later. For now, I'll hope you've

learnt these things or can learn them from other tutorials.





I. Modding Introduction (Modular Modding)

If you've ever done any kind of CivIV modding, you can probably ignore most of this section and if you've ever done any modular CivIV
at all,

you can nod off during this chapter. :)

If you're still here, welcome to the wonderful world of modding CivIV :)

I'll be going through this section briefly, but I hope slow enough that you can follow anyway... if not there are much better tutorials, or

you can just skip to the "Units" chapter and follow it through, learning by doing.

I'll begin by explaining "how" to make a new mod for CivIV:BTS. It's an extremely difficiult process, but I think you can handle it if you

follow my instructions carefully...

1) Go into your CivIV/BTS/Mods folder and create a new folder with the name of your mod.

Oh wait... there -is- no 2) :) You've just made your first mod :) However to make launching this mod easier, I'll recommend something I saw

in the video tutorials by... If you make a shortcut of your Civ4BeyondTheSword.exe file, right click and choose properties and add the phrase

"mod=modname" after the target (hopefully you'll realise you're to replace "modname" with your own mod's name :))

At the moment, your mod does nothing, so I'll explain the Assets folder. In your BTS folder, is another folder labelled "Assets". The

contents of this folder are the data files used by Beyond the Sword when the game loads. To make any changes for your mod, within your mod

folder, you simply copy the file you want to change into your mod folder (keeping the folder structure) and make the changes there. The

typical "simple" modification is to simply to create folders in your Mod structure as such "<modname>/Assets/XML/Units" and copy

"Civ4UnitInfos.xml" from the appropriote folder in your BTS folder. I will eventually be adding a section to this tutorial on XML modding,

though for now I'll suffice to say that XML files hold most of the information about the various aspects of your mod. If you search in this

file for "Settler" (I use Notepad++, I really wouldn't recommend Notepad for this and I'm pretty sure you -can't- use Microsoft Word.

Notepad++ is free and does the job splendidly), find "iMove" under this and change the number to 20, then launch your mod with the shortcut

you made earlier... you'll notice everything looks the same... except now your settler moves 20 steps a turn instead of two! You've just made

your first -real- mod! Go post it on CivFanatics! I'll wait... ... ... Done? Good :) Now delete that file and we'll move on to modular

modding.

Modular modding uses the same idea of your assets folder, but this time, you're not copying directly from the Assets folder. Instead, you're

creating a new "Modules" folder within your assets folder and then creating brand new files for every new item you create. Why!? You may ask.

Why would I want -more- files!? Well, there are lots of reasons, but in particular, it means you can merge mods, simply by combining the

modules and it's simpler to change and add new items, "overall"... just "slightly" more difficult in the short run :)

Typically you would create a new folder to hold all the files for your new item (as I will be doing) and files follow the naming structure of

"<itemname>_<filename>". This is how CivIV will load the files... for example, from the New Units part of my tutorial, creating a new

"Population" unit, there are files named "Population_CIV4UnitInfos.xml", which CivIV recognises as one of it's own.

I won't be going into detail on modular programming, instead as you follow my tutorials, I hope you'll find it easy to see how it works. I'll

be a lot more descriptive as we go through the process later today (hopefully) of "CREATING A BRAND NEW UNIT IN CIV4"! Seeya then :)
 
Back
Top Bottom