Tutorial: Replace the old animation with custom ones

Users who are viewing this thread

This is a tutorial that shows how you can replace the old animations in Mount and Blade with self made ones.

What you need:

-Mount & Blade in version of 1.010 / 1.011

-OpenBRF by mtarini: http://www.mbrepository.com/file.php?id=1466

-A program to edit animations – in this case we will use 3ds max 9

-the latest module system: http://www.taleworlds.com/mb_module_system.html

-A plugin for your animation program to im- and export smd files:
http://www.wunderboy.org/  (that are 2 files: importer and exporter)

-Python: http://www.python.org/download/


You should have to know at least something on working with 3ds max, otherwise it will be very hard, even if I'll try to explain everything very detailed.
Furthermore you should know how to work with the python scripts
Therefore I recommend you to work a bit with this tutorial: http://forums.taleworlds.com/index.php/board,12.0.html
You can also have a look at a tutorial of cdvader, on which I have orientated a bit: http://forums.taleworlds.com/index.php/topic,72992.0.html

So let's start:
Assuming that you have installed Mount and Blade, created a new module folder for your custom animations, set up your module system correctly and installed python and the smd im- and exporter plugins to your animation program, we can start. If you don't know how to do that, have a look at http://forums.taleworlds.com/index.php/board,12.0.html

Now go to commonres and make a backup of skeletons.brf in case anything goes wrong.

So, now open up OpenBRF go to file – open and select skeletons.brf in commonres.

Rightclick to anim_human, choose split via action.txt.
In the window that opens, go to your module folder and select the actions.txt there.
This also creates a new  file in your folder called “actions.txt [after splitting anim_human]”.
You can delete it or not, we don't have to care about it.

Now you should have a list of 108 animations in Mount and Blade but we will only replace one.
A hint: don't save the skeletons.brf with splitted anim_human, otherwise it will not function!
We just want to look, what we can edit.

So half down the list there are the attack animations. Select “anim_human_ready_thrust_onehanded”. Under  this you can see an animation called “ anim_human_release_thrust_onehanded”. This means the first animation is the movement, when you hold your mousebutton in the game. The second is the attack itself.
We have to replace  them both.
Have a look under data of the selected animation (anim_human_release_thrust_onehanded ). You see the bones (20), the frames of the animation (6), and the interval (28510-28540).

The count of the bones keeps naturally always the  same. The frame count shows, how much frames were created in 3ds max and the interval shows the “in game” frames. Because if its an easy animation, there would 6 frames be enough to define the move. But ingame you need a longer time sequence (in this case 40 frames – about a second).

Now write down the first interval number (28500 from the “ready” animation)  and the  last interval number (28540 from the “release” animation) on a piece of paper – we have to remember later.

Click in on skeleton (above the list) select skel_human, rightclick and choose export nude skeleton.
You can now close OpenBRF – don't save it!

Open 3ds max.
Go to file, import, select SMD as  filetype and import the exported skel_human from OpenBRF.
Don't skip  or change anything, just click “ok” two times.

Now click on “Time configuration”



Choose a length of 40 (Yes, the interval count).

Now you can see the time line has  changed to 40 frames. Select Auto key, so that it's active (red):



Now move the time bar forward to 10:



From the frames 0 – 10 it will be our “Ready” Animation.
Start rotating the bones to a position that it looks similar like that:
Keep in mind, that the first keyframe (0) must stay unedited!



Now you can move forward the time bar for some frames and rotate again the bones. Repeat these steps for about 2 or 3 times till you are content with your movement.



So that shall be enough. Not really pretty, but it will do.
Save your file, so that you can edit it later.

Now select all your bones. You can now see all the frames, on that the position of a bone has been changed.

Select the abdomen bone and move it at all edited frames to a correct position:



See? The guy has moved forward a step!
Now write down the frame numbers on which you have made changes on a paper. In my case it's 10,19 and 32.
Save the file.
Now we will export:
Go to file and choose export. For filetype choose SMD and name it  “anim_human_ready_thrust_onehanded” .
On the window that pops up, choose sequence and a range from 0 till 10:



Now click ok.
We will now repeat this, for the “Release” animation.
Go again to file, choose export, but now, name it “anim_human_release_thrust_onehanded”. Make sure, you export it as SMD file and click “save”. Again choose “sequence” but now from 0 to 40! Click “ok”.

Now, go to file and select “new”. A new scene appears. Click on file – import, choose SMD and import the new “anim_human_ready_thrust_onehanded”. Just click ok when you are asked for skipping.

You will notice, that 3ds max has created a 21th bone. It's near the feet. Delete it, because otherwise the animation would not work correctly.

Now select all the remaining bones and select furthermore the frames from 1-9, we don't need them. Hold down Strg and click on them.



Rightclick on one and choose “delete selected keys”.
There remain only the first(0) and the last one(10). But there is space between them.
Remember that by these steps, all bones have to be selected!
Click on the 10th frame, hold down and move it near the first one:



Now click on the “time configuration” button (lower right corner) and insert a length of 2. “Ok” and now we can export the ready animation. Click on file – export and overwrite the older “anim_human_ready_thrust_onehanded”. Choose again “sequence” from 0 – 2 -that's fine.
See? In the exporting dialog now only 20 nodes(bones) were exported.

Fine. The same we have to do with the “Release” animation.

