Changes

→‎Portraits: remove broken hotlinked image (images should be uploaded to the wiki with an open license instead)
Line 6: Line 6:     
==Files to edit==
 
==Files to edit==
To create a new NPC, you need to edit a number of different files. However, you don't need any programming experience and it can be done with {{nexus mod|1915|Content Patcher}}.
+
To create a new NPC, you need to edit a number of different files. However, you don't need any programming experience and it can be done with [[Modding:Content Patcher|Content Patcher]].
    
===Basic info===
 
===Basic info===
Line 53: Line 53:  
| datable
 
| datable
 
| <samp>datable</samp>
 
| <samp>datable</samp>
| Whether the NPC is <samp>datable</samp> or <samp>not-datable</samp>. This toggles the romance features (''e.g.,'' 'single' label in the social menu, bouquet gifting, and marriage).
+
| Whether the NPC is <samp>datable</samp>, <samp>not-datable</samp>, or <samp>secret</samp>. The former two toggle the romance features (''e.g.,'' 'single' label in the social menu, bouquet gifting, and marriage), while <samp>secret</samp> is used exclusively for Krobus, who cannot be married but can be made a roommate.
 
|-
 
|-
 
| 6
 
| 6
Line 94: Line 94:  
</syntaxhighlight>
 
</syntaxhighlight>
   −
The line can be broken down into 5 pairs of dialogue + item IDs in this order: Love, Like, Neutral, Dislike, Hate. If a dialogue field is empty, the game will use a generic dialogue text. See [[Modding:Items]] for the object IDs.
+
The line can be broken down into 5 pairs of dialogue + item IDs in this order: Love, Like, Dislike, Hate, Neutral. If a dialogue field is empty, the game will use a generic dialogue text. See [[Modding:Items]] for the object IDs.
    
====Birthday gift responses====
 
====Birthday gift responses====
Line 148: Line 148:  
| <samp>"Oh, a birthday gift! Thank you./Oh, a birthday gift! Thank you."</samp>
 
| <samp>"Oh, a birthday gift! Thank you./Oh, a birthday gift! Thank you."</samp>
 
|}
 
|}
 +
 +
