Jackal326
Nov 6 2007, 00:46
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="";
};
};
[/QUOTE]
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).
<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="";
};
};
[/QUOTE]
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).