Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Getting boneId from natives

Featured Replies

I'm trying to get a boneId from the face (since rage only provides neck) cause when the head moves objects attachted to the neck do not move along.

int GET_ENTITY_BONE_INDEX_BY_NAME(Entity entity, char *boneName) // FB71170B7E76ACBA 

How do i pass this char? the bone name is "FB_Tongue_000"

Easy:

NativeFunction.CallByName<int>("GET_ENTITY_BONE_INDEX_BY_NAME", entity, "FB_Tongud_000");

Basically char* is how the nativeDB represents the strings. It has an explanation, it's not something trivial, a string is an array of chars and an array is a pointer that refers to the objects added to the array, so, like all the other pointers, it's represented by the asterisk(*).

If you search a bit about how arrays are pointers you will find a better explanation.

  • Author

The above is what i tried, it's always -1.

I even tried it with "SKEL_Head", which should exist on every ped, nothing

"IK_Head" works, thanks :)

Edited by khorio

6 minutes ago, khorio said:

The above is what i tried, it's always -1.

I even tried it with "SKEL_Head", which should exist on every ped, nothing

"IK_Head" works, thanks :)

Why don't you use Entity.GetBoneIndex() instead? The Ped method also accepts the PedBoneId enum.

  • Author
8 minutes ago, alexguirre said:

Why don't you use Entity.GetBoneIndex() instead? The Ped method also accepts the PedBoneId enum.

Because i never saw "Head" in the enums...dear lord..

  • Author

While I'm asking stupid questions alex :p

NativeFunction.Natives.REQUEST_PTFX_ASSET("cs_cig_smoke");
NativeFunction.Natives.SET_PTFX_ASSET_NEXT_CALL("cs_cig_smoke");
int smoke = Rage.Native.NativeFunction.CallByName<int>("START_PARTICLE_FX_LOOPED_ON_ENTITY", "cs_cig_smoke", cigar, 0.05f, 0f, 0f, 0f, 0f, 90f, 0x3F800000, 0, 0, 0);

from the decompiled files:

STREAMING::REQUEST_PTFX_ASSET();
l_309 = OBJECT::CREATE_OBJECT(0xAB0F542F, -1850.139f, -1250.253f, 8.59f, 1, 1, 0);
ENTITY::ATTACH_ENTITY_TO_ENTITY(l_309, PLAYER::PLAYER_PED_ID(), PED::GET_PED_BONE_INDEX(PLAYER::PLAYER_PED_ID(), 28422), 0f, 0f, 0f, 0f, 0f, 180f, 0, 0, 0, 0, 2, 1);
GRAPHICS::START_PARTICLE_FX_LOOPED_ON_ENTITY("cs_cig_smoke", l_309, 0.05f, 0f, 0f, 0f, 0f, 90f, 0x3F800000, 0, 0, 0);

Only crashing, don't know if you've messed with particles yourself

8 hours ago, khorio said:

<snip>

I only used a bit the non looped particles, this is what I used:

        public static void StartParticleFxNonLoopedOnEntity(string ptfxAsset, string effectName, Entity entity, Vector3 offset, Rotator rotation, float scale)
        {
            const ulong HasNamedPtfxAssetLoadedHash = 0x8702416e512ec454;
            const ulong SetPtfxAssetNextCall = 0x6c38af3693a69a91;
            const ulong RequestNamedPtfxAsset = 0xb80d8756b4668ab6;

            NativeFunction.CallByHash<uint>(RequestNamedPtfxAsset, ptfxAsset);
            while (!NativeFunction.CallByHash<bool>(HasNamedPtfxAssetLoadedHash, ptfxAsset))
            {
                GameFiber.Sleep(25);
                NativeFunction.CallByHash<uint>(RequestNamedPtfxAsset, ptfxAsset);
                GameFiber.Yield();
            }

            NativeFunction.CallByHash<uint>(SetPtfxAssetNextCall, ptfxAsset);
            NativeFunction.CallByName<uint>("START_PARTICLE_FX_NON_LOOPED_ON_ENTITY", effectName, entity, offset.X, offset.Y, offset.Z, rotation.Pitch, rotation.Roll, rotation.Yaw, scale, false, false, false);
            // or START_PARTICLE_FX_NON_LOOPED_AT_COORD
        }

I don't remember why I used the hashes for the natives, I suppose the real name wasn't found when I wrote that code.
And you should be able to use any START_PARTICLE_FX native with that code.

  • Author

for some reason it never gets loaded, stays in the while.

c.StartParticleFxLoopedOnEntity("scr_fm_mp_missioncreator", "scr_sh_cig_smoke", cigar, new Vector3(0f, 0f, 0f), new Rotator(0f, 0f, 0f), 2.0f);

 

tried a bunch of different assets and ptfx

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.