Skip to content

Object animations #1977

@xLuxy

Description

@xLuxy

Is your feature request related to a problem? Please describe.

I'm currently working on reversing GTA:SA's parachute implementation. I found the following lines:

9@ = Object.Create(#PARACHUTE, $TEMPVAR_X_COORD, $TEMPVAR_Y_COORD, $TEMPVAR_Z_COORD)

075A: set_object 9@ animation "PARA_OPEN_O" IFP_file "PARACHUTE" 1000.0 lockF 0 loop 1 // IF AND SET

which is applying an animation (in this case, block: PARACHUTE and anim PARA_OPEN_O

Describe the solution you'd like

In order to fully implement GTA:SA's default parachute system we'd need a way to set object animations. Therefore, a function like setObjectAnimation would be a nice idea.

Additional context

  • Mantis issue: https://bugs.mtasa.com/view.php?id=8437
  • Posted by jusonex on 2014-08-08 13:49:

    Some information for later use:

    • http://www.gtamodding.com/index.php?title=ANIM
    • CFileLoader::LoadAnimatedClumpObject(const char* szConfigLine) @ 0x5B40C0 (loads anim section from .ide)
    • CClumpModelInfo::SetAnimFile(const char* szAnimName) @ 0x4C5200
    • object animations are per model
  • Provided by Saml1er on 2021-01-03:
    • Yes, object anims work the same as ped anims. There's a bug in mta's codebase which causes the object anims to crash. I was trying to fix it but then I got distracted and started working on something else
    • But before we can play object anims, the object must have skinned data like peds in the dff model
    • engineReplaceModel crashes when trying to load skin data for object models. Yes, it's possible to fix it
  • Related issue: Custom ifp animations for objects and textures #362 (custom IFP animations for objects)
  • Related PR: Add interface for model flags #1714 (model flags)
  • Some object animations:
      POOL
      POOL_XLONG_SHOT_O
      POOL_XLONG_START_O
      POOL_LONG_SHOT_O
      POOL_LONG_START_O
      POOL_MED_SHOT_O
      POOL_MED_START_O
      POOL_SHORT_SHOT_O
      POOL_SHORT_START_O
    
      BD_FIRE
      BD_FIRE1
    
      MD_CHASE
      DONUTDROP
      FEN_CHOPPA_R1
      FEN_CHOPPA_L2
      FEN_CHOPPA_R2
      FEN_CHOPPA_L3
      FEN_CHOPPA_R3
      FEN_CHOPPA_L1
    
      ROB_BANK
      CAT_SAFE_OPEN_O
      CAT_SAFE_OPEN_O
    
      MISC
      KAT_THROW_O
      PASS_RIFLE_O
    
      PARACHUTE
      PARA_OPEN_O
      PARA_STEERR_O
      PARA_STEERL_O
      PARA_DECEL_O
      PARA_FLOAT_O
      PARA_RIP_LOOP_O
      PARA_LAND_WATER_O
      PARA_LAND_O
    
      GYMNASIUM
      PEDALS_SLOW
      PEDALS_STILL
      PEDALS_MED
      PEDALS_FAST
    
      BSKTBALL
      BBALL_IDLELOOP_O
      BBALL_IDLE_O
      BBALL_IDLE2_O
      BBALL_JUMP_SHOT_O
      BBALL_JUMP_CANCEL_O
      BBALL_PICKUP_O
      BBALL_RUN_O
      BBALL_SKIDSTOP_L_O
      BBALL_SKIDSTOP_R_O
      BBALL_WALKSTOP_L_O
      BBALL_WALKSTOP_R_O
      BBALL_WALK_O
      BBALL_WALK_START_O
      BBALL_DNK_LNCH_O
      BBALL_DNK_GLI_O
      BBALL_DNK_O
    
      TATTOOS
      TAT_IDLE_LOOP_O
      TAT_DROP_O
      TAT_SIT_IN_O
      TAT_SIT_LOOP_O
      TAT_SIT_OUT_O
    
      CLOTHES
      CLO_POSE_IN_O
      CLO_POSE_OUT_O
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions