Quantcast

Jump to content

» «
Photo

rotate car custom component

3 replies to this topic
HeresOtis
  • HeresOtis

    Mark Chump

  • Members
  • Joined: 29 Apr 2011

#1

Posted 25 June 2013 - 09:59 PM

Is it possible to rotate a car's component to make it turn? I have a custom component named spotlight_dummy on a police car. I want to make it functional.
I'm using DK's New Opcodes.

aStiffSausage
  • aStiffSausage

    Formerly Oksu

  • Members
  • Joined: 30 Sep 2010
  • Finland

#2

Posted 26 June 2013 - 10:34 AM

No idea if this will work, but could you just attach an invisible object to where dummy is, and then set rotation for it?

These two might help you if you can't find another way:
CODE

0D0C: get_car 0@ component "wheel_lf_dummy" matrix_pointer_to 1@ // IF and SET
0D06: get_matrix 0@ position_to 1@ 2@ 3@

HeresOtis
  • HeresOtis

    Mark Chump

  • Members
  • Joined: 29 Apr 2011

#3

Posted 26 June 2013 - 06:48 PM

If I do attach an object, will it make the component, itself, rotate?

HeresOtis
  • HeresOtis

    Mark Chump

  • Members
  • Joined: 29 Apr 2011

#4

Posted 03 July 2013 - 04:18 PM

I found this code which makes the newsvan's satellite spin around.
CODE
0@ = Actor.CurrentCar($PLAYER_ACTOR)
0A97: 1@ = car 0@ struct
1@ += 0x68C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
if
  not 1@ == 0
jf @Noname_395
1@ += 0x9C
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
if
  not 1@ == 0
jf @Noname_395
0085: 30@ = 1@ // (int)
30@ += 64
0A8D: 2@ = read_memory 30@ size 4 virtual_protect 0
0A8D: 12@ = read_memory 30@ size 4 virtual_protect 0
30@ += 4
0A8D: 13@ = read_memory 30@ size 4 virtual_protect 0
30@ += 4
0A8D: 14@ = read_memory 30@ size 4 virtual_protect 0
30@ -= 56

:Noname_234
  Actor.InCar($PLAYER_ACTOR, 0@)
jf @Noname_395
3@ += 0.03
0AA6: call_method 0x59B120 30@ num_params 3 pop 0 3@ 0.0 0.0  
30@ += 48
0A8C: write_memory 30@ size 4 value 12@ virtual_protect 0
30@ += 4
0A8C: write_memory 30@ size 4 value 13@ virtual_protect 0
30@ += 4
0A8C: write_memory 30@ size 4 value 14@ virtual_protect 0
30@ -= 56


What does car struct + 0x68C point to? How can I incorporate this to make my spotlight_dummy spin around?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users