I'm trying to figure out how to add different addon meshes to different bones on a unit. Does anyone know how or have some ideas about it? Below I've outlined what I've tried and what it did:
As far as I know, it can't be done. I've tried before with no success.
Re: Multiple Addon Meshes?
Posted: Wed Jan 02, 2008 9:13 pm
by ROCKET
Well then let's try a little more! This is Gametoast, after all. Let's not pull out the c-word (which would be "can't", LOL) quite so quickly! Any crazy ideas to send me off to try?
Re: Multiple Addon Meshes?
Posted: Thu Jan 03, 2008 11:57 am
by Teancum
Typically you can look at .exe files in a hex editor and find out if a particular function is supported. That's how I've found a few unique things in games, and SWBF2 should be no different.
Re: Multiple Addon Meshes?
Posted: Thu Jan 03, 2008 1:39 pm
by Gogie
you can always just add them to a .fx file sorta like the geonosiuan wings, but have multiple meshs at the same time programmed in, so no blending times, unfortunately you wont be able to attach them to any other joints, which ever bone you attach them to they will be stuck there, however, if you want to add a cape to a unit that uses a double jump, your .fx file will make the cape still be atatched to your mesh when your jumping.
Re: Multiple Addon Meshes?
Posted: Fri Jan 04, 2008 12:44 am
by ROCKET
And I'm a hex-editing novice, but I'll give that a try too, Teancum.
And I guess your .fx idea won't quite work for me, Gogie (since it has to be on one bone). But I'll definitely remember it for future reference.
And I did have one other idea which I'm working on (without any luck so far). I've been able to call out multiple meshes on multiple bones with two-bladed melee weapons. So I'm thinking that I can add more meshes to the unit through it's weapon .odf by adding more OffhandGeometryNames and OffhandFirePointNames. If I get that to work, then I'll have to try to add it to ranged-weapon odf's as well. Although it would be kind of funny to have armor, helmets, etc suddenly popping on and off as you switched weapons.
EDIT
The melee ODF idea WORKED! I just had the hard point call-out wrong. I'm just adding a test mesh to the forearms as a proof of concept. Now I can get to work making nicer meshes.
Now to see if I can do something similar in a ranged-weapon ODF.
Re: Multiple Addon Meshes?
Posted: Fri Jan 04, 2008 8:14 am
by Caleb1117
Wait, how did you do that? Add another addon through the unit's weapon ODF?
Re: Multiple Addon Meshes?
Posted: Fri Jan 04, 2008 11:57 am
by Maveritchell
Caleb1117 wrote:Wait, how did you do that? Add another addon through the unit's weapon ODF?
The only problem is that I think there may be a limit on "NumDamageEdges". Going above "4" doesn't seem to work. But I'm still playing with it.
Re: Multiple Addon Meshes?
Posted: Fri Jan 04, 2008 12:19 pm
by Maveritchell
The easiest and most surefire way would probably be just to hexedit in the MODL chunk of the addon to the unit's mesh, a la RepSharpshooter's method.
Re: Multiple Addon Meshes?
Posted: Fri Jan 04, 2008 12:53 pm
by ARC_Commander
Here's what I've been trying to do, to add Bly goggles and pauldron onto a unit. I've made an effect file, using the geo_wingsfolded.fx and changing the geometry to that of the pauldron.
Message Severity: 2
.\Source\FLEffect.cpp(463)
Attach: model '' [ef944c4c] has no hardpoint 'bone_ribcage' [e5b51072]
Any ideas?
Re: Multiple Addon Meshes?
Posted: Fri Jan 04, 2008 1:13 pm
by ROCKET
I'm not sure yet about the .fx method, but I do have some other results.
I confirmed through the BFlog file that the maximum number of meshes allowed through the melee ODF is 4. I'm guessing they set the limit there to accomodate Grievous's 4 sabers. Still, that's 2 or 3 addon meshes that can be added this way (depending on whether the base melee weapon starts with 1 or 2). I still need to see if I can do something similar with a ranged weapon ODF.
I also tried a few variations of the "NextAddon" idea. I wasn't able to get any additional addons to show up in-game. But one attempt did finally give me this error:
Message Severity: 2
.\Source\EntitySoldier.cpp(11195)
EntitySoldierClass::SetProperty: multiple AnimatedAddon's not supported
So it looks like multiple addons through the unit ODF isn't going to work. I think I may end up taking a crash course in hex editing.
Re: Multiple Addon Meshes?
Posted: Fri Jan 04, 2008 1:29 pm
by ARC_Commander
Hmm... I may need to do the same.
Re: Multiple Addon Meshes?
Posted: Fri Jan 04, 2008 1:56 pm
by ROCKET
Addons on multiple bones are possible. You get one in the unit ODF, one in the .fx, and 2 or 3 in the weapon ODF. Granted it's a little inelegant to spread it all over the place, but at least it's something!
Re: Multiple Addon Meshes?
Posted: Fri Jan 04, 2008 3:16 pm
by Caleb1117
Does this method work with non-melee weapons?
Re: Multiple Addon Meshes?
Posted: Sun Jan 06, 2008 2:22 am
by ROCKET
No luck yet on the non-melee weapons. But I am still trying. And still open to ideas.
EDIT
Hey, ARC_Commander... I'm finally looking into the .fx strategy and I'm wondering where you found the example of the "AttachDynamic" code? Also, I've been thinking about your hardpoint error. If it's the same as the melee weapon geometry call-out, you would need a hard-point in the model, such as hp_fire, in addition to your unit bone. Your code would become: