Quantcast

Jump to content

» «
Photo

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

8 replies to this topic
David Thapa
  • David Thapa

    Player Hater

  • Members
  • Joined: 05 Jul 2017
  • India

#1

Posted 11 August 2017 - 03:47 PM

 
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 

Veryzon
  • Veryzon

    Player Hater

  • Members
  • Joined: 15 Jun 2017
  • Brazil

#2

Posted 12 August 2017 - 06:57 AM

What is the original purpose of this code?


David Thapa
  • David Thapa

    Player Hater

  • Members
  • Joined: 05 Jul 2017
  • India

#3

Posted 12 August 2017 - 08:25 AM

This is for it moves minigun in car


Veryzon
  • Veryzon

    Player Hater

  • Members
  • Joined: 15 Jun 2017
  • Brazil

#4

Posted 12 August 2017 - 05:16 PM Edited by Veryzon, 13 August 2017 - 02:55 PM.

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.


David Thapa
  • David Thapa

    Player Hater

  • Members
  • Joined: 05 Jul 2017
  • India

#5

Posted 13 August 2017 - 08:03 AM Edited by David Thapa, 17 August 2017 - 01:24 AM.

Thanks :)

 


Veryzon
  • Veryzon

    Player Hater

  • Members
  • Joined: 15 Jun 2017
  • Brazil

#6

Posted 13 August 2017 - 06:32 PM Edited by Veryzon, 14 August 2017 - 12:17 AM.

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__RotateMountedGunFromVehicle
0006: [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_11572
0681: 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

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

eDf9nMe.png

 

xqrijA6.png

BFaWs8m.png


David Thapa
  • David Thapa

    Player Hater

  • Members
  • Joined: 05 Jul 2017
  • India

#7

Posted 14 August 2017 - 06:29 PM Edited by David Thapa, 14 August 2017 - 06:37 PM.

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 
0006: [email protected] = 0 
0006: [email protected] = 1 
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 
0006: [email protected] = 0 
 
: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
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
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] 
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 
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
0013: [email protected] *= -1.0 
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
0006: [email protected] = 0 
000F: [email protected] -= 270.0 
0006: [email protected] = 0 
02F7: [email protected] = cosine [email protected] // (float) 
0006: [email protected] = 0 
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 

Veryzon
  • Veryzon

    Player Hater

  • Members
  • Joined: 15 Jun 2017
  • Brazil

#8

Posted 15 August 2017 - 01:56 AM Edited by Veryzon, 15 August 2017 - 03:31 AM.

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

:__proc__RotateMountedGunFromVehicle
0006: [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_11572
0681: 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.


David Thapa
  • David Thapa

    Player Hater

  • Members
  • Joined: 05 Jul 2017
  • India

#9

Posted 15 August 2017 - 03:15 AM

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





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users