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 / Code help please!

Author
Message
Social Disease
20
Years of Service
User Offline
Joined: 30th Sep 2003
Location: State of Confusion, beyond Denial...
Posted: 20th Apr 2004 23:32
Ok First I want to apologize for the length of all this.
What i have here is the same code, in one the skysphere is disabled and in the second it is not.
The first one works, except I really want the skysphere to denote how far my player can see. In the second, my player is up way over the world, outside of the dungeon.
I hope someone can look at this and tell me why, its just driving me crazy! Also, I'm new to DBPro, so any other suggestions would be helpful! thank you!

First code, no skysphere


Second Code, with the Skysphere.


Think Gad fro Spill Chock!
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 21st Apr 2004 01:12 Edited at: 21st Apr 2004 01:14
A couple of things caught my eye...

Don't use rem and ` after a commond on the same line, if can confuse the compiler. Use a colon ( to separate the commands.

if thisTest = 0 : ' remember to separate the commands with a colon

And this seems wrong...

If object collision(pn#,0)>0 and object collision (pn#,2) <> 2

Object collision either returns the number of objects hit or a one or zero for a specific object check. So, the first use (with a zero) is, "do I have any hits at all?" On the second expression you want to say, "ignore hits with the sky sphere." The kicker is that you never set a collision box for the sphere and you need to check for a 0/1 result. Try something a bit more easy and see what happens.

If object collision(pn#,0) > 0

--
TAZ

GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 21st Apr 2004 01:22 Edited at: 21st Apr 2004 01:23
Your Code Looks Good exept for few small problems...
Change This, "position object 2,object position x(1), Height, object position z(1)" to "Position Object 2, Camera Position X(),Camera Position Y(),Camera Position Z()
...As a general rule, always position your skysphere at the camera position...
Also, Have you camera range about 50 units larger than your skysphere. This will increase the performance of your game considerably...
Check the "If object collision(pn#,0)>0 and object collision (pn#,2) <> 2" Line. It might be right how it is but i think this is how it should be...
"If object collision(pn#,0)>0 and object collision (pn#,2) <> 1"

well... I hope that helps...

[Edit]
TAZ beat me to it.

Thou shalt not thwart the way of the dragon. For thou tasteth like chicken.
Social Disease
20
Years of Service
User Offline
Joined: 30th Sep 2003
Location: State of Confusion, beyond Denial...
Posted: 21st Apr 2004 10:08 Edited at: 21st Apr 2004 11:13
Still having problems, it seems that my Skysphere pushes me out of the level entirely, or my collision refuses to work at all! Please help! I tried :
and adding a collision box to my skysphere, but I'm still having the same problem

Think Gad fro Spill Chock!

Login to post a reply

Server time is: 2024-09-22 06:35:28
Your offset time is: 2024-09-22 06:35:28