Using keys and keylike objects

E.Z. Play
29 Oct 2016, 00:44

Hi, I'm not very good with code. And I'm currently making a game with locked exits. I think I've set up everything to where I can use the key with the door and unlock it and move on, but typing in "Use key on (door)" doesn't do what it's supposed to.

Can someone explain it like I'm 5 and tell me what I'm doing wrong and what I need to do?


hegemonkhan
29 Oct 2016, 03:08

Actually, you probably want to play XanMag's "tutorial and templates" (tutorial 2) game, as Xan made this to help with the big transition/jump from the tutorial to making your own game:

http://textadventures.co.uk/forum/games/topic/5940/quest-tutorials-and-templates-published

and I'm sure Xan goes over locked Exits/doors/key-usage/etc stuff


here's some links:

http://docs.textadventures.co.uk/quest/guides/hs_lockedexits.html (guide on locked doors/Exits and using keys)
http://textadventures.co.uk/forum/quest/topic/4604/cant-create-locked-door (this is probably a good link with a sub link within it to Jay's post, which likely will really help you with this stuff)

http://docs.textadventures.co.uk/quest/tutorial/using_lockable_exits.html
http://textadventures.co.uk/forum/quest/topic/5358/locked-doors

(see if this helps, and if not let us know, and we'll help you further)

(the guide doesn't talk about how to use a 'door' Object with the 'key' Object and the locked Exit, which is what usually people want to do within their games, but hopefully you can figure out how to do so from the guide --- if not, let us know and we'll help you with it)


here's the link to the guides:

http://docs.textadventures.co.uk/quest/tutorial/
http://docs.textadventures.co.uk/quest/guides/
http://textadventures.co.uk/forum/samples (more guides: libraries and code samples)


E.Z. Play
29 Oct 2016, 04:11

I'm sorry, it's still no help. I've used all the commands and terms and the game still tells me that the character can't see what I'm trying to unlock. I've looked through the tutorial but it says nothing on programming keys, just the commands to unlock doors with keys. I still have no idea what I'm supposed to be doing.

Basically here's what's happening.

  1. I take the key
  2. I go back into the room with the locked door
  3. I type in all the commands to unlock the door (use on door, use with door, unlock door with key, etc.)
  4. Game says: "I can't see that."

hegemonkhan
29 Oct 2016, 04:43

try... typing in this:

use key on door

replace 'key' with exactly whatever you named your 'key' Object as
replace 'door' with exactly whatever you named your 'door' Object or your Exit as

if you unticked the 'visible' Boolean Attribute, then the input command shouldn't work and you wouldn't even see those Elements shown on your 'places and objects' pane during game play anyways. So, make sure you have the 'visible' Boolean Attribute checked in

make sure you've set up your 'use/useon' Verb correctly:

http://docs.textadventures.co.uk/quest/tutorial/more_things_to_do_with_objects.html (covers 'use/useon/using')
http://docs.textadventures.co.uk/quest/tutorial/using_lockable_exits.html (covers locked Exits)


we may need to see your entire game code, to try to figure out the cause/error, if you could simply right click on your game file, and open it with a text software (notepad, wordpad, notepad++, Apple: text editor, etc). Then, highlight all of it, copy it, and paste it here, using the post's 'code box' code:

x```
(paste your code here)
x```

but without the x's in front of the 3 whatever-they-are/are-called-lol characters/symbols (it's the keyboard key to the left of your '1' key of the top row of numbers on your keyboard --- do NOT hold shift down as this is for getting the, tilde: ~, character)

and it should look like this:

(paste your code here)

The Pixie
29 Oct 2016, 12:27

Type this tutorial:
https://github.com/ThePix/quest/wiki/Keys-and-Locks


hegemonkhan
29 Oct 2016, 19:21

I finally bookmarked/favorited your github page, so now I actually know where to find it, and can post it's link for others who need those libraries/codes/guides of yours, Pixie. I knew you had a guide on locks but didn't know and was too lazy to find/get the link to your github, priorly

It'd be nice if this site had a sticky thread with links to everyone's github page and/or be able to have links in your profile / signature...


E.Z. Play
30 Oct 2016, 02:03

That's exactly what I'm doing though, "Use key on Guest Room Door" or "Use key on Guest Room" and all variations. The room/door is marked visible and not as scenery, but it just won't work.

If you need I can send you the file for the game and you can peek in?


hegemonkhan
30 Oct 2016, 06:29

I presume you don't want your game code to be publically posted here? hmm... unfortunately the site doesn't have pms nor attachments... and I don't really have any private 3rd party means of you sending it to me... that I'm willing to use/share... hmm...

it'd just be easier if you don't mind posting your game code publically via a post here in this thread of yours...

let me know what you want to do and we can figure something out...


E.Z. Play
30 Oct 2016, 20:03

http://www.mediafire.com/file/qw7jd4tbneqtd11/435_Well_Street.aslx

Okay here's the file. Let me know when you figure things out.

BTW, how do you delete your games off of this website? (Uploaded the beta for a friend to play, but he has a mac.)


hegemonkhan
30 Oct 2016, 20:37

hmm... I'm a bit confused myself with how to get the locking/unlocking/Exit/door to work...

wait for someone else to help you, who understands how these things work, as I'm stumped too... (I hate trying to understand the built-in stuff, lol)


until then, I'd make a new game and just use the tutorial and guides (see links) and see if you can just follow them to get a simple design working, just so you can see/understand how it works.. or if you can even get it to work...