Data - Working with Attachments (Beginner Difficulty)

by ProzaicMuse (24 August 2010)

I got a lot of requests for a more basic and intuitive guide for attachments after making the Uberlisk Tutorial. So this will serve to bridge the gap between those needing to understand what attachments are and those who have a solid understanding of them. It’s important to note that this doesn’t cover all aspects of attachments given that there are some fairly complex methods of attaching objects together. These are merely the methods that I think are likely to become commonplace once more widely understood.


Attachment Basics

The vast majority of attachments are based upon Site Operation Actors. Even when using Site Actors to create custom launch points you are likely still using a Site Operation to specify its exact location. This means understanding related fields is central to using them:

Bunker Turret

We’re going to make a bunker with a fully functioning turret. The turret will fire a beam and have its own attachment. In my Test Map I’ve removed all abilities unrelated to this turret, but you can easily keep the basic functions of the bunker as well as the added turret weapon.

Effects Tab

The 3 Flag fields are what cause the unit you attack to respond to you. Either they will attack you or run away based upon what responses the unit has been given.

Weapons Tab

This is the Turrets weapon that will go on the unit.

Turrets Tab

You can set these to whatever you’d prefer, but Idle controls the turrets action when not in combat, Yaw Arc controls its range of motion, Yaw Idle Rate is how quickly the turret rotates out of combat, Yaw Rate is how quickly the turret rotates in combat and Yaw Start determines the angle the turret begins facing.

Models Tab

Units Tab

Duplicate the Bunker structure and its corresponding Actor. Everything else will be stock or made from scratch.

Actors Tab

Site Operation Actors

Attachment Query + is where you use Attachment Methods (AMs) or Direct values to specify how attachments link together.

AMs are filters in that AMFilterWeapon wouldlook for any attachment point with the name Weapon to use. It usually takes the lowest index (0, 1 etc) first and before looking for other points. This can be convenient for use with a wide range of models. Direct allows you to pick a specific point and index. If you didn’t want Weapon00/01 you could use Direct to attach to Weapon07 instead.

These Site Operations will offset the attachments in any direction while preserving its facing and rotational axis. Using the objects original point as the origin:

+X is right of the object, -X is left of the object
+Y is towards/into the object, -Y is away from/out of the object
+Z is above the object, -Z is below the object

One thing to note is that while it preserves its rotational axis, some anchor (attachment) points will actually tilt this axis to align it with the plane it’s attached to. In other words, if you attach it to a surface that’s at a 45 degree angle to ground, the attached model will also be at a 45 degree angle. Thus it’s important to pick the right anchor point to move from before applying offsets.

This Site Operation tilts and rotates the shield model. It’s important that local is enabled so that the vectors rotate with the attachment. If it is not, the rotation is static and faces the map direction created by the vectors. Also, you must have a value for BOTH vectors even if using the default forward/facing (0.0, -1.0, 0.0) or up/axis (0.0, 0.0, -1.0). If either field is left with (0.0, 0.0, 0.0) the attachment will spin sporadically as the attachment Host moves.

The directions from offsets are the same, but instead of moving the object you are going to create new vectors. Forward is the facing vector and Up is the rotational axis vector. Some examples:

Face North
Forward - (X: 0.0,Y: 1.0, Z: 0.0)
Up - (X: 0.0,Y: 0.0, Z: 1.0)

Face Up
Forward - (X: 0.0, Y: 0.0, Z: 1.0)
Up - (X: 0.0, Y: 0.0, Z: 1.0)

Face South West
Forward - (X: -1.0, Y: -1.0, Z: 0.0)
Up - (X: 0.0,Y: 0.0, Z: 1.0)

Tilt West
Forward - (X: 0.0, Y: -1.0, Z: 0.0)
Up - (X: -1.0, Y: 0.0, Z: 0.0)

Tilt North East
Forward - (X: 0.0, Y: -1.0, Z: 0.0)
Up - (X: 1.0, Y: 1.0, Z: 0.0)

Flip Upside Down
Forward - (X: 0.0, Y: -1.0, Z: 0.0)
Up - (X: 0.0, Y: 0.0, Z: -1.0)

Model Actors

This will create the turret model, attach it to the bunker with the specified offset and play its attack animation whenever the bunker’s weapon fires. Its creation and destruction both tied to the Attachment Bunker.

This will create the shield model and attach it to the turret with the specified offset and rotation. Its creation and destruction both tied to the Attachment Bunker.

This actor is part of pair. We’re going to create its Attack Actor next.

Other Actors

This actor will allow you to shoot the beam from the turret by creating a point of reference. This can be any attachment point or even a random point in space. All that matters is that this actor is created at the same time the unit it will be associated with.

If you use the token, you don’t need to mess with the events. While I didn’t do so in the Test Map, I’ll typically change the token AND clear out the extra events that I don’t need. This is just for my own personal organization and isn’t required at all. That asside, The Launch Assets + controls the sounds/models created at the Launch Site and the Impact Map + controls the sounds/models created at the impact point.

This actor allows the turret to function by tying the Turret object to the Turret actor. The Turret Body + is the model that will rotate while the Yaw Query + is the axis.


Flipped Wraith

Fairly self-explanatory. We’re going to flip a Wraith upside down. While not incredibly impressive on its own, this is to demonstrate how to change the angle of ships. I’ve seen a lot of posts asking how to change the Yaw, Pitch and Roll of flying ships and this portion of the tutorial aims to answer those questions.

Actors Tab

This actor does nothing more than reverse a unit’s axis. As mentioned before you need to input values for both vectors (default or otherwise) and ensure local is enabled.

Now the Wraith flies upside down :)

(Note, SOpBankerWraith is a Site Operation made by Blizzard. It does not contribute to attaching models together or flipping the Wraith. It controls how much a unit banks (tilts/rolls)as it turns. You can see this when you make sharp turns while flying around.


Feel free to use the attached Test Map or contact me via forum post/IRC if you encounter problems. Keep in mind that I’m a busy person so I may not reply right away, but I’ll do my best to answer all questions/concerns that I am aware of :)

tags: data