if (not GetBoolean(player, "security")) {
msg ("Just as you reach over the desk to grab the log book, a security man appears from around the corner.<br/><br/>\"Can I help you, sir?\" he asks firmly and with more than a little suspicion.<br/><br/>\"Yes,\" you say, trying to sound confident. \"I'd like my room key, please.\"<br/><br/>The man lifts a flap and steps behind the desk. \"What name is it?\" he asks.<br/>")
SetObjectFlagOn (player, "security")
MoveObject (log book, reception desk)
}
else if (GetBoolean(player, "security")) {
msg ("You reach over and grab the log book and flick through the list of residents. There are pages and pages. You toss it away impatiently.")
MoveObject (log book, reception desk)
}
jaynabonne wrote:But is "reception desk" the room you're in?
OurJud wrote:Reception desk is set to 'room and/or object'.
The Pixie wrote:The question is really is "Reception desk" the object the player is in, or another object within the object the player is in?
You push the large double glass doors and walk into the lobby. Marble pillars and sparkling, highly poilished surfaces are everywhere. An unmanned reception desk lies on the west side of the lobby, while a large elevator is to the north.
Behind you lie the glass doors that lead back out to the street.
> w
You approach the desk for closer inpsection.
It's currently unmanned and on the wall to its back is a grid of small locked containers - presumably holding the room keys. The work area behind the desk is littered with papers and a large, leather-bound book titled 'Residents Log Book'.
The elevator is north. The lobby area is east.
> take log book
Just as you reach over the desk to grab the log book, a security man appears from around the corner.
"Can I help you, sir?" he asks firmly and with more than a little suspicion.
"Yes," you say, trying to sound confident. "I'd like my room key, please."
The man lifts a flap and steps behind the desk. "What name is it?" he asks.
> bla bla bla
The man becomes even more suspicious. "I'm afraid I'm going to have to ask you to leave, sir."
In desperation you pull out your gun and point it at his head. "Do as I tell you and you head stays on your shoulders."
The man freezes in fear.
You wave your gun at the wall of containers behind him. "I want the key to room 56!"
He nods, and reaches into his pocket, pulling out a small card which he swipes across the face of the container numbered 50-60. Visibly shaking, he fumbles through the collection of cards inside until he locates the one for room 56. He pulls it out and tosses it onto the desk in front of you.
> take card
You grab the keycard and force the security man into the office room behind reception, locking him inside.
The elevator is to the north. East will return you to the lobby area.
> take log book
I can't see that.
jaynabonne wrote:If the player is in a room (e.g "reception"?) and there is an object named "reception desk" in that room, and the log book is a child of that reception desk...
The Pixie wrote:"OurJud"
Reception desk is set to 'room and/or object'.
All that does (I think) is change the tabs you see when you are editing the game. When the game is being played there is no difference between a room and an object
jaynabonne wrote:What is the name of the room the player is in where this takes place?
Is "reception desk" an object within the room?
Since moving the log book to the reception desk seems to hide it, it seems fairly clear that the log book's parent is not initially that object. One way to find out is to run your game, click on Debugger, find the log book under the "Objects" tab, click on it and find the "parent" attribute to see what it is initially.
jaynabonne wrote:First gander, you have this as well:<ontake type="script">
SetObjectFlagOn (player, "security")
RemoveObject (log book)
</ontake>
<object name="Object_name">
<Attribute_name type="boolean">Value</Attribute_name>
</object>
// initially setting 'take' as 'false'
<object name="log_book">
<take type="boolean">false</take>
</object>
// or initially setting 'take' as 'true'
<object name="log_book">
<take type="boolean">true</take>
</object>
// when set as 'true', it is often in its shortened form
<object name="log_book">
<take />
</object>
<turnscript name="global_turnscript">
<enabled type="boolean">false</enabled>
</turnscript>
<turnscript name="global_turnscript">
<enabled type="boolean">true</enabled>
</turnscript>
// and its shortened form for being true
<turnscript name="global_turnscript">
<enabled />
</turnscript>
<object name="floor 5">
<inherit name="editor_room" />
<description type="script"><![CDATA[
msg ("The elevator doors open and you step out into a long corridor, lined on both sides with five doors. The arctitect for this place was obviously a fan of minimalism, judging by the bareness of the walls.<br/><br/>Each door is made from solid wood, their only feature a series of thin grooved lines running from top to bottom. They're all chesnut in colour and finished to a very high standard.<br/><br/>You check the number on the first door - 51.<br/><br/>Number 56 is five doors to the north.")
]]></description>
<object name="door56">
<inherit name="openable" />
<description><![CDATA[You step up to the door. A vertical slot for swiping the keycard runs through the base plate of the door handle.<br/><br/>You hold your breath and place your ear to the door, unsure if you'd hear anything through such a thick slab of wood, even if the room <i>was</i> occupide.]]></description>
<look>Made from solid wood and dyed a dark chestnut colour.</look>
<feature_container />
<openscript type="script">
if (not GetBoolean(door56, "swiped")) {
msg ("The door's locked solid.")
}
else {
msg ("You push the door and slip into the apartment quietly.")
}
</openscript>
<alias>door</alias>
<closescript type="script">
msg ("You close the door.")
</closescript>
<drop type="boolean">false</drop>
<exit alias="south" to="floor 5">
<inherit name="southdirection" />
</exit>
<command>
<pattern>knock; knock on door; knock at door; knock again; knock on door again</pattern>
<script><![CDATA[
firsttime {
msg ("You rap three times on the door, trying to sound as inconpicuous as possible.<br/><br/>Several minutes pass without a response.")
}
otherwise {
msg ("You knock again, louder this time. Still no reply.")
}
]]></script>
</command>
<command>
<pattern>swipe card; swipe keycard; swipe key card; swipe key; use keycard; use card; use key</pattern>
<script>
SetObjectFlagOn (door56, "swiped")
msg ("A quick swipe of the card is accompanied by a high-piched beep and deep clunk as the lock mechanism disengages.")
</script>
</command>
<object name="room56">
<inherit name="editor_room" />
</object>
<exit alias="in" to="room56">
<inherit name="indirection" />
</exit>
</object>
<exit alias="north" to="door56">
<inherit name="northdirection" />
</exit>
Silver wrote:Have you set 'door' as the alias for 'door56'?
jaynabonne wrote:I took that room and dropped it into an empty game and put the player there, and when I type "open door", it says "The door's locked solid."
What do you type to see the problem?
jaynabonne wrote:I did try to swipe the card, but that doesn't work because the command is attached to the door instead of the room. And since the player is not in the door, it doesn't kick in. When I moved the commands into "floor 5" instead, then I can swipe the card, knock on the door, etc. And after I swipe the card, I can open the door.
jaynabonne wrote:Perhaps create another room which is "in front of door" and put the door in there? Or add another object with alias "door" to handle the opening, etc. Basically, you need another object somewhere. You're conflating "being near the door" with the door itself.