The <samp>$h</samp> and <samp>$s</samp> are [[Modding:Dialogue#Portrait_commands|portrait commands]] that select the portrait image of the character to use.
    
===Overworld sprites===
 
===Overworld sprites===
Line 216: Line 218:     
===Portraits===
 
===Portraits===
 +
[[File:Modding - creating an XNB mod - example portraits.png|thumb|Abigail's portrait sprite sheet.]]
 +
 
The dialogue portraits are stored in <samp>Portraits/NpcName</samp>. Each frame is exactly 64x64 per portrait. The first six represent specific emotions (see [[Modding:Dialogue#Portrait commands]]), followed by any number of custom portraits. The first portrait is used when the dialogue doesn't specify one.
 
The dialogue portraits are stored in <samp>Portraits/NpcName</samp>. Each frame is exactly 64x64 per portrait. The first six represent specific emotions (see [[Modding:Dialogue#Portrait commands]]), followed by any number of custom portraits. The first portrait is used when the dialogue doesn't specify one.
  −
Here's an [https://cdn.discordapp.com/attachments/156109690059751424/729820558966915122/unknown.png example portrait guide], courtesy of TheLimeyDragon#1993 on Discord.
      
===Schedule===
 
===Schedule===
Line 227: Line 229:     
===Festivals===
 
===Festivals===
Custom NPCs should be added to festivals via the <samp>Set-Up_additionalCharacters</samp> field in the [[Modding:Festival_data#Data_file|festival's data file]]. You may also want to visit [https://stardewmodding.wiki/wiki/Custom_NPC_Tiles Custom NPC festival tile positions] to check the positions of various existing NPCs for compatibility purposes.
+
Custom NPCs should be added to festivals via the <samp>Set-Up_additionalCharacters</samp> and <samp>MainEvent_additionalCharacters</samp> fields in the [[Modding:Festival_data#Data_file|festival's data file]]. You may also want to visit [https://stardewmodding.wiki.gg/wiki/Custom_NPC_Tiles Custom NPC festival tile positions] to check the positions of various existing NPCs for compatibility purposes.
    
(Prior to Stardew Valley 1.5, {{nexus mod|1820|TMXL}} was the recommended tool for adding festival spots.)
 
(Prior to Stardew Valley 1.5, {{nexus mod|1820|TMXL}} was the recommended tool for adding festival spots.)
 +
 +
===Movie theater===
 +
An NPC's taste in movies and concessions are stored in <samp>Data\MoviesReactions.xnb</samp> and <samp>Data\ConcessionTastes.xnb</samp>, respectively. See [[Modding:Movie theater data]] for details on how these function.
 +
 +
===Spouse room===
 +
If your NPC will be a marriage candidate, note that you can add a spouse room for them much more easily after game version 1.5.5. See [[Modding:Migrate_to_Stardew_Valley_1.5.5#Custom_spouse_rooms]] for details.
 +
 +
===Sleep animation===
 +
When the NPC goes to bed, they'll play the looping sleep animation set via <samp>{{t|lowercase NPC name}}_sleep</samp> in <samp>Data/animationDescriptions</samp>, if it exists. For example, this content pack adds a sleep animation for an NPC named 'Pufferbob':
 +
{{#tag:syntaxhighlight|
 +
{
 +
    "Format": "{{Content Patcher version}}",
 +
    "Changes": [
 +
        {
 +
            "Action": "EditData",
 +
            "Target": "Data/animationDescriptions",
 +
            "Entries": {
 +
                "pufferbob_sleep": "50/50/50" // note: make name lowercase
 +
            }
 +
        }
 +
    ]
 +
}
 +
|lang=json}}
 +
}
    
==Adding your NPC==
 
==Adding your NPC==
Line 251: Line 277:  
             "Action": "Load",
 
             "Action": "Load",
 
             "Target": "Characters/Dobson",
 
             "Target": "Characters/Dobson",
             "FromFile": "assets/sprites.png",
+
             "FromFile": "assets/sprites.png"
 
         },
 
         },
 
         {
 
         {
 
             "Action": "Load",
 
             "Action": "Load",
 
             "Target": "Portraits/Dobson",
 
             "Target": "Portraits/Dobson",
             "FromFile": "assets/portraits.png",
+
             "FromFile": "assets/portraits.png"
 
         },
 
         },
 
         {
 
         {
 
             "Action": "Load",
 
             "Action": "Load",
 
             "Target": "Characters/Dialogue/Dobson",
 
             "Target": "Characters/Dialogue/Dobson",
             "FromFile": "assets/dialogue.json",
+
             "FromFile": "assets/dialogue.json"
 
         },
 
         },
 
         {
 
         {
 
             "Action": "Load",
 
             "Action": "Load",
 
             "Target": "Characters/Dialogue/MarriageDialogueDobson",
 
             "Target": "Characters/Dialogue/MarriageDialogueDobson",
             "FromFile": "assets/marriageDialogue.json",
+
             "FromFile": "assets/marriageDialogue.json"
 
         },
 
         },
 
         {
 
         {
 
             "Action": "Load",
 
             "Action": "Load",
 
             "Target": "Characters/schedules/Dobson",
 
             "Target": "Characters/schedules/Dobson",
             "FromFile": "assets/schedule.json",
+
             "FromFile": "assets/schedule.json"
 
         },
 
         },
 
         {
 
         {
Line 278: Line 304:  
             "Entries": {
 
             "Entries": {
 
                 "Dobson": "adult/rude/neutral/positive/male/datable//Town/summer 7//BusStop 19 4/Dobson"
 
                 "Dobson": "adult/rude/neutral/positive/male/datable//Town/summer 7//BusStop 19 4/Dobson"
             },
+
             }
 
         },
 
         },
 
         {
 
         {
Line 284: Line 310:  
             "Target": "Data/NPCGiftTastes",
 
             "Target": "Data/NPCGiftTastes",
 
             "Entries": {
 
             "Entries": {
                 "Dobson": "You're giving this to me? This is amazing!/207 232 233 400/Thank you! This is a very interesting specimen./-5 -79 422/...What is this?/80 330/This is disgusting./2/That was very thoughtful of you./-4/ ",
+
                 "Dobson": "You're giving this to me? This is amazing!/207 232 233 400/Thank you! This is a very interesting specimen./-5 -79 422/...What is this?/80 330/This is disgusting./2/That was very thoughtful of you./-4/ "
             },
+
             }
 
         },
 
         },
 
         {
 
         {
Line 292: Line 318:  
             "Entries": {
 
             "Entries": {
 
                 "Dobson0": "I can't believe I am about to be married!$h",
 
                 "Dobson0": "I can't believe I am about to be married!$h",
                 "Dobson1": "I hope I don't get cold feet",
+
                 "Dobson1": "I hope I don't get cold feet"
             },
+
             }
         },
+
         }
 
     ]
 
     ]
 
}
 
}
translators
8,404

edits