Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. After Hours
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

f0r357punk

How to attach entity properly?

Recommended Posts

f0r357punk

Hello everyone!

Im trying to attach prop_police_id_board correctly to the left hand. Im used All finger's bone's id's and some left hand id's with no luck. Here is id's im used: 26610, 4089, 4090, 26611, 4169, 4170, 26612, 4185, 4186, 26613, 4137, 4138, 26614, 4153, 4154, 18905, 36029, 60309.

Screenshot attached.

 

Thank you!

 




 

Share this post


Link to post
Share on other sites
LeeC2202

In what language? C++, VB, C#, Lua, RPH?

 

If you show the code you're using, people can work out what might be wrong.

Share this post


Link to post
Share on other sites
f0r357punk

Thank for your reply! Language is C#

Share this post


Link to post
Share on other sites
LeeC2202
14 minutes ago, f0r357punk said:

Thank for your reply! Language is C#

And the code that you're using that doesn't work?

Share this post


Link to post
Share on other sites
f0r357punk
int SignObject1 = API.GetHashKey("prop_police_id_board");
int SignObject2 = API.GetHashKey("prop_police_id_text");



Vector3 handPos = Function.Call<Vector3>(Hash.GET_PED_BONE_COORDS, CharA, 58868, 0f, 0f, 0f);

int SignProp1 = API.CreateObject(SignObject1, handPos.X, handPos.Y, handPos.Z, true, true, false);
int SignProp2 = API.CreateObject(SignObject2, handPos.X, handPos.Y, handPos.Z, true, true, false);

Function.Call(Hash.ATTACH_ENTITY_TO_ENTITY, SignProp1, CharA, Function.Call<int>(Hash.GET_PED_BONE_INDEX, CharA, 58868), 0.12f, 0.24f, 0.0f, 5.0f, 0.0f, 70.0f, true, true, false, false, 2, true);
            Function.Call(Hash.ATTACH_ENTITY_TO_ENTITY, SignProp2, CharA, Function.Call<int>(Hash.GET_PED_BONE_INDEX, CharA, 58868), 0.12f, 0.24f, 0.0f, 5.0f, 0.0f, 70.0f, true, true, false, false, 2, true);

 

Share this post


Link to post
Share on other sites
LeeC2202

Hmmm, I have no idea what API you're using there, it isn't ScriptHookVDotNet, is it RPH?

 

In SHVDN I would do this:

    int boneIndex = CharA.GetBoneIndex(Bone.SKEL_L_Hand);
    SignProp1.AttachTo(CharA, boneIndex, new Vector3(0.2089f,0.0662f,0.0675f), new Vector3(151.4672f,37.1995f,-145.3044f));

The first Vector3 is the offset position and the second one is the rotation. I end up with strange rotation values because I get gimbal-lock with my attachment tool, so I have to mess about to get it in just the right position. I don't understand quaternions... at all.

 

That gets me this result

sh7Gidj.jpg

Edited by LeeC2202

Share this post


Link to post
Share on other sites
f0r357punk

Thanks for help, what tool are you using?

Share this post


Link to post
Share on other sites
LeeC2202
12 minutes ago, f0r357punk said:

Thanks for help, what tool are you using?

It's one I wrote myself, I create various modding tools while I am working on my mods.

Share this post


Link to post
Share on other sites
f0r357punk

Also script doesnt working, board is in hands but it rotated to 90 degrees.

Is there any public tool that i can use to figure out what coord do i need to attach props?

Im also looked in to decompiled scripts and dont find coords or any like this for correctly attaching that god dame board. Q_Q

Share this post


Link to post
Share on other sites
LeeC2202

I have never seen another tool to attach props, which is why I had to write one.

 

How is it supposed to be attached? I don't know what that prop is, so I thought you held it like in the picture I posted. Is it supposed to be held a different way? Does it only work with a certain animation?

 

Is it supposed to be one of these?

obama-in-prison-1-1.jpg

 

In maintransition.c I found this...

 

ENTITY::ATTACH_ENTITY_TO_ENTITY(uParam1->f_18[iParam2 /*4*/].f_1, *iParam0, PED::GET_PED_BONE_INDEX(*iParam0, 28422), 0f, 0f, 0f, 0f, 0f, 0f, 0, 0, 0, 0, 2, 1);

They attach it to this bone PH_R_Hand. That script contains this police id board prop and seems connected to the mugshot room, so it seems related.

 

Edited by LeeC2202

Share this post


Link to post
Share on other sites
LeeC2202
31 minutes ago, f0r357punk said:

Its need to be something like that.

Its used with animations: [email protected]@male_a "Intro" and [email protected]@male_b "Intro" 

Those animations are also used in that same script, so I think it's definitely worth trying those values.

 

I think the PH bones are used with animations because I used the same bone with the vending machine animations and the soda can. I think the PH is for PHysics.

Share this post


Link to post
Share on other sites
f0r357punk

Thouse values also didnt worked👹

Share this post


Link to post
Share on other sites
LeeC2202
1 hour ago, f0r357punk said:

Thouse values also didnt worked👹

I am afraid I have to disagree with that.

 

TXnkBpz.jpg

Edited by LeeC2202

Share this post


Link to post
Share on other sites
f0r357punk

I will try that value again. Now my script wont work in any way (advanced anim doesnt work now wtf), thank you for your help!

Share this post


Link to post
Share on other sites

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

  • 1 User Currently Viewing
    0 Members, 0 Anonymous, 1 Guest

×

Important Information

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