Multiple Addon Meshes?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Multiple Addon Meshes?

Post by ROCKET »

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:

Option 1 (Mesh 2 shows in-game, Mesh 1 doesn't)

AnimatedAddon = "GROUP1"
GeometryAddon = "Mesh1"
AddonAttachJoint = "Bone1"
AnimatedAddon = "GROUP2"
GeometryAddon = "Mesh2"
AddonAttachJoint = "Bone2"

Option 2 (Neither mesh shows in-game)

AnimatedAddon1 = "GROUP1"
GeometryAddon1 = "Mesh1"
AddonAttachJoint1 = "Bone1"
AnimatedAddon2 = "GROUP2"
GeometryAddon2 = "Mesh2"
AddonAttachJoint2 = "Bone2"

Option 3 (Mesh 2 shows in-game, Mesh 1 doesn't)

AnimatedAddon = "GROUP"
GeometryAddon = "Mesh1"
AddonAttachJoint = "Bone1"
GeometryAddon = "Mesh2"
AddonAttachJoint = "Bone2"

Option 4 (CTD)

AnimatedAddon = "GROUP"
GeometryAddon1 = "Mesh1"
AddonAttachJoint1 = "Bone1"
GeometryAddon2 = "Mesh2"
AddonAttachJoint2 = "Bone2"
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Multiple Addon Meshes?

Post by Maveritchell »

As far as I know, it can't be done. I've tried before with no success.
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Multiple Addon Meshes?

Post 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?
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Multiple Addon Meshes?

Post 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.
User avatar
Gogie
Modeling Master
Modeling Master
Posts: 708
Joined: Fri Mar 31, 2006 11:02 pm
Projects :: Tinkering away with LEGO
Location: alberta, canada

Re: Multiple Addon Meshes?

Post 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.
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Multiple Addon Meshes?

Post 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.

Image

Now to see if I can do something similar in a ranged-weapon ODF.
Caleb1117
2008 Most Original Avatar
Posts: 3096
Joined: Sun Aug 20, 2006 5:55 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: X-Fire: caleb1117 ಠ_ಠ

Re: Multiple Addon Meshes?

Post by Caleb1117 »

Wait, how did you do that? Add another addon through the unit's weapon ODF?
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Multiple Addon Meshes?

Post by Maveritchell »

Caleb1117 wrote:Wait, how did you do that? Add another addon through the unit's weapon ODF?
It's a second "weapon," just like Aayla's sabers:
Hidden/Spoiler:
[code][WeaponClass]

ClassLabel = "melee"
ClassParent = "com_weap_inf_lightsaber"

[Properties]

GeometryName = "rep_weap_inf_lightsabre"
ComboAnimationBank = "human_sabre melee rep_hero_aalya"

NumDamageEdges = "2"

OffhandFirePointName = "hp_fire hp_weapons"
LightSaberLength = "1.0"
LightSaberWidth = "0.08"
LightSaberTexture = "greenlightsabre"
LightSaberTrailColor = "82 255 7 128"

OffhandGeometryName = "rep_weap_aalya_lightsabre"
OffhandFirePointName = "hp_fire_lightsabre"
LightSaberLength = "1.0"
LightSaberWidth = "0.08"
LightSaberTexture = "bluelightsabre"
LightSaberTrailColor = "7 85 255 128"[/code]
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Multiple Addon Meshes?

Post by ROCKET »

Exactly, Maveritchell. Just modify the "NumDamageEdges" to the total number of meshes (weapons plus addons) and add the following for each addon:

OffhandGeometryName = "your_addon_mesh"
OffhandFirePointName = "your_addon_hp your_unit_bone"
LightSaberLength = "0.0"
LightSaberWidth = "0.08"

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.
User avatar
Maveritchell
Jedi Admin
Jedi Admin
Posts: 7366
Joined: Mon Aug 21, 2006 11:03 pm

Re: Multiple Addon Meshes?

Post 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.
ARC_Commander
High General
High General
Posts: 838
Joined: Tue Feb 06, 2007 7:18 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Multiple Addon Meshes?

Post 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.
Hidden/Spoiler:
[code]ParticleEmitter("wings")
{
MaxParticles(-1.0000,-1.0000);
StartDelay(0.0000,0.0000);
BurstDelay(0.0010, 0.0010);
BurstCount(1.0000,1.0000);
MaxLodDist(1000.0000);
MinLodDist(900.0000);
BoundingRadius(5.0);
SoundName("")
NoRegisterStep();
Size(1.0000, 1.0000);
Hue(255.0000, 255.0000);
Saturation(255.0000, 255.0000);
Value(255.0000, 255.0000);
Alpha(255.0000, 255.0000);
Spawner()
{
Spread()
{
PositionX(0.0000,0.0000);
PositionY(0.0000,0.0000);
PositionZ(0.0000,0.0000);
}
Offset()
{
PositionX(0.0000,0.0000);
PositionY(0.0000,0.0000);
PositionZ(0.0000,0.0000);
}
PositionScale(0.0000,0.0000);
VelocityScale(0.0000,0.0000);
InheritVelocityFactor(0.0000,0.0000);
Size(0, 1.0000, 1.0000);
Red(0, 255.0000, 255.0000);
Green(0, 255.0000, 255.0000);
Blue(0, 255.0000, 255.0000);
Alpha(0, 255.0000, 255.0000);
StartRotation(0, 0.0000, 0.0000);
RotationVelocity(0, 0.0000, 0.0000);
FadeInTime(0.0000);
}
Transformer()
{
LifeTime(0.0010);
Position()
{
LifeTime(1.0000)
}
Size(0)
{
LifeTime(1.0000)
}
Color(0)
{
LifeTime(0.0010)
}
}
Geometry()
{
BlendMode("NORMAL");
Type("GEOMETRY");
Model("rep_waz_add_pauldron");
}
}
[/code]
The binocs are added through addon meshes, and they show up all right. I've attached the effect like so:

Code: Select all

AttachDynamic = "1"
AttachEffect = "rep_pauldron"
AttachToHardpoint = "bone_ribcage 0"
But it doesn't appear in game. Logfile gives me about 40 lines of:

Code: Select all

Message Severity: 2
.\Source\FLEffect.cpp(463)
Attach: model '' [ef944c4c] has no hardpoint 'bone_ribcage' [e5b51072]
Any ideas?
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Multiple Addon Meshes?

Post 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. :)
ARC_Commander
High General
High General
Posts: 838
Joined: Tue Feb 06, 2007 7:18 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

Re: Multiple Addon Meshes?

Post by ARC_Commander »

Hmm... I may need to do the same.
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Multiple Addon Meshes?

Post 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!
Caleb1117
2008 Most Original Avatar
Posts: 3096
Joined: Sun Aug 20, 2006 5:55 pm
Projects :: No Mod project currently.
xbox live or psn: No gamertag set
Location: X-Fire: caleb1117 ಠ_ಠ

Re: Multiple Addon Meshes?

Post by Caleb1117 »

Does this method work with non-melee weapons?
ROCKET
Private First Class
Posts: 80
Joined: Tue Aug 23, 2005 1:11 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Northern California

Re: Multiple Addon Meshes?

Post 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:

AttachToHardpoint = "hp_fire bone_ribcage"
Post Reply