problem adding a cape to a model [Solved]

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
User avatar
Brucelciolino
Private Recruit
Posts: 24
Joined: Thu Feb 11, 2021 10:54 pm
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

problem adding a cape to a model [Solved]

Post by Brucelciolino »

I've been trying to add a cape to a model following this tutorial: http://www.gametoast.com/viewtopic.php?p=210303#p210303

I put the cape inside the Dummyroot, I made the envelope and the cloth collision.

But then the tutorial asks to go to "File>Pandemic Tools>Create Cloth" and I didn't find that option.
Hidden/Spoiler:
Image
But I found this one in ZE Tools>Cloth...
Hidden/Spoiler:
Image
Hidden/Spoiler:
Image
It's different from how the tutorial described but similar, so I used this one.

I marked the fixed points, exported and tried to add to the mod, but it gave an error and this message appeared:
Hidden/Spoiler:
WARNING[PC_modelmunge msh\imp_inf_kyloren.msh]:imp_inf_kyloren has 3772 vertices and NO COLLISION GEOMETRY (WILL BE SLOW)!
ERROR[levelpack req\imp_hero_kyloren.req]:Expecting bracket, but none was found.
File : munged\pc\imp_inf_kyloren.model.req(1)...

ucft <--
ERROR[levelpack req\imp_hero_kyloren.req]:Expecting bracket, but none was found.
File : munged\pc\imp_inf_kyloren.model.req(1)...

ucft <--

2 Errors 0 Warnings
And inside the game the model appeared with the cape without physics, just like it was before I tried to add this new model.
Last edited by Brucelciolino on Tue Aug 30, 2022 6:29 pm, edited 1 time in total.
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: problem adding a cape to a model

Post by Sporadia »

That's the error you get when there's something wrong with your msh, and the mungetools have detected it. And I suspect the reason your model in game looks like the one before you started, is because it is the model from before you started. I think that error indicates that the broken msh didn't munge. I don't know what the actual problem is; the process you've described for making cloth is correct. I would also add that you should quadrangulate your cloth and triangulate your model before export, if it isn't already like that. And when you import collision primitives it sometimes breaks them, so you normally have to remake your collision primitives when you import. Or if you're making lots of changes that have nothing to do with cloth, you can delete the cloth and collision primitives temporarily then hex edit working versions on to the model at the end. Depends on how comfortable you are with a hex editor.
User avatar
Brucelciolino
Private Recruit
Posts: 24
Joined: Thu Feb 11, 2021 10:54 pm
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: problem adding a cape to a model

Post by Brucelciolino »

Sporadia wrote:
Sat Jul 09, 2022 1:11 pm
That's the error you get when there's something wrong with your msh, and the mungetools have detected it. And I suspect the reason your model in game looks like the one before you started, is because it is the model from before you started. I think that error indicates that the broken msh didn't munge. I don't know what the actual problem is; the process you've described for making cloth is correct. I would also add that you should quadrangulate your cloth and triangulate your model before export, if it isn't already like that. And when you import collision primitives it sometimes breaks them, so you normally have to remake your collision primitives when you import. Or if you're making lots of changes that have nothing to do with cloth, you can delete the cloth and collision primitives temporarily then hex edit working versions on to the model at the end. Depends on how comfortable you are with a hex editor.
the inside of the cape is transparent, do you think that could be the reason for the error?

Image
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: problem adding a cape to a model

Post by Sporadia »

No I think the problem is happening in xsi. If I had to guess about the visibility of the cape, it looks like it only has polygons facing in one direction, so it can only be seen from that direction in-game. But converting it to cloth will allow the polygons to be seen from both sides in that case. The reason why xsi has exported a broken/unmungable msh is still a mystery to me. I've had it happen to me once but it was because of something I accidentally did when I was modelling. Then I went back and redid everything and it didn't happen again.
User avatar
Brucelciolino
Private Recruit
Posts: 24
Joined: Thu Feb 11, 2021 10:54 pm
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: problem adding a cape to a model

Post by Brucelciolino »

Sporadia wrote:
Fri Jul 15, 2022 2:19 pm
No I think the problem is happening in xsi. If I had to guess about the visibility of the cape, it looks like it only has polygons facing in one direction, so it can only be seen from that direction in-game. But converting it to cloth will allow the polygons to be seen from both sides in that case. The reason why xsi has exported a broken/unmungable msh is still a mystery to me. I've had it happen to me once but it was because of something I accidentally did when I was modelling. Then I went back and redid everything and it didn't happen again.
I recorded this video so you can see if I'm doing something wrong

https://www.youtube.com/watch?v=vO8LALJRH5s
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: problem adding a cape to a model

Post by Sporadia »

