Changes between Version 2 and Version 3 of CreatingNewUnits
- Timestamp:
- May 4, 2014, 5:50:19 AM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CreatingNewUnits
v2 v3 1 '''Introduction'''[[BR]] 1 [[TOC]] 2 2 3 This tutorial covers the workflow of adding and editing units. You will learn how to create 3 4 templates and link them at the correct way. In the end you will have a fully featured axeman. … … 5 6 [[Image(http://i.imgur.com/fKKBq0d.png)]][[BR]] 6 7 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]] 16 9 If 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'm10 source code using TortoiseSVN: [wiki:TortoiseSVN_Guide TortoiseSVN Guide]. I'm 18 11 using the SVN version in this tutorial. 19 12 20 13 21 Navigate to the directory of the game, in my case: <D:\0_A.D._source>. Then go to22 <\binaries\data\mods>. Here you will find a few folders, one of them is <public>. In this folder you14 Navigate 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 23 16 will find all the data and gameplay scripts related to the main game of 0 A.D. 24 17 The 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]]18 Do so by creating a shortcut targeting pyrogenesis.exe located in [source:/ps/trunk/binaries/system binaries/system].[[BR]] 26 19 27 20 [[Image(http://i.imgur.com/jUKk6Tl.png)]] 28 21 29 22 Add “-mod=testmod” to the target and press OK. 30 Go back to the mods directory and create a folder called <testmod>. 23 24 Go back to the mods directory and create a folder called '''testmod'''. 31 25 You will notice a few additional maps in my folder, ignore them.[[BR]] 32 26 33 27 [[Image(http://i.imgur.com/j8P9lA9.png)]] 34 28 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]]29 Create 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]] 39 33 40 34 To save time and effort we will use already existing meshes, textures and animations (we therefore … … 52 46 [[BR]] 53 47 54 '''Setting up a template'''[[BR]]55 Good. Now let's head over to the template. In <simulation\templates\units>, create a file called48 == Setting up a template[[BR]] 49 Good. 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 56 50 “gaul_champion_axeman.xml” and open it in a text editor of your choice. Finally paste the 57 51 following code in it: … … 108 102 109 103 110 In the <Cost>tag the training costs are defined, we did set the metal costs to 75. The other costs104 In the ''<Cost>'' tag the training costs are defined, we did set the metal costs to 75. The other costs 111 105 are defined in the parent file. 112 106 113 107 114 In <Identity>all info about the unit is explained. You might notice that we called the unit “Gaul108 In ''<Identity>'' all info about the unit is explained. You might notice that we called the unit “Gaul 115 109 Axeman” and that we are requiring a technology to be researched before the Axeman gets 116 110 trainable. 117 111 118 112 119 Lastly we see the <VisualActor>. This is a link to an actorfile in which the visuals are defined. In the113 Lastly we see the ''<!VisualActor>''. This is a link to an [wiki:Actors actor] file in which the visuals are defined. In the 120 114 template we just created, all the rest is defined.[[BR]] 121 115 [[BR]] 122 116 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]] 118 Now, 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. 125 119 Paste this code into the file: 126 120 … … 177 171 [[BR]] 178 172 179 '''Make the unit trainable'''[[BR]]173 == Make the unit trainable[[BR]] 180 174 So far, so good. We now have the stats ánd the visuals. Now let's think of a location to train the 181 175 unit. 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. 183 177 184 178 Edit the file by adding “units/gaul_champion_axeman” (this is your template file) to 185 <ProductionQueue>.[[BR]]179 ''<!ProductionQueue>''.[[BR]] 186 180 187 181 [[Image(http://i.imgur.com/qE7NIOP.png)]] … … 189 183 [[BR]] 190 184 191 '''Result'''[[BR]]185 == Result[[BR]] 192 186 Well done, you made it to complete the tutorial! Run the game using your shortcut. The result 193 187 should be like below. If it gives some errors than likely you made some spelling errors. Go back and