Quantcast

Jump to content

» «
Photo

Main.scm- How to make a ped loop an animation

4 replies to this topic
hellya2011
  • hellya2011

    Hellya2011

  • Members
  • Joined: 23 Sep 2009

#1

Posted 21 February 2012 - 09:25 AM

what i basically want is that, im trying to place a pedestrain at X Y Z Cords on my map, and have them loop an animation such as player_idle or other animations, but all my attempts at tying to code it leads into gtasa crashing upon loading. can someone please give me a simple code to place in my main.scm to have a ped looping an animation? sad.gif

Frank.s
  • Frank.s

  • The Yardies
  • Joined: 15 Apr 2008

#2

Posted 21 February 2012 - 10:08 AM

I don't think it's possible to play player anims on a pedestrian ('cos of different bones).

See the loop 0/1 option? That's it. icon14.gif
GTAGarage documentation of all different opcodes should give any extra help/info you might need. Just put the opcode in the url like i did with that link, not all opcodes are documented thought, only the most common ones. (sometimes not even those)
Code taken from GTAGarage's Opcode 0605 documentation:
CODE
:LoadAnim
0247: load_model #BFORI
04ED: load_animation "MISC"

:CheckAnim
0001: wait 0 ms
00D6: if and
0248:   model #BFORI available
04EE:   animation "MISC" loaded
004D: jump_if_false @CheckAnim
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
0605: actor 0@ perform_animation_sequence "BMX_COMEON" IFP_file "MISC" 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1
0249: release_model #BFORI
04EF: release_animation "MISC"
004E: end_thread

hellya2011
  • hellya2011

    Hellya2011

  • Members
  • Joined: 23 Sep 2009

#3

Posted 21 February 2012 - 10:44 AM Edited by hellya2011, 21 February 2012 - 10:47 AM.

ok, thanks for the code, im still must have a misunderstanding though

i put this at the "put your create threads here"
CODE

004F: create_thread @PED1


then in the thread section i put this

CODE

:PED1
03A4: name_thread "PED1"
0247: load_model #BFORI
04ED: load_animation "MISC"

:PED2
0001: wait 0 ms
00D6: if and
0248:   model #BFORI available
04EE:   animation "MISC" loaded
004D: jump_if_false @CheckAnim
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
0605: actor 0@ perform_animation_sequence "BMX_COMEON" IFP_file "MISC" 4.0 loop 0 lockX 0 lockY 0 lockF 0 time -1
0249: release_model #BFORI
04EF: release_animation "MISC"
004E: end_thread


im sure i have a part messed up, but i have no clue which part i did wrong

i also try putting it in the Mission 0 Section without the create threads, but sannybuilder changes it into
CODE

:MAIN_297
0001: wait $DEFAULT_WAIT_TIME ms
00BF: $TIME_HOURS = current_time_hours, $TIME_MINS = current_time_minutes
0002: jump @MAIN_297
0247: load_model #BFORI
04ED: load_animation "MISC"

:MAIN_329
0001: wait 0 ms
00D6: if and
0248:   model #BFORI available
04EE:   animation "MISC" loaded
004D: jump_if_false @MAIN_329
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
0605: actor 0@ perform_animation_sequence "BMX_COMEON" IFP_file "MISC" 4.0 loop 0 0 0 0 time -1 // versionA
0249: release_model #BFORI
04EF: release_animation "MISC"
004E: end_thread


and gtasa still crashes confused.gif

Frank.s
  • Frank.s

  • The Yardies
  • Joined: 15 Apr 2008

#4

Posted 21 February 2012 - 12:19 PM

Tutorial Forum List
There are at least 5 coding tutorials there, you seem like you'd appreciate them. icon14.gif

hellya2011
  • hellya2011

    Hellya2011

  • Members
  • Joined: 23 Sep 2009

#5

Posted 03 March 2012 - 01:57 AM

thanks for all the help, i finally got them working.... still not sure what i was doing wrong, but they work now biggrin.gif




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users