Extending scopes


Email from Bolumbero:

In Inform, exist the concept of REGION.

So I can create a OBJECT... and still.. is all the region.

An scenery object...

So imagine:

You are in the forest.
X tree.
There're everywhere.

You are in the west side of the forest.

X tree
Don't see such a thing.
I must create a tree in the west side of the forest.

But, if I create a region... I can put a tree in the FOREST REGION.. to EX.. in all the location..

Scopes should be extendable - my original idea for scopes was that you would be able to say that objects in one room's scope could also be made visible from another room, for example.
Closed Jul 6, 2014 at 11:53 AM by alexwarren
All open Quest issues have now been migrated to GitHub: https://github.com/textadventures/quest/issues?state=open


xordevoreaux wrote Jul 29, 2011 at 7:06 PM

I call regions zones. You can create rooms inside of rooms, and make them all room objects. I do this all the time. For intance, create a room/object called Forest. That is your zone (region). Then create room/objects ForestWest and ForestEast as children inside Forest. ForestEast and ForestWest can be connected to each other via exits, but there are no exits between Forest and its children, it's the region. For instance, I have a street, and then I have a building (region) on the street. You go from the street to the foyer inside the building, not the building itself.

So for your forest, every time you do look, you can test for the user typing Look, and run the scope for the current room plus print the attribute for forest.look as well. They'll see ForestEast's stuff and then Forest's stuff. That won't make the parent object's stuff available to you to manipulate while standing it the child object, but you can at least see it.

xordevoreaux wrote Jul 29, 2011 at 7:08 PM

You can also run a script for the location of each area of the forest. For example, in Forest, you have a tree. Player never is actually directly in Forest, he's walking between ForestEast and ForestWest which are inside Forest. So ForestEast's look description is a script where you run a print message to describe whatever may be in ForestEast, and then run another script beneath that to do print the parent.look attribute as the finally part of the description.

alexwarren wrote Sep 18, 2011 at 2:58 PM

Also from the forums: http://www.axeuk.com/phpBB3/viewtopic.php?f=6&t=2559&p=18898#p18898

"Ubiquitous scenery items: A way to have one item in many places. The player wants to examine the wall, no problem, wall is a ubiquitous item, so is defined once, but can be examined from anywhere. The way I see this being implemented is through types. You can set a room to inherit from the "walled" type, and then add the wall object to the type. Then the scope checks through all the objects in the room the current room inherits from as well as what is in the room."