Faeblossom,
Glad to have you here. It's always nice to meet new authors.
DISCLAIMER: If there are any little errors, I'll take the blame. I tried to do this without opening the Quest software so it is from memory. But, I think (?) I got it all.
Faeblossom wrote:Is there a way to create multiple objects? I'm trying to create a little garden with dandelions and daisies that you can pick and eat or wear (I'm just using a verb to ''wear'' the flower in your hair for now, I'm sure I'll learn how to equip things later but I don't need that yet). My only problem is that there are no more flowers to pick once you've picked one and nothing to look at once you've eaten it (plus 1 health, woohoo!).
It depends on exactly what you want to do here. Do you really want the player to be able to carry around more than one of each? I don't really see a benefit of this, but it certainly can be done. There is a complex but aesthetic way and a simple and ugly way. For now, however, I'll pretend you want the player to always pick one but be able to pick others if they eat or destroy the one they are carrying.
For a case like this, I would create an object in your garden "room" called 'patch of dandelions' (or whatever you want to call it). For the description, you could print a message like "There are hundreds of dandelions here. Some call them 'weeds', but you think they look nice. There are so many here, you're sure that picking one would be okay." Create a 'dandelion' object, but tick it as scenery. For this object, under the 'inventory tab', choose to run a script. On this script, select an 'If' script. In the 'If' section of this script, choose 'If object has flag'. For the object, select player and type a name like 'dandytaken'. For the 'Then' part of this script, you can print a message like "You would take the dandelion, but you've already taken one. No need to take another!" In the 'Else' part of this script, choose 'add object to inventory'. Add dandelion1. Also add a script 'set object flag' and select object 'player' and name it 'dandytaken'. Whenever you eat or irrevocably use the dandelion, you will need to 'unset object flag' on object player named 'dandytaken' and move object 'dandelion1' to your 'dead room' (explanation follows). To make this work, you'll need to create a 'dead room' or 'item warehouse room'. This room should have no exits or entrances - it's only there to move items to/from and store items. Add object 'dandelion1' to the warehouse. In the alias box, type dandelion. Sometimes it's easier to create an entire room for objects like this and sometimes it's easier to make them invisible at first and make them visible at another time. My opinion is that it all depends on how the player will interact with those objects. For example, if your player is making a sandwich and the ONLY place that this can be done is the kitchen, invisible-to-visible objects is probably easier. But, if the player can carry the lettuce, tomato, and bread around with them and make the sandwich in ANY room in the game, it probably makes more sense to use a 'dead room'.
I'll explain picking 10-15 of the same items if that is what you really want to do, but it gets a little more complex, especially if you want it to look "nice" in the inventory.
Faeblossom wrote:I want to be able to fill a bath with water (and drain the water too). And, if possible, I want the player to be able to take a bath but it requires you to take of your clothes of course. If you try it with your clothes on you'll get your clothes wet! I don't care if that actually becomes some kind of lasting effect, it can just simply be a message.
I suppose I could simply use a verb that says “take a bath” or something and then just write it all out, but it seems more fun to make it a bit more interactive ^-^
Filling the bathtub is easy. Here is a case I would use the invisible-to-visible method. Make the bathtub a container. Put the water in the bathtub, but make it invisible. Add an object like a "faucet". Go to the 'use/give' tab of the faucet and add a script under 'use (on its own)' - or something like that. In this script, print an appropriate message and also add a 'make object visible' script (water). For later, you will want to also add a flag to the tub. Add a 'set object flag' script on object tub and name it 'filled'.
Draining the tub is a bit more complex. I'll explain the easiest route. Go to the 'verb' tab of the tub. Add verb drain. Add an 'If' script. Change the 'If' to 'object contains'. Choose 'tub' for the parent and 'water' for the child. 'Then' print a message indicating the tub water has been drained. Also, add a 'make object invisible' script and make the water invisible again.
There is another option (which is a bit more advanced, but I feel is more realistic/immersive) includes using commands. If you want an explanation on how to do that, let me know.
Taking a bath. You'll need to use flags again. In this room, you will want to add a command. Right click on your 'bathroom' room. Select 'add command'. In the box under command pattern, you will want to type everything synonymous with 'take a bath' that you can think of. It MUST look similar to this: take bath; take a bath; use bathtub; get in tub; get in the bathtub; wash myself ----- etc. Now you can run your scripts. But... first, you probably want the player to be undressed or not to get proper responses. So... Add another command to the bathroom. Same as above. Add something like this under command pattern: undress; get naked; take off clothes; take off my clothes; remove clothing; get undressed ---- etc. For the script here, you will want to print a message (of course) and also set a flag. Choose object player and name the flag naked (or whatever). Now back to your 'take a bath' command. Under this script, add an 'If' script. You will want to leave this script as an expression. You will want to type this exactly in the expression box: GetBoolean (player, "naked") and GetBoolean (tub, "filled")
Add to the 'Then' part of this script the message you want when the player takes a bath the "right way"
To the 'Else If' part of this script, you will probably want to switch it to 'if object has flag' and select tub filled. Print a message here with whatever you want to indicate that the player got their clothes wet. This will account for a tub that is filled but the player remains 'not naked'. To the next 'Else If' add another 'if object has flag' and select player naked. Add to this a message that indicates that the naked player tried to take a bath in a tub that didn't have water! For the 'Else' part of the script, you will want to add a message that indicates that the fully clothed player tried to take a bath in a tub with no water!
Faeblossom wrote:There's a book and I want the player to open it before reading it. So I tried using the ''if'' script but while you can open the book (opening it also shows a message revealing that is is actually someone's diary), when you try and read it nothing happens.
Now I kinda found an alternative by placing the diary in a drawer of a night stand and then the player can just simply read it because it says when you open the drawer that it's a diary. But I'd still like to figure out how to have an object require something, or require another object to be used in combination.
For example, I want to eat a slice of bread and that's fine. But I'd rather eat a slice of bread with some tomato slices and lettuce! I tried eating a butter sandwich, it would require you to smear the butter on the bread and then you can eat it, but again it only worked up to using the first object but then when I tried to eat the sandwich, nothing happened. I suppose I could try and make a new object which requires several objects to be created, not sure if that is possible.
I'll just answer the diary part for now, although if you have successful completed the first two obstacles I suggested, I bet you can now do this on your own!
Again, I would use a flag. For the book, go to the verb tab and add open. Print a message in this script indicating that it is so-and-so's diary. Also, add a 'set flag' script - set flag on object book named 'open'. Now add a 'read' verb to the book. For the script here, add an 'If'. If object book has flag name 'open', then print whatever message you want. For the 'Else' part of this script, you can suggest that the player should open it before rudely reading what might be another person's property without permission.
Hope this was helpful.
I now realize, The Pixie has also chimed in. Pixie is far smarter than I am with this stuff, but I will leave this here just in case another opinion is helpful! Good luck and keep asking questions!
Also, you might find 'Quest - Tutorials and Templates' helpful. It is a 'game' that helps new players walk through some of the most commonly asked questions while using the GUI in Quest. Let me know if it is helpful and if you have suggestions to making it more useful. I'm currently working on fixing the room description in the room menu to make it more user-friendly.