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 / Problem With Terrain Commands

Author
Message
Avoth
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location:
Posted: 22nd Mar 2011 21:35 Edited at: 22nd Mar 2011 23:22
Ive been spending to many hours now trying to work out where ive gone wrong. Basicly i tried making a height map using 3d World Studio and loading that into DBPro but the map is inacurate. To get round this i decided to use the

Load Terrain "mapname*", objno*

Command. This works perfectly and also alows me to have multiple textures on my map which i cant seem to work out how to apply using a height map.

Upon doing this though, when trying to use the

Get Terrain Ground Height(1, xpos, ypos)

command but this refuses to return the ground height. I know the Load command alows you to effectively import objects and set them as a terrain, but the get terrain command doesnt seem to recognise the object as a terrain there for not returning the ground height.

Can anyone tell me where i have gone wrong?

I am trying to return the ground height so i can set basic logic stating that "if player < ground height then player = ground height". As far as im aware this is the best way to do this, and i was going to use the ODE to check collisions between the player and world objects after. This is because i notice there are alot of problems with the ODE where as the dynamic object occassionaly (quit commonly in my case) falls through the object, so i didnt want to have the ground level as part of this engine.

Any advice is welcome!

Ive also just discovered commands such as "Get Terrain Size x(#)" do not exist... yet they are documented in books such as "Hands On DarkBasic Pro Vol2"
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 24th Mar 2011 04:29 Edited at: 24th Mar 2011 15:57
You have to supply the X and Z coordinates (your example shows x and y positions) to get the terrain height at that point:
You simply use the Y coordinate that the command returns for whatever object you want to place on the terrain.

Login to post a reply

Server time is: 2024-09-29 02:32:26
Your offset time is: 2024-09-29 02:32:26