HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

mdl ataching

07-26-2003, 12:44 AM#1
DS-Orkhomie
is there anyway to atach stuff like weapons to a model with .mdl editing. i would do .mdx editing but i dont got 3d max
07-26-2003, 02:00 AM#2
Ari
Yes. This is an example from an old version of a model I was working on. Try this:

Attachment "flamestrike attachment" {
ObjectId 61,
Path "FoK\f1.mdl",
Scaling 10 {
Linear,
12400: { 1, 1, 1 },
13500: { 0, 0, 0 },
13900: { 0, 0, 0 },
13933: { 0, 0, 0 },
15000: { 1, 1, 1 },
}
}

The "path" statement is the most important one there. Make sure that refers to the model that you are using. I *think* it needs to refer to a "mdl" file even if the actual file is an mdx (like many fields in WE, for example).
Note that you can scale, translate and rotate this just like it were a bone, which is *highly* useful. Also note that in this case, this is a custom attachment which I created solely to attach this one model to, but you can certainly add this to any of the already existing attachments. Also, if you *do* decide to create a new attachment, make sure you also create a new pivot point below, or you'll mess up your model (actually, you'll merely mess up any attachments or emitters below this point). If you're unfamiliar with how pivot points work, they define where your new model will be located on the original model. In my case, with no parent bone, the pivot point is static.

Let me know if that helps.
07-26-2003, 04:00 PM#3
DS-Orkhomie
Quote:
Originally posted by Ari
. Also, if you *do* decide to create a new attachment, make sure you also create a new pivot point below, or you'll mess up your model (actually, you'll merely mess up any attachments or emitters below this point). If you're unfamiliar with how pivot points work, they define where your new model will be located on the original model. In my case, with no parent bone, the pivot point is static.

Let me know if that helps. [/b]


how do i make a pivote piont? do i have to .mdx edit or can i do it in .,mdl. to make it clearer i want to add a sword(a custom model) to the left hand of a unit say the sorcerus.

O yea is there a way to get rid of part of a model bu .mdl editing?
07-27-2003, 06:11 AM#4
Ari
Pivot points can be made in notepad on the mdl. Look at the bottom of the file, above the emitters, but below the attachment points. They take a format like this:

{ 0.023893, 0.396404, 20.3708 },

with a simple x, y, z input. A pivot point defines how an object rotates when the model itself rotates. In simplest terms, you're actually defining the position of an object within a model. To add a sword, it might be sufficient to add the model directly to the hand attachment point, using the "path" statement I mentioned before. This will guarantee the sword "sticks" to the model. Keep in mind that the rotation may look messed up if you do this. Rotation in mdl's is handled in a way that will almost certainly seem strange to you if you've never modeled before. It uses quaternions, which I barely understand myself. I recommend following this link:

http://www.engin.umich.edu/dept/aero...t3DApplet.html

which links to an applet that will help you create your own quaternion values (and understand how they work) if you need to. To *use* those calues in a model, you need a rotation command. If you look through almost any mdl, you can find examples of these:

Rotation 9 {
Hermite,
GlobalSeqId 0,
0: { 0, 0, 0.998291, -0.058447 },
InTan { 0, 0, 0.998291, -0.058447 },
OutTan { 0, 0, 0.998291, -0.058447 },
267: { 0, 0, 0.901592, -0.432588 },
InTan { 0, 0, 0.901592, -0.432588 },
OutTan { 0, 0, 0.901592, -0.432588 },
567: { 0, 0, 0.670256, -0.74213 },


Personally, I use "linear" rotations instead of "hermite" because linears only need 1 line (you omit the inTan and OutTan lines altogether), and because I don't fully understand how hermite works.

As for removing parts of models, there are a few ways you can do this. You can alpha out a material ("static alpha 0,"). Or you can remove geoset vertices, though that could potentially really mess up models. Sometimes, you can delete geosets altogether, though again, you run the risk of messing up a model if it's done improperly.

As for giving a sword to a sorc, keep in mind that giving them the sword is only the beginning. You'll need "swinging" animations, since the sorc doesn't have any. Unless you're a genius (or idiot savant) there's no way you'll be able to do this in mdl format. You'll need a 3d program to animate properly.

Not to discourage you, but if you've never animated before, you might have better luck simply reskinning a model like the footman, which already has a sword (and accompanying sword animations). There are a number of sword-wielding units, especially with tft. Feel free to post any other questions, though.
07-27-2003, 05:08 PM#5
DS-Orkhomie
aftuasly i want going to atach to a sorcerus it was just an example