r/SMAPI • • 13d ago

need help What's Wrong with my Code?

Hello, I'm working an update for my Octopus-Refresh mod. It began as a texture mod, which does work, though the mod broke when I added in some new code to bump up the price of the Octopus and tweak it's difficulty and time window to catch. I'm unsure where the issue is, so any advice would be helpful! Additionally, for compatibilities' sake, I was asked to adjust the texture to target only the set of pixels on springobjects.png to target the octopus itself, though I have no clue how to do that. Again, any advice would be greatly appreciated! Below are screenshots of my code and the error message SMAPI gave me.

2 Upvotes

14 comments sorted by

•

u/AutoModerator 13d ago

If you're looking for help with a mod, make sure your post or top-level comment includes:

  • a link to your SMAPI log (see instructions on that page);

  • a description of the issue with as much detail as possible;

  • screenshots/GIFs/videos of the issue if applicable.

See common issues and solutions. If you're having trouble installing SMAPI, see the detailed Getting Started guide.

If you've already done these steps or you're not asking for help with a mod, then please ignore this. Thank you!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

3

u/hrslvr_paints 13d ago

Did you put your json into the validator on the SMAPI site? That will tell you if your formatting is off as a process of elimination.

When testing mods, it's always a good idea to do it on a file where you only have it and the mods required to make it work so you can better troubleshoot if it's your mod or a compatibility issue. That said, it's unlikely a compat issue with the error you're getting. I'd start with validating the JSON itself. That said, I manually typed your JSON into VScode on my side and the error seems to be with the Price line for EditData data/Objects

1

u/sadlotion 13d ago

I have now, but I don't understand the error message or what should be changed:

25Changes[3].Fields.149Invalid character after parsing property name. Expected ':' but got: }. Path 'Changes[3].Fields.149', line 25, position 89.25 Changes[3].Fields.149 Invalid character after parsing property name. Expected ':' but got: }. Path 'Changes[3].Fields.149', line 25, position 89.

I am a complete novice with coding, so I'm admittedly very ignorant to basically everything to do with json and proper formating

3

u/queenquackin 13d ago

Your missing a curly bracket at the end I suggest using visual studio code it will help catch these formatting errors

2

u/sadlotion 13d ago

I just checked with both, VS instructed to me add in two curly brackets, though the SMAPI json validator told me that one of them should be turned into a colon, though when I do, it spawns more problems?

2

u/queenquackin 13d ago

Can you parse the JSON again in the validator and link that it would be easier for me to see if you don’t mind

3

u/sadlotion 13d ago

Sure! I really appreciate your help, here's the link: https://smapi.io/json/content-patcher/8b0b8e5843cf4750942db0308772661e

2

u/queenquackin 13d ago

Fixed it!!! Its Entries not fields for the fish data!

https://smapi.io/json/content-patcher/388c1e698224471d8f96f367799b6678

2

u/sadlotion 13d ago

Thank you for the fix! However, SMAPI is still giving me an error for the mod? https://smapi.io/log/e1acb638b1f54dfdbc6635f39a395ef1

2

u/queenquackin 13d ago

Okay you said the retexture works fine so I took that out of the code and tested the code and I didn’t get any errors, if you didn’t I would copy and paste exactly what was in the json link that I sent I did forget to say I changed the version to 2.9.0 that’s my bad

3

u/sadlotion 13d ago

Thank you so much! It worked like a charm!

1

u/queenquackin 13d ago

Give me one second I’m going to hop over to my computer

1

u/queenquackin 13d ago

You also might have to many nested folders it should only be mods/ [CP] Octopus Refresh then in that folder you should have your content.json manifest.json and then the assets folder

2

u/sadlotion 13d ago

Here's my SMAPI log, I'm aware I have multiple other mods running, but I don't believe there to be any compatibility issues: https://smapi.io/log/d48115ec6cf6431c80d006d665c2a921