Quantcast

Jump to content

» «
Photo

get object rotation X and Y

  • This topic is locked This topic is locked
3 replies to this topic
Baragrasnki
  • Baragrasnki

    Player Hater

  • Members
  • Joined: 24 Jan 2013

#1

Posted 12 August 2013 - 04:59 PM

Hello!

With this opcode

0176: [email protected] = object [email protected] Z_angle

i can return the object Z_angle but i need the X and the Y

i have tried

0176: [email protected] = object [email protected] X_angle

but it gives Z angle.

Which opcodes should i Use?


Thank you

Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer

  • Feroci
  • Joined: 19 Aug 2006
  • Unknown
  • Contribution Award [Mods]

#2

Posted 12 August 2013 - 06:51 PM

Z_angle is only the user-made description of the preceding argument and will be skipped by the compiler during the decompilation. The only significant parts of the command (also known as "opcode" according to the old naming convention) are its ID and arguments (math commands make an exception though). You should have tried to search for another command rather than changing the arguments tag uselessly. Sadly, there's no such command which retrives the X or Y angle of both an actor and an object. We need to find a workaround way to do so. Here we are:

Baragrasnki
  • Baragrasnki

    Player Hater

  • Members
  • Joined: 24 Jan 2013

#3

Posted 12 August 2013 - 08:30 PM Edited by Baragrasnki, 12 August 2013 - 08:54 PM.

Oh thanks it seems to work

I have this codes but [email protected] [email protected] [email protected] returns all 0.000 0.000 0.000 even if i'm not, and the [email protected] (the distance) is 0 too.

CODE
              01BB: get_object_coordinates [email protected] store_to [email protected] [email protected] [email protected]
               00A0: store_actor $PLAYER_ACTOR position_to [email protected] [email protected] [email protected]

               050A: get_distance_between_coords_3d [email protected] [email protected] [email protected] and [email protected] [email protected] [email protected] store_to [email protected]

rehico
  • rehico

    Player Hater

  • Members
  • Joined: 26 Oct 2010

#4

Posted 19 June 2014 - 08:59 AM


const
   RAD_TO_DEG = 57.295776
end
 
 
0AA6: call_method 0x006A6050 struct [email protected] num_params 0 pop 0 // CVehicle__getAngleX
0AE9: pop_float [email protected]
[email protected] *= RAD_TO_DEG
0656: get_angle [email protected] absolute_degrees_to [email protected]
 
0AA6: call_method 0x006A6010 struct [email protected] num_params 0 pop 0 // CVehicle__getAngleY
0AE9: pop_float [email protected]
0656: get_angle [email protected] absolute_degrees_to [email protected]
 
// [email protected] and [email protected] will contain respectively the X and Y angle of the entity.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users