IM NEW TO DARKBASIC AND AM STILL TRYING TO LEARN VARIOUS THINGS THAT GO INTO MAKING A GAME.ITS MUCH EASIER IF SOMEONE SHOWED ME WHERE IN MY CODE WOULD THINGS BE PLACED.
FOLLOWED BELOW IS WHAT I HAVE SO FAR.
HERES WHAT I NEED TO KNOW:
1.INSERTING SKYBOXES OR SKYSPHERES FROM DARKMATTER INTO THIS TO SURROUND MY MATRIX.
2.I DONT WANT THE MATRIX TO BE ALL ONE TEXTURE I WANT TO PUT DIFFERENT TEXTURES ON DIFFERENT TILES I CANT EXACTLY MAKE IT WORK RIGHT.
3.THERES TWO OBJECTS IN THE CODE(SWAT,THUG)BOTH MODELS FROM DARKMATTER.I KNOW HOW TO DO OBJECT COLLISION WITH SIMPLE STUFF SAY MAKING A COUPLE OF CUBES BUT I CANT DO IT WITH THIS WHEN I MOVE SWAT OBJECT IT RUNS RIGHT THROUGH THUG OBJECT.
4.BOTH OF THOSE OBJECT MODELS HAVE ANIMATIONS WITH THEM WHEN I MOVE SWAT THE ANIMATION IS PLAYING HIM MOVING HIS LEGS BUT HOW CAN I GET IT TO CORRESPOND TO ME MOVING IT.WHEN I MOVE IT ACROSS THE MATRIX I WANT IT TO APPEAR TO BE MOVING ITS LEGS.(APPEND LIMBS)?
ANYONE WHO CAN HELP WITH ANY OF THESE PROBLEMS PLEASE RESPOND AND LET ME KNOW WHERE IN THIS CODE WOULD I DO SO.
Sync On
Sync Rate 30
Hide Mouse
autocam off
Backdrop on
Set camera range 1,5000
Fog on
Fog distance 4000
Fog color RGB(128,128,128)
Color Backdrop RGB(128,128,128)
Rem make matrix
Make matrix 1,10000,10000,20,20
Rem texture matrix
Load image "grass09.bmp",1
Prepare matrix texture 1,1,1,1
Fill matrix 1,0,1
rem music
load music "endless.mid",1
play music 1
rem Load object
Load object "SWATmove.X",2
load object "thugmove.x",3
loop object 2
scale object 3,2000,2000,2000
scale object 2,2000,2000,2000
position object 3,4960,get ground height(1,5000,5500),5500
position object 2,5000,Get Ground Height(1,5000,5500),5500
Rem Main loop
Do
yAng=object angle y(2)
`the following is temporary. There will be more but it will made later
`get keyboard input for movement
if upkey()=1 then move object 2,-4
if downkey()=1 then move object 2,+4
if leftkey()=1 then yrotate object 2,wrapvalue(yAng-4)
if rightkey()=1 then yrotate object 2,wrapvalue(yAng+4)
`work out the height of the character
xPos#=object position x(2)
zPos#=object position z(2)
yPos#=get ground height(1,xPos#,zPos#)
`update the objects position
position object 2,xPos#,yPos#,zPos#
`update the camera
chase_cam(1)
`update the screen
sync
loop
rem chase function
function chase_cam(1)
`work out the angle of the object being chased
yAng#=wrapvalue(object angle y(2)+90)
`grab the objects current position
xPos#=object position x(2)
yPos#=object position y(2)
zPos#=object position z(2)
`other variables
camDist=60
camHeight=30
`work out new position
xCamPos#=newxvalue(xPos#,yAng#,camDist)
zCamPos#=newZvalue(zPos#,yAng#,camDist)
`work out camera height
yCamPos#=get ground height(1,xCamPos#,zCamPos#)+camHeight
if yCamPos#