Here is my main script:

Code:


////////////////////////////////////////////////////////////////////////
// A6 main wdl:
// Created by WED.
////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////
// The PATH keyword gives directories where template files can be found.
path "D:\\Programme\\GStudio6\\template_6"; // Path to A6 templates directory
path "D:\\Programme\\GStudio6\\template_6\\code"; // Path to A6 template code subdirectory
path "D:\\Programme\\GStudio6\\template_6\\images"; // Path to A6 template image subdirectory
path "D:\\Programme\\GStudio6\\template_6\\sounds"; // Path to A6 template sound subdirectory
path "D:\\Programme\\GStudio6\\template_6\\models"; // Path to A6 template model subdirectory

/////////////////////////////////////////////////////////////////
// Filename of the starting level.
string level_str = <testraum.WMB>; // give file names in angular brackets

////////////////////////////////////////////////////////////////////////////
// Included files


path ".\\tex_spec_diff_maps"; //normal mapping
path ".\\tex_src"; //normal mapping

include <DrewParticles.wdl>;//crap i couldnt take out
include <newtonparticles.wdl>;//crap i couldnt take out
include <gid01.wdl>;
include <display00.wdl>;


include <gid01.wdl>; // global ids
include <display00.wdl>; // basic display settings
include <plSelect.wdl>;
include <cameraTarget.wdl>;
include <miscInput01.wdl>;

string shader_file_lvl = <normalmap_level_ps2.0.fx>;//mat_lighting_lvl.fx normal mapping
string shader_file_ent = <normalmap_ent_ps2.0.fx>;//mat_lighting_ent.fx normal mapping



include <plBipedInput01.wdl>;
include <bipedPhy01.wdl>;
include <bipedAnim01.wdl>;
include <bipedSnd01.wdl>;
include <plBiped01.wdl>;
include <cameraSelect.wdl>;
include <camera1stPerson01.wdl>;
include <trigger00.wdl>;
include <particle00.wdl>;
include <weaponfx00.wdl>;
include <weapons00.wdl>;
include <plBipedWeap00.wdl>;
include <plBipedWeapHUD01.wdl>;
include <feuer.wdl>;

var move_vec[3] = 0,0,0; // I placed this right after my var video_ lines for now
var idle_percent = 0;
var walk_percent = 0;


/////////////////////////////////////////////////////////////////



// DX9 Normal mapping / Bump mapping shader
// Multi source Per pixel Lighting
// shader by Matt_Aufderheide
//
// Tutorial and Demo level by Drew Medina (www.drewmedina.com)
//
// This is a sort of mix and match from the forums. Matt's shader, converted to 2.0 by Steempipe, and structured by Nadester
// included textures are taken from Nadesters demo. I have no idea where they come from...so dont use them for commercial..

// see below web links for more help...this test scene should be pretty self explanatory...
//for some reason more than 2 lights wont work. may be scale, or I may have screwed some code up ;)


// HUGE thanks to:
// Matt_Aufderheide (normal mapping shader- http://www.conitecserver.com/ubbthreads/showflat.php?Cat=&Number=455821&Main=452466#Post455821)
// Steempipe (conversion to 2.0 (AWESOME) and help)
// Nadester's "My Normal Mapping Demo - Free open source!"
// (http://www.conitecserver.com/ubbthreads/showflat.php?Cat=&Number=454772&page=0&view=collapsed&sb=5&o=&fpart=1#454772)
//
//




var d3d_automaterial=1;

//quick world texture: you can just replace Nadester's... replace both textures in both folders with new texture, same name. restart WED.
// its in src wad (textures)


//Normal maps
bmap maps01 = <cmet01_maps.tga>;
bmap maps04 = <gmet01_maps.tga>;
bmap maps02 = <dmet01_maps.tga>;
//bmap maps03 = <fmet01_maps.tga>;
//bmap maps05 = <pmet01_maps.tga>;
//bmap maps06 = <pmet03_maps.tga>;
//bmap maps07 = <pmet04_maps.tga>;
//bmap maps08 = <rock01_maps.tga>;
//bmap maps09 = <tmet01_maps.tga>;
//bmap maps10 = <tmet03_maps.tga>;
//bmap maps11 = <tmet04_maps.tga>;
//bmap maps12 = <wmet01_maps.tga>;
//bmap maps13 = <wmet02_maps.tga>;
//bmap maps14 = <wmet03_maps.tga>;

