HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Locking bones via triggers

08-17-2004, 02:08 AM#1
Ari
This is pretty obsure, I'm afraid. I'm using the action "animation - lock body part facing" to alter an effect's orientation.

The mdl of this unit looks like this in the relevent area:

Helper "Bone_Head" {
ObjectId 49,
}

Attachment "Dummy Ref " {
ObjectId 50,
Parent 12, // "BoneHorseBONE_HEAD"

}

Attachment "Foot Right Ref " {
ObjectId 51,
Parent 49, // "Bone_dummy"


The code looks like this:

call SetUnitLookAt( gur, "bone_dummy", u, 0, 0, 0 )
call TriggerSleepAction( .2 )
call AddSpecialEffectTargetUnitBJ( "right foot ", gur, "fok****reflecting.mdl" )

This is a little confusing, but in essence, I'm ordering unit "Gur" to have his "bone_dummy" face unit "u" with no offset. I'm then attaching a special effect to "gur"'s "right foot" attachment point.

Now, before I move on, keep in mind that this *works* fine in the original model I created this for. One problem is that I no longer understand *why* this works. Logically, "right foot" isn't even connected with the rotating dummy attachment point, even assuming that I'm somehow rotating the attachment point in the first place (clearly, I AM, but I certainly don't understand how).

Also, there is no bone called "bone_dummy" in this model, despite the commented out line. Indeed, the string "dummy" only appears in the code that I copied in here. I take this to mean that the jass code isn't too picky about what it rotates - or perhaps it can look for an attachment point.

Anyway, I'd be inclined to just shrug my shoulders and move on (since it *works* despite my no longer understanding why) except that a second alomst identical unit doesn't do this. It has identical bones and attachments, and while several animation names are dummied, and a geoset has been altered, it's hard to find ANY difference between these models.

Anyone able to shed any light on this? For that matter, anyone think the people in a different forum might have more luck (since this is, after all, a trigger AND model issue).