NPC clothing: starting off wearing clothing, changing clothing during game.

Hi

Another question from a beginner that has no doubt been asked before, but I'm struggling with it...

I have an NPC that I want to start off wearing an item of clothing. How do I do that? I've cobbled together something with scripts, but it's a bit unwieldy. After searching the forum, I added this library:

https://github.com/ThePix/quest/wiki/Library:-Independent-NPCs

which sounded like it would be the answer to my prayers, but I still can't figure out how I get the NPC to wear clothing. The actions that need to happen in the game are:

  1. NCP starts out wearing bathrobe.
  2. NCP removes bathrobe at certain point in game.
  3. Player gives NPC a towel and he wears that.

How do I achieve those things?


My simply solution and one that would only work if your NPC is “*limited”...
Create 3 different NPCs.
One wearing a bathrobe.
Second switched “into” game when bathrobe is removed.
The third switched into game when the player gives him a towel.

It is simple and gives the illusion (to the player) of there being one NPC - one with bathrobe, one naked (?), and one without. The only person who knows they are different is the author.

I find this simpler and far less code-cumbersome than creating all sorts of stuff on one object.

*limited in that you don’t have a bunch of code tied to one NPC. Even then, the needed code can be copy-pasted as needed.


Thanks - that's similar to what I've got already and it does work as far as it goes (I've got a couple of flags and scripts that change the npc object description and location of the clothing objects each time). Just feels like there should be a way of getting to 'man (wearing bathrobe)' etc with the npc really wearing the object, in a more complicated game. Maybe there is no simple way?


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums