Good Evening!! This is noob with another noob question
I make code that looks like this
shelf: SecretDoor 'Book Shelf' 'shelf'
@StudyRoom
" <<isOpen ? 'A large shelf that reveal secret stair down below '
: 'A large shelf with lots of book'>> . "
dobjFor(Push)
{
verify() {}
action()
{
makeOpen(!isOpen);
"The shelf slide aside revealing stairs leading to bottom. ";
}
}
the plan is I want make shelf that when u put Book it will slide open
StudyRoom: Room 'Mansion Study Room'
desc()
{
}
north : OneWayRoomConnector
{
->Stair1
canTravelerPass (traveler) { return shelf.isPush; }
explainTravelBarrier (traveler)
{ " The shelf is blocking the way"; }
}
;
two problem from this is in first code I only know how to “push” shelf not to place item in there so the shelf will move
second is eventhough I make this code the player still available to go north and when i put travelbarrier, the shelf still won’t moved. I know there are something wrong with my codes but i can’t pinpoint it! Can somebody help me?? thank u in advance and sorry for my poor english.
[size=150]
UPDATE[/size]
I manage to change the code and succesfull to push shelf but i still need to place item so the shelf can move not being pushed this is the revised code that i used
[code]shelf: SecretDoor ‘Book Shelf’ ‘shelf’
@StudyRoom
" <<isOpen ? 'A large shelf that reveal secret stair down below ’
: ‘A large shelf with lots of book’>> . "
dobjFor(Place)
{
action()
{
if (book1.location == shelf)
makeOpen(!isOpen);
"The shelf slide aside revealing stairs leading to bottom. ";
inherited;
achievement.awardPointsOnce();
}
else
{"There is slot fit for something in the shelf."}
}
achievement : Achievement { +3 “Open Secret Door” }
; [/code]
But i still find error… Can anybody help??