Help With NPC Hapiness

RoboBro🌳

Skeletron
Does anyone know how to add happiness dialogue?

1660186178232.png


If anyone knows how to, can you put a snippet/tell me what to write to add it?

Thanks!
 
Also do you know how to add unique dialogue for each liked/disliked biome and npc?
C#:
    public class SomeNPC : ModNPC
    {

        public override void SetStaticDefaults()
        {
            // Your code
            //...
            //...
            // happiness
            NPC.Happiness
                .SetBiomeAffection<ForestBiome>(AffectionLevel.Like) // prefers the forest.
                .SetBiomeAffection<SnowBiome>(AffectionLevel.Dislike) // dislikes the snow.
                .SetBiomeAffection<ExampleSurfaceBiome>(AffectionLevel.Love) // likes the Example Surface Biome
                .SetNPCAffection(NPCID.Dryad, AffectionLevel.Love) // Loves living near the dryad.
                .SetNPCAffection(NPCID.Guide, AffectionLevel.Like) // Likes living near the guide.
                .SetNPCAffection(NPCID.Merchant, AffectionLevel.Dislike) // Dislikes living near the merchant.
                .SetNPCAffection(NPCID.Demolitionist, AffectionLevel.Hate); // Hates living near the demolitionist. // < Mind the semicolon!
        }
And the text can be configured in the localization file, as I showed above
2.
View attachment 379931
I've created the .hjson file, but how would I do it with code like this?
Unfortunately, happiness dialogs can only be added using the method I showed
 
C#:
    public class SomeNPC : ModNPC
    {

        public override void SetStaticDefaults()
        {
            // Your code
            //...
            //...
            // happiness
            NPC.Happiness
                .SetBiomeAffection<ForestBiome>(AffectionLevel.Like) // prefers the forest.
                .SetBiomeAffection<SnowBiome>(AffectionLevel.Dislike) // dislikes the snow.
                .SetBiomeAffection<ExampleSurfaceBiome>(AffectionLevel.Love) // likes the Example Surface Biome
                .SetNPCAffection(NPCID.Dryad, AffectionLevel.Love) // Loves living near the dryad.
                .SetNPCAffection(NPCID.Guide, AffectionLevel.Like) // Likes living near the guide.
                .SetNPCAffection(NPCID.Merchant, AffectionLevel.Dislike) // Dislikes living near the merchant.
                .SetNPCAffection(NPCID.Demolitionist, AffectionLevel.Hate); // Hates living near the demolitionist. // < Mind the semicolon!
        }
And the text can be configured in the localization file, as I showed above
2.

Unfortunately, happiness dialogs can only be added using the method I showed
i fixed it. now im updating their shops and adding a new npc
 
Back
Top Bottom