Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

0673 animation opcode, GTA:MA


MW_29
 Share

Recommended Posts

So as far as i know mod GTA: Martial Arts /GTA:MA link HERE has side feature of implementing additiona opcode related to animations. According to author:

 

Version 0.9.0.1 now makes a new opcode (0673) available that can be used to play any animation (including non-fighting ones) on an actor anytime from script. This can be considered a side-bonus of GTA:MA.

 

...and from description of GTA:MA's 'Demo package':

 

 

GTA:MA v0.9.0.1 adds an opcode to the existing opcodes of the

VC engine, therefore we'll be able to trigger it through scripting, via the

main.scm. The opcode 0673 gets used like this:

 

0673: play_animation on actor $PLAYER_ACTOR animgroup 64 anim 512 blendfactor 30.0

 

This requires a little explaining. The use of the first variable should be

obvious. The second variable (animgroup) refers to the group from which to

use it. The standard animations are all in group 0. The first custom Form

in the GTA:MA Form has id 61, the next has 62 and so on. So to trigger the

dance move, you need to use the appropriate id (ATTENTION! That does mean that

the '64' used above is not necessarily the right id for your .cfg. Do your own

calculation.) Next you will have to pass the ID of the animation itself. In our

MA_FORM section we have set 0x200 as the anim id of dance_right. That is 512 in

decimal, so that's what we'll use. The meaning of the last variable is not

entirely clear. it seems to handle the blending of the animation you want to

play with the idle animation of the actor in question. 0.0 seems to mean that

100%ly the idle animation gets used, 30.0 seems to cause the animation you want

to play to get used 100%ly. Values inbetween caused mixed (as in "blended")

results.

 

As a final step, add this line to the end of the opcode section of the

vicescm.ini of Barton Waterduck's GTA VC Mission Builder (so that the Mission

Builder will be able to compile the new opcode):

0673=4,play_animation on actor %1d% animgroup %2d% anim %3d% blendfactor %4f%

 

...in the second quoted description there is some stuff related to adding external .ifp file with SA dance movements, but i am not interested in that now.

 

List of in-game animations numbers that were supposed to be used with this opcode is HERE

 

 

My question is, HOW TO PROPERLY RUN this opcode on already existent in game aniations? How to run any of those "stock" anims included in game? I 've added below lines:

 

...to my SB's VICE_SCM.INI

 

 

0673: play_animation on actor $PLAYER_ACTOR animgroup 64 anim 512 blendfactor 30.0

 

 

...and to opcodes.txt:

 

 

0673: play_animation on actor $PLAYER_ACTOR animgroup 64 anim 512 blendfactor 30.0

 

 

So i assume having installed GTA:MA (which i have) should allow me to use this opcode in scripts.

 

Well, simple VC CLEO script is compilable, BUT i have every time crash when code reaches mentioned new opcode line. Whether i use this...

 

 

// This file was decompiled using vicescm.ini published by http://gtag.gtagaming.com/opcode-database on 18.5.2011{$VERSION 2.1.1000}{$CLEO .cs}//-------------MAIN---------------0000: :NONAME_2wait 0 if and  Player.Defined($PLAYER_CHAR)  not Actor.Dead($PLAYER_ACTOR)jf @NONAME_2  if 00E1:   key_pressed 0 13 // "V" key pressed   jf @NONAME_2 //Player.CanMove($PLAYER_CHAR) = False  // <- tried with and without this still doesn't workwait 1000673: play_animation on actor $PLAYER_ACTOR animgroup 0 anim 0 blendfactor 30.005DC: end_custom_thread

 

 

...or this

 

 

// This file was decompiled using vicescm.ini published by http://gtag.gtagaming.com/opcode-database on 18.5.2011{$VERSION 2.1.1000}{$CLEO .cs}//-------------MAIN---------------0000: :NONAME_2wait 0 if and  Player.Defined($PLAYER_CHAR)  not Actor.Dead($PLAYER_ACTOR)jf @NONAME_2  if 00E1:   key_pressed 0 13 // "V" key pressed  jf @NONAME_2 //Player.CanMove($PLAYER_CHAR) = False  // <- tried with and without this still doesn't workjump @NONAME_3:NONAME_3wait 0 0673: play_animation on actor $PLAYER_ACTOR animgroup 0 anim 0 blendfactor 30.0jump @NONAME_3  

 

 

