Giving an object to a character

How do I display that a character is holding an object during game play?

Can a character be carrying objects at the start of the game?
I also tried to drag a comb object to Mary in the Quest tree (left of screen) but there is no display of the comb on Mary when playing the game. The only way I've found is to make Mary a container but then Quest says Mary is 'containing' a comb rather than 'carrying' the comb.
I have not found a way to take the comb from Mary.
Is there a test to see if the character is holding an certain object?

As far as Quest is concerned, there's no difference between a character and any other object. They're just objects. To have her carrying something, make her a container. You can edit the message to say "carrying". A transparent container lets the player see what she's carrying; an open container lets them take things from her (though you'd probably want to add an addscript, to make player commands like "put key in mary" give an error)

Hi mrangel
'Give book to Mary' seems to work, rather than 'put book in Mary'

Different things; the give command is designed for NPCs. But if you make her a container so that the player can take her stuff, you need to remember to stop the player putting stuff in her.

Also consider another option (because I’ve had shit luck with containers):
If the NPC typically only carries a couple objects, I simply change the look at description using flags. You’d also have to change ask (for) scripts, take scripts to accommodate for the objects that NPC may or may not be holding.

I use this in the room description:

if (mary.parent = player.parent) {
  msg ("Mary is standing here. Blah Blah.")
    if  ( comb . parent = mary) {
       Msg ( " She is carrying a comb.")

you can get the game to show she has the comb after giving it to her with a:
at the end of the "give" script.

Not an expert but it works for me 😉

Thanks Forgewright.

That would give a more natural message than what Quest gives.

Log in to post a reply.