Battlefield Modding Tutorials BFMODS

Battlefield Modding Tutorials
It is currently Fri Dec 15, 2017 12:46 am

All times are UTC




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 15 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sun Dec 20, 2009 1:33 am 
Offline

Joined: Thu Jan 08, 2009 3:06 am
Posts: 17
This post chronicles my attempt at importing a new player model into the game, as well as the end result. Hopefully someone can tell me what I'm doing wrong. Thanks in advance for those who look!

***************

1) Aquire model

Meet Boxman. Boxman was made by Sniperjack for this very purpose. Boxman has been converted to an .sm file and then imported into max, which you see below

Image

2) Import and pose .ske

Next step I imported USSoldier.ske from animations.rfa. Using only the rotate and move commands, I posed the skeleton to more or less fit Boxman. It wasn't a perfect fit by any means, but I don't care since this is only a test run.

Image

3) Weight vertices

I made a skin modifier, added the bones from the skeleton, and used the weight table and weighted every vertex to nearby bones. This is easily the longest step (Especially since Boxman went from 80 to 200 vertices while being converted to .sm).

Image

At this point the skin modifier works pretty well, I think. Boxman can dance!

Image

4) Export

Now, I select the mesh and go Battlefiel Tools > Skeleton and skin > Export .skn. I save it as Boxman.skn. I put Boxman.skn in my animations.rfa file and boxman.sm/.rs in my standardmesh.rfa file. I now need to tell the game to actually use these.

5) Code

I want to make boxman appear as the body of british soldiers. So I open up Objects.con and go to soldiers/BritishSoldier/Geometries.con and find:

GeometryTemplate.create AnimatedMesh Soldier/3PBritBody
GeometryTemplate.setSkin animations/BritBody.skn
GeometryTemplate.file BritBody
GeometryTemplate.hasDynamicShadow 1
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

I change the second two lines to:

GeometryTemplate.setSkin animations/Boxman.skn
GeometryTemplate.file Boxman

6) Try it out in-game

Load El Alamein and:

Image

Image

Oh yes. I like spikes.

****

So, what did I do wrong? I have a working skin modifier in max, so I'm guessing the error is later, but I could be wrong.

I've tried and retried this in various different mods, but the result is pretty much the same. Sometimes I don't get the "no vertices skinned" error, and sometimes the "spikes" actually move when it tries to make an animation, but it is never the right shape.


Top
 Profile Send private message E-mail  
 
PostPosted: Sun Dec 20, 2009 1:51 am 
Offline
User avatar

Joined: Sun Sep 16, 2007 2:33 pm
Posts: 1809
Location: Your moms house
Make sure you gave every vertice a weight,and gave every bone a vertice.

_________________
Image


Top
 Profile Send private message E-mail  
 
PostPosted: Sun Dec 20, 2009 6:02 am 
Offline

Joined: Thu Jan 08, 2009 3:06 am
Posts: 17
Every bone? What about, like, the head and hands? Those are going to linked to other models via other .skn files.


Top
 Profile Send private message E-mail  
 
PostPosted: Sun Dec 20, 2009 7:17 am 
Offline
User avatar

Joined: Sun Sep 16, 2007 2:33 pm
Posts: 1809
Location: Your moms house
Nope nope nope,you must import the head and hands position them and skin them as well,this skeleton is the only skeleton,it does the entire body in 1 shot,there is no separate skin file for hands and head,only separate meshes,just import them and skin them with it.

_________________
Image


Top
 Profile Send private message E-mail  
 
PostPosted: Sun Dec 20, 2009 7:30 am 
Offline

Joined: Thu Jan 08, 2009 3:06 am
Posts: 17
Then what do BritLeftHand.skn, BritRightHand.skn, and BritHead.skn do? They're not for 1p, since those are separate and labeled as such.

Moreover, why are the models separate and not called when the code is defining the british 3p body? That is, these are all separate:

Code:
GeometryTemplate.create AnimatedMesh Soldier/3PBritBody
GeometryTemplate.setSkin animations/Boxman.skn
GeometryTemplate.file Boxman
GeometryTemplate.hasDynamicShadow 1
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


Code:
GeometryTemplate.create AnimatedMesh Soldier/BritLeftHand
GeometryTemplate.setSkin animations/BritLeftHand.skn
GeometryTemplate.file BritLeftHand
GeometryTemplate.hasDynamicShadow 1
GeometryTemplate.setLodRange 0 0 1 20 2 50
GeometryTemplate.setLodPercent 0 1.0
GeometryTemplate.setLodPercent 1 0.6
GeometryTemplate.setLodPercent 2 0.03


Code:
GeometryTemplate.create AnimatedMesh Soldier/BritHead
GeometryTemplate.setSkin animations/BritHead.skn
GeometryTemplate.file BritHead
GeometryTemplate.hasDynamicShadow 1
GeometryTemplate.setLodRange 0 0 1 10 2 30
GeometryTemplate.setLodRange 3 50 4 60 5 100
GeometryTemplate.setLodPercent 0 1.0
GeometryTemplate.setLodPercent 1 0.6
GeometryTemplate.setLodPercent 2 0.3
GeometryTemplate.setLodPercent 3 0.2
GeometryTemplate.setLodPercent 4 0.1
GeometryTemplate.setLodPercent 5 0.03


Code:
GeometryTemplate.create AnimatedMesh Soldier/BritRightHand
GeometryTemplate.setSkin animations/BritRightHand.skn
GeometryTemplate.file BritRightHand
GeometryTemplate.hasDynamicShadow 1
GeometryTemplate.setLodRange 0 0 1 20 2 50
GeometryTemplate.setLodPercent 0 1.0
GeometryTemplate.setLodPercent 1 0.6
GeometryTemplate.setLodPercent 2 0.03


And they are added separately to the body in objects.con as well.


Top
 Profile Send private message E-mail  
 
PostPosted: Sun Dec 20, 2009 6:23 pm 
Offline
User avatar

Joined: Sun Sep 16, 2007 2:33 pm
Posts: 1809
Location: Your moms house
hmm ok,The reason for this is because,they are all skinned in one scene and all have to be present and weighed,BUT,the the skins are exported for each mesh,i/e you still have to have them all in 1 scene and weight them all,just export a .skn for each mesh

Which means,Import Everything,give each mesh a separate .skn then skin them make sure every bone,every vertex,done

_________________
Image


Top
 Profile Send private message E-mail  
 
PostPosted: Mon Dec 21, 2009 11:40 am 
Offline

Joined: Mon Oct 09, 2006 12:51 pm
Posts: 782
Surrender yourself for a few days, let me get a video Tutorial up on my old youtube channel.

_________________
Image


Top
 Profile Send private message E-mail  
 
PostPosted: Mon Dec 21, 2009 4:59 pm 
Offline
User avatar

Joined: Sun Sep 16, 2007 2:33 pm
Posts: 1809
Location: Your moms house
yay :)

_________________
Image


Top
 Profile Send private message E-mail  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 15 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Group