| 09-07-2003, 04:35 AM | #1 |
This is a tutorial for adding and removing a hero glow to a unit that doesn't have one. Someone mentioned that this wasn't well documented yet on ths forum. If I'm mistaken, my bad. Contents: The first two posts, and most of the third, deal with adding a hero glow to a unit that does not have one. At the very bottom of the third post, I deal with the much simpler task of removing the glow from a hero (who does have a glow). I'm going to confine this to adding the "basic" hero glow that is at a unit's feet. While the same things that work for this likely work for the other glows, I've never myself done them, so I'll leave that for the reader to play around with. Finally, this tutorial assumes the reader knows at least the basics of the mdl format. Questions like 'how do I open an mdl' and 'how do I convert mdx's to mdl's' are left to be asked elsewhere. Ok, now, for those still with me, I'm going to demonstrate the parts of a model that you need to play around with to get a glow from one unit to another. For my example, I'm going to use the glow that the "Jaina" model uses. For larger units, other models may be more appropriate. With a little luck this will take 15-20 minutes. The glow itself consists of a geoset that consists of 3 concentric planes. The first thing you'll need is to insert the hero glow texture into your target model, preferably after all other textures in your model: The last texture (the 4th, or textureID 3) there is the one that you'll need to copy into your model's texture section (replacable indicates that it changes with team ownership, in the same way that teamcolor does). Now that you've done that, you'll need to copy in the material that uses that texture into your model's materials section, again, preferably after all other materials in your model (this keeps things as simple as possible): Notice that the last material uses textureID 3. This is the one that will need to be copied. Keep in mind that if YOUR model has a different number of textures in use, you will have to alter the TextureID in your new model to reflect that (ID = order of texture - 1). The section in this material below the texture reference makes the glow semi-transparent. The '3333' refers to the keyframe of the very first animation Jaina uses. Alter that so that it is the first keyframe used by any animation YOUR model. With that done, we want to copy the geoset that the glow uses from 'Jaina' into your model: ![]() Depending on the model you use as your source, this may look different, but in general, it will be a small geoset (this one only has 12 vertices). You'll want to copy this geoset in its entirety into your model, again, preferably AFTER all other geosets. For the most part, you don't really care about the contents of the geoset. A few parts ARE important though. First, you'll notice that one of the very last lines is "MaterialID 2," The geoset is looking for the material you pasted earlier. If that material is NOT the 3rd material in the model, you'll have to adjust this number accordingly. |
| 09-07-2003, 04:56 AM | #2 |
The next thing you need to worry about in the geoset are the animation references: Notice the section that begins with "anim" at the bottom of the picture. There are 8 identical sections. Not at all coincidentally, there are 8 animations for the Jaina model. If YOUR model has a different number of animations make more or fewer copies of this section. Finally, you'll see something called VertexGroup at the top. This is how a geoset is divided between bones. You don't really care about this section, except to know that numbers here correspond to the "groups" that are at the middle of the picture. The "matrix" numbers in the {}'s tell the geoset the ObjectID's (more on those in a second) each group uses. In other words, there are 3 bones that the glow uses. In the JAINA model they are objectIDs's 0 through 2. In your model, you'll want to change them. We'll return to this in a few minutes. The next logical thing to do is to copy the bones that the glow uses into your model: This is a picture of the first of the 3 bones that the glow uses. The other two are right below this. These are the first three bones the Jaina model has. To save you some effort, you're going to want to copy these to the END of the bones section in your model. These MUST be before the 'helpers' or all sorts of bad things happen. Once you've pasted these three bones, you'll need to make 2 changes to them. First, notice that each bone refers to 'GeosetId' In the JAINA model, the geoset for the hero glow is the 3rd geoset. In your model, it will likely be something else. Counting geosets is a pain in the ***, but you'll have to count from the top downwards. If this is the ONLY geoset that's been added to this model, and you're modifying a blizzard model, the number of geosets in the model is at the VERY top of the mdl. You can assume that your added geoset is the next one (if a model has 5 geosets, assume your pasted one is the 6th, and so it would be GeosetId 5). Now, notice the ObjectId number of the bone. In the Jaina model, the first of these bones was the very first object, so it was ObjectId 0. Now it will be something else. Look at the previous bone in the model, and add 1 to that. The second bone should have 2 added to that and the 3rd copies bone should have 3 added to that. Now for the awful, tedious part. ObjectId's must be in order, and ideally there should be no gaps in the sequence. You've just added 3 new objectId's in, so the next object number is now wrong. You're going to need to correct this in 2 steps. First, go forward, and add 3 to EVERY objectID in the model. This includes ALL helpers, ALL lights, ALL attachment points, ALL emitters, and ALL event objects (now you see why you didn't paste these at the beginning of the bone section). This must be done properly, with no errors. Failure here will royally mess up the model, and worse, will be hard to find later. Next, go to the very beginning of the bones section. Notice that most bones have a line like "Parent 29, // "Bone_RootArchDruid." This means that this object is attached to another object. THe only problem is that some of these are messed up now. Take a look at the ID you assigned to your first pasted bone. Any parent reference to a number EQUAL TO OR GREATER THAN that number is now incorrect. You'll need to ADD 3 to each such reference. Mind you, not all references need fixing, only those references to objects after your bones. Again, go through bones, helpers, lights, attachment points, and emitters (in general, event objects don't have parents, but double checking won't hurt). And as I said above, erros here will hurt you bad, so don't mess this up. The next thing we want to do is go back to our pasted geoset. In it, you'll see 3 lines like this: Matrices { 0 }, Replace the number inside the {} with the ObjectId of the first pasted bone. Repeat this with the other 2 lines, substituting in the ObjectId's of the other 2 bones. Now that the hardest part of this is done, only 2 more steps. First, we need to play with pivot points. For the sake of this tutorial it doesn't really matter what pivot points are. They are listed towards the very end of the mdl, after attachment points, but before emitters: Each objectID needs a corresponding pivot point. This picture shows the pivot points in the Jaina model. The first three correspond to the bones we pasted. We need to copy these three lines, and then paste them into the pivot point list in our own model such that they are in the right order (so if your bones are objectID's 30-32, make sure the pivot points you insert are the 31st through 33rd lines). Recheck this. Twice. An error here is easy to find, but could make your model kinda funky. |
| 09-07-2003, 05:51 AM | #3 |
Ok, now for the final step. If you look carefully, you'll see that the glow "pulses" gently. It does this irrespective of what animation is playing. This is because the glow uses something called "global sequences." Without going into details, you'll need to add global sequences to you model: ![]() This pic is taken from the Jaina model, immediately after the section that defines animations (so towards the very top of the file). We only care about the 3rd and 4th of these sequences, but especially if your model doesn't have any, it is easiest to copy and past the entire section (beginning with "globalsequences" and ending with "}" into your model. Should your model already have a global sequence section, there are three possbilities. The first is that there already are 2 sequences. Best case scenario. Just paste the 3rd and 4th lines from the Jaina model into this one. Another possibility is that there is only 1 sequence. Again, paste in the 2nd, 3rd, and 4th lines into this model. If there are MORE than two sequences already present, paste in the 3rd and 4th emitters. Now you have to go back to your bones. Observe that in the 3 copies bones, there is a reference to "GlobalSeqId." You'll need to change those numbers to correspond to the new numbers that you pasted in (the 1st bone takes the lower number, the other two take the higher number). That's it, all done. Hopefully, at this point you should have a completed model. If not, feel free to post any questions in here. And by all means post any suggestions, or errors you find in this. ![]() "Luthien" from Fury of Kadesh. To REMOVE a hero glow is far easier: Again, from the Jaina model: If you recall from above, "TextureID 3" is the other replaceable texture in this model (the one that ISN'T teamcolor). This is the glow texture (and glow material). Remove this stuff: Alpha 1 { Linear, 3333: 0.75, } and add this line: static Alpha 0, in its place. THat should do the trick. |
| 09-07-2003, 03:42 PM | #4 |
is it possible when editing mdls. to add a build animation by using an attack one? heres what i did. i clicked ctrl+f and found the animations, took the attack one, and cnp it to the bottom of the attacks section. then i found the second part of the animaiotns part and so and so and but i soon abandoned it cuz it took so long. is there an ez-er way? |
| 09-09-2003, 07:36 AM | #5 |
Hmm, I think you should have put the text in the code tag instead, it makes it easier for people to cnp it if they want to, and it retains the tab spaces. |
| 09-09-2003, 07:12 PM | #6 |
the point of tutorials isn't to get the results of the given tutorial, but to be able to apply the knowledge in it elsewhere. If all people did was CnP from tutorials they wouldn't fully understand what they were doing, and then get lost when they tried it on another model. |
| 09-10-2003, 03:21 PM | #7 |
damn id didnt saw u post, so i had to figure out how to make the glow, but at the end i figured out the same way as you did. So this is the only way to do it(to add glow to non-hero unit or a unit that dont have the bone in origin and dont have animation). Look at my avatar :ggani: that is my new hero called The Unknown Blademaster |
| 11-19-2003, 05:09 AM | #8 |
Yes build is the name but if you want it to also be attack then you would half to change alot :nono: Try experimenting with calling it "attack build" kinda like the attack spell animation concept, may work my not. And good tutorial I've wanted to know how to do this for some time :D |
| 01-02-2004, 10:49 PM | #9 |
can you explain this tutorial better?! you say copy BUT COPY WHAT AND WHERE?! this tutorial doesnt explain anything and please give us the end result so i can see what to do easier. |
| 01-26-2004, 01:08 PM | #10 | |
Quote:
i really must agree here! |
| 02-01-2004, 08:41 PM | #11 |
Wtf? He doesnt even tell us what to open the file with, nor what file to even open, and have of the terms I dont even understand. The only person who would understand this is a person who already knew how to edit hero glow. Someone make a noobies edition! |
| 02-17-2004, 04:09 PM | #12 | |||
Quote:
Quote:
I'll make a deal: let's raise the tone of discussion a tad, and I'll try to expand this to cover areas that I had stated I'd never intended to cover. When this was moved to tutorials, I lost track of replies, but I'll try to correct that now. Quote:
To produce mdl files, you need yobgul's mdx <--> mdl converter. An mdl file is a text version of an mdx file. Both are equivalent, but mdl files can be edited in notepad, as opposed to a modeling program. Perhaps there are other ways to create mdl's, but that's the only way I know. You can find it most likely by searching for it via the search page. I have no idea where it's been relocated to. As a further aside, the program is notoriously difficult to get running - there's a nice long post about the subject if you have difficulties. Now, then. My tutorial assumes that you have the "target" and "source" mdl files open. The target model is the one you want to give a glow to, while the source model is, in this case, Jaina. Since this is all in notepad, text can freely be copied from one to the other. Mdl files are organized such that different aspects of the model are in different locataions. Although I'm leaving some stuff out, this is roughly what mdl files look like: animation textures materials geosets (this is the long list of numbers) geoset animations bones lights helpers (bones and helpers are about 60% of most mdls, with geosets taking up most of the rest) pivot points (this is the long list of coordinates at the very bottom of the file) emitters event objects In general, things are clearly labeled inside the mdl, though it WILL take a while to get oriented. Several things that may make this easier: keyframes: animations in mdl's use keyframes. a keyframe says that that at frame x an action happens. An example might be: Scaling 2 { Linear, 67: { 2, 2, 2 }, this particular example says that at keyframe 67, something should be doubled in size. Wc3 runs at about "1000" animation frames per second (not really, of course, but that's the rate it reads from keyframes), so most animations are ~2000 or so keyframes. ObjectID: All bones, helpers, lights, emitters, and event objects are refered to in an mdl by their objectID. As with all other lists in the mdl, this starts at 0, and ascends. Your model will fail to compile if there are gaps in the sequence of objects, and it'll be messed up, most likely, if there are duplicate entries from the same object number. Pivot points: each objectID has a corresponding pivot poijnt (look at the bottom of the file for the list of pivot points). If you alter the order of the object ID's be sure to also alter the order of the pivot points. If you add a new objectID in the middle of the sequence, you'll need to also add a new pivot point, or risk messing up the model. If anyone has specific questions, or still has trouble getting started, post in here, and I'll try to answer an questions. The finished product, btw, is the Luthien model, which if it wasn't clear is an emissary that has been reskinned and had a glow added. pps: Luthien has now been slightly revamped (might as well plug FoK): ![]() |
| 02-28-2004, 08:33 PM | #13 | ||
Hey, Looks like a nice tutorial! I'm trying it out now, but I have a doubt: Quote:
How do I know which is the first keyframe used by my model? Hey, Looks like a nice tutorial! I'm trying it out now, but I have a doubt: Quote:
How do I know which is the first keyframe used by my model? Guess it doesn't matter... :D |
| 03-19-2004, 11:54 AM | #14 |
Could u plz explain how to remove the glow for the demon hunter i can absolutley not find out how!!!!!!!!!!!!!!!!!!!! |
| 04-10-2004, 07:19 PM | #15 |
Give the man a break people. He has explained how, and good might I add. It's not a step by step, doing that on model this, but if you have tried editing mdl's at all, you should have no problem following his examples. |
