//How to use:
/*
// to spawn a bot
- local entity oldself;
+ entity oldself;
oldself = self;
self = spawnclient();
if (!self)
self = oldself;
// to remove all bots
- local entity head;
+ entity head;
head = find(world, classname, "player");
while (head)
{
//"leftarm" (which is a child of "torso") which would return 2 instead...
float(float skel, float bonenum, string g1, string g2, string g3, string g4, string g5, string g6) example_skel_findbonegroup =
{
- local string bonename;
+ string bonename;
while (bonenum >= 0)
{
bonename = skel_get_bonename(skel, bonenum);
// apply a different framegroup animation to bones with a specified parent
void(float animmodelindex, float framegroup, float framegroupstarttime, float blendalpha, string groupbonename, string excludegroupname1, string excludegroupname2) example_skel_player_update_applyoverride =
{
- local float bonenum;
- local float numbones;
+ float bonenum;
+ float numbones;
self.frame = framegroup;
self.frame2 = 0;
self.frame3 = 0;
// make eyes point at a target location, be sure v_forward, v_right, v_up are set correctly before calling
void(vector eyetarget, string bonename) example_skel_player_update_eyetarget =
{
- local float bonenum;
- local vector ang;
- local vector oldforward, oldright, oldup;
- local vector relforward, relright, relup, relorg;
- local vector boneforward, boneright, boneup, boneorg;
- local vector parentforward, parentright, parentup, parentorg;
- local vector u, v;
- local vector modeleyetarget;
+ float bonenum;
+ vector ang;
+ vector oldforward, oldright, oldup;
+ vector relforward, relright, relup, relorg;
+ vector boneforward, boneright, boneup, boneorg;
+ vector parentforward, parentright, parentup, parentorg;
+ vector u, v;
+ vector modeleyetarget;
bonenum = skel_find_bone(self.skeletonindex, bonename) - 1;
if (bonenum < 0)
return;