I need help.. with everything.

I just started using quest yesterday. I'm trying to put my own image in my game but it won't show up for some reason. I also have som problems with the inventory. I can't drop an item without it being still in the inventory. I don't know ANYTHING about code. I have tried literally every forum post for help but people write a whole novel about code.. So uh.. Can you guys eksplain what is happening.. and more simple, thanks? :)


If something isn't working, it would be best if you can show us what isn't working.

If possible, post the game you're having trouble with on the website (you can still make it only accessible to people who have a link) so we can see what you're doing and hopefully point out the problem.

If you don't want to share the whole game, you can go into 'code view' and copy/paste the parts that don't seem to be working.


I'm trying to put my own image in my game but it won't show up for some reason.

Can you share the piece of the script you're using to display the image? There's loads of different ways to do it, and it's hard to offer advice without knowing which one you're attempting.


I can't drop an item without it being still in the inventory.

On the object's 'Inventory' tab, have you ticked the box "object can be dropped"? If so, it should just work.

If you have the drop behavior set to "Run script", your script will be run instead of automatically removing the object from the inventory. So the script will need to include a line that moves the object to somewhere other than the inventory. The most common piece of code for doing this would be the line this.parent = game.pov.parent (put this object in the same room as the player).


I have send you a link to my game via direct messages. But it's totally ruined now. I can't even make a door you can go in and out of.. :/


Doors are surprisingly hard to get working properly. The most common method seems to be having an exit that the player can step through, and a 'door' object which unlocks the exit when you use a key on it.


Do you have discord or other social medias? I could really use some help.. :/


Need to learn about coding geomerty dash for all


For the door, you seem to have a few fragments of old code scattered around. It might be easier to remove the door and exits and recreate them so you're starting from a clean slate.

Quest's built in "lock and keys" functionality only works properly with containers. So the simplest way to make it work is to create an object called "door" and make it a closed container. The door's "Container" tab lets you choose if it starts closed and locked, how many keys are needed, and which object is the key.

However, you don't want the player to be able to put objects in the door once it's open. So for the "Script to run when trying to add an object:" you can put:

msg (Template("CannotDoThat"))

That way, "put diary in door" will have exactly the same effect as putting an object in anything else that isn't a container.
You can also use the "After opening the object:" and "After closing the object:" scripts if you want to add creaking-door sound effects.

Now you've got a door object that can be opened, closed, locked, and unlocked.

Then you create an exit going out, but you give it a script to run:

if (GetBoolean (door, "isopen")) {
  game.pov.parent = this.to
}
else {
  door.to = this.to
  Ask ("Would you like to open the door?") {
    if (result) {
      TryOpenClose (true, door)
      if (GetBoolean (door, "isopen")) {
        game.pov.parent = door.to
      }
    }
    else {
      msg ("The door is closed.")
    }
  }
}

Doing it this way, you don't need to worry about locking the exit. When the player types "go out" it will run the script, which does the following:

  • if (GetBoolean (door, "isopen")) - check if the door is open already
    • game.pov.parent = this.to - if the door's open, the player can just go through it
  • else { - if the door isn't open,
    • door.to = this.to - make a note of which room the exit leads to (because this doesn't play nicely with Ask)
    • Ask ... - Ask the player if they'd like to open the door
      • TryOpenClose (... - try to open the door; which includes checking if the player has a key, playing sound effects, and anything else that needs doing
      • if (GetBoolean ... - after trying to open the door, we only go through it if it was successfully opened
        • game.pov.parent = door.to - use the note we made earlier about the door's destination, so we don't need to worry about naming the exit.

I hope that makes sense :)
I find that explaining a script piece by piece is often a good way to learn.


Log in to post a reply.

Support

Forums