material mat_norm_ent
{
flags = tangent;
}

action Shdr_NormalMap
{
my.material = mat_norm_ent;
my.enable_scan=on;
}

material cmet01_tga{
skin1 = maps01;flags = tangent;}
material dmet01_tga{
skin1 = maps02;flags = tangent;}
//material fmet01_tga{
// skin1 = maps03;flags = tangent;}
material gmet01_tga{
skin1 = maps04;flags = tangent;}
//material pmet01_tga{
// skin1 = maps05;flags = tangent;}
// material pmet03_tga{
// skin1 = maps06;flags = tangent;}
//material pmet04_tga{
// skin1 = maps07;flags = tangent;}
//material rock01_tga{
// skin1 = maps08;flags = tangent;}
//material tmet02_tga{
// skin1 = maps09;flags = tangent;}
//material tmet03_tga{
// skin1 = maps10;flags = tangent;}
// material tmet01_tga{
// skin1 = maps11;flags = tangent;}
//material tmet04_tga{
// skin1 = maps11;flags = tangent;}
//material wmet01_tga{
// skin1 = maps12;flags = tangent;}
//material wmet02_tga{
// skin1 = maps13;flags = tangent;}
//material wmet03_tga{
// skin1 = maps14;flags = tangent;}
}


var light_dist=2700; //Distance Light LOD...this is how far away from a light you can be until it shuts off/on

action light_pos_object
{
wait(5);
my.invisible=on;
my.passable=on;
//NewtonCreateGravityEntity (wood_material);
while(1)
{

if vec_dist(my.x, player.x )<light_dist// or camera
{

my.light=on;
my.lightrange=1800; //could be set also to a skill

my.red= my.skill1; //just put in the r,g,b values
my.green= my.skill2;
my.blue= my.skill3;

my.cast=on; //casts a shadow when on
}


else
{
my.lightrange=0; //if too far away turn it off
my.light=off;
my.cast=off;

}

wait(1);
}






}

function load_shaders()
{
effect_load(cmet01_tga,shader_file_lvl);
//effect_load(dmet01_tga,shader_file_lvl);
//effect_load(fmet01_tga,shader_file_lvl);
effect_load(gmet01_tga,shader_file_lvl);
// effect_load(pmet01_tga,shader_file_lvl);
// effect_load(pmet03_tga,shader_file_lvl);
// effect_load(pmet04_tga,shader_file_lvl);
// effect_load(rock01_tga,shader_file_lvl);
// effect_load(tmet01_tga,shader_file_lvl);
// effect_load(tmet03_tga,shader_file_lvl);
// effect_load(tmet04_tga,shader_file_lvl);
// effect_load(wmet01_tga,shader_file_lvl);
// effect_load(wmet02_tga,shader_file_lvl);
// effect_load(wmet03_tga,shader_file_lvl);effect_load(dru_brik1_tga,shader_file_lvl);



effect_load(mat_norm_ent,shader_file_ent);

wait(5);
}





/////////////////////////////////////////////////////////////////
// define a splash screen with the required A4/A5 logo
bmap splashmap = <logodark.pcx>; // the default logo in templates
panel splashscreen {
bmap = splashmap;
flags = refresh,d3d;
}


function main()
{
// center the splash screen for non-640x480 resolutions, and display it
splashscreen.pos_x = (screen_size.x - bmap_width(splashmap))/2;
splashscreen.pos_y = (screen_size.y - bmap_height(splashmap))/2;
splashscreen.visible = on;
// wait 3 frames (for triple buffering) until it is flipped to the foreground
waitt(3);

level_load("testraum.wmb");
shadow_stencil=1;
d3d_lightres=on; //normal mapping
waitt(2);


// wait the required second, then switch the splashscreen off.
sleep(1);
splashscreen.visible = off;
bmap_purge(splashmap); // remove splashscreen from video memory



max_lights=8;
load_shaders(); //normal mapping
freeze_mode = 0;
}

/////////////////////////////////////////////////////////////////

I use A6 commercial 6.34








Athlon 64 3700+ 2048 MB DDR PC400 Dual Corsair XFX Geforce 7800 GT A6 Commercial 6.4