da12thMonkey 1943 Posted January 2, 2017 20 minutes ago, UK_Apollo said: You can put multiple animate statements in your UserAction eg. CONFIG.CPP class AnimationSources : AnimationSources { class Wing_Left_Fold { source = "user"; animPeriod = 1; initPhase = 0; }; class Wing_Right_Fold : Wing_Left_Fold {}; }; class UserActions : UserActions { class Wings_Fold { displayName = "Fold Wings"; textToolTip = ""; shortcut = ""; priority = 2.0; position = ""; radius = 2; showWindow = 0; onlyForPlayer = 1; condition = "(this animationPhase 'Wing_Left_Fold' < 0.5) AND (alive this)"; statement = "this animate ['Wing_Left_Fold', 1]; this animate ['Wing_Right_Fold', 1];"; }; class Wings_UnFold : Wings_Fold { displayName = "UnFold Wings"; condition = "(this animationPhase 'Wing_Left_Fold' > 0.5) AND (alive this)"; statement = "this animate ['Wing_Left_Fold', 0]; this animate ['Wing_Right_Fold', 0];"; }; }; Probably easier to just use one source for the animation of both wings rather than giving each one its own source, and use the https://community.bistudio.com/wiki/animateSource command to trigger all animation classes in the model.cfg that use that source 1 Share this post Link to post Share on other sites
scotg 204 Posted January 3, 2017 3 hours ago, da12thMonkey said: Probably easier to just use one source for the animation of both wings rather than giving each one its own source, and use the https://community.bistudio.com/wiki/animateSource command to trigger all animation classes in the model.cfg that use that source Ok. I hadn't gotten that far just yet. I was operating only within buldozer at this point - with the files firebat1.p3d and model.cfg (and all textures and rvmats). In other words, I didn't get to the config.cpp file, yet. That being said, here's how that particular section looks in my model.cfg: class Leftwing: Rotation { type = "rotation"; source="user"; selection="wingL"; axis="wingL_axis"; minValue=0; maxValue=4; angle0=0; angle1=1.571;// i.e.: 90 deg animPeriod = 0.0; initPhase = 0.0; // memory = true;//(default assumed) }; class Rightwing: Rotation { type = "rotation"; source="user"; selection="wingR"; axis="wingR_axis"; minValue=0; maxValue=4; angle0=0; angle1=-1.571;// i.e.: 90 deg animPeriod = 0.0; initPhase = 0.0; // memory = true;//(default assumed) }; As you can see, the source is "user" for both, but in buldozer they appear as "user16" and "user17" and don't animate simultaneously. Can I put "user16" or some other specific number in both sources? EDIT: Yes. I can specify "user16" in the source, and both wings fold together. Derrrrr. It was a simple test that worked. Now I'm off to see why it was "user16 and -17" instead of 1-15 or 18+. Share this post Link to post Share on other sites
da12thMonkey 1943 Posted January 3, 2017 The way to do it is not to use the user source in the model.cfg. You create your own animationSource like apollo showed (with source = "user"; in the config.cpp) and put that custom animation source in the model.cfg as the source for both animations. AFAIK, then when you write the class userAction (also like Apollo also showed) you can bind each action to one of the key input actions https://community.bistudio.com/wiki/inputAction/actions with the shortcut = parameter, such as shortcut = User8; If not, I guess it's a matter of scripting the action to a keybind. 1 Share this post Link to post Share on other sites
scotg 204 Posted January 3, 2017 Ok, but then that means that pre-testing the animation in Buldozer will either have to be done separately for each wing, or that I'll have to use the same specific "user#" until ready to test in-game. I guess what I've learned is, as far as buldozer is concerned, there needs to be a specific number or extra variable assigned to the source term "user" in the model.cfg animations, or else it will auto-assign a number for you for each part. Share this post Link to post Share on other sites
da12thMonkey 1943 Posted January 3, 2017 You can put your custom animation source name in the model.cfg and test in buldozer without writing the config first. You don't have to put user in the model.cfg at all and deal with the ensuing weirdness. Buldozer will use whatever source names exists in the model.cfg because the control values all come direct from the user's [ ] key inputs or scrolling the mouse wheel. Not from any scripting or simulation. It's only ingame where it actually matters whether the named source is defined in the game or not 1 Share this post Link to post Share on other sites
scotg 204 Posted January 4, 2017 (edited) On 1/3/2017 at 9:35 AM, da12thMonkey said: You can put your custom animation source name in the model.cfg and test in buldozer without writing the config first. You don't have to put user in the model.cfg at all and deal with the ensuing weirdness. Buldozer will use whatever source names exists in the model.cfg because the control values all come direct from the user's [ ] key inputs or scrolling the mouse wheel. Not from any scripting or simulation. It's only ingame where it actually matters whether the named source is defined in the game or not Ah. Ok, I'm slowly grasping this. So just to clarify, are you saying as long as I define the source in config.cpp -> AnimationSources, for all pertaining objects, the same as whatever I named it in the model.cfg, then I am not confined to the term "user?" So e.g.: model.cfg: class Leftwing: Rotation { type = "rotation"; source="UK_Apollo_Rocks"; selection="wingL"; axis="wingL_axis"; minValue=0; maxValue=4; angle0=0; angle1=1.571;// i.e.: 90 deg animPeriod = 0.0; initPhase = 0.0; // memory = true;//(default assumed) }; class Rightwing: Rotation { type = "rotation"; source="UK_Apollo_Rocks"; selection="wingR"; axis="wingR_axis"; minValue=0; maxValue=4; angle0=0; angle1=-1.571;// i.e.: 90 deg animPeriod = 0.0; initPhase = 0.0; // memory = true;//(default assumed) }; ...paired with config.cpp: class AnimationSources : AnimationSources { class UK_Apollo_Rocks { source = "user"; animPeriod = 1; initPhase = 0; }; }; class UserActions { class da12thMonkey_RocksToo { displayName = "Tuck Wings"; textToolTip = ""; shortcut = ""; priority = 2.0; position = ""; radius = 2; showWindow = 0; onlyForPlayer = 1; condition = "(this animationPhase 'UK_Apollo_Rocks' < 0.5) AND (alive this)"; statement = "this animate ['UK_Apollo_Rocks', 1]"; }; class Wings_UnFold : da12thMonkey_RocksToo { displayName = "Extend Wings"; condition = "(this animationPhase 'UK_Apollo_Rocks' > 0.5) AND (alive this)"; statement = "this animate ['UK_Apollo_Rocks', 0]"; }; }; That right? Edit: Ermm, I've included the class useractions:useractions within my plane's main class (where all its pertinents are assigned values), but I get an error report that says it's an undefined base class. I guess I assumed it was defined at a lower level, but what should I do now to get it working? Edit 2: Fixed: I missed the "userActions" after the colon, which was apparently not necessary, so I fixed it in my code. I've also edited the code above to more represent how I've structured these sections of the actual code for my plane, but added props to da12thMonkey and UK_Apollo. :-) Edited January 5, 2017 by scotg to avoid spamming his own thread. Share this post Link to post Share on other sites