Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Help With Links

8 years ago

I'm creating a storygame that has locked doors in it. I want to be able to make it where you need the key to unlock the door and when you don't have the key and you haven't unlocked it yet, you can't click on the link.

I just can't seem to figure it out. I've tried reading the articles, but they don't seem to make sense to me (It's just me, I prefer an organized table with the scripts and what they do compared to the many paragraphs explaining it. It's just how I learn stuff.).

I have some of the keys as items and been testing out how to do it. I put the restriction on the link for the item restriction "has" because from what I understand, unless the main character has the key, they can't click on the link and whenever I test it, it doesn't work. I have no idea what to do. Any help would be appreciated.

Help With Links

8 years ago
What do you mean "it doesn't work"? Is the link there regardless of if they have the key or not?

Help With Links

8 years ago

Yes, I can click and go to the page with or without the key.

Help With Links

8 years ago

Have a Variable for Each Door with a Lock (%DOOR1, %DOOR2, %DOOR3, etc)

Set your Link Restrictions to allow the Link, only if the Value of the Variable > 0. Also set the Link to show even if Restricted.

Then when you want to give the player the"key", just set the Variable to a Value above zero.

Help With Links

8 years ago

Okay, I'll try.

Help With Links

8 years ago
It sounds like you have the solution, and the suggestions here are good. In case you haven't figured it all out, here is the simple version of what should work:

Create the key.
Edit the page that has the link to the door on it.
Click on the little "Stop" sign on the row with the link to "unlock door" or whatever on it.
When that window opens, you will see "Link Options." There is a check box next to "visible when inactive." If you check this, when readers do not have the key, they will see the link, but not be able to click on it. If you leave it unchecked, the link does not even appear when the reader does not have the key. Set this how you like.
Click on "Item Restrictions"
On that page you should see your Key item and a drop-down with restrictions. Select "has" from the drop-down list.
Click on the button to Save & Close Windows
Then be sure to Close & Save Changes on the editing window.

Sorry if you already tried this, but this is what should happen.

Now when you view that page as a reader, if you have the key, you should see and be able to click on the link. If you do not have the key, it depends on the check box what will appear. The best way I have found to test this is to put the key in the room, then view it, then pick up the key, then drop the key. That should show you all the options.

Help With Links

8 years ago

I think I know what I did wrong now. Let me see if that's it, because everything seemed straight forward, but I think I did one thing wrong...

EDIT: I figured out what I did wrong. I didn't create an Unlock Door link on the page. The most obvious thing. But thank you!!!