ATTACH

It affects in only 1 frame.
It means that you have to call this in every frame and you can use this to any objects.

PHP:
:ATTACH
// 0AB1: @ATTACH 6 AS_actor $PLAYER_ACTOR attach_to_object 0@ offset 0.0 0.0 0.0 on_bone 6
0A9F: 6@ = current_thread_pointer
000A: 6@ += 0x44
0A96: 7@ = actor 0@ struct
0085: 0@ = 7@ // (int)
000A: 0@ += 0x18
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
0AA7: call_function 0x734A40 num_params 1 pop 1 0@ 0@ // _clumpGetFirstSkinAtomicHAnimHierarchy
0012: 5@ *= 0x4
000A: 5@ += 0x488
005A: 5@ += 7@ // (int)
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
000A: 5@ += 0x14
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
0A8D: 7@ = read_memory 0x7C51E0 size 4 virtual_protect 1
if    
0039: 7@ == 0x424548B
then    
    0AA7: call_function 0x7C51E0 num_params 2 pop 2 5@ 0@ 5@ // _RpHAnimIDGetIndex    
    0AA7: call_function 0x7C5160 num_params 1 pop 1 0@ 0@ // _RpHAnimHierarchyGetMatrixArray    
    0012: 5@ *= 0x40    
    005A: 5@ += 0@ // (int)    
    0AA5: call 0x7EDDD0 num_params 4 pop 4 5@ 1 6@ 6@
else    
    0AA7: call_function 0x7C51A0 num_params 2 pop 2 5@ 0@ 5@ // _RpHAnimIDGetIndex    
    0AA7: call_function 0x7C5120 num_params 1 pop 1 0@ 0@ // _RpHAnimHierarchyGetMatrixArray    
    0012: 5@ *= 0x40    
    005A: 5@ += 0@ // (int)    
    0AA5: call 0x7EDD90 num_params 4 pop 4 5@ 1 6@ 6@
end
0177: set_object 1@ Z_angle_to 0.0
0A98: 1@ = object 1@ struct
000A: 1@ += 0x14
0A8D: 0@ = read_memory 1@ size 4 virtual_protect 0
000A: 1@ += -0x14
0AA6: call_method 0x411990 struct 1@ num_params 0 pop 0 // sub_411990
0AA6: call_method 0x59AD20 struct 0@ num_params 1 pop 0 5@ // _CMatrix__copyTo
0AA6: call_method 0x4241C0 struct 1@ num_params 1 pop 0 6@ // sub_4241C0
000A: 1@ += 0x18
0A8D: 7@ = read_memory 1@ size 4 virtual_protect 0
if    
8039:   not  7@ == 0
then    
    000A: 7@ += 0x4    
    0A8D: 7@ = read_memory 7@ size 4 virtual_protect 0    
    000A: 7@ += 0x10    
    0AA6: call_method 0x59AD70 struct 0@ num_params 1 pop 0 7@ // _CMatrix__copyTo
end
000A: 1@ += -0x18
0AA6: call_method 0x532B00 struct 1@ num_params 0 pop 0 // _RwFrameUpdateObject
0AB2: ret 0
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
It affects in only 1 frame.
It means that you have to call this in every frame and you can use this to any objects.

PHP:
:ATTACH
// 0AB1: @ATTACH 6 AS_actor $PLAYER_ACTOR attach_to_object 0@ offset 0.0 0.0 0.0 on_bone 6
0A9F: 6@ = current_thread_pointer
000A: 6@ += 0x44
0A96: 7@ = actor 0@ struct
0085: 0@ = 7@ // (int)
000A: 0@ += 0x18
0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0
0AA7: call_function 0x734A40 num_params 1 pop 1 0@ 0@ // _clumpGetFirstSkinAtomicHAnimHierarchy
0012: 5@ *= 0x4
000A: 5@ += 0x488
005A: 5@ += 7@ // (int)
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
000A: 5@ += 0x14
0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
0A8D: 7@ = read_memory 0x7C51E0 size 4 virtual_protect 1
if   
0039: 7@ == 0x424548B
then   
    0AA7: call_function 0x7C51E0 num_params 2 pop 2 5@ 0@ 5@ // _RpHAnimIDGetIndex   
    0AA7: call_function 0x7C5160 num_params 1 pop 1 0@ 0@ // _RpHAnimHierarchyGetMatrixArray   
    0012: 5@ *= 0x40   
    005A: 5@ += 0@ // (int)   
    0AA5: call 0x7EDDD0 num_params 4 pop 4 5@ 1 6@ 6@
else   
    0AA7: call_function 0x7C51A0 num_params 2 pop 2 5@ 0@ 5@ // _RpHAnimIDGetIndex   
    0AA7: call_function 0x7C5120 num_params 1 pop 1 0@ 0@ // _RpHAnimHierarchyGetMatrixArray   
    0012: 5@ *= 0x40   
    005A: 5@ += 0@ // (int)   
    0AA5: call 0x7EDD90 num_params 4 pop 4 5@ 1 6@ 6@
end
0177: set_object 1@ Z_angle_to 0.0
0A98: 1@ = object 1@ struct
000A: 1@ += 0x14
0A8D: 0@ = read_memory 1@ size 4 virtual_protect 0
000A: 1@ += -0x14
0AA6: call_method 0x411990 struct 1@ num_params 0 pop 0 // sub_411990
0AA6: call_method 0x59AD20 struct 0@ num_params 1 pop 0 5@ // _CMatrix__copyTo
0AA6: call_method 0x4241C0 struct 1@ num_params 1 pop 0 6@ // sub_4241C0
000A: 1@ += 0x18
0A8D: 7@ = read_memory 1@ size 4 virtual_protect 0
if   
8039:   not  7@ == 0
then   
    000A: 7@ += 0x4   
    0A8D: 7@ = read_memory 7@ size 4 virtual_protect 0   
    000A: 7@ += 0x10   
    0AA6: call_method 0x59AD70 struct 0@ num_params 1 pop 0 7@ // _CMatrix__copyTo
end
000A: 1@ += -0x18
0AA6: call_method 0x532B00 struct 1@ num_params 0 pop 0 // _RwFrameUpdateObject
0AB2: ret 0

How is it different from:
Code:
04F4: put_actor 37@ into_turret_on_object 52@ offset_from_object_origin 2.85 -0.7 5.9 orientation 0 both_side_angle_limit 360.0 lock_weapon 0
070A: AS_actor 358@ attach_to_object 359@ offset 0.0 0.0 0.0 on_bone 6 16 perform_animation "NULL" IFP_file "NULL" time 1

Is doing one frame an advantage? I think you can do that by:
Code:
while true // attach actor to object per loop
    wait 0
    
    0470: 1@ = actor $PLAYER_ACTOR current_weapon
    06A7: put_actor $PLAYER_ACTOR into_turret_on_car 0@ at_car_offset -0.2 0.5 0.0 position 1 shooting_angle 0.0 360.0 with_weapon 1@
    0465: remove_actor $PLAYER_ACTOR from_turret_mode
end
 
Top