Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (85,113 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

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

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption 2

    2. Red Dead Redemption

    3. Rockstar Games

    1. Off-Topic

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

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

    2. Site Suggestions

Sign in to follow this  
David Thapa

I need a help to make it using 0AB1: call_scm_func Please Help

Recommended Posts

David Thapa


0AB1: call_scm_func @GetSQR 1 10 $result



:Rotate681


068E: get_camera_target_point_to [email protected] [email protected] [email protected]

0400: store_coords_to [email protected] [email protected] [email protected] from_object [email protected] with_offset 0.0 0.0 0.0




0013: [email protected] *= 0.25

0013: [email protected] *= 0.25

0013: [email protected] *= 0.25




04D5: create_corona_at [email protected] [email protected] [email protected] radius 0.2 type 9 flare 0 RGB 255 255 0






0013: [email protected] *= -1.0

0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected]

0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected]







0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected]

000F: [email protected] -= 270.0




02F7: [email protected] = cosine [email protected] // (float)


02F6: [email protected] = sine [email protected] // (float)




000B: [email protected] += 93.0

000B: [email protected] += 115.0

00D6: if

8031: not [email protected] >= 394.0

0AA0: gosub_if_false @Rotate3373


000F: [email protected] -= 270.0

0013: [email protected] *= -1.0


:Rotate3373

0007: [email protected] = 394.0


000F: [email protected] -= 110.0



0051: return

Share this post


Link to post
Share on other sites
Veryzon

What is the original purpose of this code?

Share this post


Link to post
Share on other sites
David Thapa

This is for it moves minigun in car

Share this post


Link to post
Share on other sites
Veryzon

This code is not fully executable. It have four dependencies: one handle of vehicle, two handles of objects and a offset value vector to position.

 

At end is notable have a reason for something like a angle's calcul. Do you extracted this code from what mod? Explain the left of code here.

Edited by Veryzon

Share this post


Link to post
Share on other sites
David Thapa

Thanks :)

 

Edited by David Thapa

Share this post


Link to post
Share on other sites
Veryzon

The code needs of one vehicle's handle, two objects' handles and a vector 3D (three floats) to be used as position offset on vehicle.

 

[ ↓ ] In medium-level SCM code.

// Use this to call.0AB1: call_scm_func @__proc__RotateMountedGunFromVehicle 6 {hVehicle} [email protected] {hObject1} [email protected] {hObject2} [email protected] {fOffsetX} 0.0 {fOffsetY} 0.0 {fOffsetZ} 1.5:__proc__RotateMountedGunFromVehicle0006: [email protected] = 0 0006: [email protected] = 0 0006: [email protected] = 0 068D: get_camera_position_to [email protected] [email protected] [email protected] 0006: [email protected] = 0 0006: [email protected] = 0 0006: [email protected] = 0 068E: get_camera_target_point_to [email protected] [email protected] [email protected] 0400: store_coords_from_object [email protected] with_offset 0.0 0.0 0.0 to [email protected] [email protected] [email protected] 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0013: [email protected] *= 0.25 0013: [email protected] *= 0.25 0013: [email protected] *= 0.25 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 04D5: create_corona_at [email protected] [email protected] [email protected] radius 0.2 type 8 flare 0 RGB 255 255 0 0006: [email protected] = 0 0006: [email protected] = 0 0006: [email protected] = 0 01BB: store_object [email protected] position_to [email protected] [email protected] [email protected] 0006: [email protected] = 0 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0013: [email protected] *= -1.0 0006: [email protected] = 0 0604: [email protected] = get_Z_angle_for_point [email protected] [email protected] 0006: [email protected] = 0 0604: [email protected] = get_Z_angle_for_point [email protected] [email protected] 0006: [email protected] = 0 0174: [email protected] = car [email protected] Z_angle 0006: [email protected] = 0 06BE: [email protected] = car [email protected] y_angle 0006: [email protected] = 0 0006: [email protected] = 0 0006: [email protected] = 0 01BB: store_object [email protected] position_to [email protected] [email protected] [email protected] 0006: [email protected] = 0 0006: [email protected] = 0 0006: [email protected] = 0 01BB: store_object [email protected] position_to [email protected] [email protected] [email protected] 0063: [email protected] -= [email protected] // (float) 0006: [email protected] = 0 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] 0006: [email protected] = 0 0604: [email protected] = get_Z_angle_for_point [email protected] [email protected] 000F: [email protected] -= 270.0 0087: [email protected] = [email protected] // (float) 0087: [email protected] = [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0006: [email protected] = 0 02F7: [email protected] = cosine [email protected] // (float) 006B: [email protected] *= [email protected] // (float) 0006: [email protected] = 0 02F6: [email protected] = sine [email protected] // (float) 006B: [email protected] *= [email protected] // (float) 005B: [email protected] += [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 000B: [email protected] += 93.0 000B: [email protected] += 115.0 00D6: if 0031:   [email protected] >= 394.0 004D: jump_if_false @testgun_11572 0007: [email protected] = 394.0 0087: [email protected] = [email protected] // (float) 000F: [email protected] -= 110.0 005B: [email protected] += [email protected] // (float) 0063: [email protected] -= [email protected] // (float) :testgun_115720681: attach_object [email protected] to_car [email protected] with_offset [email protected] [email protected] [email protected] rotation 0.0 [email protected] [email protected] 000F: [email protected] -= 270.0 0013: [email protected] *= -1.00AB2: ret 0

