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 Professional Discussion / Help needed, code included

Author
Message
AndyUK
23
Years of Service
User Offline
Joined: 2nd Apr 2003
Location: United Kingdom
Posted: 11th Apr 2003 18:53 Edited at: 11th Apr 2003 19:43
Hi guys, so far what i have works fine but i need the object on the ground.. i tried decreasing the object y position which works but i cant tell it to stop decreasing when it hits the floor so sometimes it goes through the floor or has difficulty climbing steps.. this is probably simple but i dont have enough info on the commands. All done in exclusive mode.

sync on
backdrop off
hide mouse
set text size 15
load bsp "level.pk3","q3dm7.bsp"
set camera range 0.1,5000
autocam off
make object box 1,1,1,1
hide object 1
position object 1,60,0,-40
position camera 60,1,-40
set camera to object orientation 1
set bsp object collision 1,1,1,0
do
text 0,0,"Fps"
text 50,0,str$(Screen Fps())
yrotate object 1,object angle y(1)+(mousemovex()/5.0)
yrotate camera object angle y(1)
xrotate camera camera angle x()+(mousemovey()/5.0)
if upkey()=1
move object 1,0.1
endif
if downkey()=1
move object 1,-0.1
endif
if leftkey()=1
move object left 1,0.1
endif
if rightkey()=1
move object right 1,0.1
endif
position camera object position x(1),object position y(1),object position z(1)
sync
loop


thanx

| P4 2.4(533) | 512DDR(333) | GF4Ti4200 64MB | WinXP Home Sp1 | Cup of CoffeE |
deathAngel
23
Years of Service
User Offline
Joined: 11th Feb 2003
Location:
Posted: 12th Apr 2003 09:26
i haven't tryed to run your code couse i dont have the bsp.
But i think you can try(deppending on you'r ground Y position):

groundY#=0
dist#=abs(groundY#-object position y(1))

if downkey()=1 and stop=0
if dist# < 10 then stop=1
move object 1,-0.1
endif

Hope this will help. (Sorry for the bad English).

AndyUK
23
Years of Service
User Offline
Joined: 2nd Apr 2003
Location: United Kingdom
Posted: 12th Apr 2003 16:27
i think i know what your trying to get at.. thanx ill av a go

| P4 2.4(533) | 512DDR(333) | GF4Ti4200 64MB | WinXP Home Sp1 | Cup of CoffeE |

Login to post a reply

Server time is: 2026-07-10 19:47:18
Your offset time is: 2026-07-10 19:47:18