Top 10 Content Patcher Code Errors

From Stardew Modding Wiki
Jump to navigation Jump to search

Starting from number 10 and working our way up, here's my list of the top 10 most annoying Content Patcher errors! Some of them have modding badges too, so if you've also had one of these errors, award yourself a badge. Vote on which error you think is the most irritating in this survey!

10. Wrong word in the When condition

Might just be a me thing, but some of the CP tokens are less intuitively named than others (looking at you, Day instead of Date and LocationName instead of Location).


9. Missing dependency

Technically a manifest error rather than a CP error, but I'm the one making this list so I'm including it. "Why is my code not overwriting the other mod properly/doing what the framework says it should?" you ask yourself. Because as far as your mod's concerned, that other mod/the framework doesn't exist.


8. Wrong filepath location

Low on the list because SMAPI picks it up pretty quickly, unless you use When: HasFile:{{FromFile}} in which case it'll just tell you it can't find the file without any more details. Thanks, SMAPI.


7. Wrong co-ordinates

This one's frustrating because it's easy to miss - SMAPI won't throw any errors, it just won't show the right thing because it's pasted the image somewhere else.


6. Changed a config or token name but forgot to update the Changes section

Sigh. This one's easy to miss in bugtesting if you forget that you changed it, so you just end up going "but this is the right name, why isn't it working?"


5. Forgetting the Update:OnLocationChange code

Another victim of "easy to miss + "doesn't show up in the SMAPI log as incorrect".


4. Forgot to update the manifest

Content.json's all beautifully polished up and completely bug-free, you upload the update, and an hour later you've got half a dozen people saying that SMAPI's telling them they still need to update even though they just did. Ugh.


3. Typo in the code

Pretty self-explanatory - we've all been there. It's particularly irritating if it's something like "EditImages" instead of "EditImage" so your spellchecker doesn't pick it up.


2. Bad query logic

Bad query logic takes second place because as noted in the CP documentation, queries just quietly fail instead of giving an error message, so they're a pain to bug test. Doesn't help that queries in general are confusing to begin with, so it's more likely that you'll make a mistake in the first place.


1. Missing comma / missing bracket

I think everyone saw this one coming. Missing comma/missing bracket take joint first place because they're so ubiquitous that they were what kickstarted our modding badges. Even people who've been modding for years still miss commas & brackets.