I see a few problems. I'll start with the one that's probably breaking the export: Don't use the scale transformation on your collision primitives. Change the size of the spheres using the properties window (when you first make the sphere, or double click on the sphere in the explorer). The only collision primitive where it's ok to use the scale transform is the cube (according to the docs, I haven't verified this). You also can't change the proportions of the spheres like that; they need to be perfect spheres, not spheroids. You can however change the proportions of cylinders in the properties window, and like I say I don't know what works for cubes/cuboids. Supposedly for a cube you should keep the properties that it's made with, then just use the scale transform, which is the opposite of what you do for spheres and cylinders.

Second, quadrangulate your cape before you export and it will perform better in game. Cloth works best with quadrilaterals, whereas the main polymesh works best with triangles. (It's also worth knowing that faces with 5 or more vertices can mess up the ZETools exporter, so always reduce everything to triangles and quadrilaterals).

c_b_spine is an unusual choice. c_ribcage, c_pelvis and c_head are what the stock models usually use for this kind of cape. Along with a c_l_thigh, c_l_calf, c_r_thigh and c_r_calf to stop it falling through the legs. (Also c_bone_b_spine is definitely wrong, you should replace the bone_ with c_).

Finally, it looks like you're only enveloping the whole cape to bone_neck, which is another thing that stock models typically don't do. Conventionally, you would envelope this cape to bone_ribcage, bone_l_clavicle and bone_r_clavicle. And then you would need to set the weights (you haven't set the weights in the video, but it's also all enveloped to one bone so I understand it wasn't necessary). The only weighting that matters for cloth is the weighting on the fixed points. But for this you would typically weight the left hand side to bone_l_clavicle, and weight the right hand side bone_r_clavicle. Then a couple of central points near the neck can be weighted to bone_ribcage. But most points can be weighted to the clavicles.

Everything else looks good.

Also I don't know if you have weld boundary points/edges checked on the import msh settings. It's up to you if you want to do that. But you'd have more control over how much your model deforms if you uncheck that setting, then perform a manual weld boundary points/edges from model > deform > polymesh then set the slider to something like 0.001. In this case it doesn't look like it matters though.
User avatar
Brucelciolino
Private Recruit
Posts: 24
Joined: Thu Feb 11, 2021 10:54 pm
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: problem adding a cape to a model

Post by Brucelciolino »

Sporadia wrote:
Thu Jul 21, 2022 12:05 pm
I see a few problems. I'll start with the one that's probably breaking the export: Don't use the scale transformation on your collision primitives. Change the size of the spheres using the properties window (when you first make the sphere, or double click on the sphere in the explorer). The only collision primitive where it's ok to use the scale transform is the cube (according to the docs, I haven't verified this). You also can't change the proportions of the spheres like that; they need to be perfect spheres, not spheroids. You can however change the proportions of cylinders in the properties window, and like I say I don't know what works for cubes/cuboids. Supposedly for a cube you should keep the properties that it's made with, then just use the scale transform, which is the opposite of what you do for spheres and cylinders.

Second, quadrangulate your cape before you export and it will perform better in game. Cloth works best with quadrilaterals, whereas the main polymesh works best with triangles. (It's also worth knowing that faces with 5 or more vertices can mess up the ZETools exporter, so always reduce everything to triangles and quadrilaterals).

c_b_spine is an unusual choice. c_ribcage, c_pelvis and c_head are what the stock models usually use for this kind of cape. Along with a c_l_thigh, c_l_calf, c_r_thigh and c_r_calf to stop it falling through the legs. (Also c_bone_b_spine is definitely wrong, you should replace the bone_ with c_).

Finally, it looks like you're only enveloping the whole cape to bone_neck, which is another thing that stock models typically don't do. Conventionally, you would envelope this cape to bone_ribcage, bone_l_clavicle and bone_r_clavicle. And then you would need to set the weights (you haven't set the weights in the video, but it's also all enveloped to one bone so I understand it wasn't necessary). The only weighting that matters for cloth is the weighting on the fixed points. But for this you would typically weight the left hand side to bone_l_clavicle, and weight the right hand side bone_r_clavicle. Then a couple of central points near the neck can be weighted to bone_ribcage. But most points can be weighted to the clavicles.

Everything else looks good.

Also I don't know if you have weld boundary points/edges checked on the import msh settings. It's up to you if you want to do that. But you'd have more control over how much your model deforms if you uncheck that setting, then perform a manual weld boundary points/edges from model > deform > polymesh then set the slider to something like 0.001. In this case it doesn't look like it matters though.
I did the collisions as you said and the errors continued, then I realized that I was in an old version of ZE Tools and updated it, now I am able to export the model into the game but the cape is not showing.

This is the "all_inf_kylo_cape":
Hidden/Spoiler:
[GameObjectClass]
ClassLabel = "cloth"

[Properties]
attachedmesh = "imp_inf_kyloren"
priority = 1.0

I tried changing the "attachedmesh" to "kylo_unmasked_Mesh_001" which is the name of the model inside the "DummyRoot" folder and I also tried changing it to "override_texture" which is the name of the folder with the model skeleton, but neither of them worked.
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: problem adding a cape to a model

Post by Sporadia »

Why all_inf_kylo_cape.odf? Why not imp_inf_kyloren_cape.odf?

Also attachedmesh = uses the name of the .msh so you were probably right the first time.
User avatar
Brucelciolino
Private Recruit
Posts: 24
Joined: Thu Feb 11, 2021 10:54 pm
Projects :: No Mod project currently.
Games I'm Playing :: Battlefront 2
xbox live or psn: No gamertag set

Re: problem adding a cape to a model

Post by Brucelciolino »

Sporadia wrote:
Sat Aug 20, 2022 12:12 pm
Why all_inf_kylo_cape.odf? Why not imp_inf_kyloren_cape.odf?

Also attachedmesh = uses the name of the .msh so you were probably right the first time.
IT WORKED!
I changed the cape ODF name to the cape model name inside the DummyRoot and it appeared

Image

It looks bad because I haven't added all the collisions yet or enveloped it with all the bones needed, which I'll do shortly, but the important thing is that it's working

Thank you for your help
Post Reply