Well here is the code that is runable. I attached the media folder. just make a proj folder and put the media folder in it with the code.
REM Project: Locked Away
REM Created: 2/21/2010 2:04:51 PM
REM
REM ***** Main Source File *****
REM
Set display mode 1024,768,32,1
Sync on:sync rate 60
Hide mouse
Global Cam as integer = 0
`********************************OBJECT NUMBERS********************************
Global Crossbow as integer = 1
Global Bolt as integer = 5
`*******************************COLLISION NUMBERS*******************************
Global FloorCollision as integer = 0
Global LevelCollision as integer = 0
Global EnemyCollision as integer = 0
`*********************************IMAGE NUMBERS*********************************
Global StoneWall as integer = 1
Global StoneWallN as integer = 2
Global StoneFloor as integer = 3
Global StoneFloorN as integer = 4
Global Normal as integer = 5
Global Bow as integer = 6
Global BowN as integer = 7
Global GunBody as integer = 8
Global GunBodyN as integer = 9
`*********************************SOUND NUMBERS**********************************
Global Walk as integer = 1
Global Bow as integer = 2
`*********************************EFFECT NUMBERS*********************************
Global NMFX as integer = 1
`*********************************MISC VARIABLES*********************************
Global Num as integer = 0
Global Y as integer = 0
dim Weapon(5)
dim Level(50)
`================================================================================
`**************************************MAIN**************************************
`================================================================================
Level_Setup()
Player_Setup()
do
Manage_Normal_Mapping()
Player_Controls()
sync
loop
Function Player_Setup()
position camera 0,0,0
Set camera range 0.1,10000.0
autocam off
GetFreeObj()
Weapon(Crossbow)=num
Load object "Media2/Crossbow/CrossBow2.x",Weapon(Crossbow)
Load image "Media2/Crossbow/BowUV.tga",Bow
Load image "Media2/Crossbow/BowNUV.tga",BowN
Load image "Media2/Crossbow/GunBodyUV.tga",GunBody
Load image "Media2/Crossbow/GunBodyNUV.tga",GunBodyN
Yrotate object Weapon(Crossbow),90
scale object Weapon(Crossbow),30,30,30
Texture object Weapon(Crossbow),0
Texture limb Weapon(Crossbow),3,0,GunBody
Texture limb Weapon(Crossbow),2,0,Bow
Texture limb Weapon(Crossbow),3,1,GunBodyN
Texture limb Weapon(Crossbow),2,1,BowN
Texture limb Weapon(Crossbow),3,2,Normal
Texture limb Weapon(Crossbow),2,2,Normal
Set limb effect Weapon(Crossbow),1,NMFX
Set limb effect Weapon(Crossbow),2,NMFX
Set limb effect Weapon(Crossbow),3,NMFX
endfunction
Function Level_Setup()
set ambient light 50
hide light 0
Load effect "Media2/Normal Mapping/Fx/NormalMapping.fx",NMFX,0
Load image "Media2/Normal Mapping/Media/RockWall.tga",StoneWall
Load image "Media2/Normal Mapping/Media/RockWall_N.tga",StoneWallN
Load image "Media2/Normal Mapping/Media/Fieldstone2.tga",StoneFloor
Load image "Media2/Normal Mapping/Media/Fieldstone_n.tga",StoneFloorN
Load image "Media2/Normal Mapping/Media/Normalize.dds",Normal,2
L=1
GetFreeObj()
Level(L)=Num
Load object "Media2/Dungeon/Dungeon"+Str$(L)+".x",Level(L)
GetFreeObj()
Level(L+1)=Num
Load object "Media2/Dungeon/DungeonFloor"+Str$(L)+".x",Level(L+1)
Y=0
For X=1 to 2
If X=2 then inc Y,2
Texture object Level(X),0,(StoneWall+Y)
Texture object Level(X),1,(StoneWallN+Y)
Texture object Level(X),2,Normal
scale object texture Level(X),20,20
set object effect Level(X),NMFX
Sc_SetupComplexObject Level(X),Level,2
Sc_AllowObjectScaling Level(X)
Scale object Level(X),500,500,500
sc_Updateobject Level(X)
next X
LightAng=Make matrix4(5)
LightPos=Make vector4(1)
Endfunction
Function GetFreeObj()
Tempnum=1
While object exist(TempNum)=1
inc TempNum
endwhile
Num=Tempnum
Endfunction
Function Player_Controls()
rotate camera Cam,camera angle x(Cam)+(mousemovey()/2),camera angle y(Cam)+(mousemovex()/2.0),0
If keystate(17)=1
move camera Cam,0.175
endif
If keystate(31)=1
move camera Cam,-0.175
endif
If keystate(30)=1
Yrotate camera Cam,Camera angle Y(Cam)-90
Move camera Cam,0.175
Yrotate camera Cam,Camera angle Y(Cam)+90
endif
If keystate(32)=1
Yrotate camera Player,Camera angle Y(Cam)+90
Move camera player,0.175
Yrotate camera Player,Camera angle Y(Cam)-90
endif
if wrapvalue(camera angle x(Cam))>40 and wrapvalue(camera angle x(Cam))<180 then xrotate camera Cam,40
if wrapvalue(camera angle x(Cam))>180 and wrapvalue(camera angle x(Cam))<280 then xrotate camera Cam,280
position camera Player,camera position X(Player),camera position Y(Player),camera position Z(Player)
Endfunction
Function Manage_Normal_Mapping()
set vector4 1,15,40,0,0
set effect constant vector NMFX,"LightPosition",1
set effect constant matrix NMFX,"LightAngle",5
Endfunction
If it hasn't exploded yet, I haven't touched it.