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.

Author
Message
koolaid
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Cyberspace
Posted: 14th Feb 2003 01:35
i cant seem to make stuff go right in usinf it with my code ive seen it but cant do it i want to have my matrix surrounded by a skybox from darkmatter named sky please take a look at my code and if you could let me know what to do and where to put the code i tried before but couldnt get the sizes right to surround it.thankyou

Sync On
Sync Rate 25
Hide Mouse
autocam off

Backdrop on
Set camera range 1,1000

Fog on
Fog distance 1000
Fog color RGB(0,0,0)
Color Backdrop RGB(0,0,32)
ink rgb(0,0,255),rgb(0,0,0)
set cursor 320,240

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

Rem texture matrix
Load image "grass09.bmp",1
load image "stone05.bmp",3
Prepare matrix texture 1,1,1,1

rem music/sound
load music "endless.mid",1
play music 1

load sound "earth slow.wav",1
set sound speed 1,12000
set sound pan 1,0

load 3dsound "moan.wav",2
loop sound 2
pause sound 2

rem make wall object
make object cube 4,20
position object 4,5500,0,5000
scale object 4,500,500,50
texture object 4,3
set object collision to boxes 4

rem Load object
Load object "swatidle.X",2
loop object 2
scale object 2,2000,2000,2000
position object 2,5000,Get Ground Height(1,5000,5500),5500
set object collision to spheres 2

load object "thugmove.x",3
loop object 3
scale object 3,2000,2000,2000
position object 3,5100,get ground height(1,5000,5500),5000
set object collision to polygons 3
rem Add walk animation data to your object appending to frame 100
append object "swatmove.x",2,100
append object "attack1.x",2,130

rem Set new speed for your model
set object speed 2,10

rem Set object to interpolate to a new frame at a speed of 25%
set object interpolation 2,10

rem resume sound 2
resume sound 2

Rem Main loop
Do
yAng=object angle y(2)

rem move object across matrix/controls
yAng=object angle y(2)
if rightkey()=1 then yrotate object 2,wrapvalue(yang+5)
if leftkey()=1 then yrotate object 2,wrapvalue(yang-5)
if upkey()=1
xtest# = newxvalue(xpos#,object angle y(2),-8)
ztest# = newzvalue(zpos#,object angle y(2),-8)
if xtest#>0 and xtest#0 and ztest#0 then position object 2,xpos#,ypos#,zpos#
rem refresh screen
sync rate 30

rem If walk animation required, make sure can perform animation
if animpause=0
animpause=1
if upkey()=1
if animstate=0
rem then slowly interpolate to the first walk frame
animstate=1
loop sound 1
loop object 2
set object frame 2,100
stop object 2
endif
else
if animstate=1
rem else slowly interpolate to the first idle frame
animstate=0
stop sound 1
stop object 2
set object frame 2,0
endif
endif
else
rem Count down until the interpolation has finished
animpause=animpause-1
if animpause=0
if animstate=0 then loop object 2,0,20
if animstate=1 then loop object 2,100,125
endif
endif

`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)+360)

`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#
Arrow
21
Years of Service
User Offline
Joined: 1st Jan 2003
Location: United States
Posted: 14th Feb 2003 02:25
Please use the code snippet, it makes the code much easier to read.

Am I a butterfly dreaming I'm a man?
Or a bowling ball dreaming I'm a plate of samishi?
Never assume that what you see or feel is real.
John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 14th Feb 2003 03:07
I dont even see your sky model anywhere in there! Just put it right by the make matrix code.

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!

Login to post a reply

Server time is: 2024-11-24 03:13:28
Your offset time is: 2024-11-24 03:13:28