Quantcast

Jump to content

» «
Photo

Animations

3 replies to this topic
julionib
  • julionib

    Coder

  • Members
  • Joined: 13 Sep 2012
  • Brazil

#1

Posted 11 March 2013 - 02:48 AM

anyone knows how to play two anims at same time? like walk and aim with the gun?

and how to make the animation change shape/rotation based on camera rotation? like normal game aim animation does, changing the "pitch" of the player arms when you change the rotation of the camera?

nixolas1
  • nixolas1

    Creator/Destroyer

  • Members
  • Joined: 23 Dec 2008
  • None

#2

Posted 11 March 2013 - 02:56 PM

QUOTE (julionib @ Monday, Mar 11 2013, 03:48)
anyone knows how to play two anims at same time? like walk and aim with the gun?

and how to make the animation change shape/rotation based on camera rotation? like normal game aim animation does, changing the "pitch" of the player arms when you change the rotation of the camera?

there are two ways of playing anims on one part of the body, the first, easy way is TaskPlayAnimUpperBody.
then for moving body parts independently and custom movements, you must use the RAGE animation/movement engine calls.
like:
CODE

GetPedBonePosition(ped,Left_Hand,0,0,0,&bonev);
      AttachPedToCarPhysically(ped,dacar,Left_Hand,0,bonev.X,bonev.Y,bonev.Z,-1,0,1);
      CreateNmMessage(1,28);
      SetNmMessageFloat(31,15.0f);
      SetNmMessageFloat(32,0.55f);
      SendNmMessage(ped);
      CreateNmMessage(1,3);
      SendNmMessage(ped);
      GetOffsetFromCarInWorldCoords(dacar,(float)0,1.0f,3.0f,&hookX,&hookY,&hookZ);
      CreateNmMessage(1,237);
      SetNmMessageVec3(243,hookX,hookY,hookZ);
      SendNmMessage(ped);

which is to attach hand under heli. there are other functions/modifiers which are Set_anim_pose and something, but i dont know a lot about this system. look through the decomiled game scos and check out how they do it. good luck!

julionib
  • julionib

    Coder

  • Members
  • Joined: 13 Sep 2012
  • Brazil

#3

Posted 11 March 2013 - 07:53 PM

thx, i will try this smile.gif

LordOfTheBongs
  • LordOfTheBongs

    Deceased

  • Members
  • Joined: 21 Sep 2013
  • None

#4

Posted 09 March 2014 - 06:10 AM

QUOTE (julionib @ Monday, Mar 11 2013, 03:48) anyone knows how to play two anims at same time? like walk and aim with the gun?

and how to make the animation change shape/rotation based on camera rotation? like normal game aim animation does, changing the "pitch" of the player arms when you change the rotation of the camera?
there are two ways of playing anims on one part of the body, the first, easy way is TaskPlayAnimUpperBody.
then for moving body parts independently and custom movements, you must use the RAGE animation/movement engine calls.
like:
CODE
GetPedBonePosition(ped,Left_Hand,0,0,0,&bonev);
      AttachPedToCarPhysically(ped,dacar,Left_Hand,0,bonev.X,bonev.Y,bonev.Z,-1,0,1);
      CreateNmMessage(1,28);
      SetNmMessageFloat(31,15.0f);
      SetNmMessageFloat(32,0.55f);
      SendNmMessage(ped);
      CreateNmMessage(1,3);
      SendNmMessage(ped);
      GetOffsetFromCarInWorldCoords(dacar,(float)0,1.0f,3.0f,&hookX,&hookY,&hookZ);
      CreateNmMessage(1,237);
      SetNmMessageVec3(243,hookX,hookY,hookZ);
      SendNmMessage(ped);

which is to attach hand under heli. there are other functions/modifiers which are Set_anim_pose and something, but i dont know a lot about this system. look through the decomiled game scos and check out how they do it. good luck!

 

this is from bell6.txt... here is the complete code and animation it is used with...

 

void sub_33178()
{
    CLEAR_PRINTS();
    ATTACH_PED_TO_CAR( sub_4466(), l_U888[3]._fU0, 0, l_U748, 0, 0, 0, 1 );
    UNLOCK_RAGDOLL( sub_4466(), 1 );
    SWITCH_PED_TO_RAGDOLL( sub_4466(), 30000, 0, 1, 1, 1, 0 );
    if (IS_PED_RAGDOLL( sub_4466() ))
    {
        GET_PED_BONE_POSITION( sub_4466(), 1232, 0.00000000, 0.00000000, 0.00000000, ref l_U793 );
        ATTACH_PED_TO_CAR_PHYSICALLY( sub_4466(), l_U888[3]._fU0, 1232, 0, l_U793, -1.00000000, 0, 1 );
        GET_PED_BONE_POSITION( sub_4466(), 1219, 0.00000000, 0.00000000, 0.00000000, ref l_U793 );
        ATTACH_PED_TO_CAR_PHYSICALLY( sub_4466(), l_U888[3]._fU0, 1219, 0, l_U793, -1.00000000, 0, 1 );
        SET_NM_ANIM_POSE( sub_4466(), "MISSKBTRUCK", "jump_grab", 0.86000000 );
        CREATE_NM_MESSAGE( 1, 28 );
        SET_NM_MESSAGE_FLOAT( 31, 8.00000000 );
        SET_NM_MESSAGE_FLOAT( 32, 0.55000000 );
        SEND_NM_MESSAGE( sub_4466() );
        CREATE_NM_MESSAGE( 1, 3 );
        SEND_NM_MESSAGE( sub_4466() );
        GET_OFFSET_FROM_CAR_IN_WORLD_COORDS( l_U888[3]._fU0, 0, 1.00000000, 3.00000000, ref l_U815, ref l_U816, ref l_U817 );
        CREATE_NM_MESSAGE( 1, 237 );
        SET_NM_MESSAGE_VEC3( 243, l_U815, l_U816, l_U817 );
        SEND_NM_MESSAGE( sub_4466() );
        CREATE_NM_MESSAGE( 1, 67 );
        SET_NM_MESSAGE_FLOAT( 74, 6.00000000 );
        SET_NM_MESSAGE_FLOAT( 73, 0.12500000 );
        SEND_NM_MESSAGE( sub_4466() );
        l_U739 = 2;
    }
    else
    {
        WAIT( 0 );
    }
    return;
}




2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users