ofp:modeling:brsseb_lesson9
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
ofp:modeling:brsseb_lesson9 [2024/03/19 06:56] – download link torrent magnet updated. snakeman | ofp:modeling:brsseb_lesson9 [2024/07/31 15:54] (current) – links added. snakeman | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== OFP Brsseb 3D Modeling Tutorial ====== | ||
+ | |||
+ | [[https:// | ||
+ | |||
+ | **Operation Flashpoint (OFP)** aka ArmA: Cold War Assault (CWA) | ||
+ | |||
+ | |||
====== Lesson 9: Custom Object Animations ====== | ====== Lesson 9: Custom Object Animations ====== | ||
Line 13: | Line 20: | ||
* Some basic OFP configfile OR C++ skills will also be helpfull | * Some basic OFP configfile OR C++ skills will also be helpfull | ||
- | Im assuming you either have done all or most of my other tutorials or are experienced in modeling and the o2 interface. Also, making object animations are mostly configfile work, so you better have some experience in basic configfiles and/or be familiar with some basic programming issues (C++). But as always, I`ll will provide you with what you need and will tell you how to do everything right. The goal of this tutorial is to serve as a reference or template for your own addons and you are free to use whatever code or tricks you learn from the tutorial. | + | Im assuming you either have done all or most of my other tutorials or are experienced in modeling and the o2 interface. Also, making object animations are mostly configfile work, so you better have some experience in basic configfiles and/or be familiar with some basic programming issues (C++). But as always, I`ll will provide you with what you need and will tell you how to do everything right. The goal of this tutorial is to serve as a reference or template for your own addons and you are free to use whatever code or tricks you learn from the tutorial. |
- | Please note that you need version 1.85 (Resistance plus patch) or higher to to this tutorial since the animation code used is not compatible with older OFP versions! I will be using Eventhandlers, | + | Please note that you need version 1.85 (Resistance plus patch) or higher to to this tutorial since the animation code used is not compatible with older OFP versions! I will be using Eventhandlers, |
Lets get started! | Lets get started! | ||
Line 26: | Line 33: | ||
//Two shots of the tutorial model we will be using.// | //Two shots of the tutorial model we will be using.// | ||
- | The goal of the tutorial is to show you the most common animation types and tricks used on addons. Although the animation abilities for static objects in OFP is very limited, with the right tricks and settings you can still do some cool stuff. I will show you some of this in this tutorial. | + | The goal of the tutorial is to show you the most common animation types and tricks used on addons. Although the animation abilities for static objects in OFP is very limited, with the right tricks and settings you can still do some cool stuff. I will show you some of this in this tutorial. |
- | Get the project folder with textures and configfile Brsseb_lesson9_start.rar from bottom of this page. Put the folder on the Z:\ drive and load up the p3d file firstanim.p3d and have a look at the model. Study it so that you understand whats going on. It should be easy stuff if you done some of my tutorials. | + | Get the project folder with textures and configfile Brsseb_lesson9_start.rar from bottom of this page. Put the folder on the Z:\ drive and load up the p3d file firstanim.p3d and have a look at the model. Study it so that you understand whats going on. It should be easy stuff if you done some of my tutorials. |
Lets look at the basic model together first. | Lets look at the basic model together first. | ||
Line 45: | Line 52: | ||
//The LandContact LOD// | //The LandContact LOD// | ||
- | The landcontact was explained in lesson 8 and all it does is creating a walkable area for the units to walk and drive on. | + | The landcontact was explained in lesson 8 and all it does is creating a walkable area for the units to walk and drive on. |
- | So, what we are gonna do is getting the garage door and the side door to open and close when the player walks up to them (you will get an option on the action menu). We are also gonna set up the switch so that it controls the main garage door. Then we are gonna make the radar on top of the garage to constantly spin around. | + | So, what we are gonna do is getting the garage door and the side door to open and close when the player walks up to them (you will get an option on the action menu). We are also gonna set up the switch so that it controls the main garage door. Then we are gonna make the radar on top of the garage to constantly spin around. |
Move on! | Move on! | ||
Line 53: | Line 60: | ||
====== Setting up " | ====== Setting up " | ||
- | First we need to set up some selections in 0.00 LOD. The OFP engine need to know what part is the garage door, what is the side door and whats the radardome, etc. We do that by assigning the various parts to selection labels, which in turn is " | + | First we need to set up some selections in 0.00 LOD. The OFP engine need to know what part is the garage door, what is the side door and whats the radardome, etc. We do that by assigning the various parts to selection labels, which in turn is " |
Lets get started right away: | Lets get started right away: | ||
Line 75: | Line 82: | ||
//Here is a review of all the labels you need in Geometry LOD// | //Here is a review of all the labels you need in Geometry LOD// | ||
- | OK then we are done with Geometry and 0.000 LOD. But we need another, all-important lod..Memory LOD | + | OK then we are done with Geometry and 0.000 LOD. But we need another, all-important lod..Memory LOD |
Next! | Next! | ||
Line 81: | Line 88: | ||
====== Memory LOD ====== | ====== Memory LOD ====== | ||
- | In Memory LOD we define the " | + | In Memory LOD we define the " |
Lets go: | Lets go: | ||
Line 115: | Line 122: | ||
{{ https:// | {{ https:// | ||
- | OK, that's 3 of 4. The last one is easy to make but can be tricky to configure. So far we have created axises that makes an object rotate around it. All the stuff we have made so far are for either doors that swing open, a switch that flips and a spinning radar structure. All those are rotating objects in one way or the other. But what if we want a structure to slide, like a side door on a Huey, car or doorway? | + | OK, that's 3 of 4. The last one is easy to make but can be tricky to configure. So far we have created axises that makes an object rotate around it. All the stuff we have made so far are for either doors that swing open, a switch that flips and a spinning radar structure. All those are rotating objects in one way or the other. But what if we want a structure to slide, like a side door on a Huey, car or doorway? |
Well, the truth is that you cant. OFP does only rotations, its a silly engine limit. But we can fake it to some degree. What if we place the axis faaaaaaaarrrr away from the actual door structure. And let it rotate only a small degree? Done right, and given that the door structure isn't too big, it might just look like the door slides linearly without rotating! See this illustration: | Well, the truth is that you cant. OFP does only rotations, its a silly engine limit. But we can fake it to some degree. What if we place the axis faaaaaaaarrrr away from the actual door structure. And let it rotate only a small degree? Done right, and given that the door structure isn't too big, it might just look like the door slides linearly without rotating! See this illustration: | ||
Line 122: | Line 129: | ||
//(But-ugly :) ) Drawing explaining how having the axis point farther away from the door " | //(But-ugly :) ) Drawing explaining how having the axis point farther away from the door " | ||
- | This is the main trick used to create sliding doors in ofp and it works quite well in most cases. Problem is that the larger the door is (say a hangar door), the more movement is needed to open the door (larger angle) and the more apparent the rotating effect will be. A trick would be to split the door into smaller doors and have them rotate separately, but it can be tricky to pull off. | + | This is the main trick used to create sliding doors in ofp and it works quite well in most cases. Problem is that the larger the door is (say a hangar door), the more movement is needed to open the door (larger angle) and the more apparent the rotating effect will be. A trick would be to split the door into smaller doors and have them rotate separately, but it can be tricky to pull off. |
- | For out sliding door, which is quite small, we wont have much problem. Figuring out a good location for the axis AND tuning the right rotation angle (more on that in the configfile in the end) is the main problem getting this trick to work. Thankfully for you I've already found a good spot for it :). | + | For out sliding door, which is quite small, we wont have much problem. Figuring out a good location for the axis AND tuning the right rotation angle (more on that in the configfile in the end) is the main problem getting this trick to work. Thankfully for you I've already found a good spot for it :). |
Lets rock: | Lets rock: | ||
Line 135: | Line 142: | ||
{{ https:// | {{ https:// | ||
- | Now if you understood the trick, you will know see we got an axis far away from the model and by letting the door move just a small degree, it will look like its sliding, and not rotating. The goal is to have the door slide along the door rail. | + | Now if you understood the trick, you will know see we got an axis far away from the model and by letting the door move just a small degree, it will look like its sliding, and not rotating. The goal is to have the door slide along the door rail. |
- | You gotta watch out for some issues when making an axis. If any of the doors seems to rotate the OPPOSITE direction then you compile the addon (don't do that yet, still some more stuff do to), then you gotta go back in o2 and //reverse// the axis, either by selecting it and hitting W or by swapping the vertice positions of an axis. I talked about this in lesson 6, and you should already know this. | + | You gotta watch out for some issues when making an axis. If any of the doors seems to rotate the OPPOSITE direction then you compile the addon (don't do that yet, still some more stuff do to), then you gotta go back in o2 and //reverse// the axis, either by selecting it and hitting W or by swapping the vertice positions of an axis. I talked about this in lesson 6, and you should already know this. |
- | Also, one thing that might cause trouble when doing your own " | + | Also, one thing that might cause trouble when doing your own " |
The last thing we gotta do is create some single vertices in various places to be used as trigger points for the action menu items (more on that in the configfile section). We need to place two vertices, one near the side door and one near the switch. Lets go: | The last thing we gotta do is create some single vertices in various places to be used as trigger points for the action menu items (more on that in the configfile section). We need to place two vertices, one near the side door and one near the switch. Lets go: | ||
Line 151: | Line 158: | ||
{{ https:// | {{ https:// | ||
- | I`ll talk more about the points later. Now we are done with the p3d, so before we move on to the configfile and compiling the addon, make sure you have done all the steps right and that you got no typos in the labels. | + | I`ll talk more about the points later. Now we are done with the p3d, so before we move on to the configfile and compiling the addon, make sure you have done all the steps right and that you got no typos in the labels. |
Next! | Next! | ||
Line 168: | Line 175: | ||
* The animation class define how each animation type will perform. | * The animation class define how each animation type will perform. | ||
- | The animationclass is the most important new stuff here. It defines like what stuff to rotate, the name of the axis to rotate around, how long the animation takes to run and the angle (or amount of movement if you will) in radians to rotate. Each animation is given a class name (like ani_sideDoor) which will later be used to run them. | + | The animationclass is the most important new stuff here. It defines like what stuff to rotate, the name of the axis to rotate around, how long the animation takes to run and the angle (or amount of movement if you will) in radians to rotate. Each animation is given a class name (like ani_sideDoor) which will later be used to run them. |
- | If you want to run an animation " | + | If you want to run an animation " |
- | If you look closely you will notice that all but the ani_radarDome looks similar to the other classes. The ani_radarDome is unique in this case since the radardome is supposed to spin around forever, not just move a certain degree (like the garage door moves from 0 to -1.5 (" | + | If you look closely you will notice that all but the ani_radarDome looks similar to the other classes. The ani_radarDome is unique in this case since the radardome is supposed to spin around forever, not just move a certain degree (like the garage door moves from 0 to -1.5 (" |
If you study it, you will notice that the radar dome animation settings seem pretty odd. And they sure are! They seem to have an very large angle1 (60000+ in radians) and the animPeriod is set to 100.000. Well, the truth is that ofp didn't support constant rotating animations (except for some hard coded ones like the ship class` radar) and with normal settings and a angle1 set at 2*3.14159 (360*), it would just rotate one cycle and then stop. But thanks to some pioneers on the forums, they found a way to break this limit and create a constant spinning animation. Basically by setting the angle1 AND animPeriod to very high, you will force the radar to rotate slowly around the axis multiple times. It wont be forever, but with such a high angle (60.000 radians is A LOT of degrees!) and the time set to 100000 it will most certainly run for hours before it stops, and most people wont ever see it finally stopping. | If you study it, you will notice that the radar dome animation settings seem pretty odd. And they sure are! They seem to have an very large angle1 (60000+ in radians) and the animPeriod is set to 100.000. Well, the truth is that ofp didn't support constant rotating animations (except for some hard coded ones like the ship class` radar) and with normal settings and a angle1 set at 2*3.14159 (360*), it would just rotate one cycle and then stop. But thanks to some pioneers on the forums, they found a way to break this limit and create a constant spinning animation. Basically by setting the angle1 AND animPeriod to very high, you will force the radar to rotate slowly around the axis multiple times. It wont be forever, but with such a high angle (60.000 radians is A LOT of degrees!) and the time set to 100000 it will most certainly run for hours before it stops, and most people wont ever see it finally stopping. | ||
Line 179: | Line 186: | ||
// | // | ||
- | The UserAction class defines how the player interacts with the animations. We basically want an action appearing on the action menu when we walk close to the side-door or the switch, allowing us to open or close the doors, or pull and push the switch. Note that no separate action is defined for either the main garage door or the radar, since the radar will be uncontrollable and the garage door will be controlled by the switch. | + | The UserAction class defines how the player interacts with the animations. We basically want an action appearing on the action menu when we walk close to the side-door or the switch, allowing us to open or close the doors, or pull and push the switch. Note that no separate action is defined for either the main garage door or the radar, since the radar will be uncontrollable and the garage door will be controlled by the switch. |
- | Lets look at the first class; it is the command for opening the side door (OpenSideDoor). Its display (which shows in the ingame menu) is "Open door2" | + | Lets look at the first class; it is the command for opening the side door (OpenSideDoor). Its display (which shows in the ingame menu) is "Open door2" |
- | Also, you see the switch`s statements fields are also controlling the main garage door animation by adding a second "this anim...." | + | Also, you see the switch`s statements fields are also controlling the main garage door animation by adding a second "this anim...." |
So that leaves us with a working side door, an animated switch that also operates the main garage door. But we need one more thing to get the radar animation to start. | So that leaves us with a working side door, an animated switch that also operates the main garage door. But we need one more thing to get the radar animation to start. | ||
Line 190: | Line 197: | ||
//The Eventhandler class is a v1.85+ feature and is quite handy sometimes// | //The Eventhandler class is a v1.85+ feature and is quite handy sometimes// | ||
- | The eventhandler is a nice addition to OFP and a small revolution on its own. Basically it checks if certain " | + | The eventhandler is a nice addition to OFP and a small revolution on its own. Basically it checks if certain " |
- | This is done with filling out the init-field with the rather strange-looking variant of the "this animate[" | + | This is done with filling out the init-field with the rather strange-looking variant of the "this animate[" |
- | OK, that was the configfile and a bit info about animations. Hope you learned some of it and maybe can use this information on your own addons soon. Lets get this structure ingame and see how it all looks like! | + | OK, that was the configfile and a bit info about animations. Hope you learned some of it and maybe can use this information on your own addons soon. Lets get this structure ingame and see how it all looks like! |
Next! | Next! | ||
Line 200: | Line 207: | ||
====== Ingame testing ====== | ====== Ingame testing ====== | ||
- | Ok, time to test it ingame. Make sure all steps are completed right and compile the file the usual way, naming it firstanim.pbo. Its under Objects-> | + | Ok, time to test it ingame. Make sure all steps are completed right and compile the file the usual way, naming it firstanim.pbo. Its under Objects-> |
Walk up to the console and try the garage and switch animation to see if they work OK. Then make sure the side door works and that the fake linear animation trick works nice. Also, the radar should be spinning strait away. If all that seems OK, then congratulations :). If one of more of the doors seem to rotate wrong (maybe the side_door sliding the other direction), then go back in the p3d and reverse the axis (or switch the +/- signs in front of the angle1 setting for the offending animation) | Walk up to the console and try the garage and switch animation to see if they work OK. Then make sure the side door works and that the fake linear animation trick works nice. Also, the radar should be spinning strait away. If all that seems OK, then congratulations :). If one of more of the doors seem to rotate wrong (maybe the side_door sliding the other direction), then go back in the p3d and reverse the axis (or switch the +/- signs in front of the angle1 setting for the offending animation) | ||
Line 213: | Line 220: | ||
//..and the door moves then you pull the switch as it should do. Nice :)// | //..and the door moves then you pull the switch as it should do. Nice :)// | ||
- | Well, hope you liked the tutorial. You can get the final working PBO Brsseb_lesson9_done.rar from below. Look at it if you got trouble. If all fails or you have further questions, don't hesitate to mail me at brsseb@hotmail.com | + | Well, hope you liked the tutorial. You can get the final working PBO Brsseb_lesson9_done.rar from below. Look at it if you got trouble. If all fails or you have further questions, don't hesitate to mail me at brsseb@hotmail.com |
- | Cheers! | + | Cheers! |
Next! | Next! |
ofp/modeling/brsseb_lesson9.1710831398.txt.gz · Last modified: 2024/03/19 06:56 by snakeman