I was pretty bored today, so I decided to do something sooo stupid that I knew it would never get into DROD otherwise:
I made it output a room as a text file.
The text output is formatted as follows (this is an example):
OLAYER:
WWWWWWWWWWWWWWWWWWWWWWWWWWWW
W O W
W O W
W O W
G O W
WWWWWWWWWWWWWWWWWWWWWWWWWWWW
TLAYER:
O
MLAYER:
RRRRRRRRRRRR
RRRRRRRRRRRR
RRRRRRRRRRRR
RRRRRRRRRRRR
ORIENTATIONS:
44444444444444444444444444444
46666666666664444444444444444
46666666666664444444444444444
46666666666664444444444444444
46666666666664444444444444444
44444444444444444444444444444
ORBDATA:
2,5:2,8,2;5,23,1;
SCROLLDATA:
5,6:Hello, this is DROD at your service
OLAYER,TLAYER, and MLAYER represent the object on the respective layer. ORIENTATION contains the orientation of the object:
012
345
678
ORBDATA has one line per orb in the room, consisting of comma-seperated x and y values for the orb, followed by a colon, and comman-seperated x, y, and effect values for each door affected (effect is 1 for toggle, 2 for open, 3 for close). Each of these are seperated by a semicolon.
SCROLLDATA has a starting line for each scroll in the room, that is labeled with comma-seperated x and y values, followed by a colon. After that is the data from the scroll, terminated by the string "
?%?"
(this is in case of multi=line scrolls, so that a parser would know when to stop). On the next line is the next scroll.
Scripting could be handled with the upcoming script-to-text parser, and could easily be added to the end. The rest of the data is not of consequence (stairs would theoretically be automatically assigned to end hold, because when modifying rooms like this, it would be too unreliable). Entrances would not be stored at all (although there is a character for Beethro).
I won't bother saying here what all the characters are, because I have yet to add any sort of interface to the function, or to write the inverse (that turns the string into a room). As would be expected, the function is untested (due to my inability to actually get DROD to boot up when I compile it). Don't worry though, I already ironed out the errors. The modified files (DbRooms.h, DbRooms.cpp, TileConstants.h) are included here.
Oh, and in case it wasn't obvious from the files, they're under the MPL (apparently I'm supposed to say that here).
Oh, and can someone please tell me where TILE_MID is defined? I seem to have lost it!
[Last edited by coppro at 10-21-2006 05:16 AM]