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 / can't get this to work

Author
Message
Chief Voyager
21
Years of Service
User Offline
Joined: 20th Mar 2003
Location: United States
Posted: 31st Mar 2003 22:06
i'm trying to keep my camera from moving up the mountains but my program isn't working right. here's what i got


i've tried using something like oldX# = X# and stuff like that but my X# value always falls below 12000, usually stops at around 11980 or so and them i stuck on the side of the mountain. why won't it reposition the camera so that it doesn't go up the mountain?

thanx for any help
You're ate up like a soup sandwich.
Terabyte
21
Years of Service
User Offline
Joined: 28th Dec 2002
Location: UK
Posted: 1st Apr 2003 01:19
" if X# > 12000 and X# 12000 and Z# 88000 then X# = 79999
if Z# 88000 then Z# = 79999"

that section of code looks quite screwed up if you ask me!
where the =,< or > signs. it would help if you post a little more and be a bit more descriptive in what your prog. is supposed to do. remember not very good mind readers! [img][/img]
also might i sugest using slightly smaller co-orinates if possible you really shouldnt need your 3d space co-ordinates to run into 5 digits

if you post a bit more code then i can help but the main problem is you have no operators in your-

if X# > 12000 and X# 12000 and Z# 88000 then X# = 79999
if Z# 88000 then Z# = 79999

if you want it to work at all you need to put an operator between z# and 88000 x# and 12000 z# and 88000


[img][/img]

I have a word of advice...
..don't piss on an electric fence!
Chief Voyager
21
Years of Service
User Offline
Joined: 20th Mar 2003
Location: United States
Posted: 1st Apr 2003 02:09
i don't know what the problem is, i guess when i posted the code it neglected the operators. here's where i check the camera coordinates:

if X# > 12000 and X# < 88000 and Z# > 12000 and Z# < 88000
move camera 12
if sound playing(1)=0 then play sound 1
endif

what i don't want is the camera to go below the 12000 mark at both the x and z axis. i also want the camera to stay below the 88000 mark at the x and z axis. these points are where my mountains begin and i don't want the player camera to go beyond these points ie climb the mountain. what happens is that the camera will go up to say 11980 on the x axis and get stuck in the mountain, then the camera can't get back out. so what i was trying to do was keep the camera from getting that far by trying to change the positions with this:

if X# < 12000 then X# = 12001
if X# > 88000 then X# = 79999
if Z# < 12000 then Z# = 12001
if Z# > 88000 then Z# = 79999

but it still doesn't work. the camera still gets stuck in the side of the mountains.

You're ate up like a soup sandwich.
Chief Voyager
21
Years of Service
User Offline
Joined: 20th Mar 2003
Location: United States
Posted: 1st Apr 2003 03:45
any ideas anyone?

You're ate up like a soup sandwich.
Bluedeep
21
Years of Service
User Offline
Joined: 3rd Feb 2003
Location: Finland
Posted: 1st Apr 2003 11:16
Try using camera position camera 1,xvalue,yvalue,zvalue instead of x# and z#.
and when you need to know if the camera is out then use
camera position(x) and camera position(z)
Superbeest
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: Netherlands
Posted: 1st Apr 2003 12:29
Yes I ve got one idea. KEEP IT SMALL. If you scale everything a whole lot down. and zoom in you get the same results, but it looks a whole lot better. If you have this big values you get enormous clipping, if you scale it down for about a 1000 times, it looks way beter and the results are the same! Ive tried these sizes once in my first DB program and it looked OK, but then i tried it way smaller and it looked superb, way better than before. And the results are the same. Image two world both exactly the same only one way sharpen and clearer. With one whould you choose?
And about your problem: make somethin like this:
If get ground height(matrixno,x,z) > maxvalue then notmoveherethingy
or if upkey() = 1 and get ground height(matrixno,x,z) < then move camera up 1
i think that is easier. I don't like working with numbers. They are messy and unclear. work with variables, is easy to read and to change, without spitting through your entire code. If you have any other questions, please mail me.

By steel will thy flesh divide

Login to post a reply

Server time is: 2024-11-24 08:39:00
Your offset time is: 2024-11-24 08:39:00