What he means is, that you should copy your code into a new file and save it as (for example) shader.fx ...

Code:
 ///////////////////////////////////////////////////////////

// FFP Terrain MultiTexturing Effect
//
// By: Eric A. Hendrickson-Lambert (Steempipe)
//
// Rev. 04.05.04.1
//
// Description:
// Using 2 tileable textures and an alphamap for blending.
// This code uses (2) passes because more than 2 stages would be needed
// for 1 pass. The First Fallback Technique is just a 2 stage 1 pass but
// has the transformation. The second fallback has no transformation.
//
//////////////////////////////////////////////////////////


// A tileable texture
//bmap grass = <tilegrass.bmp>;


//RGB Channels are blank
//The A channel has the blending weight (pattern)
bmap blendmap = <blendme.tga>;

// A tileable texture
//bmap sand = <tilesand.bmp>;


function mtl_terraintex_init()
{


//bmap_to_mipmap(mtl.skin1);
bmap_to_mipmap(mtl.skin2);
//bmap_to_mipmap(mtl.skin3);

//
// Adjust the texture transform to do some tiling of the textures
//
mtl.matrix11 = float(18); // default u scale
mtl.matrix22 = float(18); // default v scale

}



material mat_terraintex
{
//skin1 = grass;
Skin2 = blendmap;
//skin3 = sand;

// define a material effect string

event = mtl_terraintex_init;

effect =
"

matrix matMtl;


texture entSkin1; // Grass
texture mtlSkin2; // Alpha Blending Map
texture entSkin2; // sand
texture entSkin3; // detailmap
texture entSkin4; // Basic Skin



// default technique


technique ffp_terrain_tex
{
pass P0
{

alphablendenable=false;

//
// Stage 0
//
Texture[0] = <entSkin1>;

magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;



TextureTransformFlags[0] = Count2;
TextureTransform[0] = <matMtl>;
texcoordindex[0]=0;

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

alphaop[0]=disable;

//
//stage 1
//
colorop[1]=disable;
alphaop[1]=disable;

}

pass P1
{

// We need to enable alphablending

alphablendenable=true;
srcblend=srcalpha;
destblend=invsrcalpha;

//
// Stage 0
//
Texture[0] = <mtlSkin2>;

magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;

//
// We don't want the alphamap to tile
//
TextureTransformFlags[0] = disable;

texcoordindex[0]=1;

ColorArg1[0] = current;
ColorOp[0] = selectarg1;
alphaarg1[0] = texture | alphareplicate;
alphaop[0]=selectarg1;

//
// Stage 1
//
Texture[1] = <entSkin2>;//sand

magFilter[1]=linear;
minFilter[1]=linear;
mipFilter[1]=linear;


TextureTransformFlags[1] = Count2;
TextureTransform[1] = <matMtl>;
texcoordindex[1]=0;

ColorArg1[1] = texture;
ColorOp[1] = modulate;
alphaarg1[1] = current | alphareplicate;
alphaop[1]=disable;

//
// Stage 2
//
colorop[2]=disable;
alphaop[2]=disable;


}



}


technique firstfallback
{
pass P0
{
//
// Stage 0
//
Texture[0] = <entSkin4>;

magFilter[0]=linear;
minFilter[0]=linear;
mipFilter[0]=linear;

texcoordindex[1]=0;

ColorArg1[0] = Texture;
ColorArg2[0] = Diffuse;
ColorOp[0] = Modulate;
//
// Stage 1
//
Texture[1] = <entSkin3>;

magFilter[1]=linear;
minFilter[1]=linear;
mipFilter[1]=linear;


TextureTransformFlags[1] = Count2;
TextureTransform[1] = <matMtl>;
texcoordindex[1]=1;

ColorArg1[1] = texture;
ColorArg2[1] = Current;
ColorOp[1] = addsigned;


}
}



technique secondfallback
{
pass P0
{
//
// Stage 0
//
Texture[0] = <entSkin4>;

ColorArg1[0] = Texture;
//ColorArg2[0] = Diffuse;
ColorOp[0] = selectarg1;

//
// Stage 1
//
Texture[1] = <entSkin4>;

ColorArg1[1] = texture;
ColorArg2[1] = Current;
ColorOp[1] = modulate;

}
}


"; // end of the effect string

}



action ffp_TerrainTex
{
my.material = mat_terraintex;
}



Is this the code you are using?

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software