Main Menu

Mappy and DBpro

Started by 3ddd, April 15, 2004, 11:44:04 AM

Previous topic - Next topic

3ddd

Hi all,

I'd like to use Mappy (a 2D tile editor/library) with Dark Basic Pro but I am having some difficulties.

First, the example programs don't seem to compile under DBpro. Turns out that the line of code that reads:
byte=-1-ThisByte
in the file "VirtualBanksLibrary_FULL_DBpro_V010a.dba" seems to be bad. "Byte" is a keyword in DBpro but it appears to have been used as a variable. I commented it out and the program compiled. However, I don't know what the ramifications of thie missing code are.

Second, how can I implement the MapGetBlock function in DBpro? I went through the functions in the provided libraries and I did not find it. I need to access it to check for collision, etc.

I spoke to the author of Mappy who suggested I talk to the author or the DBpro libraries for Mappy. So, Kevin, please feel free to chime in  :P

Thanks!

kevin

QuoteFirst, the example programs don't seem to compile under DBpro. Turns out that the line of code that reads:
byte=-1-ThisByte

 Yeah BYTE is reversed word in DBpro.  The library was updated for Dbpro , an used to compile under revision  3 or maybe 4.  During that update,  as you can see I've replace the right hand occurrence of BYTE with "THISBYTE" so replacing the left hand one should correct this line at least.  Any following usages should then use THISBYTE in the function rather than the original BYTE variable name.

So this line should be

ThisByte=-1-ThisByte



QuoteSecond, how can I implement the MapGetBlock function in DBpro? I went through the functions in the provided libraries and I did not find it. I need to access it to check for collision, etc.

There's and example of this in this source code forum.

3ddd

Thanks for the fast reply! I figured it should read ThisByte!

Regarding, the MapGetBlock function for reading the block structure information (user data, collision data, etc), is the source code you were referring in the thread titled "Reading Tile Map Layers Directly"?

If so, can you clarify what the "tile structure index number" is?

For example, would I need to create the BLKSTR type structure specifed in the code :

typedef struct {   /* Structure for data blocks */
long int bgoff, fgoff;   /* offsets from start of graphic blocks */
long int fgoff2, fgoff3; /* more overlay blocks */
unsigned long int user1, user2;   /* user long data */
unsigned short int user3, user4;   /* user short data */
unsigned char user5, user6, user7;   /* user byte data */
unsigned char tl : 1;   /* bits for collision detection */
unsigned char tr : 1;
unsigned char bl : 1;
unsigned char br : 1;
unsigned char trigger : 1;   /* bit to trigger an event */
unsigned char unused1 : 1;
unsigned char unused2 : 1;
unsigned char unused3 : 1;
} BLKSTR;

Then make a variable "myTile" of type BLKSTR

Then do:

myTile = Mappy_Read_Tile_Layer(1,10,10)

And then I could evaluate myTile.tl, myTile.user1, etc?