Alexander,

Sorry for the silence. The flu got me big time. Here the code. In this example im simply trying to give each entity different texture scaling, but they all end up with the same.

Note: The entities are created in runtime by another entity and given the same Action. They use the same model. They all have different skill2 values.


Code:
 bmap testsquares = <testsquares50.tga>;


function mtl_terr_view()
{

mtl.matrix22 = floatd(mtl.skill1,1);
mtl.matrix11 = floatd(mtl.skill1,1);

}

function mtl_terrer_init
{
mtl.skill1 = my.skill2*10;
mtl.event = mtl_terr_view;
mtl.enable_render=on;

}


material terry
{

skin1 = testsquares;
event = mtl_terrer_init;

effect ="

texture entSkin1;
texture mtlSkin1;

matrix matMtl;

technique scalex
{
pass p0
{

Texture[0]=<mtlSkin1>;

ColorArg1[0]=Texture;
ColorOp[0]=SELECTARG1;

TextureTransformFlags[0] = count2; // use u,v values
TextureTransform[0] = <matMtl>;
}

}
";
}