cdvader
Introduction.
Greetings, it's CdVader again, with another tutorial. This time, I'll show you how to either Add a new animation or edit old ones. The reason I'm making this tutorial is because of a Post I saw, and that made me think "Hey, why not make a tutorial!" . So, Berserker Pride asked this.
[quote author= Berserker Pride]I wonder if you could duplicate an animation so that you wouldn't have to overwrite an existing throwing type. [/quote]
And hopefully, I will show you how to do that.
Anyway. Thanks to 'mtarini' we can now edit, add, and do all kinds of things with Animations. Let's begin.
What do we need?
The game.
Mount & Blade - Version 1.011.
Mount & Blade - Module System for Version 1.011.
Some kind of a animation editing program. Here's two of the (probably) most known:
Autodesk 3ds Max
Blender
And the import/export SMD scripts for them.
3ds Max SMD Import/Export
Blender SMD Import
Working Blender Export Script.
And the most important thing of all.
Open BRF
PART 1 - Getting ready.
Okay. First of all, make sure you've got a working copy of Mount & Blade v1.011 and the ModuleSystem all set-up. Before you begin this tutorial, You must have SOME knowledge of the Module System. I highly recommend The Official ModuleSystem Documentation or another, a extremely good (a bit advanced) ModuleSystem Documentation made by Jik. After you have set up the ModuleSystem and gone through the Documentations, we can continue.
Now, install 'mtarinis' Open BRF. Just download & extract it to somewhere, like onto your desktop. OpenBRF is a very good alternative to BRFEdit, because it can edit Animations and Skeletons, which BRFEdit cannot. However, since OpenBRF is still in it's very early development stages (Alpha stage), it doesn't have all the necessary features like Material, Collision or Shader tabs. Thus, currently you should only use OpenBRF for Skeleton and Animation related stuff, and BRFEdit for all the other. But I'm quite sure that soon enough, OpenBRF will be better and more complete.
The next step is to get a Animation and Skeleton editing program. Blender is a bit complicated, but good. And it's also free, which is a really good thing. The other solution - 3ds Max is better in all ways, especially the price part. That's the only downside of Max - It costs around 3500$. I personally use 3ds Max. To get it, either download the 30-day Tutorial or, if you're lucky, you may get a Commercial edition (Or something like that) from school.
Okay, I belive we're ready.
Part 2 - Adding a "new" animation.
If anyone has seen the movie "Braveheart", in the last battle William's good friend inspired his fellow lads to battle by throwing William's giant sword over the field. If you haven't seen the movie, you can see the scene here. William Wallace's sword flight. It's really epic and it can also hurt your enemy real bad (Should the throw hit the enemy). So we'll try to create something like that, expect a bit more simpler, less epic, so you could throw many swords in a row.
Alright. Open 'OpenBRF', go to File > Open and open uni_throws. Whoa, a lot of Opens in that sentence. Ok, click on 'throw_javelin' and Duplicate it (press Right-Click). Rename it (Right-Click again) to 'throw_braveheart'. Go to File > Save and exit OpenBRF. Basically, that's how you duplicate Animations, so you won't run into the problem Berserker Pride had. If you don't duplicate and rename a animation, and then make a new animation line in module_animations.py, it will overwrite the type.
However, if you want to actually add in completely new, from-scratch animations, then either open 'skeletons.brf' using OpenBRF and export the skeleton there as 'Nude' or go to Tools > Edit Reference Data, click on the Skeleton tab and click on "human" and Export it as 'Nude'. Get the new, exported Nude skeleton to Blender or 3ds Max using a SMD Importer. When exporting from Max, make sure you tick it to a "Sequence" instead of "Referene". I am not sure about how it works in Blender. Currently, the OpenBRF's exporter is a bit unfinished (OpenBRF is still in Alpha stage), so all of the bones seem to be out of place, but you can actually create new animations, the only down-side is that it is harder to understand the skeleton than normal. However, do not fret, OpenBRF's Importer seems to re-fix the screwed up bone system. Importing it is really easy too, just open an existing .brf file (Can't make new ones currently) and go to Import > Skeletal Animation. That's it.
Okay, so in short, look at the old, existing animations to see how much Frames you approximately you need, export a Nude skeleton without any animations, make your animation, Import as Skeletal Animation and watch your new animation!
If you want to see a example, download this file. Don't worry, it's an .AVI so it cannot be a virus. It's a basic animation showed in OpenBRF I did just to test.
Okay, 'new' animation set-up, we can now move on. Go where your ModuleSystem is located, and open "module_animations.py", "header_items.py" and, not so necessary but for the sake of keeping it simple, "module_items.py". First, we will edit module_animations.py. Copy "ready_javelin" and "release_javelin" approximately at line 509. Paste them (replacing the old "unused_human_anims") at line 1123. Make sure you replace the old animations. Now, rename the stuff to _braveheart. Should look like this.
Basically, these small script parts "define" the animation. If you look at the first script, 4 major things catch your eye. "ready_braveheart" is the first, that is the animation ID, used for referencing the animation. The next thing is "acf_rotate_body", which is pretty easy to guess. It rotates the body. The next thing is "throw_braveheart". That is the name of the animation resource/sequence, and the last one, "blend_in_ready", is basically a line that makes the animation blend in with other animations. The "0, 30" part is the frame count. Now you know all that is necessary, and we can move on.
Go to header_items.py. Find "itcf_throw_javelin" and copy the whole thing to the bottom of the itcf_ list, right before the itc_cleaver. Rename it to itcf_throw_braveheart". If you did it right, it should look like this.
And now we make a new itc_ . Basically, from my understanding, an itc_ (item capabilities) is a list of various animations packed together. If you put itc_scimitar to your item, you will not be able to stab/thrust, because the itc_ doesn't have itcf_thrust_onehanded. itcf_, again from my understanding, is necessary to link into itc_ tag. So, now you have two choices. You either make a new itc_ OR simply put itcf_ to your item. However, I prefer to use itc_ in any case, because then it looks cleaner and you can, if needed, add other animations to the itc_ later. So let's make a new itc_ called itc_braveheart below itc_greatlance. If you did it right, it should look like this.
I'm not 100% sure why the itcf_force_64_bits is for, but most of the itc_ seem to have it, and it works with it perfectly, so it's better we keep it in. Okay. We can now save and move on to module_items.py. In module_items.py, simply copy 'practice_javelin' or other javelin kind of weapon, and paste it at the very end, right before the last ']'. If you did it right, it should look something like this.
As you can see, we have added itc_braveheart to the item. I also kept the old itcf_carry_quiver_back, just to show that you can have both itc_ and itcf_ on the item. You can and should add the two itcf_ to itc_braveheart. Then it looks much cleaner. Okay. You've got ALL basically ready, I hope I haven't forgot anything or something like that. Now start making decapitation animations! And don't forget to post some feedback...
Enjoy,
cdvader.
Critical Update (15/08/09) - You *can not* make a completely new .brf file from scratch and put your custom animation in it, else you will get a RGL error. However, you *can* add your new custom animation to an existing .brf file in CommonRes/ which has the prefix ani_ and you will not get a RGL error.
I have yet to test if adding ani_ or uni_ to your custom mod .brf files work.
Credits.
A big thanks to mtarini for Open-BRF.
And, of course, a big thanks to Armagan for Mount & Blade.
Greetings, it's CdVader again, with another tutorial. This time, I'll show you how to either Add a new animation or edit old ones. The reason I'm making this tutorial is because of a Post I saw, and that made me think "Hey, why not make a tutorial!" . So, Berserker Pride asked this.
[quote author= Berserker Pride]I wonder if you could duplicate an animation so that you wouldn't have to overwrite an existing throwing type. [/quote]
And hopefully, I will show you how to do that.
Anyway. Thanks to 'mtarini' we can now edit, add, and do all kinds of things with Animations. Let's begin.
What do we need?
The game.
Mount & Blade - Version 1.011.
Mount & Blade - Module System for Version 1.011.
Some kind of a animation editing program. Here's two of the (probably) most known:
Autodesk 3ds Max
Blender
And the import/export SMD scripts for them.
3ds Max SMD Import/Export
Blender SMD Import
Working Blender Export Script.
And the most important thing of all.
Open BRF
PART 1 - Getting ready.
Okay. First of all, make sure you've got a working copy of Mount & Blade v1.011 and the ModuleSystem all set-up. Before you begin this tutorial, You must have SOME knowledge of the Module System. I highly recommend The Official ModuleSystem Documentation or another, a extremely good (a bit advanced) ModuleSystem Documentation made by Jik. After you have set up the ModuleSystem and gone through the Documentations, we can continue.
Now, install 'mtarinis' Open BRF. Just download & extract it to somewhere, like onto your desktop. OpenBRF is a very good alternative to BRFEdit, because it can edit Animations and Skeletons, which BRFEdit cannot. However, since OpenBRF is still in it's very early development stages (Alpha stage), it doesn't have all the necessary features like Material, Collision or Shader tabs. Thus, currently you should only use OpenBRF for Skeleton and Animation related stuff, and BRFEdit for all the other. But I'm quite sure that soon enough, OpenBRF will be better and more complete.
The next step is to get a Animation and Skeleton editing program. Blender is a bit complicated, but good. And it's also free, which is a really good thing. The other solution - 3ds Max is better in all ways, especially the price part. That's the only downside of Max - It costs around 3500$. I personally use 3ds Max. To get it, either download the 30-day Tutorial or, if you're lucky, you may get a Commercial edition (Or something like that) from school.
Okay, I belive we're ready.
Part 2 - Adding a "new" animation.
If anyone has seen the movie "Braveheart", in the last battle William's good friend inspired his fellow lads to battle by throwing William's giant sword over the field. If you haven't seen the movie, you can see the scene here. William Wallace's sword flight. It's really epic and it can also hurt your enemy real bad (Should the throw hit the enemy). So we'll try to create something like that, expect a bit more simpler, less epic, so you could throw many swords in a row.
Alright. Open 'OpenBRF', go to File > Open and open uni_throws. Whoa, a lot of Opens in that sentence. Ok, click on 'throw_javelin' and Duplicate it (press Right-Click). Rename it (Right-Click again) to 'throw_braveheart'. Go to File > Save and exit OpenBRF. Basically, that's how you duplicate Animations, so you won't run into the problem Berserker Pride had. If you don't duplicate and rename a animation, and then make a new animation line in module_animations.py, it will overwrite the type.
However, if you want to actually add in completely new, from-scratch animations, then either open 'skeletons.brf' using OpenBRF and export the skeleton there as 'Nude' or go to Tools > Edit Reference Data, click on the Skeleton tab and click on "human" and Export it as 'Nude'. Get the new, exported Nude skeleton to Blender or 3ds Max using a SMD Importer. When exporting from Max, make sure you tick it to a "Sequence" instead of "Referene". I am not sure about how it works in Blender. Currently, the OpenBRF's exporter is a bit unfinished (OpenBRF is still in Alpha stage), so all of the bones seem to be out of place, but you can actually create new animations, the only down-side is that it is harder to understand the skeleton than normal. However, do not fret, OpenBRF's Importer seems to re-fix the screwed up bone system. Importing it is really easy too, just open an existing .brf file (Can't make new ones currently) and go to Import > Skeletal Animation. That's it.
Okay, so in short, look at the old, existing animations to see how much Frames you approximately you need, export a Nude skeleton without any animations, make your animation, Import as Skeletal Animation and watch your new animation!
If you want to see a example, download this file. Don't worry, it's an .AVI so it cannot be a virus. It's a basic animation showed in OpenBRF I did just to test.
Okay, 'new' animation set-up, we can now move on. Go where your ModuleSystem is located, and open "module_animations.py", "header_items.py" and, not so necessary but for the sake of keeping it simple, "module_items.py". First, we will edit module_animations.py. Copy "ready_javelin" and "release_javelin" approximately at line 509. Paste them (replacing the old "unused_human_anims") at line 1123. Make sure you replace the old animations. Now, rename the stuff to _braveheart. Should look like this.
Code:
["ready_braveheart", acf_rotate_body,
[0.3, "throw_braveheart", 0, 30, blend_in_ready],
],
["release_braveheart", acf_rotate_body,
[1.0, "throw_braveheart", 55, 100, arf_blend_in_0],
],
Basically, these small script parts "define" the animation. If you look at the first script, 4 major things catch your eye. "ready_braveheart" is the first, that is the animation ID, used for referencing the animation. The next thing is "acf_rotate_body", which is pretty easy to guess. It rotates the body. The next thing is "throw_braveheart". That is the name of the animation resource/sequence, and the last one, "blend_in_ready", is basically a line that makes the animation blend in with other animations. The "0, 30" part is the frame count. Now you know all that is necessary, and we can move on.
Go to header_items.py. Find "itcf_throw_javelin" and copy the whole thing to the bottom of the itcf_ list, right before the itc_cleaver. Rename it to itcf_throw_braveheart". If you did it right, it should look like this.
Code:
itcf_force_64_bits = 0x8000000000000000
itcf_throw_braveheart = 0x0000000000040000
itc_cleaver
And now we make a new itc_ . Basically, from my understanding, an itc_ (item capabilities) is a list of various animations packed together. If you put itc_scimitar to your item, you will not be able to stab/thrust, because the itc_ doesn't have itcf_thrust_onehanded. itcf_, again from my understanding, is necessary to link into itc_ tag. So, now you have two choices. You either make a new itc_ OR simply put itcf_ to your item. However, I prefer to use itc_ in any case, because then it looks cleaner and you can, if needed, add other animations to the itc_ later. So let's make a new itc_ called itc_braveheart below itc_greatlance. If you did it right, it should look like this.
Code:
itc_greatlance = itcf_thrust_onehanded_lance |itcf_thrust_onehanded_lance_horseback| itcf_thrust_polearm
itc_braveheart = itcf_force_64_bits | itcf_throw_braveheart
ixmesh_inventory = 0x1000000000000000
I'm not 100% sure why the itcf_force_64_bits is for, but most of the itc_ seem to have it, and it works with it perfectly, so it's better we keep it in. Okay. We can now save and move on to module_items.py. In module_items.py, simply copy 'practice_javelin' or other javelin kind of weapon, and paste it at the very end, right before the last ']'. If you did it right, it should look something like this.
Code:
["rabati", "Rabati", [("rabati",0)], itp_type_head_armor ,0, 278 , weight(2)|abundance(100)|head_armor(20)|body_armor(0)|leg_armor(0) ,imodbits_cloth ],
["braveheart_sword", "Braveheart Sword", [("b_bastard_sword",0),("b_bastard_sword", ixmesh_carry)], itp_type_thrown |itp_primary|itp_bonus_against_shield ,itc_braveheart|itcf_carry_quiver_back|itcf_show_holster_when_drawn, 0, weight(5) | spd_rtng(91) | shoot_speed(28) | thrust_damage(27, blunt) | max_ammo(50) | weapon_length(75), imodbits_thrown],
]
As you can see, we have added itc_braveheart to the item. I also kept the old itcf_carry_quiver_back, just to show that you can have both itc_ and itcf_ on the item. You can and should add the two itcf_ to itc_braveheart. Then it looks much cleaner. Okay. You've got ALL basically ready, I hope I haven't forgot anything or something like that. Now start making decapitation animations! And don't forget to post some feedback...
Enjoy,
cdvader.
Critical Update (15/08/09) - You *can not* make a completely new .brf file from scratch and put your custom animation in it, else you will get a RGL error. However, you *can* add your new custom animation to an existing .brf file in CommonRes/ which has the prefix ani_ and you will not get a RGL error.
I have yet to test if adding ani_ or uni_ to your custom mod .brf files work.
Credits.
A big thanks to mtarini for Open-BRF.
And, of course, a big thanks to Armagan for Mount & Blade.