Jackal326 1158 Posted November 6, 2007 Does anyone know of a way to delay weapon animations? Basically, I am trying to animate a bolt on a rifle, and I don't want the bolt to rotate and retract at the same time, I want a short delay while the bolt rotates, and then I want the bolt to be drawn back ~half a second later. I currently have the follwing as the model.cfg <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgSkeletons { class SJB_SniperRifle { isDiscrete=0; skeletonInherit=""; skeletonBones[]= { "bolt", "", "bolt_retract", "", "bolt_rotate", "", "magazine", "", "trigger", "" }; }; }; class CfgModels { class Default; class Weapon; //was class Weapon: Default {}; class SJB_AWP_proxy: Weapon { skeletonName="SJB_SniperRifle"; class Animations { class reload_magazine { type="rotationZ"; // The type of animation. source="reloadMagazine";// The controller that provides input. selection="magazine"; // The name of the skeleton bone used. axis="magazine_axis"; // The name of the axis in the model. minPhase=1.2; // Minimum phase of the animation.i.e. Animation phase when the controller value is 0. maxPhase=1.8; // Maxmimum value of the motion range.i.e. Animation phase when the controller value is 1. minValue="0"; // The minimum value of the motion range. i.e. The controller input when animation phase is 0. maxValue="1"; // The maximum value of the motion range. i.e. The controller input when animation phase is 1. angle0="0"; // The starting angle of this animation, where the animation phase is 0. angle1="rad -90"; // The ending angle of this animation, where the animation phase is 1. }; //ROTATING THE BOLT class bolt_rotate { type="rotationX"; //The type of animation. source="reload"; //The controller that provides input. selection="bolt_rotate"; //The name of the skeleton bone used. axis="bolt_axis"; //The name of the axis in the model. minValue=0; //The minimum value of the motion range. i.e. The controller input when animation phase is 0. maxValue="0.75"; //The maximum value of the motion range. i.e. The controller input when animation phase is 1. angle0="0"; //The starting angle of this animation, where the animation phase is 0. angle1="rad 100"; //The ending angle of this animation, where the animation phase is 1. }; //RETRACTING THE BOLT class bolt_retraction { type="translation"; // The type of animation. source="reload"; // The controller that provides input. selection="bolt_retract"; // The name of the skeleton bone used. begin="bolt_retraction_begin"; end="bolt_retraction_end"; minValue=0; //The minimum value of the motion range. i.e. The controller input when animation phase is 0. maxValue="1.2"; //The maximum value of the motion range. i.e. The controller input when animation phase is 1. offset0="0"; offset1="1.5"; }; }; sections[]={"zasleh"}; sectionsInherit=""; }; }; The bolt retracts as required, but it doesn't seem to rotate at all. The selections are defined, and I have the axis setup, I think its my botched coding at fault. Any suggestions? EDIT: Also, another strange thing, I've just managed to get the bolt to rotate (model.cfg above has been changed to reflect it), but it also seems to shrink when it rotates (not in length or in depth - imagine a cylinder getting thinner, but maintaining legth). Share this post Link to post Share on other sites
RN Malboeuf 12 Posted November 6, 2007 Quote[/b] ]I am trying to animate a bolt on a rifle no use without man anim minValue/maxValue is what you are looking for. and check pm Share this post Link to post Share on other sites
Panda-PL- 0 Posted November 6, 2007 Look it up in Skaven's racs weapons, he has a working AWP: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Ska_AWP: SIX_SkaWeapon { skeletonName="Ska_AWP"; class Animations { class reload_magazine { type="hide"; source="reloadMagazine"; selection="magazine"; hidevalue=0.2; }; class reload_magazine_release { type="rotationZ"; source="reloadMagazine"; selection="magazine"; axis="magazine_axis"; minValue=0.1; maxValue="1"; angle0="0"; angle1="rad -20"; }; class magazine_Magrelease { type="rotationZ"; source="reloadMagazine"; selection="magrelease"; axis="magrelease_axis"; minValue=0.38; maxValue=0.4; angle0="0"; angle1="rad 20"; }; class firingpin { type="translation"; source="reload"; selection="pin"; begin="bolt_axis_end"; end="bolt_axis_begin"; minValue=0; maxValue=".02"; offset0="0"; offset1=".05"; }; class firingpin_empty: firingpin { source="isempty"; }; class bolt_moveback { type="translation"; source="reload"; selection="nonrotating_bolt"; begin="bolt_axis_begin"; end="bolt_axis_end"; minValue=.03; maxValue=".3"; offset0="0"; offset1="1"; }; class bolt_movefront { type="translation"; source="reload"; selection="nonrotating_bolt"; begin="bolt_axis_end"; end="bolt_axis_begin"; minValue=.7; maxValue=".80"; offset0="0"; offset1="1"; }; class bullet_hide { type="hide"; source="isempty"; selection="bullet"; hidevalue=.5; }; class bolt_open { type="rotationX"; source="reload"; selection="rotating_bolt"; axis="bolt_axis"; minValue=0; maxValue=".1"; angle0="0"; angle1="rad 90"; }; class bolt_close { type="rotationX"; source="reload"; selection="rotating_bolt"; axis="bolt_axis"; minValue=.9; maxValue="1"; angle0="0"; angle1="rad -90"; }; class trigger { type="rotationZ"; source="reload"; selection="trigger"; axis="trigger_axis"; minValue=0; maxValue="0.05"; angle0="0"; angle1="rad -35"; }; }; sections[]={"zasleh"}; sectionsInherit=""; }; Study minvalue and maxvalue, they determine when the anim starts and ends. If you're using SLX demo weapons - they got the meaning wrong in some places. Shrinking might be because you've only assigned one end of cylinder to the selection, in which case it would shrink in the middle while the other one rotates. It can be also the fault of skeleton. When I did mine it was much more complex because of how AWP is built. In your case everything is attached right at the root of the model. If two parts are supposed to first move together and then one independently (like in case of rotating and nonrotating part of the bolt) it is good to make one bone and link it to another so they allways move together when you move the later one but you can still move the fiorst one in relation to the other when needed ("opening" the bolt on AWP). Here's the skeleton: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class Ska_AWP { isDiscrete=0; skeletonInherit=""; skeletonBones[]= { "magazine", "", "bullet", "magazine", "magrelease", "", "nonrotating_bolt", "", "rotating_bolt","nonrotating_bolt", "pin","nonrotating_bolt", "trigger", "" }; };You can study them or just use them as they are, the result is posted somewhere in Ska racs thread as a video. Share this post Link to post Share on other sites
Jackal326 1158 Posted November 6, 2007 Quote[/b] ]I am trying to animate a bolt on a rifle no use without man anim minValue/maxValue is what you are looking for. and check pm I know its no use without the animation, but my theory is if I get this down now, someone in the future can do a bolt animation for the reload at a later stage. Though as it seems the major players in the OFP animation front are no-longer in the ArmA community, that will be a long-time off yet. Oh and the PM was useless because the link didn't work @Panda[PL]: Thanks for that information. I'm currently looking for Skaevn's up to date pack (the pack I have doesn't have an AWP in it) so I can setup the memory points and the selections correctly. Thanks for the help. Share this post Link to post Share on other sites
RN Malboeuf 12 Posted November 6, 2007 Quote[/b] ]I know its no use without the animation, but my theory is if I get this down now, someone in the future can do a bolt animation for the reload at a later stage. Though as it seems the major players in the OFP animation front are no-longer in the ArmA community, that will be a long-time off yet. Oh and the PM was useless because the link didn't work link is ok anyway that was bolt anim for weapon movie. It's easy to make. But it's just useless without man anim. and i got no hope there will be one Share this post Link to post Share on other sites