Question from a newby

Emjayf
Okay so I'm trying to create a little game but need help.

I've created a room in which there are curtains that I want to open and close.

I've created it so when I type "open curtains"
It gives me a correct response - but when I type "close curtains"
It tells me "It is already closed"!

Any helps with what I should do? I only want to be able to look out of the window - when the curtains are open. - I don't want to climb out of the window or anything!

Any ideas?

Thanks
Emjayf

Silver
You could make the curtains a container and that would enable opening and closing.

Emjayf
Just done that (Made a container) and they open fine - but when I say close it still says "It is already closed."

Perhaps I need to alter something else?

Silver
Can you post the .aslx file here? I can look at it later if nobody else sorts it first.

Emjayf
don't know what .aslx file is I'm afraid - I've had a look around the internet and i'm still clueless. I found an example on this site but it's load of code that I don't know how to show on mine!

Silver
It's your game file (assuming you're using the offline editor). There's a way of getting the file if you're making the game with the online editor but I'm not familiar with it.

Emjayf
Ahh no -I'm doing it all online using the programme that use. As I said I only started yesterday so I might be doing it all completely wrong!

Thanks anyhow

Silver
Unless something makes it impossible (such as using a mac or mobile device) I really would use the offline editor.

jaynabonne
(This is a guess based on me not being able to test it at the moment.)

When you override the open or closed behavior, it no longer calls the default. So even though you have printed out a response saying the curtains are open, unless you explicitly set them to open, they will still be closed as far as Quest is concerned. You need to set the right attribute.

I'm away from Quest at the moment, so I can't tell you which attribute to set. I'll either get it to you when I get home or someone else can jump in. :)

HegemonKhan
here's some links:

http://docs.textadventures.co.uk/quest/tutorial/
http://docs.textadventures.co.uk/quest/guides/
http://docs.textadventures.co.uk/quest/ ... iners.html (this one is probably hopefully what you want~need)
http://docs.textadventures.co.uk/quest/ ... exits.html
http://docs.textadventures.co.uk/quest/ ... jects.html
http://docs.textadventures.co.uk/quest/ ... nside.html

-----------

the easiest way probably is this:

your 'curtains' Object is a Type: closed container

your 'windows' Object is INSIDE of your 'curtains' Object

once you 'open curtains', now your 'windows' Object is visable (appears on the right side)

as for both 'opening~closing' and 'locking~unlocking' scripting, this is a bit advanced and confusing:

you want this logic structure:

(I don't know this built-in stuff's terms~words + etc very well, so this isn't actual working syntax)

'open' Verb:
if (curtain.open = true) {
-> msg ("The curtain is already open, silly.")
} else if (curtain.open = false) {
-> curtain.open = true
-> msg ("You open up the curtain, revealing the window behind it.")
}

'close' Verb:
if (curtain.open = false) {
-> msg ("The curtain is already closed, silly.")
} else if (curtain.open = true) {
-> curtain.open = false
-> msg ("You close the curtain, hidding the window behind it.")
}

and the same pattern for:

'locked' Verb:

blah blah blah

'unlock' Verb:

blah blah blah

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums