Changes between Version 2 and Version 3 of CreatingNewUnits


Ignore:
Timestamp:
May 4, 2014, 5:50:19 AM (10 years ago)
Author:
leper
Comment:

wikify this a bit

Legend:

Unmodified
Added
Removed
Modified
  • CreatingNewUnits

    v2 v3  
    1 '''Introduction'''[[BR]]
     1[[TOC]]
     2
    23This tutorial covers the workflow of adding and editing units. You will learn how to create
    34templates and link them at the correct way. In the end you will have a fully featured axeman.
     
    56[[Image(http://i.imgur.com/fKKBq0d.png)]][[BR]]
    67
    7 '''Table of contents'''[[BR]]
    8 * First start[[BR]]
    9 * Setting up a template[[BR]]
    10 * Setting up an actor[[BR]]
    11 * Make the unit trainable
    12 * Result[[BR]]
    13 [[BR]]
    14 
    15 '''First start'''[[BR]]
     8== First start[[BR]]
    169If you haven't done already, download the game and install it in any directory you like or obtain the
    17 source code using TortoiseSVN: <http://trac.wildfiregames.com/wiki/TortoiseSVN_Guide>. I'm
     10source code using TortoiseSVN: [wiki:TortoiseSVN_Guide TortoiseSVN Guide]. I'm
    1811using the SVN version in this tutorial.
    1912
    2013
    21 Navigate to the directory of the game, in my case: <D:\0_A.D._source>. Then go to
    22 <\binaries\data\mods>. Here you will find a few folders, one of them is <public>. In this folder you
     14Navigate to the directory of the game, in my case: ''D:\0_A.D._source''. Then go to
     15[source:/ps/trunk/binaries/data/mods binaries/data/mods]. Here you will find a few folders, one of them is [source:/ps/trunk/binaries/data/mods/public public]. In this folder you
    2316will find all the data and gameplay scripts related to the main game of 0 A.D.
    2417The game works with the so called mod folders. Everything you put in there will override the main game's data, the only requirement is that you load them.
    25 Do so by creating a shortcut targeting pyrogenesis.exe located in <\binaries\system>.[[BR]]
     18Do so by creating a shortcut targeting pyrogenesis.exe located in [source:/ps/trunk/binaries/system binaries/system].[[BR]]
    2619
    2720[[Image(http://i.imgur.com/jUKk6Tl.png)]]
    2821
    2922Add “-mod=testmod” to the target and press OK.
    30 Go back to the mods directory and create a folder called <testmod>.
     23
     24Go back to the mods directory and create a folder called '''testmod'''.
    3125You will notice a few additional maps in my folder, ignore them.[[BR]]
    3226
    3327[[Image(http://i.imgur.com/j8P9lA9.png)]]
    3428
    35 Create the following map structure like you see in the public mod:[[BR]]
    36 <\simulation\templates\units>[[BR]]
    37 <\simulation\templates\structures>[[BR]]
    38 <\art\actors\units\gaul>[[BR]]
     29Create the following map structure like you see in the [source:/ps/trunk/binaries/data/mods/public/ public mod]:[[BR]]
     30 * [source:/ps/trunk/binaries/data/mods/public/simulation/templates/units simulation/templates/units][[BR]]
     31 * [source:/ps/trunk/binaries/data/mods/public/simulation/templates/structures simulation/templates/structures][[BR]]
     32 * [source:/ps/trunk/binaries/data/mods/public/art/actors/units/gaul art/actors/units/gaul][[BR]]
    3933
    4034To save time and effort we will use already existing meshes, textures and animations (we therefore
     
    5246[[BR]]
    5347
    54 '''Setting up a template'''[[BR]]
    55 Good. Now let's head over to the template. In <simulation\templates\units>, create a file called
     48== Setting up a template[[BR]]
     49Good. Now let's head over to the template. In [source:/ps/trunk/binaries/data/mods/public/simulation/templates/units simulation/templates/units], create a file called
    5650“gaul_champion_axeman.xml” and open it in a text editor of your choice. Finally paste the
    5751following code in it:
     
    108102
    109103
    110 In the <Cost> tag the training costs are defined, we did set the metal costs to 75. The other costs
     104In the ''<Cost>'' tag the training costs are defined, we did set the metal costs to 75. The other costs
    111105are defined in the parent file.
    112106
    113107
    114 In <Identity> all info about the unit is explained. You might notice that we called the unit “Gaul
     108In ''<Identity>'' all info about the unit is explained. You might notice that we called the unit “Gaul
    115109Axeman” and that we are requiring a technology to be researched before the Axeman gets
    116110trainable.
    117111
    118112
    119 Lastly we see the <VisualActor>. This is a link to an actor file in which the visuals are defined. In the
     113Lastly we see the ''<!VisualActor>''. This is a link to an [wiki:Actors actor] file in which the visuals are defined. In the
    120114template we just created, all the rest is defined.[[BR]]
    121115[[BR]]
    122116
    123 '''Setting up an actor'''[[BR]]
    124 Now, let's go to <\art\actors\units\gaul> and create the actor file we defined above.
     117== Setting up an [wiki:Actors actor][[BR]]
     118Now, let's go to [source:/ps/trunk/binaries/data/mods/public/art/actors/units/gaul art/actors/units/gaul] and create the actor file we defined above.
    125119Paste this code into the file:
    126120
     
    177171[[BR]]
    178172
    179 '''Make the unit trainable''' [[BR]]
     173== Make the unit trainable[[BR]]
    180174So far, so good. We now have the stats ánd the visuals. Now let's think of a location to train the
    181175unit. I'm choosing the barracks. Therefore I need to copy the “gaul_barracks.xml” from
    182 <simulation\templates\structures> and copy it in the right folder in our own testmod.
     176[source:/ps/trunk/binaries/data/mods/public/simulation/templates/structures simulation/templates/structures] and copy it in the right folder in our own testmod.
    183177
    184178Edit the file by adding “units/gaul_champion_axeman” (this is your template file) to
    185 <ProductionQueue>.[[BR]]
     179''<!ProductionQueue>''.[[BR]]
    186180
    187181[[Image(http://i.imgur.com/qE7NIOP.png)]]
     
    189183[[BR]]
    190184
    191 '''Result'''[[BR]]
     185== Result[[BR]]
    192186Well done, you made it to complete the tutorial! Run the game using your shortcut. The result
    193187should be like below. If it gives some errors than likely you made some spelling errors. Go back and