Looking at scenery objects of NPC characters

Mokonzi
25 Mar 2018, 07:48

I've been looking over the forums to see if I can get an answer to this question, but no luck so far... so I'm posting to see if someone can tell me what I'm doing wrong.

I've been playing with the idea of using scenery objects as a way of describing specific features of a NPC character, i.e. "look at george's tattoo", "examine eve's necklace" where I want to the objects visible to be examined when the character first encounters the NPC.

I've setup this parent/child structure using objects:

Room > Character > Scenery Object

So far when I try to look at the scenery object, I get a 'You can't see that" response.

Can you give me any heads up what I might be doing wrong so that I can't actually 'see' the item.

I've tried moving the scenery item to be a direct child of the room and then I can look at it. But as a child of the character, no success.

Thanks again for your help.

Mokonzi


The Pixie
25 Mar 2018, 08:59

Try setting the character to be a surface (type of container). There made be unexpected side effects, so test well!


Mokonzi
25 Mar 2018, 15:25

Interesting idea... I'll see how that works... :D


XanMag
25 Mar 2018, 17:19

Does the NPC object change rooms frequently?

If not, just put them in the same room as the NPC. They don’t have to be a child of the actual object.

If so, Pixie’s plan will work. You will have to adjust the prefix/suffix or whatever you call that.


K.V.
25 Mar 2018, 17:24

I do exactly what Pixie suggested.

You'll probably want to change the following:

image


I also add a take script to things which may be carried by Ralph.

if (this.parent = Ralph){
  msg("Ralph hands over " + GetDisplayName(this) + ".")
  AddToInventory(this)
}
else {
  msg("You pick " + this.article + " up.")
  AddToInventory(this)
}

image


K.V.
25 Mar 2018, 17:26

XanMag's method works, too.


Mokonzi
27 Mar 2018, 07:26

I like these ideas. I'll try this today and let you know how I get on. :)


CheeseMyBaby
27 Mar 2018, 09:26

Very interesting and helpful.
Thanks the Pixie and K.V.!


The Pixie
27 Mar 2018, 10:36

Another possibility is have the person a closed transparent container. That would stop the player being able to take the objects, but still see them. If using the desktop version, you can over override the "ObjectNotOpen" dynamic template to this:

NotOpenResponse(object)

Then create a new function, "NotOpenResponse", returning a string, with a single parameter, "object":

if (DoesInherit(object, "npc_type")) {
  return (CapFirst(object.gender) + " won't let you do that.")
}
else {
  return (CapFirst(GetDisplayAlias(object)) + " " + Conjugate(object, "be") + " not open.")
}

Mokonzi
27 Mar 2018, 10:48

It worked great. I also had to check the 'Hide children until object is looked at' option, otherwise it would display the 'on which' information.

Thanks for the help on this one. I appreciate such an active and responsive community. :)


Mokonzi
27 Mar 2018, 11:10

Thanks for the extra idea The Pixie. Had to work on the carrying issue, because any worn items would be displayed as 'worn', so added an extra line of script code to remove the worn items from the list of 'carried' items.