4.1.2.6 Attaching Entities After covering attach point transform options, lets move to the attachments themselves. Here you will learn how to attach Entities (effects, items, monsters, decorations and such) directly to a mesh.
An Entity is basically a link to a .DBR file in the game's records. You must know the exact file path of the Entity you want to attach for this to work.
To attach anything, scroll down in the mesh TextData and on the bottom use the following entry:
CreateEntity
{
attach = "*Entity Attach Point Name*"
entity = "*Entity Record Path*"
}
Here is an example. Lets say we want to attach a common leather helmet that always remains visible on the character. We open Art Manager and click on "Import Record..." to browse existing items. In this case, the leather helmet record path is "records\item\equipmenthelm\c01_helm01.dbr". So our attachment entry would look like this:
We relaunch the game to see the result:
The helmet is attached permanently now, not equipped. But there is a small problem - the default hair (and all equipped helmets) remain visible too. Lets fix it by scaling down the "Head" Attach Point again and make it invisible as we learned above:
AttachPoint
{
name = "Head"
origin = (0.000000, 0.000000, 0.000000)
xAxis = (0.000001, 0.000000, 0.000000)
yAxis = (0.000000, 0.000001, 0.000000)
zAxis = (0.000000, 0.000000, 0.000001)
}
Remember, normal helmets Attach point is "Head", while the leather helmet one is named "Helmet", so even if you shrink the first, it won't affect the size of the attached item. Result ingame:
Ok, we attached a piece of armor, but how about an effect? It's the same method, again we browse the database to find a suitable effect record. In this example I'll use a well known aura effect - Art of the Hunt. It's record file path is "records\effects\hunting\343_trailblazing_fx01.dbr". Lets try by adding a new Entity, beside the leather helmet:
CreateEntity
{
attach = "Helmet"
entity = "records\item\equipmenthelm\c01_helm01.dbr"
}
CreateEntity
{
attach = "Effect"
entity = "records\effects\hunting\343_trailblazing_fx01.dbr"
}
Here is the result ingame:
4.1.2.7 Attaching Entities to BonesNow, let's say we want to move the attached effect up, around the head like a halo. Right now we cant - the Effect origin remains at the center ot the coordinate system, and the position of the effect itself (or any other attached Entity) depends on the default position it was created with according to that origin. To move, scale or rotate an entity in any way, we must first attach it to a certain bone. And to do that, we need to create a new attach point that depends on that bone.
The easiest way to move the position of any effect or armor piece is to attach it to the base bone that lies in the very the coordinate center - MoveAxis. It's normally invisible, but its location is between the feet of the character. Let's create a new attach point now, corresponding to the "Effect" entity and depending of MoveAxis:
AttachPoint
{
name = "Effect"
parent = "MoveAxis"
origin = (0.000000, 0.000000, 0.000000)
xAxis = (1.000000, 0.000000, 0.000000)
yAxis = (0.000000, 1.000000, 0.000000)
zAxis = (0.000000, 0.000000, 1.000000)
}
The attach point name and the entity name must be the same, otherwise it wont work.
If you launch the game now, you won't see any difference - the effect will stay at the same position, as MoveAxis' origin is exactly at the center. The only difference is the Entity is controllable now. So we just proceed to moving the effect up via the attach point. Let's try this:
AttachPoint
{
name = "Effect"
parent = "MoveAxis"
origin = (0.000000, 1.0000000, 0.000000)
xAxis = (1.000000, 0.000000, 0.000000)
yAxis = (0.000000, 1.000000, 0.000000)
zAxis = (0.000000, 0.000000, 1.000000)
}
Checking the result:
As you see, sometimes attachments may appear on places that are unexpected, depending on the initial rotation/position of the parent bone or the attached entity itself. With some trial and error however you'll learn how to manage that. After a few more tests, here is the correct attach point position:
AttachPoint
{
name = "Effect"
parent = "MoveAXIS"
origin = (0.000000, 0.000000, 0.800000)
xAxis = (1.000000, 0.000000, 0.000000)
yAxis = (0.000000, 1.000000, 0.000000)
zAxis = (0.000000, 0.000000, 1.000000)
}
Just a note when attaching particle effects - usually they cannot be scaled or rotated, unless when they come with a mesh of their own. In this case Art of the Hunt effect is just particles, so we can only change its position.
Ok, we made the halo and it looks OK-ish, but there is one problem when attaching effects to MoveAxis - they will always stay at the same height, no matter how the character is moving. Example is this crouching animation:
The better solution in this case is to attach the effect directly to Bone_Head of the character. In difference to MoveAxis, Bone_Head will follow the character's animation, and the attached effect will move with it. Lets try that now, by reseting the attach point and changing the parent bone:
AttachPoint
{
name = "Effect"
parent = "Bone_Head"
origin = (0.000000, 0.000000, 0.000000)
xAxis = (1.000000, 0.000000, 0.000000)
yAxis = (0.000000, 1.000000, 0.000000)
zAxis = (0.000000, 0.000000, 1.000000)
}
After you check ingame, you will see that the effect follows the character's head now, only it appears high above it:
Not what we want, so lets try finding the correct position again. After some time, here is a decent attach point for this particular effect:
AttachPoint
{
name = "Effect"
parent = "Bone_Head"
origin = (-1.250000, 0.600000, 0.000000)
xAxis = (0.000000, 0.000000, 1.000000)
yAxis = (1.000000, 0.000000, 0.000000)
zAxis = (0.000000, 1.000000, 0.000000)
}
Sadly, armor pieces cannot be attached to bones this way - or they can, but the animations will be terrible. You may think a helmet will fit good attached to Bone_Head.. it seems so, but it doesnt. The only bone armors CAN be attached to with no problem is the mentioned MoveAxis. This gives some interesting opportunities for creature transformations... but that will be a topic of another tutorial.
4.1.2.7 Attaching Animated DecorationsAlright, we learned how to attach armors and particle effects, now lets move to something cooler - how about something moving, like wings?
For this example i'll show you how to attach butterfly wings to the character. This is not very hard to do, as butterflies are already existing ingame as ambient animals (decorations), and they are animated. Lets browse in Art Manager to their file path:
In this case we need an "idle" butterfly record file (doesnt matter what color) - it has static position with only wings moving, while the other one is flying in circles and will be difficult to attach. Copy the record link and create a new entity in the character mesh, with a new attach point to control it:
CreateEntity
{
attach = "Wings"
entity = "records\creature\ambient\butterflyblueidle01.dbr"
}
AttachPoint
{
name = "Wings"
origin = (0.000000, 0.000000, 0.000000)
xAxis = (1.000000, 0.000000, 0.000000)
yAxis = (0.000000, 1.000000, 0.000000)
zAxis = (0.000000, 0.000000, 1.000000)
}
Checking ingame:
You can see the butterfly between the character's feet. Now remain two things - to make it bigger and to attach it to the character's back, where the wings should be, and make them follow her movements. Lets start with increasing the size:
AttachPoint
{
name = "Wings"
origin = (0.000000, 0.000000, 0.000000)
xAxis = (5.000000, 0.000000, 0.000000)
yAxis = (0.000000, 5.000000, 0.000000)
zAxis = (0.000000, 0.000000, 5.000000)
}
The wings are 5 times bigger now, probably enough. All we need now is a suitable bone to attach them to. The best bone for this purpose is Bone_Spine02 - its located on the upper part of character's torso. This time ill skip the rotation/adjustment steps (again, i recomend to use Viewer for that) and just give you the ready to use attach point:
AttachPoint
{
name = "Wings"
parent = "Bone_Spine02"
origin = (0.300000, -0.150000, 0.000000)
xAxis = (0.0000000, 0.0000000, 5.0000000)
yAxis = (0.0000000, -5.0000000, 0.0000000)
zAxis = (5.0000000, 0.0000000, 0.000000)
}
4.1.2.8 List of Attach PointsHere i'll briefly describe the default attach points in the player character's meshes. Monsters usually have similar, but their attach points may differ.
"SpecialHit01", "SpecialHit02", "SpecialHit03", "SpecialHit04" - TBH, im not sure what these do. I assume they are used for landing a hit with weapon attacks, but its better to not mislead you with false info.
"Head", "Upper Body", "Forearm", "Lower Body" - These are the default attach points for armors - for helmet, torso armor, armbands and leg armor respectivelly. "Forearm" and "Lower Body" attach points are missing in the default character meshes. To edit the position of arm and leg armors, just create new attach points with these names.
"R Hand", "L Hand" - These are the default attach points for weapons. Usually they are tied to Bone_R_Weapon and Bone_L_Weapon, but for creatures that doesnt have these two bones, you can also use Bone_R_Wrist and Bone_L_Wrist as parents and after adjust the attach point position manually.
"Camera", "HeadCam" - "Camera" defines in what position (mostly height) the in-game camera will show the character when zoomed. Play around with the Y origin to adjust it if needed. If you remove or disable this attach point, the camera zooms at character's feet. "HeadCam" is responsible for the character's portrait in the upper left corner. If you are making a creature PC mod and the head of the character is missing from the portrait, try adding this attach point.
"Target" - As with SpecialHit, im not sure. Probably defines the aim of enemy weapons or ranged attacks.
"Light", "Prey_Effect", "Head Effect", "Particle1" - These are effects. "Light" is the light that surrounds the character at night, "Prey Effect" is the attach point for Study Prey eye effect when cast on the character; the rest are for some other effects or auras, not sure which.
To disable a default attach point, just rename it - for example, "Camera" to "Caamera". This will make it inactive.
4.1.2.9 Rest of TextData sectionBesides Attach Points and Entities, rest of the TextData consists of Rigid Bodies data, Joint data and Skeleton Emitter Bones. I'm not very familiar with these. Roughly, Rigid Bodies and Joints define the way a creature mesh reacts on death. You know how a Satyr randomly "splashes" on the ground when killed? That depends on the Rigid Bodies - basically they are boxes around each bone that mimic normal physic laws when falling. If you remove Rigid Body/Joint data and the creature has death animation, it will use it instead. But if it doesnt have death animation, it will just freeze. I assume Skeleton Emitter Bones is related to effects, but cant say for sure.
4.1.3 BonesI'll skip the next 3 sections of MeshView - Vertices, Triangles nad DrawCalls, because their functions are mostly unknown to me. Let's move straight to the Bones section - you can do some pretty cool things there. To begin, ill try to give a brief definition of what are bones in 3D models.
Basically, bones are invisible objects used to deform the surface of a mesh through animation. Each bone has a certain influence over its surrounding vertices (points on the surface of the mesh that build it's geometry structure). Also, bones usually have their own hierarchy of Parent > Children, which means deforming the parrent affects its children bones. Here is an regular example of a skeletal structure in Titan Quest (in this case i'm using a Machae model):
The arrows show the connection between parent and child bones. This hierarchy is important to know when making animations or when changing the size and shape of a certain bone. But i'll stop to this in more detail in the next parts. For now lets just open the Bones section of the Machae mesh by expanding it:
Here you can remove all bones if you desire so. Not much else to do here, so we move to the next part - the bone data.
4.1.3.1 Bone DataLets open the first bone in the list - MoveAXIS. We see this:
"Name" - Here you can change the name of the bone. This is useful when you dont want this bone to be affected by animations (disabling it), or to fit with a certain animation of a bone with different name. I'll come back to this a bit later.
"First Child" - Not sure, probably which bone is the next child of this bone in the list.
"Child Count" - how many child bones this bone has.
Under these are 4 columns, where you can see the position, rotation and size of the bone. From left to right column - X, Y, Z, Origin. This is very similar to the attach poins, only here we can edit parameters of the current mesh instead. In this case, if we translate the values of MoveAxis into Attach point values, it makes this:
origin = (0.000000, 0.000000, 0.000000)
xAxis = (1.0000000, 0.0000000, 0.0000000)
yAxis = (0.0000000, 0.0000000, -1.0000000)
zAxis = (0.0000000, 1.0000000, 0.000000)
Sadly, you are more limited with the manipulations you can do to bones than to attach points, especially with this particular bone. One basic rule is - don't touch the Origin values ever, or the mesh will become distorted. I'll show you more of what you can do with the next bone - Bone_Root.
4.1.3.2 Reshaping a Model through Bone DataFor this example i'll be using the vanilla female model again, to show you how you can reshape it just by changing the scale and rotation of different bones in MeshView. This is how i started modifying the early versions of Ariadne. It's a bit time-consuming and based on trial and error, but i still refine my models using this method sometimes, because its very precise.
After opening the mesh, we expand Bones section and click on Bone_Root, to see the values are not as clean as they were with MoveAXIS:
First, if you want to simplify things, all the values that contain letters in the first 3 columns (for example: 2,503327E-08) can be made 0 without problem. My guess is that these are very small numbers for rotations and they have almost zero influence on the mesh. Let's clean them:
Now remain the values that matter. Values that are close to 1 mostly define height, width and depth of the bone, values closer to 0 mostly define rotations. Since Bone_Root is a base parent bone, it affects all other bones in the skeleton. Lets look again at the model in-game, before changing anything:
To make things easier, i'll give you some more directions of what value is for what for which type of bone. For Bone_Root in particular:
For all Vertical bones, aligned with the main Y axis:
For all Horizontal bones, aligned with the main X axis:
For all Horizontal bones, aligned with the main Z axis:
Knowing this, we can start experimenting. Let's return to Bone_Root and increase its width by half, just for the try:
Checking ingame:
Lol. What did you expect?
If you notice the bones stretch, but they keep their default position. It's because we don't change the origin, only the width.
But that was way too much haha. Lets reset the width value to default again and try editing the rotation values this time:
Even by a small amount the result is drastic... and quite alien looking lol. If you want to make a model prettier though, you need much smaller changes.
I'll leave further experimenting to those who are curious. If you want to make a thin Satyr Brute, a fat Machae, or you just want a monster to fit better with armors that are uncommon to it, you can try this method. Just find which bones to stretch or rotate and to what degree.
BTW, talking about fitting armors... there is one more thing you can do using bone data - transfering bones. I'll explain about it in the next part.
(Continuing on 5-th post)