File – New (you don't have to save the old scene) and import “anim_human_release_thrust_onehanded” as always.

Again delete the bone at the  feets. Now select all bones and delete all the keyframes, you have NOT edited before. Hard to remember now, eh? I hope you have  wrote them down before, as I told you^^



Only the red marked remain.
Then move the remaining keys near each other as we have done before in the “Ready” animation. Go to Time configuration and choose a length from 0 to 3:



Fine, now our “Release” animation is only 4 frames  long. Time to export. Overwrite the old “anim_human_release_thrust_onehanded”. “Sequence” from 0 till 3.

Congratulations, your animation is ready for use. Time to take a break xD

Ok let's move on.
Open OpenBRF.
Open skeletons.brf.
Don't split anything, but click on animation so you can see “anim_human”
Go to “import” and choose skeletal animation.
Import the two new done animations below anim_human.We must do it like this, because we cannot zip splitted animations again.
Rightclick on “anim_human_ready_thrust_onehanded” and rename it to  “ready_thrust_onehanded”.
Now, under Data – time of frame go to 1 and insert the first interval number (28500) then, for the secound frame, insert 28510. Exactly as it was in the original animation.


The same you do with  “anim_human_release_thrust_onehanded”. Rename it to “release_thrust_onehanded”.
For the first frame, insert a interval number of 28510, for the next, the number, you have written down before in 3ds max.
In my case it was 19 so it becomes 28519. And for the last frame, insert your last interval number in my case 28532 I think.
Before, at the original “Release”  animation, the last interval number was 28540, but now our animation is shorter.

Fine. Save.

Now let's move on to the module system:
Search in the module system for a file called module_animations. Rightclick – edit with Idle.

Go to the line ["ready_thrust_onehanded".... about half down the  page.
Edit it as this:

["ready_thrust_onehanded",  acf_thrust|acf_anim_length(100)|acf_rotate_body|acf_enforce_rightside,
  [ready_durn, "ready_thrust_onehanded", combat+8500, combat+8510, blend_in_ready],
],

Delete the line “acf_parallels_for_look_slope”. This is that you can aim at different heights in game. But for some reason it does not function with custom made animations. I don't know why...

Before the engine looked in anim_human for the thrust, but now, we have saved it like it's name

For the “Release” animation you do it the  same way. The lines should look like this then:

["release_thrust_onehanded", acf_thrust|acf_anim_length(100)|acf_rotate_body|acf_enforce_rightside,
  [0.61, "release_thrust_onehanded", combat+8510, combat+8532, blend_in_release],
],

I have changed the number (red) to 8532 because that's the last interval number and this is now shorter than the original one.

Perfect. Save the file and exit.

Now run the “build module” of the module system.

Go to Mount&Blade, choose your module (the same name as your created folder), run the  game and thrust some enemies the cool way xD

I hope, I could help you a bit.

Have a nice day and a look into http://forums.taleworlds.com/index.php/topic,76185.0.html

Dreamterror.
 
But somewhat needlessly complicated in the actual implementation. There's no need to plug your animation in over the old one, just import it and change the name/intervals in module_animation.
 
Thanks :smile:

But somewhat needlessly complicated in the actual implementation. There's no need to plug your animation in over the old one, just import it and change the name/intervals in module_animation.

That should be also possible, yes. But as you can't use the  old animations anyhow at the same time, it doesn't make much difference...
 
well you can actually y'know. You can have multiple animations for most actions (I'm not sure about parries)

But whatever you do it's much easier to simply add "my new animation 0 - 50" than replacing an existing animation in the BRF.
 
How do I do that?

I've tested it like this: I have just added the new animation in module_animations under unused human anim or whatever it's called and let the original one untouched.
Named it all correctly, but then in game only the original came up...
So what's the clue?
 
No, don't do that

Add it to an existing human_action that you want the animation to be used for. There are a few native actions with multiple animations I think.
 
How do you mean "add"?
Just write it under the existing action or behind it?

Btw personally, I can't think of any random animation in native, but maybe I'm also wrong^^
 
Just a few in native, some standing/walking ones.

["stand", 0,
  [3.0, "anim_human", 50, 52, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],
  [3.0, "anim_human", 60, 62, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.75],
  [3.0, "anim_human", 70, 72, arf_use_stand_progress|arf_cyclic, 0, (0, 0, 0), 0.25],

 
There is one (small?) problem with it. If you, for example, run for too long, then it will switch to the other animation. Not a big deal with stuff like running, but with things like holding shields up, etc, is a problem.
 
It depends on the action I think. Walk action will pick an animation and stick with it until you stop walking. Run animations will randomly choose another at the end of each cycle..
 
Lucke189 said:
Could anyone upload their skeletons.brf? Apparently both my original and my backup have been messed up.  :roll:
http://rapidshare.com/files/301048681/skeletons.brf

I keep a whole backup installation of mount and blade just incase something weird like this happens


On a different note, has anyone worked out how to use the acf_parallels_for_look_slope feature yet? Without it the only attack animations you can really change are the overswings and "ready" animations, otherwise you often find yourself attacking a ladder or the air above people's heads.

Auto split reveals three different animations for all the attacks that use this- one looking up (shifted 100 frames back) one looking forwards (the one you get with action.txt split) and one looking down (shifted 100 frames forward). However when I tried the obvious solution of combining all these tracks into one smd and giving them the appropriate frame numbers nothing happened, so either there's something else involved or I didn't do it right somehow....
 
Back
Top Bottom