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 Discussion / Terrain and Level Editor

Author
Message
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 8th Mar 2004 22:33
Fir the game I am currently working on I have built a terrain/level editor. All is fine apart from saving. I currently have DarkBASIC opening a seperate file and storing the height of each matrix co-ordinate in each one.
I know there is a quicker way.
Can someon please give me some code to:
a)Save the height of each co-ordinate on a matrix made like this:
eg. Make matrix 1,1000,1000,50,50
b)Load the saved matrix in a seperate file
Any help is appreciated.
Thanks.

BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 9th Mar 2004 02:31
You could use a combination of arrays and for...next loops instead of saving each and every coordinate with one single command. Check out MagicWorld from http://www.robinking.com/allseeingi, Robin King just released the source code, and it may help you.

Crazy Donut Productions
Current Project: KillZone
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 9th Mar 2004 15:09
At the moment I am using a peice of code like this:

save:
z=0
continue_save:
for x = 0 to 49
x$=STR$(x)
z$=STR$(z)
join$="_"
ext$=".dat"
y=get matrix height(1,x,z)
y$=STR$(y)
file$=x$+join$+z$+ext$
if file exist(file$)
open to read file$,1
write string 1,y$
close file 1
next x
z=z+1
if z = 50 then goto saved
goto continue_save

Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 9th Mar 2004 16:26 Edited at: 9th Mar 2004 16:28
why do you use goto's ( THEY SUCK)

try this



isnt that a LOT easier?

Quote: "
UPDATED

Amd 2800+ | 1024mb pc3200 | A7N8eluxe | Ati Radeon 9800PRO 256mb
"
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 9th Mar 2004 16:36
Yeah!
Thats why I asked for help!

Login to post a reply

Server time is: 2025-05-23 08:23:30
Your offset time is: 2025-05-23 08:23:30