Your blending code works really great. Thank you very much for this contribution.

Perhaps you may find this tip useful if you want to optimize the code further:

You are spending several skills as 'flags', for instance, my.stand_blend and my.run_blend.

You can use bitwise operators to put several 'flags' in a single skill. For instance, if you assign bit values to flags variables or constants. This way you can combine, turn on and off several 'modes' in a single value. Also, this would save several lines of code.


For example:

//define flag constants
define stand_blend,1;
define run_blend,2;
define walk_blend,4;
define idle_blend, 8;
define rturn_blend, 16;
define lturn_blend, 32;
define lstrafe, 64;
define rstrafe, 128;
...

//Only one skill to define if these blends are on or off
define blendmode,skill38;


//Examples of usage:

//To turn ON the run_blend flag use | (bitwise or):
my.blendmode = my.blendmode | run_blend;

//short version
my.blendmode |= run_blend; //equivalent to "my.run_blend = 1";

//To turn OFF the walk_blend flag use ^ (bitwise exclusive or):
my.blendmode ^= walk_blend; //replaces to "my.walk_blend = 0"

//To check if a flag is ON use & (bitwise and)
if (my.blendmode & rturn_blend) //replaces like "if(my.rturn_blend ==1)"
{
//execute this if rturn_blend is included in the flags
}

//Delete all flags:
my.blendmode = 0;

//set several flags on
my.blendmode |= run_blend | walk_blend | idle_blend;

//set several flags off
my.blendmode ^= run_blend | walk_blend | idle_blend;



//Finally, to turn on a single flag and turn off the others:
my.blendmode = run_blend;

//this line replaces:
my.stand_blend = 0;
my.walk_blend = 0;
my.run_blend = 1;
my.idle_blend = 0;
my.rturn_blend = 0;
my.lturn_blend = 0;
my.lstrafe_blend = 0;
my.rstrafe_blend = 0;



The exception is walk_blend that could have a value of 2, but then you could add an extra flag for that.