RELEASED [SMAPI] CustomNPC

Discussion in 'Mods' started by Platonymous, Nov 5, 2017.

  1. Mizzion

    Mizzion Phantasmal Quasar

    Could you post your NPC's json file? As for the file its looking for. That is where the mod creator compiled his mod from.
     
    • Darkry 115

      Darkry 115 Void-Bound Voyager

      Sure thing. It's not letting me post the .json directly so here's a .txt.
       

        Attached Files:

      • Mizzion

        Mizzion Phantasmal Quasar

        Could you also post your dialogue.tsv file please. If you don't mind, maybe it would be better to post your entire npc folder. That way we're not asking for different files over and over.
         
        • Darkry 115

          Darkry 115 Void-Bound Voyager

          Okay, here are the documents. They're not very exciting considering I'm still working out his character.
           

            Attached Files:

          • Mizzion

            Mizzion Phantasmal Quasar

            Ok, here's what I've seen. Inside your dialogue.txt file. You have "loveItemdialogue" but it's looking for "loveItemDialogue". Same for the other ones such as like, hate. Next thing I noticed, you have empty lines in the animations file. I don't think it's liking that.
             
            • Darkry 115

              Darkry 115 Void-Bound Voyager

              We're making progress, I think. The documents are case sensitive. Now, I get this error after I have loaded my save.

              [22:30:16 INFO Custom NPC] Rex 1.0.0 by Darkry 115
              [22:30:16 DEBUG Custom NPC] Placed Rex on Map: <Saloon>
              [22:30:16 ERROR Custom NPC] This mod failed in the TimeEvents.AfterDayStarted event. Technical details:
              System.NullReferenceException: Object reference not set to an instance of an object.
              at CustomNPC.CustomNPCMod.placeNPCs() in C:\Users\David\Documents\GitHub\Stardew-Valley-Mods\CustomNPC\CustomNPCMod.cs:line 187
              at CustomNPC.CustomNPCMod.TimeEvents_AfterDayStarted(Object sender, EventArgs e) in C:\Users\David\Documents\GitHub\Stardew-Valley-Mods\CustomNPC\CustomNPCMod.cs:line 81
              at StardewModdingAPI.Framework.Events.ManagedEvent.Raise() in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\Events\ManagedEvent.cs:line 110
               
              • Mizzion

                Mizzion Phantasmal Quasar

                Next things on the list is in your json, you have

                But it should be like

                 
                  Darkry 115 likes this.
                • Darkry 115

                  Darkry 115 Void-Bound Voyager

                  It works now! Except he's just standing in the same place in the Saloon breathing all day, but he's there and he talks so that's great.
                   
                  • Mizzion

                    Mizzion Phantasmal Quasar

                    The not walking part, must be something in the animations file.
                     
                    • Darkry 115

                      Darkry 115 Void-Bound Voyager

                      I still haven't figured it out and it doesn't seem like I'll be able to figure it out tonight, but I'd like to thank you for all the help you've been, Mizzion.
                       
                      • Platonymous

                        Platonymous Big Damn Hero

                        The format is a bit off, you were missing some tabs in the schedule.
                        (Use Notepad+ to edit the file and acivate "Show All Characters" to see the tabs as arrows in the document)
                        Also the keys aren't right (should be Mon instead of Monday) and the animation dialogue is missing it's %.
                        You should however use a variable for that and define it in dialogues so if you or anyone ever wants to translate the mod it's all in one place.
                        And yes the Item Dialogue keys are case sensitive.
                        I quickly made those changes for you. I might have overlooked something but see if this works better.

                        For the json: You don't need to include any line that has the default value, in your case: crush, relations, datable, gender, facing, age, and displayname.
                         

                          Attached Files:

                          Darkry 115 likes this.
                        • Darkry 115

                          Darkry 115 Void-Bound Voyager

                          Yes, I caught the error I made in writing out the weekdays, but not the other ones, so thank you for that. He's out and about now! The only thing amiss is that his animation dialogue is not displaying his portrait and it doesn't help if I put $0 or any other number after the dialogue string. This is a minor thing, though.
                           
                          • Platonymous

                            Platonymous Big Damn Hero

                            That's on me, just take the % back out :D
                             
                            • thingwithwings

                              thingwithwings Phantasmal Quasar

                              I saw a while back that a template would be available for creating new NPCs, is that still in the works, or maybe published somewhere separate from the customnpc mod?

                              (honestly, i mostly just need help figuring out the schedule and animation files, the rest i can figure out on my own haha)
                               
                                .Lavender. and HopeWasHere like this.
                              • hwayunhae

                                hwayunhae Pangalactic Porcupine

                                Since there's already one (mostly) working NPC, I believe some of us (or at least myself), intend to use that as a basic template to learn what to do to make our own npcs. I hope to finish a personal project soon where I take some of the "famous characters" NPC replacements and turn them into actual NPCs, so I don't have to choose between, for example, having Diverse Sam and Sebastian, or having Prompto and Noctis (from FFXV) in my game. :D
                                 
                                  thingwithwings and HopeWasHere like this.
                                • Ztluh

                                  Ztluh Scruffy Nerf-Herder

                                  Hey, sorry if this thread is dead. I was wondering if anyone can explain adding a building+Interior? I have them made, and have been trying to use both the Alec and Nagito examples, but for some reason it's been alluding me. Any help or direction to a more detailed explanation would be appreciated.
                                   
                                    Last edited: May 15, 2018
                                  • AxlPrototype

                                    AxlPrototype Void-Bound Voyager

                                    Is it dead yet? I'm curious to know if it's possible to add "neutral items" into the NPC's item preference. The items are default to their universal liking (for example, everyone dislikes fish). Obviously, by including the fish ID in "love", "like", or "hate" would do the trick and adjust the preference, but I wan't to know why there isn't a way to configure an NPC's "neutral" item lists? In short, I want my NPC to accept fish as neutral gifts.
                                     
                                    • Scribe336

                                      Scribe336 Space Hobo

                                      So, I'm keen to create an NPC, but have absolutely no idea what I'm doing. Can anyone give me, or link me to a crash course in json. file creation?
                                      I know it's all listed up there, but to my uneducated eyes it just looks like gibberish.
                                      My apologies for the bother.
                                       
                                      • Alandauron

                                        Alandauron Space Hobo

                                        Platonymous, just wanted to ask if you were planning to update your mods to the MP beta or if you only intend to work with the single player version of the game? Other than that awesome project and I'm using the structure you have in place to build my own project for new NPCs in MP.
                                         
                                        • Lukaja

                                          Lukaja Void-Bound Voyager

                                          I'm pretty sure I wrote everything correctly but I always end up with this error:

                                          [Custom NPC] Mod crashed when editing asset 'Data\NPCGiftTastes', which may cause errors in-game. Error details:
                                          System.IO.FileNotFoundException: Could not find file 'C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley\Mods\CustomNPC\Npcs\Jeff\none'.
                                          File name: 'C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley\Mods\CustomNPC\Npcs\Jeff\none'
                                          at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
                                          at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
                                          at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
                                          at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize, Boolean checkHost)
                                          at System.IO.StreamReader..ctor(String path, Encoding encoding)
                                          at System.IO.File.ReadLines(String path)
                                          at CustomNPC.CustomNPCMod.loadCSV(NPCBlueprint blueprint, String file, Boolean translate, Int32 type) in C:\Users\David\Documents\GitHub\Stardew-Valley-Mods\CustomNPC\CustomNPCMod.cs:line 714
                                          at CustomNPC.CustomNPCMod.getAnimations(NPCBlueprint blueprint, Boolean parse) in C:\Users\David\Documents\GitHub\Stardew-Valley-Mods\CustomNPC\CustomNPCMod.cs:line 787
                                          at CustomNPC.CustomNPCMod.parseVariables(String data, NPCBlueprint blueprint) in C:\Users\David\Documents\GitHub\Stardew-Valley-Mods\CustomNPC\CustomNPCMod.cs:line 302
                                          at CustomNPC.CustomNPCMod.loadCSV(NPCBlueprint blueprint, String file, Boolean translate, Int32 type) in C:\Users\David\Documents\GitHub\Stardew-Valley-Mods\CustomNPC\CustomNPCMod.cs:line 729
                                          at CustomNPC.CustomNPCMod.getDialogue(NPCBlueprint blueprint, Boolean parse) in C:\Users\David\Documents\GitHub\Stardew-Valley-Mods\CustomNPC\CustomNPCMod.cs:line 896
                                          at CustomNPC.CustomNPCMod.getGiftTastes(NPCBlueprint blueprint) in C:\Users\David\Documents\GitHub\Stardew-Valley-Mods\CustomNPC\CustomNPCMod.cs:line 922
                                          at CustomNPC.CustomNPCMod.Edit[T](IAssetData asset) in C:\Users\David\Documents\GitHub\Stardew-Valley-Mods\CustomNPC\CustomNPCMod.cs:line 1241
                                          at StardewModdingAPI.Framework.ContentCore.ApplyEditors[T](IAssetInfo info, IAssetData asset) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\ContentCore.cs:line 733

                                          Thanks for any help i get
                                           

                                          Share This Page