Switch-show or else don't show
sonic102
21 May 2012, 08:21I'm modifying the tutorial a bit. How can I make it show room description, objects, exits, everything when I switch on the lamp and when it's off it won't show anything except something like "You can't see anything in this dark room."
sgreig
21 May 2012, 18:01Set a flag on the room with a name like "light", and then make the room description a script that checks if "light" is true or not. If it is, then show the regular room descriptions and if not, show the other message.
sonic102
22 May 2012, 09:43The problem in the above mentioned solution is that when you look at the room it will show only what I entered and not the objects, places you can go etc. Here's what I mean through an example:
By default
Room Description:Blah blah blah
Output
>look
Blah blah blah
You can see an object
You can go to a room
Your idea
If lamp is switched on
Print 'blah blah blah'
Else print 'I cant see!'
Output
>look
Blah blah blah
>switch off lamp
It is switched off.
>look
I can't see!
If you didn't undestand throught the above example, I'll explain in simpler language.
If you look at a room, it will show the description, the objects and the exits.
If you look at a room with your idea, it will show only the room description.
By default
Room Description:Blah blah blah
Output
>look
Blah blah blah
You can see an object
You can go to a room
Your idea
If lamp is switched on
Print 'blah blah blah'
Else print 'I cant see!'
Output
>look
Blah blah blah
>switch off lamp
It is switched off.
>look
I can't see!
If you didn't undestand throught the above example, I'll explain in simpler language.
If you look at a room, it will show the description, the objects and the exits.
If you look at a room with your idea, it will show only the room description.

Pertex
22 May 2012, 10:50sonic102 wrote:The problem in the above mentioned solution is...
...
If you look at a room, it will show the description, the objects and the exits.
If you look at a room with your idea, it will show only the room description.
Is sgreigs idea not the same thing you want to do? Could you describe your idea?
sgreig
23 May 2012, 02:22Making the room description be a script shouldn't affect whether or not Quest displays the objects and exits. As a matter of fact, it should be displaying them whether the light is on or off unless you turned that off in the game object somewhere. Since ideally you wouldn't want to display the exits and objects when the lights are off, you should probably turn that function off anyway, and add a section to the script that displays the exits and objects yourself.

Pertex
23 May 2012, 07:27sgreig wrote:Making the room description be a script shouldn't affect whether or not Quest displays the objects and exits.
If you have a room description script at the moment, it only displays text coming from this script, objects and exits will not be displayed. This will change with version 5.3

guzmere
23 May 2012, 18:44Would it be too. Much problem to run a script if the light was out move the player to a new room with whatever name you wanted to call it and say that all is dark and you cant see anything. Then make sure that do a script to turn on the light and move the player back to the original room nuff said





sgreig
23 May 2012, 19:52That is one way you could do it. Alex has also suggested in the past writing a script that chages the room description and moves the objects and exits out of the room when the light is off, and then move them all back and change the description back when the light is back on.
Making the dark room and moving the player sounds a lot easier however.
And you could actually just have the one "dark" room for the whole game, and send the player there any time a light is turned out. All you would need is a variable that kept track of what room the player came from when they turned off the light in order to be able to send them back to the right room when the light is on again.
Making the dark room and moving the player sounds a lot easier however.


guzmere
24 May 2012, 06:49Like the idea about the variable for the player, mmmmmmm? Simple to the complex thats me. The simpler it is the less my brain hurts and the more sleep I get. Lol




