I been trying to get this to work, but no success.
Well here is the code if any body can help, and the code contains custom media.
`BattleZone Game
`Real Time Strategy Game
`Starting Date June 3,2008
`SETUP GAME
SYNC ON
SYNC RATE 60
`LOAD DARK LIGHTS
LM START
AI START
`MAKE CAMERAS
`LOAD FULLSCREEN SHADERS
LOAD CAMERA EFFECT "SHADERS\FULLSCREEN\BLOOM.fx",1,0
`LOAD SHADERS
LOAD EFFECT "SHADERS\OBJECT\HALO.fx",1,0
`MAKE CAMERA OBJECT
MAKE OBJECT SPHERE 1,10
HIDE OBJECT 1
`MAKE MOUSE POINTER
MAKE OBJECT SPHERE 3,10
`LOAD TERRAIN
LOAD OBJECT "LEVELS\TUTORIAL\MAP1\MAP1.x",2
LOAD IMAGE "TEXTURES\sand.jpg",1
LOAD IMAGE "TEXTURES\NOISE.jpg",2
TEXTURE OBJECT 2,0,1
`START LIGHTS
LM ADD COLLISION OBJECT 2
LM ADD LIGHT MAP OBJECT 2,0
LM BUILD COLLISION DATA
LM ADD POINT LIGHT 195,75,348,900,1,1,1
LM BUILD LIGHT MAPS 1024,0.5,3
`UNIT ACTIONS & PROPERTIES
TYPE BASICUNITACTIONS
ISSELECTED AS BOOLEAN
ENDTYPE
TYPE BASICUNITPROPERTIES
NAME AS STRING
MAXLIFE AS INTEGER
ENDTYPE
DIM CHARACTERTYPE(2) AS BASICUNITPROPERTIES
`UNIT TYPES
`UNITS
CHARACTERTYPE(GROUND).name = "SHADOW"
CHARACTERTYPE(GROUND).maxLife = 60
CHARACTERTYPE(FLIGHT).name = "STRIKER"
CHARACTERTYPE(FLIGHT).maxLife = 40
TYPE CHARACTER
OBJECT AS INTEGER
ACTION AS BASICUNITACTIONS
GROUP AS INTEGER
UNIT AS INTEGER
LIFE AS INTEGER
ENDTYPE
DIM CHARACTERS(0) AS CHARACTER
`MAKE ONE UNIT
UNITS=100
LOAD OBJECT "MODELS\BODY PARTS\GROUND\SHADOWBLUE.x",UNITS
POSITION OBJECT UNITS,250,5,348
SCALE OBJECT UNITS,3500,3500,3500
AI ADD FRIENDLY UNITS,1
AI SET ENTITY SPEED UNITS,95
ARRAY INSERT AT BOTTOM CHARACTERS(0)
INDEX=ARRAY COUNT(CHARACTERS(0))
CHARACTERS(INDEX).OBJECT=UNITS
CHARACTERS(INDEX).ACTION.ISSELECTED=0
CHARACTERS(INDEX).UNIT=GROUND
CHARACTERS(INDEX).LIFE=CHARACTERTYPE(GROUND).MAXLIFE
INC UNITS
LOAD OBJECT "MODELS\BODY PARTS\GROUND\SHADOWBLUE.x",UNITS
POSITION OBJECT UNITS,195,5,348
SCALE OBJECT UNITS,3500,3500,3500
AI ADD FRIENDLY UNITS,1
AI SET ENTITY SPEED UNITS,95
ARRAY INSERT AT BOTTOM CHARACTERS(0)
INDEX=ARRAY COUNT(CHARACTERS(0))
CHARACTERS(INDEX).OBJECT=UNITS
CHARACTERS(INDEX).ACTION.ISSELECTED=0
CHARACTERS(INDEX).UNIT=FLIGHT
CHARACTERS(INDEX).LIFE=CHARACTERTYPE(FLIGHT).MAXLIFE
`GRID
squareSize#=40.0
mapX=68
mapZ=68
DIM map(mapX,mapZ)
terrainX#=mapX*squareSize#
terrainZ#=mapZ*squareSize#
MAKE MATRIX 1,terrainX#,terrainZ#,mapX,mapZ
`START MAIN LOOP
DO
`UNIT MOVING AND SELECTING
_mouse_click = MOUSECLICK()
IF _mouse_click = 1 AND selectionFlag = 0
selectionFlag = 1
bx = MOUSEX()
by = MOUSEY()
ENDIF
IF _mouse_click = 1 AND selectionFlag = 1
bx2 = MOUSEX()
by2 = MOUSEY()
ENDIF
IF _mouse_click <> 1 then selectionFlag = 0
IF selectionFlag = 1
rem sort the coordinates
IF bx < bx2
bx0 = bx
bx1 = bx2
ELSE
bx0 = bx2
bx1 = bx
ENDIF
IF by < by2
by0 = by
by1 = by2
ELSE
by0 = by2
by1 = by
ENDIF
rem draw a box
LINE bx0, by0, bx1, by0
LINE bx0, by1, bx1, by1
LINE bx0, by0, bx0, by1
LINE bx1, by0, bx1, by1
rem loop through all characters
FOR CHAR = 1 to ARRAY COUNT(CHARACTERS(0))
rem get object number of this character for future object related actions
OBJ = CHARACTERS(CHAR).OBJECT
rem get the character's 2D screen coordinates
CX=OBJECT SCREEN X(OBJ)
CY=OBJECT SCREEN Y(OBJ)
rem if character is within the selection box..
IF CX > bx0 AND CX < bx1 AND CY > by0 AND CY < by1
CHARACTERS(CHAR).ACTION.ISSELECTED = 1
ELSE
CHARACTERS(CHAR).ACTION.ISSELECTED = 0
ENDIF
NEXT CHAR
ENDIF
`SETUP CAMERA
`GET CAMERA POSITION & ANGLE
CAMX=OBJECT POSITION X(1)
CAMY=OBJECT POSITION Y(1)+350
CAMZ=OBJECT POSITION Z(1)
TEXT 0,0,"X: "+STR$(CAMX)
TEXT 0,10,"Z: "+STR$(CAMZ)
`MOVE CAMERA CONTROLS
IF UPKEY()=1 THEN MOVE OBJECT 1,3
IF DOWNKEY()=1 THEN MOVE OBJECT 1,-3
IF LEFTKEY()=1 THEN MOVE OBJECT LEFT 1,3
IF RIGHTKEY()=1 THEN MOVE OBJECT RIGHT 1,3
IF CONTROLKEY()=1 THEN MOVE OBJECT UP 1,3
IF SHIFTKEY()=1 THEN MOVE OBJECT DOWN 1,3
`ROTATE & POSITION CAMERA
POSITION CAMERA CAMX,CAMY,CAMZ
POINT CAMERA CAMX,OBJECT POSITION Y(1),CAMZ
`MOUSE POINTER
`position mouse marker
null = pick object(mousex(), mousey(), object, object)
targetX# = camera position x() + get pick vector x()
targetY# = camera position y() + get pick vector y()
targetZ# = camera position z() + get pick vector z()
pick screen mousex(),mouseY(),1000
vx# = get pick vector x()
vy# = get pick vector y()
vz# = get pick vector z()
dy# = -camera position y()/vy#
vx# = vx#*dy# + camera position x()
vz# = vz#*dy# + camera position z()
position object 3,vx#,1,vz#
`MOVING UNITS
IF characters(INDEX).action.ISSELECTED = 1
IF _mouse_click=2
AI ENTITY GO TO POSITION OBJ,OBJECT POSITION X(3),OBJECT POSITION Z(3)
ENDIF
ENDIF
`END LOOP
AI UPDATE
SYNC
LOOP