ID:154456
 
Yo, its the supa-noob Elorien again! ^^;;

This time amazingly enough, Im not asking for really basic coding solutions to my really stupidly complex coding! XD *listens to the cheers*

Anyways, I have a question about library management, cuz Im not really sure how it works ^^;;

While your making a game, you can create multiple .dm files in your main .dme file.. I understand the use of the #include command thingies, so dont start spouting that off at me please ^^;;

My question is whats the best use of it? What creative, or time saving uses have people put towards it? What are the drawbacks? ^^ could you split up your obj, mob, world and turf trees into seperate .dm files?

I know, wide ranging question, but If Im wondering, then Im sure more quiet people are too ^^ its strange.. Im quiet and really shy offline.. online tho watch out @.@ *LOL*

Anyways, Ill stop and wait for answers ^^;;;

Elorien
My question is whats the best use of it? What creative, or time saving uses have people put towards it? What are the drawbacks? ^^ could you split up your obj, mob, world and turf trees into seperate .dm files?

Yes you can split things into whatever dm files you want. When I first started with BYOND (DUNG in those days) I never did this. Then (when I hit the limit of what could be in one dm file) I started splitting them by type, such as obj.dm, mob.dm, etc. Now I've found that the best system is to group them by use. For example, everything relating to combat is in combat.dm: all procs, objects, datums, etc. Everything related to AI is in ai.dm; everything related to skills is in skills.dm, and so forth.
It makes managing everything much easier, especially when you have games with thousands of lines in them. My main RPG project had 9035 lines at last count, which was several months ago. Without a good system of organization, finding stuff would waste valuable time.
I've also found, for example, that if I edit a mob proc related to combat, theres a good chance I'll be editting a turf or obj proc related to combat at the same time. Having them all right next to each other makes this incredibly easier, especially if you have to reference the previous proc as you're editing the next one.
-AbyssDragon
In response to AbyssDragon
Hey.. thats a good idea.. thanks Abyss ^___^

K, slight added question tho ^^;;

When you split them up like that, are they all run as if thier one file? You dont have to crosslink or anything other then the #include in your main dm file? ^^

I know Im being a pain, but with my latest additions and rebiulds to my engine-in-progress its getting kinda cluttered, this would be great to help organize things..

thanks ^_^

Elorien
In response to Elorien
Elorien wrote:
Hey.. thats a good idea.. thanks Abyss ^___^

K, slight added question tho ^^;;

When you split them up like that, are they all run as if thier one file? You dont have to crosslink or anything other then the #include in your main dm file? ^^

I know Im being a pain, but with my latest additions and rebiulds to my engine-in-progress its getting kinda cluttered, this would be great to help organize things..

thanks ^_^

Elorien

Every dm file you create is included, alphabetically, as long as the box next to the name is checked.
In response to Elorien
Elorien wrote:
Hey.. thats a good idea.. thanks Abyss ^___^

K, slight added question tho ^^;;

When you split them up like that, are they all run as if thier one file? You dont have to crosslink or anything other then the #include in your main dm file? ^^

I know Im being a pain, but with my latest additions and rebiulds to my engine-in-progress its getting kinda cluttered, this would be great to help organize things..

thanks ^_^

Elorien

Sometimes the order that you include files matters, but that's rare if your code is well structured. Also, if you include it once, you don't have to include it again. Actually it's a bad idea to include a file twice.

I tend to make separate folders for major code divisions, that way I can close the combat folder to see the crafts folder easier. Within the folders, I usually break the code up into separate files whenever a file gets longer than 500 lines or so. More than 500 is too much to to search through in my opinion. For instance the player folder in one of my projects might contain saving.dm, playermob.dm, comverbs.dm and a folder full of icons related to players. I might be overcomplicating things, but it works well for me :)

I try to leave all the includes in the dme file, just so I know where they all are. If order matters, I remove the checkmark in the file tree and manually include the ordered files in front of the automatically included files.
In response to Shadowdarke
Actually it's a bad idea to include a file twice.

Not so! Dream Maker detects this and ignores this... or at least, it should detect and ignore this. I haven't tested it, myself.
In response to Spuzzum
Spuzzum wrote:
Actually it's a bad idea to include a file twice.

Not so! Dream Maker detects this and ignores this... or at least, it should detect and ignore this. I haven't tested it, myself.

Spuzzum is correct -- there is no problem including something twice, and sometimes it's unavoidable.