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.

Newcomers DBPro Corner / What is going on here...

Author
Message
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 17th Feb 2004 06:04
ok so, im making an FPS. i have loaded an m4a1 machine gun, and a matrix. now the problem is, when i move the gun over the matrix, the gun goes way up in the air! can som1 just look at my code and find the problem!?! THanks
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 17th Feb 2004 06:05
sorry, forgot to attach it

Rem Setup sync
Sync On
Sync Rate 30

Hide mouse
autocam off

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

position matrix 1,-500,-200,-500

Rem texture matrix
Load image "sand.bmp",1
Prepare matrix texture 1,1,2,2

Rem Randomize the matrix
randomize matrix 1,250

Rem Place random texture on each matrix tile
For x = 0 to 19
For z = 0 to 19
t = rnd(3)+1
Set Matrix Tile 1,x,z,t
Next z
Next x

Rem Update the changes to the matrix
update matrix 1


Rem Make Cubes for reference
For x = 1 to 5
Make object cube x,100
Position object x,Rnd(2000),0,Rnd(2000)
Set object collision to boxes x
Next x

Rem make the m4a1
load object "m4a1.3ds",10
yrotate object 10,353
scale object 10,25,25,25
set object collision to boxes 10

Rem Main loop
Do

Rem Store Object angle Y in aY#
aY# = Object angle Y(10)

Rem Control input for camera
If Upkey()=1 then Move object 10,20
If Leftkey()=1 then Yrotate object 10,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object 10,Wrapvalue(aY#+5)

X# = Object position x(10)
Z# = Object position z(10)

Rem position camera
position camera X#-50,62,Z#-125

Rem Refresh Screen after all dat stuff
Sync
Loop
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 17th Feb 2004 08:37
when you using move object your object move in the direction you are pointing in use position object

You can do it if you try
Indian Homie G
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: San Jose, CA
Posted: 17th Feb 2004 09:18
wait what do u mean by that
X_MEN
21
Years of Service
User Offline
Joined: 14th Sep 2003
Location:
Posted: 17th Feb 2004 17:04
Do

Rem Store Object angle Y in aY#
aY# = Object angle Y(10)

Rem Control input for camera
If Upkey()=1 then Move object 10,20
If Leftkey()=1 then Yrotate object 10,Wrapvalue(aY#-5)
If Rightkey()=1 then Yrotate object 10,Wrapvalue(aY#+5)

X# = Object position x(10)
Z# = Object position z(10)
Y# = Object position y(10)

Rem matrix height

y#=get ground height(1,x#,z#)+20.0

Rem position object

position object 10,x#,y#,z#

Rem position camera

position camera X#-50,Y#,Z#-125

Rem Refresh Screen after all dat stuff
Sync
Loop

You can do it if you try

Login to post a reply

Server time is: 2024-09-21 20:49:37
Your offset time is: 2024-09-21 20:49:37