So does anybody know how to deal with that opcode and if using it via GTA:MA is in fact possible and working in practical? Did anyone used it somewhere already? I'd be glad for any constructive responses.

Link to comment
Share on other sites

VC 1.0

 

// [email protected] - ped handle05E6: [email protected] = actor [email protected] [email protected] += 0x4C05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0// CAnimManager::BlendAnimation(RpClump *, AssocGroupId, AnimationId, float)05E1: call 0x405640 num_params 4 pop 4 _blendFactor 8.0 _animationId 165 _assocGroupId 0 _rwObject [email protected]

 

Link to comment
Share on other sites

 

VC 1.0

 

// [email protected] - ped handle05E6: [email protected] = actor [email protected] [email protected] += 0x4C05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0// CAnimManager::BlendAnimation(RpClump *, AssocGroupId, AnimationId, float)05E1: call 0x405640 num_params 4 pop 4 _blendFactor 8.0 _animationId 165 _assocGroupId 0 _rwObject [email protected]

 

Thanks @DK22Pac smile.gif ...firstly it crashed, then i realised that parkour mod uses similar things so according to it's source code, i changed order of arguments for 05E6 , and then it works perfectly biggrin.gif

 

 

// This file was decompiled using vicescm.ini published by http://gtag.gtagaming.com/opcode-database on 18.5.2011{$VERSION 2.1.1000}{$CLEO .cs}//-------------MAIN---------------0000: :NONAME_2wait 0 if and  Player.Defined($PLAYER_CHAR)  not Actor.Dead($PLAYER_ACTOR)jf @NONAME_2  if 00E1:   key_pressed 0 13 jf @NONAME_2 05E6: $PLAYER_ACTOR = actor [email protected] struct // <- just changing order of arguments [email protected] += 0x4C05E0: [email protected] = read_memory [email protected] size 4 virtual_protect 0//05DC: end_custom_thread:NONAME_3wait 0 05E1: call 0x405640 num_params 4 pop 4 _blendFactor 30.0 _animationId 0 _assocGroupId 0 _rwObject [email protected] @NONAME_3 

 

 

Thanks for help smile.gif

Link to comment
Share on other sites

MW_29, open VCSCM.ini and change

 

05E6=2, 1% = actor 2% struct

 

to

 

05E6=2, 2% = actor 1% struct

 

Link to comment
Share on other sites

MW_29, open VCSCM.ini and change

 

05E6=2, 1% = actor 2% struct

 

to

 

05E6=2, 2% = actor 1% struct

 

Yeah, i can also use this way icon14.gif

 

By the way , do You know if is it possible to make or call some function which would create a "shot of a bullet" from one point towards another, just like SA opcode does:

 

06BC: create_M4_shoot_from 2193.268 -1165.441 1031.124 target $TEMPVAR_X_COORD $TEMPVAR_Y_COORD $TEMPVAR_Z_COORD energy 1 

...but in Vice? Sorry for offtopic.

Link to comment
Share on other sites

// [email protected], [email protected], [email protected] - start point04C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0 1.0 0.805F8: [email protected] = var [email protected] offset// [email protected], [email protected], [email protected] - end point04C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0 20.0 0.805F8: [email protected] = var [email protected] offset05E1: call 0x5C9BB0 num_params 3 pop 3 _intensuty 15 _endPoint [email protected] _startPoint [email protected]

 

Edited by DK22Pac
Link to comment
Share on other sites

 

