Switching vehicle body and turret

Matthias Mailänder edited this page May 17, 2015 · 2 revisions
Clone this wiki locally

Whose body? Whose turret?

It might happen that while modding and finding assets (which are not many for RA1 frankly), you want something that looks different. In your search you might come across different SHP files where the entire unit is defined in one SHP file or it is made by combining several SHP files. If it is the former, then your job is a bit easy, otherwise it is slightly difficult.

What exactly is a sequence?

There is no actual use of 3D data in RA1. The units are actually pictures of 3D models and OpenRA calculates which picture to show at what time to show a proper unit. As an example, look at the sequence for 1tnk:

1tnk:
    idle:
        Start: 0
        Facings: 32
    turret:
        Start: 32
        Facings: 32
    muzzle: gunfire2
        Start: 0
        Length: 2
    icon: 1tnkicon
        Start: 0

This defines the frames for every animations. When the unit is idle, it should start from frame number 0 and show one of the 32 next frames, so frames 0,1,2,...,31 represent the idle torso animation.

The turret is defined from frame number 32 onward to frame number 63 (as it says 32 facings)

The definition for muzzle is a but different.

muzzle: gunfire2
    Start: 0
    Length: 2

What this means is that, for muzzle animation, use the animation "gunfire" and use frame numbers 0 and 1 as the length is 2

Here the 1tnk is using the assets from another SHP with the name gunfire.

Swapping parts

Now for some fun stuff. What we will do is to make 1tnk use the turret for 2tnk. to do this, you will change the code like this:

turret: 2tnk
    Start: 32
    Facings: 32

So the changed code will look like this:

1tnk:
    idle:
        Start: 0
        Facings: 32
    turret: 2tnk
        Start: 32
        Facings: 32
    muzzle: gunfire2
        Start: 0
        Length: 2
    icon: 1tnkicon
        Start: 0

Keep in mind that this will only work if the number of frames in the turret sequence is the same as that for 2tnk's turret. You can check that by checking 2tnk's sequence entry.

If however, there is a separate turret model in another SHP, then the frames for turrent will start from frame number 0. I came across a model for a BMP and I had to define it like this:

bmp:
    idle:
        Start: 0
        Facings: 32
    muzzle: minigun
        Start: 0
        Length: 6
        Facings: 8
    turret: bmptur
        Start: 0
        Facings: 32
    icon: bmpicon
        Start: 0

You can see that the bmptur sequence starts from 0 and ends at 31 (0 to 31 makes 32 facings).