View Single Post
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-23-2011 , 13:53   Re: Open the scientist's mouth.
Reply With Quote #13

Ok, I've found the solution.

It's funny to see the time passed on the problem when the solution is simple.
What is have bugged me is that, in CHostage:Spawn() :

SetBoneController(0, 0.0);
SetBoneController(1, 0.0);
SetBoneController(2, 0.0);
SetBoneController(3, 0.0);
SetBoneController(4, 0.0);

Notice the last line. Yes, controller should go from 0 to 3. Here, 4.

So I decide to play with SetBoneController() and when I do SetBoneController(3, 255.0), it returns 255.0.
Looking at the HLSDK, it returns your value either if the model pointer is invalid or the controller index was not found.
To understand, I've used the fakemeta version set_controller() and put some debug line to see the value of pbonecontroller->index and surprise, it returns 4.

Something you should see In HLMV, but you see "Mouth" instead as label. Looking at the HLMV code source, it appears there is a specific support for the mouth. So, 4 is for the mouth. By decompiling the model, you see well in the .qc : $controller 4 [...]. Reading the HLSDK(client), it seems this way is used to synchronize mouth movements.

So, the solution : Editing .qc file, changing 4 by a value <= 3, compiling and using a value between 0 and 64.

It works. .
__________________

Last edited by Arkshine; 01-23-2011 at 13:57.
Arkshine is offline