Hello! First of all, I'm not sure if I'm posting this in the right thread or not. If I didn't, do tell me, I apologize. Anyway, I was adding more events to NPCs and everything worked great until today. I was modifying an already existing (but new, created by me) event, which worked fine a few days ago and I haven't touched since, but today I really just changed some portrait commands because I also added more portraits to Alex. I did also add a bit more dialogue to it to match those new portraits, but I don't think any of that is the root of my problem - even when I deleted those changes it didn't work. Removing the entire event does make it work. Now, I've been having problems with any xnb converter I used, but finally stumbled upon https://www.nexusmods.com/stardewvalley/mods/1080?tab=description&BH=0 <- this one (together with the normal xnb.node). The only one that actually gave me an error code: "SyntaxError: Unexpected token I at Object.parse (native) at getValue (C:\Users\Lucai\Documents\My Games\Stardew.Valley.v1.3.36\xnb-node\typeyaml.js:203:18) at getObject (C:\Users\Lucai\Documents\My Games\Stardew.Valley.v1.3.36\xnb-node\typeyaml.js:180:21) at getObject (C:\Users\Lucai\Documents\My Games\Stardew.Valley.v1.3.36\xnb-node\typeyaml.js:182:21) at Object.parse (C:\Users\Lucai\Documents\My Games\Stardew.Valley.v1.3.36\xnb-node\typeyaml.js:222:12) at packXnb (C:\Users\Lucai\Documents\My Games\Stardew.Valley.v1.3.36\xnb-node\main.js:50:25) at C:\Users\Lucai\Documents\My Games\Stardew.Valley.v1.3.36\xnb-node\main.js:60:16 at Walker.<anonymous> (C:\Users\Marti\Documents\My Games\Stardew.Valley.v1.3.36\xnb-node\main.js:100:13) at emitThree (events.js:110:13) at Walker.emit (events.js:188:7)" I don't know if anyone can help me with this alone, if the actual .yaml file is needed, I can upload that (.....it is nsfw though.) At first I thought that somewhere in that document, I added an " I " where it intervened with the code or what not, so I literally searched the entire document for I's, went through all the ones in the troublesome event (since removing it makes it work again, I assume I just have to check that part). But it doesn't look like I did. I'd really appreciate if anyone could help. Thank you in advance.
Is there a specific reason you are trying to repack into XNB? XNBnode is a bit outdated, XNBCli is the newer version. Pathos also has a XNB unpacker on his GitHub page available. I'm afraid most of us aren't very familiar with repacking, as all frameworks support using PNGs, json, tbin, etc.
I've tried all of those converters, that xnb node "expansion" is just the only one where I can see that something is wrong with the file, not the converter (i think?) I guess not, I just don't know how to make mods. I know CP is supposed to be easy, but at least for now I'd rather stick to XNB's. If need be I'll try to learn about it but I can't even find any step-by-step, iidiotproof guides on creating mods
I don't know how to unpack/pack XNBs correctly beyond using XNBCLI; I'm sorry you're having trouble. If you were interested in learning how to make CP mods, these links can help you get started: Wiki's Content Patcher Guide Wiki's Manifest Info Pathoschild's Content Patcher documentation
Thanks for the links. Still, funnily enough, what's supposed to make it easier, actually makes it harder for me (e.g. how you can type "ActionLoad", "When" etc. instead of writing the entire key, among other stuff), but now I'm pretty sure I just have an issue with json, not the actual modding. I'll just have to rewrite my event some time. Also, in case someone else is having problems: I found a site that shows you the problem with your text & formats it. Found it pretty useful. https://jsonlint.com/ Other than that, guess we're done here lol. Thanks for the help again!
Huh, this community has it all doesn't it! What would be different from the normal validator? I mean, if the code is wrong, json won't be able to read it no matter if Stardew or not, right?
The Content Patcher code (as well as SMAPI) handle some SDV specific json things, like being able to use comment blocks in your json. Pathos is the tech whiz behind the whole thing if you're curious how it works. So this validator handles the specific SDV formats, since they are a tad different.
Ah, yes, I tested it earlier (with a different code). Normal validator? Valid. This SV one? Expected Object instead of String. Interesting. I'll have one or two last tries to fix the code. I don't know if it's just me, but between commands, json seems to add weird "\r\n\t\t" or "\t\r\t\r", etc, stuff. Seems to be added automatically, and when I was editing a map earlier, I included those things when I probably shouldn't have? Not the case for my initial event modding problem, but I was already set on retyping it all individually when I get the chance, rather than skimming through to find the error but just lose/not find it.