Loading a Map in DBPro

It’s easy to load a Cartography Shop map in Dark Basic Pro.

 

 

Loading X Files

 

1)  First, select the File>Export menu.

 

2)  Select the Microsoft DirectX Model (*.x) export and save a copy of your map.

 

3)  Copy this source code to a .dba file in the SAME DIRECTORY as your .x file and run it.  You may need to change the file name to load:

 

set camera range 1,10000

 

load object "..\..\maps\bedroom.x",1

load object "..\..\maps\bedroom_lm.x",2

ghost object on 2,1

set ambient light 100

 

do

loop

 

Loading CSM Maps Directly

 

1)  Save your map.

 

2)  Cut and paste this code into the SAME DIRECTORY as your map, as well as the include files.  You need to copy every texture you use to the same directory, or you can select export an .X file, and all textures used will be copied to the export directory:

 

3)  This source code will load a CSM map directly into DBPro.

 

Rem ***************************************************************

Rem     Author:     Paul S. J. Millard

Rem     Purpose:    Cartography Shop (v4) CSM file importer for

Rem                 DarkBASIC Professional v5.1b and upwards

Rem     Version:    2.0.0

Rem     History:    04/12/03        - Created

Rem ***************************************************************

 

Sync On

Sync Rate 0

AutoCam off

Color Backdrop rgb(63, 63, 63)

Sync

 

Set Camera Range 10, 100000

 

Position Camera 0, 0, 200, -1000

 

copy file "..\..\maps\bedroom.csm","..\..\textures\bedroom.csm"

set dir "..\..\textures\"

 

CSM_Initialize()

CSM_Load( "bedroom.csm", 1 )

 

Repeat

    Text 0, 0, "Map Loaded"

    Control Camera Using ArrowKeys 0, 10, 1

    Sync

Until SpaceKey()

 

End