Right now >LOOK WEST will get you something like "You see nothing special to the west", which is generated in objlib.h by the direction class's long_desc property.
You could either handle this specially in a given location's before property as in:
Code: Select all
before
{
location DoLook
{
if object = w_obj
"...Your description here..."
else
return false
}
}
or, if you wanted to do this throughout the game, you could derive a class from the basic room class and use that to build all your locations. Your derived class could have special handling to do more or less the above for any existing west_desc, etc. properties for the location. Something like:
Code: Select all
room myroom
{
before
{
location DoLook
{
if object = n_obj
return self.north_desc
if object = ne_obj
return self.northeast_desc
...
else
return false
}
}
}
(Please note that all this code is untested.)
Note that if, for instance, self.north_desc doesn't exist on the location object, it's the same as returning false in the above code. Your north_desc property, then, would look like:
Code: Select all
north_desc
"You see stuff that is to the north."
Hopefully that's sort of clear, or at least a start.
Right now >LOOK WEST will get you something like "You see nothing special to the west", which is generated in objlib.h by the direction class's long_desc property.
You could either handle this specially in a given location's before property as in:
[code]before
{
location DoLook
{
if object = w_obj
"...Your description here..."
else
return false
}
}[/code]
or, if you wanted to do this throughout the game, you could derive a class from the basic room class and use that to build all your locations. Your derived class could have special handling to do more or less the above for any existing west_desc, etc. properties for the location. Something like:
[code]room myroom
{
before
{
location DoLook
{
if object = n_obj
return self.north_desc
if object = ne_obj
return self.northeast_desc
...
else
return false
}
}
}[/code]
(Please note that all this code is untested.)
Note that if, for instance, self.north_desc doesn't exist on the location object, it's the same as returning false in the above code. Your north_desc property, then, would look like:
[code]north_desc
"You see stuff that is to the north."[/code]
Hopefully that's sort of clear, or at least a start.