PDA

View Full Version : dump($here)



JamusPsi
06-11-2009, 01:45 AM
This is a dump of the $here variable available to all sage scripts. You'll see that the entire room is parsed into structures which your script can access. If you're worried about the efficiency of this, don't be- psinet has been doing this invisibly for a year or two (in expectation of this scripting engine).

First example: the dais in illisti, with assorted things on the ground. Important things to note; each person present has their name parsed out from their title, and from any additional info- the script can see that Felychia is sitting, and that Valir is a great lord. Best guesses are made for objects on the ground, to determine article, adjectives, and noun. It is even able to detect things like "with some stuff on it", which is seen below as ".extra"

>ll
[Ta'Illistim, Hanging Gardens]
Although the floating platform is suspended well above the ground below, it overflows with abundant plant life. The edges of the dais are brimming with delicate white queen's lace, dark lavender, fragrant rosemary and a variety of other colorful flora. Thick grass underfoot provides an enticingly peaceful resting spot. A thin silk canopy is rolled back to permit an unobstructed view of the starry night sky. You also see a wafer of candied seeds, a shiny earring, a medicinal donations bin, a glaesine arch, a richly finished wooden bench with some stuff on it and a large faenor-chased barrel.
Also here: Lady Felychia who is sitting, Great Lord Valir
Obvious paths: out



>@$dumper.dump($here, "$here")
$here = Sage.Shared.Data.Room[7]
$here.livingitems = list[0]
$here.nonlivingitems = list[6]
$here.nonlivingitems[0] = wafer of candied seeds
$here.nonlivingitems[0].short = wafer of candied seeds
$here.nonlivingitems[0].text = a wafer of candied seeds
$here.nonlivingitems[0].article = a
$here.nonlivingitems[0].noun = seeds
$here.nonlivingitems[0].adjectives = wafer of candied
$here.nonlivingitems[0].extra =
$here.nonlivingitems[0].living = False
$here.nonlivingitems[1] = shiny earring
$here.nonlivingitems[1].short = shiny earring
$here.nonlivingitems[1].text = a shiny earring
$here.nonlivingitems[1].article = a
$here.nonlivingitems[1].noun = earring
$here.nonlivingitems[1].adjectives = shiny
$here.nonlivingitems[1].extra =
$here.nonlivingitems[1].living = False
$here.nonlivingitems[2] = medicinal donations bin
$here.nonlivingitems[2].short = medicinal donations bin
$here.nonlivingitems[2].text = a medicinal donations bin
$here.nonlivingitems[2].article = a
$here.nonlivingitems[2].noun = bin
$here.nonlivingitems[2].adjectives = medicinal donations
$here.nonlivingitems[2].extra =
$here.nonlivingitems[2].living = False
$here.nonlivingitems[3] = glaesine arch
$here.nonlivingitems[3].short = glaesine arch
$here.nonlivingitems[3].text = a glaesine arch
$here.nonlivingitems[3].article = a
$here.nonlivingitems[3].noun = arch
$here.nonlivingitems[3].adjectives = glaesine
$here.nonlivingitems[3].extra =
$here.nonlivingitems[3].living = False
$here.nonlivingitems[4] = richly finished wooden bench
$here.nonlivingitems[4].short = richly finished wooden bench
$here.nonlivingitems[4].text = a richly finished wooden bench with some stuff on it
$here.nonlivingitems[4].article = a
$here.nonlivingitems[4].noun = bench
$here.nonlivingitems[4].adjectives = richly finished wooden
$here.nonlivingitems[4].extra = with some stuff on it
$here.nonlivingitems[4].living = False
$here.nonlivingitems[5] = large faenor-chased barrel
$here.nonlivingitems[5].short = large faenor-chased barrel
$here.nonlivingitems[5].text = a large faenor-chased barrel
$here.nonlivingitems[5].article = a
$here.nonlivingitems[5].noun = barrel
$here.nonlivingitems[5].adjectives = large faenor-chased
$here.nonlivingitems[5].extra =
$here.nonlivingitems[5].living = False
$here.title = [Ta'Illistim, Hanging Gardens]
$here.description = Although the floating platform is suspended well above the ground below, it overflows with abundant plant life. The edges of the dais are brimming with delicate white queen's lace, dark lavender, fragrant rosemary and a variety of other colorful flora. Thick grass underfoot provides an enticingly peaceful resting spot. A thin silk canopy is rolled back to permit an unobstructed view of the starry night sky.
$here.people = list[2]
$here.people[0] = Felychia
$here.people[0].title = Lady
$here.people[0].originaltitle = Lady
$here.people[0].pretext =
$here.people[0].posttext = who is sitting
$here.people[0].name = Felychia
$here.people[0].exist = (undef)
$here.people[0].psinettitle = (undef)
$here.people[0].psinetposttitle = (undef)
$here.people[0].stunned = False
$here.people[0].dead = False
$here.people[0].bound = False
$here.people[0].webbed = False
$here.people[0].afk = False
$here.people[0].position = Sitting
$here.people[1] = Valir
$here.people[1].title = Great Lord
$here.people[1].originaltitle = Great Lord
$here.people[1].pretext =
$here.people[1].posttext =
$here.people[1].name = Valir
$here.people[1].exist = (undef)
$here.people[1].psinettitle = (undef)
$here.people[1].psinetposttitle = (undef)
$here.people[1].stunned = False
$here.people[1].dead = False
$here.people[1].bound = False
$here.people[1].webbed = False
$here.people[1].afk = False
$here.people[1].position = Standing
$here.items = list[6]
$here.items[0] = wafer of candied seeds
$here.items[0].short = wafer of candied seeds
$here.items[0].text = a wafer of candied seeds
$here.items[0].article = a
$here.items[0].noun = seeds
$here.items[0].adjectives = wafer of candied
$here.items[0].extra =
$here.items[0].living = False
$here.items[1] = shiny earring
$here.items[1].short = shiny earring
$here.items[1].text = a shiny earring
$here.items[1].article = a
$here.items[1].noun = earring
$here.items[1].adjectives = shiny
$here.items[1].extra =
$here.items[1].living = False
$here.items[2] = medicinal donations bin
$here.items[2].short = medicinal donations bin
$here.items[2].text = a medicinal donations bin
$here.items[2].article = a
$here.items[2].noun = bin
$here.items[2].adjectives = medicinal donations
$here.items[2].extra =
$here.items[2].living = False
$here.items[3] = glaesine arch
$here.items[3].short = glaesine arch
$here.items[3].text = a glaesine arch
$here.items[3].article = a
$here.items[3].noun = arch
$here.items[3].adjectives = glaesine
$here.items[3].extra =
$here.items[3].living = False
$here.items[4] = richly finished wooden bench
$here.items[4].short = richly finished wooden bench
$here.items[4].text = a richly finished wooden bench with some stuff on it
$here.items[4].article = a
$here.items[4].noun = bench
$here.items[4].adjectives = richly finished wooden
$here.items[4].extra = with some stuff on it
$here.items[4].living = False
$here.items[5] = large faenor-chased barrel
$here.items[5].short = large faenor-chased barrel
$here.items[5].text = a large faenor-chased barrel
$here.items[5].article = a
$here.items[5].noun = barrel
$here.items[5].adjectives = large faenor-chased
$here.items[5].extra =
$here.items[5].living = False
$here.exits = list[1]
$here.exits[0] = Out
Script ended. (Ended)

JamusPsi
06-11-2009, 01:53 AM
Example two, a room in the temple, and a dogmatist.

Note that the dogmatist alone appears in livingitems. This list is filtered for only living objects and uses a different set of conditions for "extra" text- so that it understands things like stuns, webs, binds. (This part is not working correctly at the time of this post.)

>sw
[Temple Wyneb, Calvaria]
Several small holes mar the surface of the east wall. A closer examination reveals a thin metal shaft stuck inside one of them. The rest could still be quite functional, however, and might be set off at any time. You also see a hunch-backed dogmatist, a tattered skeleton and a depressed floor stone.
Obvious exits: northeast, southwest
>



>@$dumper.dump($here, "$here")
$here = Sage.Shared.Data.Room[7]
$here.livingitems = list[1]
$here.livingitems[0] = hunch-backed dogmatist
$here.livingitems[0].short = hunch-backed dogmatist
$here.livingitems[0].text = a hunch-backed dogmatist
$here.livingitems[0].article = a
$here.livingitems[0].noun = dogmatist
$here.livingitems[0].adjectives = hunch-backed
$here.livingitems[0].extra =
$here.livingitems[0].living = True
$here.nonlivingitems = list[2]
$here.nonlivingitems[0] = tattered skeleton
$here.nonlivingitems[0].short = tattered skeleton
$here.nonlivingitems[0].text = a tattered skeleton
$here.nonlivingitems[0].article = a
$here.nonlivingitems[0].noun = skeleton
$here.nonlivingitems[0].adjectives = tattered
$here.nonlivingitems[0].extra =
$here.nonlivingitems[0].living = False
$here.nonlivingitems[1] = depressed floor stone
$here.nonlivingitems[1].short = depressed floor stone
$here.nonlivingitems[1].text = a depressed floor stone
$here.nonlivingitems[1].article = a
$here.nonlivingitems[1].noun = stone
$here.nonlivingitems[1].adjectives = depressed floor
$here.nonlivingitems[1].extra =
$here.nonlivingitems[1].living = False
$here.title = [Temple Wyneb, Calvaria]
$here.description = Several small holes mar the surface of the east wall. A closer examination reveals a thin metal shaft stuck inside one of them. The rest could still be quite functional, however, and might be set off at any time.
$here.people = list[0]
$here.items = list[3]
$here.items[0] = hunch-backed dogmatist
$here.items[0].short = hunch-backed dogmatist
$here.items[0].text = a hunch-backed dogmatist
$here.items[0].article = a
$here.items[0].noun = dogmatist
$here.items[0].adjectives = hunch-backed
$here.items[0].extra =
$here.items[0].living = True
$here.items[1] = tattered skeleton
$here.items[1].short = tattered skeleton
$here.items[1].text = a tattered skeleton
$here.items[1].article = a
$here.items[1].noun = skeleton
$here.items[1].adjectives = tattered
$here.items[1].extra =
$here.items[1].living = False
$here.items[2] = depressed floor stone
$here.items[2].short = depressed floor stone
$here.items[2].text = a depressed floor stone
$here.items[2].article = a
$here.items[2].noun = stone
$here.items[2].adjectives = depressed floor
$here.items[2].extra =
$here.items[2].living = False
$here.exits = list[2]
$here.exits[0] = Northeast
$here.exits[1] = Southwest
Script ended. (Ended)

Drew
06-11-2009, 02:07 AM
Dump here.
http://www.tyronewhite.co.uk/images/tee_with_mouth_open.jpg

Kinslar
06-29-2009, 02:57 AM
There does not seem to be an entry for personal disk though. Shouldn't that be in the room?