arma2:modeling:user_animation
Differences
This shows you the differences between two versions of the page.
arma2:modeling:user_animation [2011/06/30 18:10] – created user_animation initial page. snakeman | — | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== User Animation Tutorial ====== | ||
- | Primary target - Vehicles | ||
- | |||
- | This tutorial is to show the basics of how to animate a section of a vehicle model with a USER action. Specific subject pictures are a aeroplane ramp, but any vehicle can have similar. | ||
- | |||
- | |||
- | ====== Model ====== | ||
- | |||
- | First thing that needs to be done is create the section to be animated (an access ramp in this case). | ||
- | |||
- | This section needs its own name in O2. " | ||
- | |||
- | This section needs to be created and named in every Resolution LOD as well as the Geometry LOD. | ||
- | |||
- | If someone is going to walk on this section, then it should also be created and named in the Roadway as well. | ||
- | |||
- | In the Memory LOD you need to create 2 points/ | ||
- | |||
- | These 2 points need also to be named. " | ||
- | |||
- | For the USER/Player to access the Action menu of the vehicle, we definite points or locations where the required action will appear in the player menu. | ||
- | |||
- | These User Action point(s) we name for our example " | ||
- | |||
- | |||
- | ====== Model.cfg ====== | ||
- | |||
- | In the CFG Skeleton section of the model.cfg file you should add something like this; | ||
- | <code cpp> | ||
- | class CfgSkeletons | ||
- | { | ||
- | class Plane; | ||
- | class myPlaneBones: | ||
- | { | ||
- | isDiscrete=1; | ||
- | skeletonInherit = ""; | ||
- | skeletonBones[]= | ||
- | { | ||
- | " | ||
- | xxxxxx, xxxxx, | ||
- | etc etc | ||
- | </ | ||
- | |||
- | Its important to have the ,"" | ||
- | In the CFG Model section of the model.cfg you should add something like this; | ||
- | <code cpp> | ||
- | class CfgModels | ||
- | { | ||
- | class Plane; | ||
- | class NameofmyP3Dfile: | ||
- | { | ||
- | sectionsInherit = ""; | ||
- | skeletonName = " | ||
- | sections[] = {}; | ||
- | class Animations | ||
- | { | ||
- | class AnimateRAMP1 | ||
- | { | ||
- | type=" | ||
- | source=" | ||
- | sourceAddress = " | ||
- | selection=" | ||
- | axis=" | ||
- | memory=1; | ||
- | angle0=" | ||
- | angle1=" | ||
- | minValue=0.000; | ||
- | maxValue=1.000; | ||
- | }; | ||
- | etc etc | ||
- | </ | ||
- | |||
- | TIP: If you have saved the model.cfg in your addon project file, when you reopen your model in O2, in Buldozer you can use the middle mouse button and wheel to select/ | ||
- | |||
- | If the animation / ramp animations in the wrong direction, just change "rad 22" (which is 22 degrees) to "rad -22" | ||
- | |||
- | " | ||
- | |||
- | |||
- | ====== Config.cpp ====== | ||
- | |||
- | Inside you CFGVehicle definition you need to have something like; | ||
- | <code cpp> | ||
- | class AnimationSources: | ||
- | { | ||
- | class | ||
- | { | ||
- | source = " | ||
- | animPeriod = 20; | ||
- | initPhase=0; | ||
- | }; | ||
- | }; | ||
- | </ | ||
- | |||
- | The " | ||
- | |||
- | source: The controller is defined as a user animation. Always " | ||
- | |||
- | animPeriod: The animation period used for this controller. In seconds. | ||
- | |||
- | initPhase: Initial phase / status when object is created. 0 = CLOSED or O2 default modeled state. | ||
- | |||
- | To create the pop-up menu near the vehicle that allows players to open or close the ramp, add code like this inside the CFGVehicle definition; | ||
- | <code cpp> | ||
- | class UserActions | ||
- | { | ||
- | class OpenRamp | ||
- | { | ||
- | displayName=" | ||
- | position=" | ||
- | onlyforplayer=0; | ||
- | radius=8; | ||
- | condition=" | ||
- | statement=" | ||
- | }; | ||
- | class CloseRamp | ||
- | { | ||
- | displayName=" | ||
- | position=" | ||
- | onlyforplayer=0; | ||
- | radius=8; | ||
- | condition=" | ||
- | statement=" | ||
- | }; | ||
- | }; | ||
- | </ | ||
- | |||
- | ACTION_RAMP1 is the point(s) we named in the Memory LOD | ||
- | |||
- | AnimateRAMP1 is the same name we used in the CfgModel section of the model.cfg | ||
- | |||
- | "Open Ramp" and "Close Ramp" are exactly the menu actions the player will see. | ||
- | |||
- | RADIUS is the radius in meters around the ACTION_RAMP1 points that players will see the action in menu. |
arma2/modeling/user_animation.txt · Last modified: 2024/08/01 22:06 by snakeman