FANDOM


By now you should have managed to understand:

  • anim_graphics governs the animation of the unit,
  • unit_graphics governs the appearance of the unit and also determines what animations listed under anim_graphics to use.

In this section we will now begin working with the appearance of the unit. You must be thinking, "freaking finally!" However we still have a long, long way to go before we can finish up the task of introducing a Panzerfaust to RoN.

With anim_graphics.xml now cleared out of the way, it is now time to introduce the unit_graphics.xml file. As mentioned before, unit_graphics.xml determines the appearance of the unit, as well as the animations associated with it.

Panzerfaust, take 1

To create a new unit, we need to create a new <UNIT> entry under the <UNITS> tag. This is best done by copying an older <UNIT> entry coded in as it will save you the hassle of coding from scratch which may result in errors in your game.

Because a Panzerfaust is very similar to a Bazooka, we choose to commence our work by replacing the <UNIT> entry, <BAZOOKA-NA-AGE0> with our own coding for this example.

  • First, we rename the unit entry to "PFAUST-DEFAULT-AGE0", making it separate from the rest of the BAZOOKA entries. The tag "DEFAULT" tells the computer that this is the default appearance of the unit. All <UNIT> entries in your unit_graphics.xml file must always have 1 entry with a name ending with "DEFAULT-AGE0".
  • Next, we insert the directory paths for our files. For this first instance, we will first introduce the .tga file, d_m44.tga:
    Pfaust
    Notice all the strange variables that you see here? fret not, we have a list explaining what each one does below:
scale determines the ingame size of the unit.
trackdist size of a unit's tracks.
tracktype tracks left by the unit's movement. At present, it is set to "Foot", meaning that the unit will leave behind footprints as it moves.
shadowtype the shadow cast by a unit. At present, it is set to "Biped Shadow", which appears as a disc-like blur on the ground.
shadowwidth, shadowheight determines the size of the shadow and its position.
skeleton determines the sort of corpse left behind. The variable is based on the name of a <SKELETON> entry.
scorch determines the sort of corpse and animation used when the unit is burnt to death by flamethrower or by fire lance.
tex_id, tex_col, tex_row determines the unit icon (TBC). The tex_id variable is indicated under the following file: ./Thrones and Patriots/data/interface.xml
tex_x, tex_y determines the positioning of a unit - this is especially important for crewed units such as artillery.
AGE The appearance of the unit over the ages. You must have at least 1 unit

For our example, we are going to work on SKELETON - because it's the most important for "organic" units.

We go down to the <SKELETONS> section of unit_graphics.xml, and we subsequently insert the following tag:

Rolldembones

What the "Bones" entry does is that if a unit with a skeleton variable of "Bones" dies, the computer will now superimpose the model skelett.bh3 under it. In theory you can also customise how a unit reacts when it burns to death, but we will not cover that in this tutorial.

Panzerfaust, take 2

Going back to our <UNIT> entry, PFAUST, we are now ready to code the unit into the game. For my own preference, I set the following variables under "PFAUST-DEFAULT-AGE0"

scale 0.91
skeleton "Bones"

tex_id, tex_col, tex_row

  • TEX_UNITS_AXPA (linking to an entry I have prepared earlier on)
  • tex_col="2"; tex_row="10" - this tells the computer to seek out the 3rd left icon on the 11th row.
tex_x, tex_y determines the positioning of a unit - this is especially important for crewed units such as artillery.
AGE The appearance of the unit over the ages. You must have at least 1 unit

Our work is still not complete, however: animations, particles and ammo must still be determined.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.