Jump to content

[SA][H]Attach object to player and a new actor in object


Recommended Posts

I was trying to find a solution by myself, but without successful.
probably someone can tell any solution for this.
this is basically to have Wings in game, the new actor will be the wings.

 

Problem;

a) I attached the object to a bone, but when walking the actor attached to object, shakes. which is not too good. I'm not sure, why is this problem.
b) I used the opcode 069B: (attach to actor_offset) instead the opcode 070A: (attach on bone_actor) which works perfect, the "wings" are not shaking any more, BUT when walking, or performing an animation the object keeps static in the back, it will always be in the same postion, which is not too nice. :/
take a look;

a)

    const        WINGS       = 31@        dummy_obj   = 30@    end    0172: 8@ = actor $PLAYER_ACTOR Z_angle    04C4: store_coords_to 27@ 28@ 29@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 -18.6     009A: WINGS = create_actor_pedtype 8 model #SPECIAL06 at 27@ 28@ 29@     0107: dummy_obj = create_object 1582 at 27@ 28@ -25.0     0177: set_object dummy_obj Z_angle_to 8@     0382: set_object dummy_obj collision_detection 0     070A: AS_actor $PLAYER_ACTOR attach_to_object dummy_obj offset 0.3 -0.25 0.0 on_bone 17 16 perform_animation "NULL" IFP_file "NULL" time -1
//069B: attach_object dummy_obj to_actor $PLAYER_ACTOR with_offset 0.0 -0.5 0.0 rotation 0.0 0.0 0.0

04F4: put_actor WINGS into_turret_on_object dummy_obj offset_from_object_origin 0.0 0.0 -0.5 orientation 0 both_side_angle_limit 0.0 lock_weapon 1 0812: AS_actor WINGS perform_animation "ANIM" IFP_file "ANIM" 1.0 loopA 1 lockX 0 lockY 0 lockF 1 time -1 // versionB

 

I also used Ryosuke code, to attach an object to a bone;

0AB1: call_scm_func @ATEST_ATTACH 6 AS_actor $PLAYER_ACTOR attach_to_object PIV_OBJ offset -0.005 0.01 0.0 on_bone 17
but it works in the same way, as using opcode 070A: and the "wings" shakes, while walking or performing an animation.
someone can help me with this..? a tip, maybe

thanks ;):cookie::cookie::cookie:

 

 

try this setting

on_bone 7 1

7 seems to be root and with 1 for orientation it don't shake so much, maybe it needs to rotate the model in 3d editor

 

if not ok, then you could script an auto adjusting for attaching by 069B:

using a second, unvisible object attached to bone to get height and calculate offset for wing object attached by 069B:

try this setting

on_bone 7 1

7 seems to be root and with 1 for orientation it don't shake so much, maybe it needs to rotate the model in 3d editor

 

if not ok, then you could script an auto adjusting for attaching by 069B:

using a second, unvisible object attached to bone to get height and calculate offset for wing object attached by 069B:

 

thank you ZAZ :cookie:
your'e right, with on_bone 7 1 don't shake to much. but is still shaking.. :/

 

yes, I tried the second object too. but is still same problem, because, there is need to constantly put the wing_Dummy_object, in the new position;

070A: AS_actor $PLAYER_ACTOR attach_to_object dummy_obj1 offset 0.0 0.0 0.0 on_bone 17 16 perform_animation "NULL" IFP_file "NULL" time -1  // secon object in bone///-- in loop        01BB: store_object dummy_obj1 position_to 1@ 2@ 3@  // second object01BC: put_object dummy_obj at 1@ 2@ 3@///

or;

070A: AS_actor $PLAYER_ACTOR attach_to_object dummy_obj1 offset 0.0 0.0 0.0 on_bone 17 16 perform_animation "NULL" IFP_file "NULL" time -1  // secon object in bone///-- in loop 069A: attach_object dummy_obj to_object dummy_obj1 with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.0 0682: detach_object dummy_obj 0.0 0.0 0.0 collision_detection 0///

is still shaking while walking... :/

I also tried this one; which will avoid the use of objects, but it has the same result;

0AB1: call_scm_func @GET_BONE_OFFSET 5 actor $PLAYER_ACTOR bone 1 offset -1.0999 -0.0699 0.0 store_to 1@ 2@ 3@    // spine 101BC: put_object dummy_objs at 1@ 2@ 3@

it seems that all this, has effect frame by frame. :/ that's why it shakes.

and still without a solution :(

anyway, thank you very much! ;):cookie:

Edited by jayd00

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
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

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