New Area flag #HIDDEN

Posted by Lywellyn on Mon 09 Jan 2006 04:57 AM — 9 posts, 29,289 views.

USA #0
I coded in a new area header #HIDDEN for my areas, and when Area Editor tries to load them, it won't load it since it doesn't recognize it. Is there something that can be done about this? Either adding a new feature to the configuration file? Or if it runs into a header it doesn't recognize, it may show an error, but it doesn't stop the process of loading the file?

I don't really want to have to take the header completely out, as it's useful for my MUD.

Thank you.
Australia Forum Administrator #1
I think this came up a while ago. It is hard to support custom area file formats, because of the difficulty of specifying what might follow the header.

All I can suggest is some sort of "pre-processing" where you strip out the #HIDDEN flag prior to editing, and put it back afterwards.
USA #2
Pre-processing would work, but it could become tedious. Isn't there a way to make it so that it will show the error, but skip it and load the rest of the area file it *does* recognize?
Australia Forum Administrator #3
But then what? It ignores the part it doesn't recognise, so it doesn't get written out, so it is dropped from the file.
USA #4
Erm....temporarily write the unknown parts to a temp file, then write those parts when you save? *shrug*

Just trying to present an idea. :)
Australia Forum Administrator #5
Well, you could write a small script (eg. in Lua) to do that. Can you post the format of your #HIDDEN flag, with a few lines before and after it, so I can see the context, and let me think about it.
USA #6
It's simply this:




#AREA   The Noble Academy of Knowledge~



#VERSION 1
#HIDDEN 0
#AUTHOR Delynn~

#RANGES
0 10 0 10
$




Where the value after hidden is 0 if the area is not hidden to mortals, or 1 if it is.
Australia Forum Administrator #7
I think there is a simple solution to this that doesn't require changes to the Area Editor, and still let you keep your flag.

Rather than adding a new field to the area file, and thus making it incompatible with this (and other) area editors, simply slip the flag in a different way.

For example, if the first character of the area name is a hyphen it could be a hidden area.


#AREA   -The Noble Academy of Knowledge~


Then when you load an area you could do something like this:


 if (tarea->name [0] == '-')
  tarea->hidden = true;


That way the area file is still readable by the area editor and to set the "hidden" flag you just add a hyphen to the area name.
USA #8
Ooh, good idea :D Thank you!