I have been modeling our custom pilot addon for our mod. To make the addon interesting I tried to add a custom Visor and Holstering animation. Once I started the config process and tried to add the custom animations and placing the bones in the Cfgskeleton and adding the class UserActions, all sorts of problems occured in the game. Anybody that has tried to add a custom animation to a soldier model will know what I am talking about.
The major problem was that the model was streched out of preportion and the second problem is that the animations did not work in game at all. Due to the amount of work I put into this model I tried a work around using the class EventHandlers via the init= field
class EventHandlers
{
init = "[_this select 0] exec ""\bwc_pilots\data\scr\pilot_init.sqs""";
};
I then created some scripts using the SetObjectTexture for the "visor" and AddWeapon/RemoveWeapon for the "bwc_star" pistol.
Here are the samples of the scripts
PILOT_INIT.SQS
_player = _this select 0
_player setObjectTexture [0, ""];
holster = player addAction ["Holster","\bwc_pilots\data\scr\holster.sqs"];
_player removeaction holster;
_player setObjectTexture [1, "\bwc_pilots\data\visor_ca.paa"];
raisevisor = player addAction ["RaiseVisor","\bwc_pilots\data\scr\raisevisor.sqs"];
_player removeaction raisevisor;
exit
RAISEVISOR.SQS
_player = _this select 0
?(not alive _player): goto "Exit"
_player setObjectTexture [1, ""];
lowervisor = player addAction ["LowerVisor","\bwc_pilots\data\scr\lowervisor.sqs"];
_player removeaction raisevisor;
#Exit
exit
LOWERVISOR.SQS
_player = _this select 0
?(not alive _player): goto "Exit"
_player setObjectTexture [1, "\bwc_pilots\data\visor_ca.paa"];
raisevisor = player addAction ["RaiseVisor","\bwc_pilots\data\scr\raisevisor.sqs"];
_player removeaction lowervisor;
#Exit
exit
And the 2 weapon scripts
HOLSTER.SQS
_player = _this select 0
_gun = "bwc_star";
?(not alive _player): goto "Exit"
_player removeWeapon _gun;
_player setObjectTexture [0, "\bwc_pilots\data\star\star_co.paa"];
unholster = player addAction ["Unholster","\bwc_pilots\data\scr\unholster.sqs"];
_player removeaction holster;
#Exit
exit
UNHOLSTER.SQS
_player = _this select 0
_gun = "bwc_star";
?(not alive _player): goto "Exit"
_player addWeapon _gun;
_player selectWeapon _gun;
~2
_player setObjectTexture [0, ""];
holster = player addAction ["Holster","\bwc_pilots\data\scr\holster.sqs"];
_player removeaction unholster;
#Exit
exit
Very simple and basic scripting and I now have the animations working properly including a little scripting trick which holsters/unholsters the pistol ...... HOWEVER the animations only work if the pilot is initiated directly in the game and not in a vehicle. If the pilot is initiated in the helicopter once he gets out the animations are not available to the player and AI. The other problem is if you order an AI to lets say "RaiseVisor" he moves towards the player and raises the players visor and not his own.
The only way to fix this is to run the animations using the "class UserActions" in the config. I have tried everything but have had no success.
What I would like to know from the scripting community is, how does one configure these animations in the class UserActions without having to include custom anims or bones to the model as this seems to create all sorts of problems. I know it is possible to do this I just don't know how to script the arguments with out having to add a custom --- class Animations ---- in the cfgModels or bones in the cfgSkeletons.
class UserActions
{
class holster
{
displayName="Holster";
position="pilot";
radius=1
onlyForplayer = false;
condition= "WHAT CONDITION DO I USE HERE";
statement= "WHAT STATEMENT DO I USE HERE";
};
class unholster
{
displayName="Unholster";
position="pilot";
radius=1
onlyForplayer = false;
condition= "WHAT CONDITION DO I USE HERE";
statement= "WHAT STATEMENT DO I USE HERE";
};
Please if anyone has been sucessful in including a custom animation with their soldier models could they post sample of scripts or explain how they did it, here........I would really appreciate the help as I would like to release the pilots with our Puma 330L helicopters before Christmas.