Home   Help Search Login Register  

Author Topic: Custom Soldier Animation Problems  (Read 2604 times)

0 Members and 1 Guest are viewing this topic.

Offline Obmar

  • Members
  • *
  • - Obmar -
    • Bush Wars Mod
Custom Soldier Animation Problems
« on: 14 Dec 2007, 06:41:06 »
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
Quote
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
Quote
_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
Quote
_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
Quote
_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
Quote
_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
Quote
_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.
Quote
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.
One man's terrorist is another man's freedom fighter.

Offline bdfy85

  • Contributing Member
  • **
Re: Custom Soldier Animation Problems
« Reply #1 on: 14 Dec 2007, 15:38:22 »
your scripts will be faulty with after save/load ;) Remeber random numbers example i gave you ? look at it
this scripts will be buggy in mp too, i'm sure. hiding objects with  setObjectTexture is a buggy old ofp way.
I wouldn't call it animation ;) Don't know if these features worth the time you'll spend on them

I can remember ofp addons with "RaiseVisor" features... i suggest you to look at it.


Liberation Mod scripts&balance

Offline Obmar

  • Members
  • *
  • - Obmar -
    • Bush Wars Mod
Re: Custom Soldier Animation Problems
« Reply #2 on: 15 Dec 2007, 17:42:50 »
The problem is that at the moment we can not add custom animations to the soldier it distorts the model ingame. I think it has to do with the CfgSkeleton and the bones which are set for the BIS soldier model, as soon as we add a named selection and an axis in the memory lod it distorts the model ingame and the animations dont work. That is the problem I have. I just want to find out if there is another way of adding custom animations without adding bones to the model. I think it is posible via the class UseActions I just don't know how to implement it. I have tried many different ways but with no success.
« Last Edit: 15 Dec 2007, 17:46:32 by Obmar (Bush Wars) »
One man's terrorist is another man's freedom fighter.

Offline bdfy85

  • Contributing Member
  • **
Re: Custom Soldier Animation Problems
« Reply #3 on: 16 Dec 2007, 01:08:37 »
Quote
I think it has to do with the CfgSkeleton and the bones which are set for the BIS soldier model
of course they are :cool2: You have to define your one Skeletone, your own cfgModels, your own cfgMoves anyway if you want to use new model. Why not to try add some more bbones and see what happens ?
Anyway i think that features you are implementing just do not worth the time you'll waste on them ;)
Liberation Mod scripts&balance

Offline Obmar

  • Members
  • *
  • - Obmar -
    • Bush Wars Mod
Re: Custom Soldier Animation Problems
« Reply #4 on: 17 Dec 2007, 08:59:55 »
thanks for that bdfy85, I added more bones as a test and it just distorts the model ingame. Anyone know where I can get hold of the full cfgModels with all the bone animations for the BIS sample model. That way I can redefine my own skeleton. The problem is we dont have that info as BIS did not incude it with the model like they did with the sample A10 which has the documentation for the skeleton, bones and animations. I would like to at least get the holstering animation working properly.
One man's terrorist is another man's freedom fighter.

Offline bdfy85

  • Contributing Member
  • **
Re: Custom Soldier Animation Problems
« Reply #5 on: 17 Dec 2007, 10:28:06 »
Quote
The problem is we dont have that info
false. search for JdB tutorial or SLX_People Example. Man Skeletone aws out long before o2 release ;) and you have to define all i mentioned aboeve nto only bones
Liberation Mod scripts&balance

Offline Obmar

  • Members
  • *
  • - Obmar -
    • Bush Wars Mod
Re: Custom Soldier Animation Problems
« Reply #6 on: 20 Dec 2007, 02:40:11 »
Yes but that is based on the cfgSkeleton being inherited from The BI man skeleton. Even with the new config I did and the CfgMoves I still can not add bones to the skeleton. It either distorts the model or does not recognise the new bones. It looks lke I am going to have to use the "HIDE" animation and a selection as it will be the only way to implement the animation actions via Use Actions.
One man's terrorist is another man's freedom fighter.

Offline bdfy85

  • Contributing Member
  • **
Re: Custom Soldier Animation Problems
« Reply #7 on: 20 Dec 2007, 09:45:05 »
Quote
It looks lke I am going to have to use the "HIDE" animation and a selection as it will be the only way to implement the animation actions via Use Actions.
hide animation needs a bone just like any other ;)
Liberation Mod scripts&balance