"Log: Warning: Invalid bone index (-1) for GetBoneRotation" reported every time another player shoots

Issue #300 resolved
Colin Basnett created an issue

Not sure when this happened.

Comments (4)

  1. Matt Hands

    I can see the problem is in DHWeaponAttachment.SpawnShells() function, where it tries to get bone for rotation for ShellEjectionBoneName. Default bone name is 'weapon_eject' and I guess some weapons don't have that bone.

    This function was modified in commit 2961339, but I don't see that causing the problem. Except that the former default property bSpawnShellsOutBottom=true for deleted class DHMGWeaponAttachment hasn't been added to weapon classes that used to extend DHMGWeaponAttachment (30 cal, MG34, MG42), but which no longer inherit true as default. That will cause them to try to access the ShellEjectionBoneName, when previously they wouldn't, but that isn't the cause of the problem.

    Maybe just a simple ShellEjectionBoneName != '''. But will do some further investigation when I'm back on.

  2. Matt Hands

    No, not just a simple ShellEjectionBoneName != ''', as there is always a bone name, just not always a bone ! I can't see an Unreal function to check if a particular bone exists in a mesh (similar to how HasAnim() function can be used to make sure an animation exists.

    Pretty sure this is a very old bug, not something new. I see it in reported DH logs going back to 2009. And I've noticed it logging over the past couple of years when testing with bots (thought it was a bot-related error, but clearly not).

    I've logged different weapons as they spawn, with a GetBoneRotatation to see which ones log bone errors. The RO weapons are ok but all the new DH weapons don't have the named bone. I guess it will be a case of finding suitable bone names for each weapon and added to def props. I hope each DH weapon, or at least most of them, has used a standard shell eject bone name, otherwise groan ........

  3. Matt Hands

    Good news - looks like all but one DH weapons have an 'ejector' bone ! Enfield no.2 pistol being the exception, but I'll pick another bone for that. This should sort it.

  4. Log in to comment