kaylus / myanmud

Automatically exported from code.google.com/p/myanmud
GNU Affero General Public License v3.0
0 stars 0 forks source link

virtual rooms #34

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
> I was wondering if anyone knew how I could implement 'virtual rooms'
> in DGD. Specifically the type that would let me generate a large
> two-dimensional terrain where the room description would be set by
> some equation.
>[...]
> With this method you could easily create a large wilderness area by
> creating a file like "thomas/wilderness.c" and referring to rooms like
> "thomas/wilderness/1,1,1" and having the GetVirtualObject parse the
> string to work out the coordinates and then set up the room by cloning
> it and returning it.

Simple enough.  Either clone rooms in the area and refer to them using
your own custom naming scheme (e.g. "thomas/wilderness"->room_at(1,1,1))
or compile the room from a string instead of a file, and then
configure it as a clone:

    room = compile_object("thomas/wilderness/1,1,1",
              read_file("thomas/wilderness.c"));
    room->set_long(etc);

The latter will require a recent version of DGD.

Original issue reported on code.google.com by hambon...@gmail.com on 29 Mar 2012 at 4:43