Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / NEW GUY COUPLE OF PROBLEMS PLEASE HELP

Author
Message
koolaid
22
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 2nd Feb 2003 08:16
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#
bugsquish
22
Years of Service
User Offline
Joined: 31st Jan 2003
Location:
Posted: 2nd Feb 2003 08:31
wll im a bit of a newb but i think i can help with textures.. you would need to use a paint program to make 4 tiles in a single image. ie double length and width of canvas and draw/paste 3 more tiles. this code should put a random texture on every tile.

Rem make matrix
Make matrix 1,10000,10000,20,20

Rem texture matrix
Load image "grass09.bmp",1
Prepare matrix texture 1,1,4,4
for x=1 to 20
for y=1 to 20
set matrix tile 1,x,y,rnd(3)+1
next y
next x

if it doesnt work then sorry i didnt test it! but i think its ok. rnd(3)+1 is selecting a random texture for the tile at that x,y location.
Kangaroo2
22
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 2nd Feb 2003 15:14
TURN YOUR CAPS LOCK OFF ITS REALLY ANNOYING

CaiF_R
22
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 2nd Feb 2003 16:05
Same oppinion here! I didnt even want to read trough all that when its cap`ed thus I cant help u!

CaiF_R
22
Years of Service
User Offline
Joined: 25th Jan 2003
Location:
Posted: 2nd Feb 2003 16:07
... And next time use the "code" thingy. Its also annoying to scroll 3 pages when 1 is enough.

Login to post a reply

Server time is: 2025-08-08 11:45:04
Your offset time is: 2025-08-08 11:45:04