Randomizing soldier uniforms

Ask questions, discuss ideas, get answers
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Randomizing soldier uniforms

Post by Senshi »

Well, this is just an idea that occurred to me, but I've never seen it in any mod.

In BF42 soldiers are uniquely defined for a team. Meaning, all soldiers in a team are "clones". However, there are existing variations (e.g. in Vanilla three different faces). The very same should be applicable to the soldiers' body, that is defining the body uniform. This would mean you could make a team use different uniforms for its soldiers, independent from the kits chosen. I think it would be nice to have some variation there, perfomance drawback is minimal and it would be a fancy visual plus.

How to? This would be the way to do it (not tested):
HungarianSoldier\geometries.con
GeometryTemplate.create AnimatedMesh Soldier/3PHunBody1
GeometryTemplate.setSkin animations/GerBody.skn
GeometryTemplate.file Ger1Body
GeometryTemplate.setLodRange 0 0 1 30 2 80
GeometryTemplate.setLodRange 3 150 4 210 5 230
GeometryTemplate.setLodPercent 0 1.0
GeometryTemplate.setLodPercent 1 0.7
GeometryTemplate.setLodPercent 2 0.3
GeometryTemplate.setLodPercent 3 0.2
GeometryTemplate.setLodPercent 4 0.1
GeometryTemplate.setLodPercent 5 0.05

GeometryTemplate.create AnimatedMesh Soldier/3PHunBody2
GeometryTemplate.setSkin animations/GerBody.skn
GeometryTemplate.file Ger2Body
GeometryTemplate.setLodRange 0 0 1 30 2 80
GeometryTemplate.setLodRange 3 150 4 210 5 230
GeometryTemplate.setLodPercent 0 1.0
GeometryTemplate.setLodPercent 1 0.7
GeometryTemplate.setLodPercent 2 0.3
GeometryTemplate.setLodPercent 3 0.2
GeometryTemplate.setLodPercent 4 0.1
GeometryTemplate.setLodPercent 5 0.05

GeometryTemplate.create AnimatedMesh Soldier/3PHunBody3
GeometryTemplate.setSkin animations/GerBody.skn
GeometryTemplate.file Ger3Body
GeometryTemplate.setLodRange 0 0 1 30 2 80
GeometryTemplate.setLodRange 3 150 4 210 5 230
GeometryTemplate.setLodPercent 0 1.0
GeometryTemplate.setLodPercent 1 0.7
GeometryTemplate.setLodPercent 2 0.3
GeometryTemplate.setLodPercent 3 0.2
GeometryTemplate.setLodPercent 4 0.1
GeometryTemplate.setLodPercent 5 0.05
Now you only need to copy the GerBody.sm two times and rename all of them to "Ger1Body, Ger2Body and Ger3Body", then either use 3dsmax to assign a new uniform texture, or just open the corresponding ".rs" file and change the texture path there:

Code: Select all

subshader "GerBody_Material14" "StandardMesh/Default"
{
	lighting true;
	lightingSpecular false;
	materialDiffuse 0.4 0.4 0.4;
	texture "texture/Germun_r";
}

subshader "GerBody_Material15" "StandardMesh/Default"
{
	lighting true;
	lightingSpecular false;
	materialDiffuse 0.4 0.4 0.4;
	texture "texture/Germov_r";
}
Et voìla, you got randomized uniforms!

As stated before, these uniforms will be distributed completely randomly and are NOT kit-associated (only "extras" like backpacks, hippacks, helmet etc. are kit-related!)

Though that would be another interesting project: would it be possible to make animatedmeshes part of kits? I fear not, as throughout the game only "KitParts" are used, and AFAIK they are all simpleobjects attached to a specific bone...

Also, does anyone know what this code used in kitparts does?

Code: Select all

ObjectTemplate.setCopyLinksCount 0
User avatar
HJGF
Posts: 233
Joined: Fri Feb 05, 2010 10:28 pm

Re: Randomizing soldier uniforms

Post by HJGF »

