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 / Loading a level

Author
Message
Doomwad
20
Years of Service
User Offline
Joined: 29th Dec 2003
Location:
Posted: 5th Jun 2004 04:44
How would you load a level map/ matrix?
Dgamer
21
Years of Service
User Offline
Joined: 30th Sep 2002
Location:
Posted: 5th Jun 2004 05:27 Edited at: 5th Jun 2004 17:25
To load an object use the load object command.

Loading a matrix isn't as trivial. Since there is no official matrix fileformat, each editor's matrix export file has a different structure and therefore require different import codes.

The statement below is true
The statement above is false
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 5th Jun 2004 07:35 Edited at: 5th Jun 2004 07:39
You could save the data for the level/matrix into an array... Like, set each value in the array to the height of the matrix coordinants...

Dim Height(50,50)
...
For X=0 to 50
For Z=0 to 50
Height(X,Z)=Get Ground Height(1,X*20,Y*20)
Next X
Next Z
...
Save Array "Filename",Height(0)

Then you can load the file by doing the following...

Load Array "Filename",Height(0)
...
For X=0 to 50
For Z=0 to 50
Set Matrix Height(1,X,Z)=Height(X,Z)
Next X
Next Z

...I hope you get the Idea...

...well... I hope I helped...

[Edit]
Saving the tile textures would be a bit more diffecult because you would have to save the texture value into an array each time you applied the new texture... To save the level's objects, just store the XYZ positions and angles for each object...

Programming isn’t an addiction, its more of a mental and social dependancy.

Login to post a reply

Server time is: 2024-09-22 11:29:18
Your offset time is: 2024-09-22 11:29:18