-
Notifications
You must be signed in to change notification settings - Fork 0
Bestiary
Rijam edited this page Mar 26, 2024
·
1 revision
If you've taken a look at your Town NPC in the bestiary, you will notice that it just stands still, has no background, and has no description. We can easily add those with the following:
In SetStaticDefaults(), add:
// Influences how the NPC looks in the Bestiary
NPCID.Sets.NPCBestiaryDrawModifiers drawModifiers = new(0) {
Velocity = 1f, // Draws the NPC in the bestiary as if it's walking +1 tiles in the x direction
Direction = -1 // Faces left
};
NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, drawModifiers);We also need to override the SetBestiary() hook:
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) {
bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] {
// The first line is for the background. Auto complete is recommended to see the available options.
// Generally, this is set to the background of the biome that the Town NPC most loves/likes, but it is not automatic.
BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.TheHallow,
// Examples for how to modify the background
// BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Visuals.Blizzard,
// BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Times.NightTime,
// This line is for the description of the entry. We are accessing a localization key here.
new FlavorTextBestiaryInfoElement("Mods.TownNPCGuide.NPCs.TutorialTownNPC.Bestiary")
});
}Here is the localization for this example.
Mods: {
TownNPCGuide: {
NPCs: {
TutorialTownNPC: {
# Other keys omitted for this example.
Bestiary: This NPC is here to teach all about creating your own Town NPCs!
}
}
}
}Basic Guides
Intermediate Guides
Advanced Guides
- Preliminaries and What are Town NPCs?
- Spriting
- Create Your Town NPC's Class
- Spawn Condition
- Names
- Chat
- Buttons
- Shop
- Attacking
- Bestiary
- Happiness
- Profile
- Gore
- Misc
- Editing Vanilla NPCs with Global NPC