// [email protected], [email protected], [email protected] - start point04C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0 1.0 0.805F8: [email protected] = var [email protected] offset// [email protected], [email protected], [email protected] - end point04C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0 20.0 0.805F8: [email protected] = var [email protected] offset05E1: call 0x5C9BB0 num_params 3 pop 3 _intensuty 15 _endPoint [email protected] _startPoint [email protected]

 

Awesome! biggrin.gif Man where do You get all this knowledge from? I ve searched not once not twice the internet for things like that and i couldn't find anything..

 

The code You posted not only creates shot but the shot is a tracer round cool.gif So tell me if it is possible to change something to reach this shot effect on already present in-game guns, i mean is it possible to set default game shot to this kind of shot with tracer effect?

Link to comment
Share on other sites

This needs some researching, detecting all places where default bullet traces are created and replace them with that new function.

Link to comment
Share on other sites

ThirteenAG

 

So tell me if it is possible to change something to reach this shot effect on already present in-game guns, i mean is it possible to set default game shot to this kind of shot with tracer effect?

Well, kinda proof of concept:

user posted image user posted image 2mb gif

 

 

{$CLEO}0000:05F8: [email protected] = var [email protected] offset05F8: [email protected] = var [email protected] offset05DF: write_memory 0x5734DD size 5 value 0x90 virtual_protect 1  //smoke trail05DF: write_memory 0x5736EE size 5 value 0x90 virtual_protect 1  //smoke trail05DF: write_memory 0x57389B size 5 value 0x90 virtual_protect 1  //smoke trail05DF: write_memory 0x5C9C06 size 5 value 0x90 virtual_protect 1  //muzzleflashwhile true   wait 00054: store_player $player_char position_to [email protected] [email protected] [email protected]   05EF: [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 550.0 find_next 0 pass_deads 0 //IF and SETthen   repeat       // [email protected], [email protected], [email protected] - start point       05E0: [email protected] = read_memory 0x7E46B8 size 4 virtual_protect 1       05E0: [email protected] = read_memory 0x7E46BC size 4 virtual_protect 1       05E0: [email protected] = read_memory 0x7E46C0 size 4 virtual_protect 1       // [email protected], [email protected], [email protected] - end point       05E0: [email protected] = read_memory 0x77EC78 size 4 virtual_protect 1       05E0: [email protected] = read_memory 0x77EC7C size 4 virtual_protect 1       05E0: [email protected] = read_memory 0x77EC80 size 4 virtual_protect 1           if        02E0:   actor $PLAYER_ACTOR firing_weapon       then       04C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 0.0 0.0 0.0       05E1: call 0x5C9BB0 num_params 3 pop 3 _intensuty 0 _endPoint [email protected] _startPoint [email protected]       else           if            02E0:   actor [email protected] firing_weapon           then           04C4: create_coordinate [email protected] [email protected] [email protected] from_actor [email protected] offset 0.0 0.0 0.0           05E1: call 0x5C9BB0 num_params 3 pop 3 _intensuty 0 _endPoint [email protected] _startPoint [email protected]           end       end   until 85EF: not [email protected] = random_actor_near_point [email protected] [email protected] [email protected] in_radius 550.0 find_next 1 pass_deads 0 //IF and SETendend

 

 

Looks cool, but still some work needs to be done.

Edited by ThirteenAG
Link to comment
Share on other sites

Good biggrin.gif Also now arming vehicles possible even without MVL tounge.gif

 

user posted image

 

The question is how to 'run' desired SFX (yeah any of weapon shot effects on example) on demand? Because opcodes 018C and 018D are let's say ... a "little" limited

 

By the way, i see a lot of creativity here as for an offtopic question but i hope anything what is creative will be tolerated by staff biggrin.gif

Edited by MW_29
Link to comment
Share on other sites

My latest attempt to create bullet traces instead of smoke trails:

 

https://dl.dropboxusercontent.com/u/1399262...ullet_trace.zip

 

It contains two scripts, for player and for peds, and the effect itself doesn't look perfect. But it's still better than smoke trail, in my opinion.

 

bullet_trace_pt1 src

 

bullet_trace_pt2 src

Edited by ThirteenAG
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.