NPCs - FearAndDelight/Schedule-1-Modder-Documentation GitHub Wiki
Here are my notes when trying to add custom NPC functionality to Cute & Funny framework.
NPC Schedules is what makes the world feel alive. NPCs do not walk randomly, in fact their schedule is EXACTLY the same day to day down to where they buy drugs.
The base class all schedule components inherit from, and dictate what exactly happens during these events. Actions can be manually started and interrupted via code.
There are few types of actions baseline that you can tap into.
NPC Events are actions that happen on a time based schedule. They serve no purpose other than to make the world appear more lively (i.e going into a building)
Note: NPCEvent_LocationBasedAction is an exception, as this can invoke a UnityEvent during the start and end of the action. (onStartAction, onEndAction)
https://docs.unity3d.com/6000.0/Documentation/ScriptReference/Events.UnityEvent.html Currently looking into if you can do anything with it or not.
NPC Signals appear to be actions that have to be called in advance to start (i.e buying drugs)
Cosmetics are all stored in a list corresponding to the cosmetic type in AvatarSettings within the Avatar component. Here is an example, where NPC is the gameobject you of the NPC.
Avatar civAvatar = NPC.GetComponentInChildren<Avatar>();
//If you are making an NPC from a prefab you NEED to make a new avatarsettings instance.
AvatarSettings civAvatarSettings = ScriptableObject.CreateInstance<AvatarSettings>();
civAvatarSettings.AccessorySettings.Add(new AvatarSettings.AccessorySetting
{
path = "Avatar/Accessories/Feet/CombatBoots/CombatBoots",
color = Color.black
});
civAvatarSettings.AccessorySettings.Add(new AvatarSettings.AccessorySetting
{
path = "Avatar/Accessories/Head/Saucepan/Saucepan",
color = Color.white
});
civAvatarSettings.HairPath = "Avatar/Hair/LongCurly/LongCurly";
civAvatarSettings.SkinColor = new Color32(144, 128, 115, 255);
civAvatar.CurrentSettings = civAvatarSettings;
civAvatar.ApplyHairSettings(civAvatarSettings);
civAvatar.ApplyAccessorySettings(civAvatarSettings);
civAvatar.ApplyBodyLayerSettings(civAvatarSettings);
//DO NOT USE LoadAvatarSettings!!! Rn, it bugs out and renders the avatar invisible.
Do keep in mind, there is a limit to how many layers and accessories can be worn at one time!