For the concept (default releases of Sanny Builder does not can compile it), the high-level SCM code.

eDf9nMe.png

 

xqrijA6.png

BFaWs8m.png

Edited by Veryzon

Share this post


Link to post
Share on other sites
David Thapa

Which part i am missing here sir need a help :facedesk:

 

 

 

{$CLEO .cs}

0000: NOP
:Noname_2
0001: wait 0 ms
00D6: if
0256: player $PLAYER_CHAR defined
004D: jump_if_false @Noname_2
00D6: if
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false @Noname_2
03C0: [email protected] = actor $PLAYER_ACTOR car
00D6: if and
0AB0: key_pressed 2
0AB0: key_pressed 74
004D: jump_if_false @Noname_2
00D6: if
03CA: object [email protected] exists
004D: jump_if_false @Noname_10a
0108: destroy_object [email protected]
:Noname_10a
00D6: if
03CA: object [email protected] exists
004D: jump_if_false @Noname_100
0108: destroy_object [email protected]
:Noname_100
0247: load_model #MINIGUN
038B: load_requested_models
:Noname_107
0001: wait 0 ms
00D6: if
0248: model #MINIGUN available
004D: jump_if_false @Noname_107
03C0: [email protected] = actor $PLAYER_ACTOR car
0013: [email protected] *= 1.43
0107: [email protected] = create_object #MINIGUN at 0.0 0.0 -200.0
0107: [email protected] = create_object #MINIGUN at 0.0 0.0 -200.0
0001: wait 100 ms
0681: attach_object [email protected] to_car [email protected] with_offset 1.0 0.9 [email protected] rotation 0.0 30.0 94.0
0681: attach_object [email protected] to_car [email protected] with_offset -1.0 0.9 [email protected] rotation 0.0 30.0 94.0
02AC: set_car [email protected] immunities BP 1 FP 1 EP 1 CP 1 MP 1
053F: set_car [email protected] tires_vulnerability 0
0001: wait 100 ms
0249: release_model #MINIGUN
:Noname_285
0001: wait 0 ms
00D6: if
00DF: actor $PLAYER_ACTOR driving
004D: jump_if_false @Noname_1375
00D6: if
80E1: not player 0 pressed_key 10
004D: jump_if_false @Noname_1375
:Noname_438
00D6: if and
03CA: object [email protected] exists
03CA: object [email protected] exists
004D: jump_if_false @Noname_1000
0AB1: call_scm_func @__proc__RotateMountedGunFromVehicle 6 {hVehicle} [email protected] {hObject1} [email protected] {hObject2} [email protected] {fOffsetX} 0.0 {fOffsetY} 0.0 {fOffsetZ} 1.5
0002: jump @Noname_285
:Noname_1375
00D6: if
03CA: object [email protected] exists
004D: jump_if_false @Noname_1395
0108: destroy_object [email protected]
:Noname_1395
00D6: if
03CA: object [email protected] exists
004D: jump_if_false @Noname_1396
0108: destroy_object [email protected]
:Noname_1396
020A: set_car [email protected] door_status_to 0
00D6: if or
8202: not actor $PLAYER_ACTOR near_car [email protected] radius 50.0 50.0 sphere 0
02BF: car [email protected] sunk
004D: jump_if_false @Noname_2
01C3: remove_references_to_car [email protected]
0002: jump @Noname_2
:__proc__RotateMountedGunFromVehicle
068E: get_camera_target_point_to [email protected] [email protected] [email protected]
0400: store_coords_from_object [email protected] with_offset 0.0 0.0 0.0 to [email protected] [email protected] [email protected]
0013: [email protected] *= 0.25
0013: [email protected] *= 0.25
0013: [email protected] *= 0.25
04D5: create_corona_at [email protected] [email protected] [email protected] radius 0.2 type 8 flare 0 RGB 255 255 0
0013: [email protected] *= -1.0
000F: [email protected] -= 270.0
02F7: [email protected] = cosine [email protected] // (float)
02F6: [email protected] = sine [email protected] // (float)
000B: [email protected] += 93.0
000B: [email protected] += 115.0
00D6: if
0031: [email protected] >= 394.0
004D: jump_if_false @testgun_11572
0007: [email protected] = 394.0
000F: [email protected] -= 110.0
:testgun_11572
000F: [email protected] -= 270.0
0013: [email protected] *= -1.0
0AB2: ret 0
Sorry to Bother you again and again but i am null to 0AB1: call_scm_func i have try to learn it all makes me confused
this
0AB2: ret 0
and this
Edited by David Thapa

Share this post


Link to post
Share on other sites
Veryzon

I did a mistake. Some opcodes from this code can not be compiled by default SB releases. Use the following code.

:__proc__RotateMountedGunFromVehicle0006: [email protected] = 0 0006: [email protected] = 0 0006: [email protected] = 0 068D: get_camera_position_to [email protected] [email protected] [email protected] 0006: [email protected] = 0 0006: [email protected] = 0 0006: [email protected] = 0 068E: get_camera_target_point_to [email protected] [email protected] [email protected] 0400: store_coords_to [email protected] [email protected] [email protected] from_object [email protected] with_offset 0.0 0.0 0.0 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0013: [email protected] *= 0.25 0013: [email protected] *= 0.25 0013: [email protected] *= 0.25 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 04D5: create_corona_at [email protected] [email protected] [email protected] radius 0.2 type 8 flare 0 RGB 255 255 0 0006: [email protected] = 0 0006: [email protected] = 0 0006: [email protected] = 0 01BB: store_object [email protected] position_to [email protected] [email protected] [email protected] 0006: [email protected] = 0 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0013: [email protected] *= -1.0 0006: [email protected] = 0 0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected] 0006: [email protected] = 0 0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected] 0006: [email protected] = 0 0174: [email protected] = car [email protected] Z_angle 0006: [email protected] = 0 06BE: [email protected] = car [email protected] y_angle 0006: [email protected] = 0 0006: [email protected] = 0 0006: [email protected] = 0 01BB: store_object [email protected] position_to [email protected] [email protected] [email protected] 0006: [email protected] = 0 0006: [email protected] = 0 0006: [email protected] = 0 01BB: store_object [email protected] position_to [email protected] [email protected] [email protected] 0063: [email protected] -= [email protected] // (float) 0006: [email protected] = 0 0509: [email protected] = distance_between_XY [email protected] [email protected] and_XY [email protected] [email protected] 0006: [email protected] = 0 0604: get_Z_angle_for_point [email protected] [email protected] store_to [email protected] 000F: [email protected] -= 270.0 0087: [email protected] = [email protected] // (float) 0087: [email protected] = [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0006: [email protected] = 0 02F7: [email protected] = cosine [email protected] // (float) 006B: [email protected] *= [email protected] // (float) 0006: [email protected] = 0 02F6: [email protected] = sine [email protected] // (float) 006B: [email protected] *= [email protected] // (float) 005B: [email protected] += [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 000B: [email protected] += 93.0 000B: [email protected] += 115.0 00D6: if 0031:   [email protected] >= 394.0 004D: jump_if_false @TESTGUN_11572 0007: [email protected] = 394.0 0087: [email protected] = [email protected] // (float) 000F: [email protected] -= 110.0 005B: [email protected] += [email protected] // (float) 0063: [email protected] -= [email protected] // (float) :TESTGUN_115720681: attach_object [email protected] to_car [email protected] with_offset [email protected] [email protected] [email protected] rotation 0.0 [email protected] [email protected] 000F: [email protected] -= 270.0 0013: [email protected] *= -1.0 0AB2: ret 0

This function does not return any value. All the parameters of 0x0AB1 are read-only by function.

 

The opcode 0x0AB1 expect for two parameters: the first is a label reference from function's entry-point and the second is the number of arguments to be pushed to the function's TLS.

 

In case of __proc__RotateMountedGunFromVehicle, we pushes six arguments, wich are hVehicle, hObject1, hObject2, fOffsetX, fOffsetY and fOffsetZ.

 

The opcode 0x0AB2 expect for one parameter: the number of arguments to be returned. In case of __proc__RotateMountedGunFromVehicle, we do not push back any argument.

Edited by Veryzon

Share this post


Link to post
Share on other sites
David Thapa

Thank you sir its working :^: something is missing but i'll find out..it looks funny :lol: when i aim straight down both minigun moves different direction but when aim straight works perfect but at least i learn something from it thank you so much God Bless You :colgate: its was very very helpful you are awesome very kind person

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

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