Help in my start Room!

Emjayf
Okay so I've started to make a game where I start in a bedroom.
There is a window with closed curtains to the north.
The Curtains are an object which I can open.
I can open them and see a street through a window.
So "Window" is a subheading within "Curtains"

I want to say "Open Window" and be told they can't as it's locked - however when I say
"open widow"
it says "I can't see that."

I then want to close the curtains (I'd like it not be an issue to open and close them - but when I type
"close curtains"
it says "They are already closed" - even though I never closed them!

Both curtains and window are listed as "Objects".

Am I doing something really silly here? If I can't sort this simple problem I have no idea how I'll cope when my character leaves the house!! :D

Cheers
Emjay

Silver
If you were using the offline editor someone could either take a look at your game or build you an example game for you to look at.

Silver
Firstly I would set the window object to be invisible. Then in the open curtains script you can set windows to become visible and in the closed curtains script set it to be invisible again. Or you can just change the response for x windows depending on their state to give a different reply. It's quite complex for a newbie and difficult to convey without being able to give you working examples.

Instead of making the curtains a container like I previously suggested, have you tried just creating them as verbs on the curtains object? This will be a trickier way of doing it as you'll have to set an attribute/flag checking what state they're in but this is the way to do it if making the curtains object a container doesn't work.

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

Emjayf
Wow! That's quite complex - I thought it would be more straight forward! Okay so that looks like something I need to read into more!

I've just tried to add some new bits and they don't save when I test them in the game! Oh it's SO frustrating!

Thanks for trying to help!

Cheers
MJ

The Pixie
I tried doing this in the on-line version. I added an object called "curtains", then on the Features tab, set it to be a container, then on the Container tab, set it to be a Closed Container.

Then I created a Window object, you need to make sure the parent is the curtains, not the room (you have to select the curtains, then click add, then select curtains from the drop-down box under where you type in the name of the object; alternatively, use the Move button at the top right).

When I played, the window was visible when the curtains were open, and not if they were closed.

HegemonKhan
ignore my code, and follow Pixie's post, as my code was just to show you the needed logic~mindset~mentality, which is something that you *DO* need to learn (both coding and GUI~Editor requires this logic brain training, unfortunately), and it takes quite a while to train your brain to think in this code-logic, it took me along time to get my brain trained in this code logic.

try to imagine it being you opening and closing a door~window~curtains, and think of all of the possible scenarios (4 in this example):

1. you try to open a closed door: real world behavior (easy logic)
2. you try to open an open door: not real world behavior (hard logic, lol)

3. you try to close a closed door: not real world behavior (hard logic, lol)
4. you try to close an open door: real world behavior (easy logic)

computers are stupid, that's why you got to deal with: 'opening an open door' and 'closing a closed door', something that a human wouldn't try to do.

even what seems like something really simple, can actually be something quite complex to do with computers~programming~coding~GUI~Editor~game making

for a great example of this:

Human:

HK is a male human warrior.

~VS~

Computer:

player.alias = "HK"
player.gender_string = "male"
player.race = "human"
player.class = "warrior"
msg (player.alias + " is a " + player.gender_string + " " + player.race + " " + player.class + ".")
// outputs: HK is a male human warrior.

yeesh! So much work for something we can do so easily, hehe :D

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

Support

Forums