Combining Inventory Items

Hello, I'm new to Quest and am still working on my first game. I'd like to know if there's any way to combine two inventory items into one item. For example, there's a part in my game where you have to get past a guard who's blocking an entrance. I was planning on combining two items that are picked up earlier in the game (a cup of coffee and a bottle of sleeping pills) into one item (a cup of coffee laced with sleeping pills) in order to make the guard fall asleep. Is there anyway to do this?


There is! The title says converting one thing to another, but it works for any number:
http://docs.textadventures.co.uk/quest/convert.html


UPDATE:

Yeah.. do what Pixie said.


I'll leave these alternate methods listed, just in case...


  1. Create an object called cup of coffee laced with sleeping pills and set (none) as the parent. (The parent setting is the same window in which you name your new object.)

  2. Now, go select cup of coffee in your tree on the left of the screen. Go to the Features tab, and select the box marked Container.

  3. Select the tab labeled Container and select container from the drop-down menu.

  4. Uncheck can be opened and can be closed. (It's a cup, after all, right?)

  5. Towards the bottom, you'll see Script to run when trying to add an object. Copy the following and paste it into that script's code view:

if (object = bottle of sleeping pills) {
  MoveObject (cup of coffee laced with sleeping pills, player)
  RemoveObject (cup of coffee)
  RemoveObject (bottle of sleeping pills)
  msg ("Insert your message to print here! I.e., You put the pills into the coffee. They dissolve instantly.")
}

You could take a different route, and set up a GIVE option on the guard. It basically be the same setup though.

  1. Select the guard in the object tree on the left.

  2. go to the Features tab

  3. Check the box labeled Use/Give

  4. Select the Use/Give tab

  5. Check the box for Give this to other object

  6. Select handle objects individually from the drop-down menu

  7. click ADD, and click the drop-down menu's arrow to select the guard

  8. Past the following into the code view:

if (bottle of sleeping pills.parent = cup of coffee) {
  Remove(bottle of sleeping pills)
  Remove(cup of coffee)
  msg ("The guard take the cup, drinks it and passes out!")
  guard.unconscious = true
}

--
You'll also have to set up the exit you're blocking so you can pass through it when the guard is asleep.

We can help you out there if you need it when you get to writing that, just let us know!


Here's a link to the tutorial (it's quite helpful, and it's got screenshots to look at!):

http://docs.textadventures.co.uk/quest/tutorial/


Log in to post a reply.

Support

Forums