I do stuff and thingies... Try widening and reducing the number of small nooks and crannies to correct the problem.
How do I attach a model to the unit actor?
when I do UnitBirth.Nova -> Create, it only lets me attach actors, which leads to an error message.
Models cannot be created on their own, they are always used by an actor.
So, you create an actor of the type "model".
The parent is usually "ModelAddition", but that's just the source for the grey base values, so it does not matter too much.
You either create the attached model within the unit actor with the actor message you stated. Usually, I would use ActorCreation as the parent because you are attaching actors to actors. This might be the source of the error message, though. But I do not know for sure as that would require me to know what the error message was.
Which actor to attach to?- The "Host" is usually set to use "_Selectable" which is an alias that all unit actors should receive (as set in the unit actor by default).
Where does it attach on the hosts model?- If you do not specify anything, usually an actor is attached to the center of the unit model like the one in the example map I linked above. A model has attachment points and you can specify which one you want to attach to via "Host Site Operations".
- You can see the attachment points on a model in the cutscene editor after adding a model to the scene. Select the model in the scene and hit "A" to see the attachment points. Hit Shift+D to see the properties window which lists the attachment points the model has. If you click on an attachment point in the list, the marker on the model will light up and alter its size.
What are Site Operations?- Site Operations alter an actor. There are multiple "Site Operation" actors already defined in the editor, but it is possible to create new ones. Usually, they are abbreviated with "SOp" in their name.
They are able to make actors rotate, offset them from the attachment point, make flying units visually rotate sideways when turning, etc... and as already mentioned they allow you to attach an actor to another. The actor having the site operation in its settings is the one that is attached to another actor.
- The "Site Operation (Attachment)" specifies an attachment point in its query. Methods are supported, too, if you need to have a random point.
An example for an attached model is a weapon attached to the player's hero in my Diablo map:
<CActorModel id="___carryBluntWeaponAttachment" parent="ModelAnimationStyleContinuousUNIT">
<Inherits index="CloakEffect" value="1"/>
<Inherits index="Opacity" value="1"/>
<Inherits index="WarpGroup" value="1"/>
<On Terms="Behavior.aaaCarriesBluntWeaponAttachment.Create" Send="Create"/>
<On Terms="Behavior.aaaCarriesBluntWeaponAttachment.Destroy" Send="AnimBracketStop BSD"/>
<HostSiteOps Ops="SOpAttachWeapon"/>
<Model value="aaaBlunt"/>
<ModelFlags index="AllowHitTest" value="0"/>
</CActorModel>
- The parent is different, but that just means that you might have less properties to edit.
- It inherits a few properties from its host like opacity and cloack effect. I actually do not know what warpGroup is, but I enabled it anyway. It might be used when you teleport a unit.
- The actor is created when the "aaaCarriesBluntWeaponAttachment" behavior is added to a unit and destroyed when it is removed. The AnimBracketStop message references BSD which is usually used as the name for the "Birth Stand Death" animation as defined in its parent.
- The host is not altered here, so it is "_Selectable" aka the unit actor and its model.
- The Site Operation is "SOpAttachWeapon", so this actor's model will be attached to the weapon attachment point of the host's model.
- This actor's model is "aaaBlunt" which is a model showing a blunt weapon like a mace.
- In the model flags, I disabled "allowHitTest", so the attached actor's model will not add a selection area. In your case, you would want that enabled.