i think i found what u mean http://img.villagephotos.com/p/2005-2/956333/AIS03.jpg ill ask how he did it
Image
Image
User avatar
HJGF
Posts: 233
Joined: Fri Feb 05, 2010 10:28 pm

Re: Randomizing soldier uniforms

Post by HJGF »

lol ik i was just showing a pic
Image
Image
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Randomizing soldier uniforms

Post by Apache Thunder »

Ahh yes the random geometries code is perfect for this. The 3p/1p body mesh are addTemplated to the soldier and are not directly part of the soldier.

So to have the geometries get used in the manner described above, you would do the following: (ussoldier used as an example)

Code: Select all

ObjectTemplate.create BFSoldier USSoldier



ObjectTemplate.addTemplate USSoldier1PBody
ObjectTemplate.setIsFirstPersonPart 1
objectTemplate.setRandomGeometries 3


ObjectTemplate.addTemplate USSoldier3pBody
ObjectTemplate.setIsFirstPersonPart 0
objectTemplate.setRandomGeometries 3

ObjectTemplate.create SimpleObject USSoldier1PBody1
ObjectTemplate.geometry Soldier/1PUsBody1

ObjectTemplate.create SimpleObject USSoldier1PBody2
ObjectTemplate.geometry Soldier/1PUsBody2

ObjectTemplate.create SimpleObject USSoldier1PBody3
ObjectTemplate.geometry Soldier/1PUsBody3

ObjectTemplate.create SimpleObject USSoldier3PBody1
ObjectTemplate.geometry Soldier/3PUsBody1
ObjectTemplate.hasDynamicShadow 1

ObjectTemplate.create SimpleObject USSoldier3PBody2
ObjectTemplate.geometry Soldier/3PUsBody2
ObjectTemplate.hasDynamicShadow 1

ObjectTemplate.create SimpleObject USSoldier3PBody3
ObjectTemplate.geometry Soldier/3PUsBody3
ObjectTemplate.hasDynamicShadow 1
There's the 1p body mesh. If you have some extra textures for that you can do random versions of that too. In BFV your limited to 3 or 4 geometries. But BF42 has no limit that I know of. :D
ImageImageImage
I have cameras in your head!
User avatar
Senshi
Posts: 697
Joined: Sun Oct 18, 2009 1:14 pm
Location: Germany
Contact:

Re: Randomizing soldier uniforms

Post by Senshi »

Oh yeah, obviously I forgot about the objects.con and the randomgeometries there...d'uh...

But, considering that the body meshes are just addtemplated, what would happen if you'd remove them from the soldier and move them to the kits? Make them a kit part, attach them to the soldier and good to go? Or are there problems I don't see?

Because that would be really really awesome. Just imagine having unique tank commander uniforms, pilot uniforms, paratrooper uniforms etc., all in one map!
POTAmatt
Posts: 89
Joined: Mon Dec 07, 2009 9:09 pm
Location: New Yawk

Re: Randomizing soldier uniforms

Post by POTAmatt »

Well, this is just an idea that occurred to me, but I've never seen it in any mod.
Sure you have. In my Planet of the Apes mod. Way back when, on SSM.com, you helped me fix the LOD values on their faces so the correct skins would display with the proper uniforms at any visible distance. That's all one team in the pic: 3 different designations - Chimp (Green), Orangutan (Yellow) , Gorilla (Red) - each with 3 different faces totaling 9 random geometries.

http://battlefieldmodding.com/ssm/phpBB ... 5be#p40830
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Randomizing soldier uniforms

Post by Apache Thunder »

AnimatedMeshes via kitparts won't animate. I tried that once with some boots I ported from BFheroes. I made it a animatedMesh and added that to a kitpart. It did not animate with the soldier. So unfortunately I don't think this will work. :(
ImageImageImage
I have cameras in your head!
Sniperjack
Posts: 24
Joined: Tue Oct 27, 2009 11:18 pm

Re: Randomizing soldier uniforms

Post by Sniperjack »

So you can have different randomized player models, not just different skins for the same one, right? Just this would require three times as much rigging?
Post Reply