I am assuming you are getting the bones in code, not in editor seen as you are in the runtime forum, not editor forum
I have to assume you are getting the bones via
skeleton->bones[IDOFBBONE]
there is no particular way of ensuring a bone will remain the same ID, especially if your assets are constantly being edited. what you really want to do is on load use
spSkeleton_findBone
, find all the bones and store their id. Then you can use
skeleton->bones[STOREDIDOFBBONE]
.