0 votes
by (120 points)
I would like to know how to code twine to be able to take an object and use it somewhere else ie(key to a lock).

I am making a game that requires interaction and functions like search and take objects. I want to be able to have players search a room and find hidden objects not on the main screen upon entrance. Once object acquired it unlocks a door in another room.

1 Answer

0 votes
by (159k points)

Please use Question Tags to state the name and version of the Story Format you are using, as answers can vary based on this information. Because I don't know which story format you are using the following information will be general.

One way you could implement the functionality you require is to use a story variable to track the current location (eg. nowhere, current passage, the player) of all the relevant items in your story. You could then check that current location to determine things like:

a. If the item hasn't been "found" yet. (item location is "nowhere")
b. If the item is in the current room. (item location is "Library" and the player is in the "Library" passage)
c. If the item is being carried by the player. (item location is "player")

When the player searches the current room/passage the found item's location would change from "nowhere" to the name of the current passage, and when the player picks up an item located in the current room/passage then the item's location would change from the name of the current passage to "player".

by (120 points)
The Game we are creating is called Nightmare Hotel. I am not sure how to answer what version and type of game. We are building a game similar to Raganarok. I can send you the story just not sure how.

We are using Twine 2.2.1,  Its a text based game with links to other rooms. Upon entering a room it gives basic description and the ability to go back or click a link for a different view(like night vision googles etc). Once you have been through certain rooms you will have pieces of keys to put together to open main door to a new floor with all new rooms and all new challenge. We need to be able to at least have the ability to acquire key parts and be able to open the door in the lobby but not see the link until all key parts are obtained. There is other things we want to be able to "take" to use in another room and show an additional link as well. For instance you need to get the bed sheets from one room to use to climb down to a window below in another room.

I hope this might explain things better. Thank you for your time and help.