#making-mods-general
1 messages · Page 379 of 1
which is how parsers for languages where whitespace doesn't matter read it
so comments would still be allowed in there
the block style anyway
... I hope I never have to read a minified Json then
That sounds awful to read/parse
I mean u just format it with whatever editor first
how would you do that, chu?
This is for shipping off to endpoint
Genuine question because it might be helpful formatting wise
Uh depends on the editor
yeah minifying is for saving bytes in your final file sizes
bc the whitespace adds up
I have format on save enabled in vsc so i just save and that's it
From software pov they r equiv and the places to add space and newline for reading is well defined
Yeah I know about the whitespace adding up thing for pretty much any file, unfortunately
(Long story, shared work file was 100 MB, got it down to under 1 MB by killing whitespace/blank cells that had somehow been added and I confirmed with work it was blank)
I feel like I need this now, brb
Imo vsc has much better json support than np++
that is a fuckton of blank cells lol
And it's not locked to vsc official u can use vscodium
I think npp is lower support in everything
but anyway I'm on mobile and can't really troubleshoot well on here so someone should probably help them figure out their location issue
It's windows exclusive anyway i don't think about it existing much
ggVG=
I use vim btw
Yes, yes it is
I had to actually confirm they were blank and not going to lose any data before I did it
And I was just like "what.... the.... fuck...."
Anyway, update, Json Viewer -> Format Json does it, but it removes comments
So does anyone know why it’s saying it’s invalid?
Can you try patch export on the tmx you loaded
Your MapPath is wrong
replace Locations with Maps
And change the load target to match
the fact that they don't match is why it's erroring actually but they should probably be in maps anyway
the one in your log is different
Wouldn’t that mean when people download it those files would be missing though? I have no maps folder in my mod
And again, the first location is working fine
The Target is made up
it's just that a lot of things rely on it being "Maps/" specifically
regardless, your MapPath and your Target for the beach cave don't match anyway
What specifically needs to be fixed
line 71 and line 79 do not match values
What should they say?
I’m an idiot
It’s working now, thanks for your help. Sorry it took so long to understand, it’s my first time making a mod
everyone was at one point making their first mod, nothing to apologize for
Is it normal for a warp to not be working but not show up in the SMAPI console?
for that you probably do want to start with a patch export of the map to make sure your warp is there
How do I do that
patch export YourMapAssetHere in your console
Ok. Also, would you happen to know how to make it so when you click on something it brings up an option NPC asking if you want to visit x location and if you hit yes it warps you?
MMAP or BETAS maybe, or a minecart system if the NPC wasn't gonna move
Yep
I've never test if it works or not, but you can use $q then in the answer add $v to enter an event then changeLocation to the new location.
makes you use a farm totem
-# can you start an event, change map and immediately end the event?
that's hitme's suggestion right
but yea if u were doing this with mmap it is a map action question dialogue and then warp
Very new to modding, what would the format in the JSON need to be for that?
the warp is perfectly ordinary
interesting verbiage. when is MMAP going to add an unusual warp?
so in theory, this should work right??
https://smapi.io/json/none/1d463b39fcab4fb0b2e5b6e4b238514f
Both $v and $q are in Modding:Dialogue
And changeLocation is in Modding:Event
use Fields instead of Entries, right now you're wiping the entire locationI guess you don't need this if you're only interested in setting that one field?- as mentioned in the other thread the season override will only update when the save is reloaded
otherwise
dang so no work around at all
woops
3. your When is inside Entries
there's no workaround to a game limitation itself
maybe you can nerd snipe one of the resident framework modders
id hate to bug ppl so much
@ chu @ button
hmm I wonder if just reseting the cached override season is sufficient
not sure how the tilesheets are handled
I would help but I don't have a map mod and I'm also cooking linner (lunch/dinner aka my one daily meal) rn
ill look as soon as i defeat mac inlining again
ig it should ideally be a traction?
GameLocation.seasonOverride = null should force reload
if its something thats more of a "bug" of sorts in the base game and is to be looked at in 1.6.16, im less inclined, even though i know thats potentially a ways away
what do you want it for
I wanted my custom location to have different seasons from pelican town
To give the illusion of being across the world
but they still need to change?
Yeah
there's a few ways to imply it i think
that said knowing not really anything about the issue bc i dont really understand what it is, if its a problem with sometihng not being properly invalidated when the overlying asset is, that seems like something that SMAPI could fix too, isnt it? hasnt SMAPI handled similar stuff before?
like special seeds that only grow where u are
If you don't have crops growing there you could bodge job it by renameing the spring tilesheets to fall, summer to winter, etc?
tilesheets
It's ok I can wait for a fix pathos told me he would look into it
Looking through the decompiled FarmAnimals.cs at where the HappinessDrain is used, and I see where it gets subtracted, but if I'm understanding this correctly, it also looks like it gets added under certain circumstances:
this.happiness.Value = (byte)Math.Min(255, this.happiness.Value + Math.Max(5, 30 + happinessDrain));
I'm experimenting with an alternative for the Auto-Petter, with the idea that my mod would conditionally lower the HappinessDrain on certain animals to 0. Would that not work? I know some custom animals, including ones I've made in the past, just never added a number to the happiness drain and they gained friendship just fine.
I did, while I'm not a fan of AI dialogue mods, I don't really have anything against them for the most part
yeah seems to also control how much happiness is gained when an animal is tucked in at night or when its full of food
(I was slightly confused when I first saw it for sure tho)
So is it that they still gain friendship points from petting and getting milked/sheared when the HappinessDrain is 0, so they do still gain friendship just slower?
i only looked at one function actually it does seem used for petting too, and if there IS a heater in the winter it gets added as well
petting has a default amount in addition to the happinessDrain value though so they still get some
so yeah thats my interpretation of the c ode too
Interesting...
Does anyone know how to figure out what specifically is clashing between two mods to make a game crash?
!mh
For help with modding issues, please ask in #1272025932932055121! When asking for assistance there, sharing an error log will help others identify your issue (see https://smapi.io/log for instructions).
(New in the upcoming Central Station 1.5.0: a variety of travel related decor you can buy from the gift shop.)
hello, im making a content patcher mod and it's not working in a lot of different ways, can someone please help me
Custom warp randoamly stoped working, and there is nothing about it in the SMAPI log?
nothing in the SMAPI log and he's in town square, his sprite's warpy and he isn't moving, following his schedule, he's not even in the friendship tab, i can't talk to him or gift him either
!json can you send all relevant json files using this link?
JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.
If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.
When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.
!json
JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.
If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.
When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.
is your warp in a custom map or are you patching it into a vanilla map?
JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.
If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.
When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.
that reply was to another user, don't worry about it. also please visit the link in governor's message to upload your jsons there
!json
JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.
If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.
When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.
oh i did that, it says it's valid
this is so that i can easily read your json, not to validate it
!npc it looks like you're using an outdated tutorial to add your NPC. dispositions isn't used anymore. check out any of these resources governor will link you to after my message
Keep in mind that making NPCs is a complex process that requires learning many different aspects of Stardew modding.
Here are a few links that can help get you started on all that you need to know:
-
Tiakall has a great tutorial on making a custom NPC for 1.6.
-
NPCs no longer use dispositions, check the wiki page for the new NPC data.
-
Aviroen has put together a template that will allow you to easily create a romanceable NPC.
-
Feel free to jump into the https://discord.com/channels/137344473976799233/1277457201077813280 thread for more interactive feedback and help!
-
Fireredlily has a WIP NPC Builder Please do report any errors you get with it into the NPC thread!
thanks ill check the new links
good luck, feel free to come back here if you have any more questions
ok
I’m trying to add some cooking recipes that allow the use of any of a specific “kind” of ingredient—example: if the recipe calls for “butter,” you could use regular butter, goat butter, margarine, etc. But since there’s no “butter” category—unlike for something like eggs—and since I’m not sure if it’s possible to create my own categories, I opted to use SpaceCore for its ability to override cooking recipes to allow the use of context tags in place of ingredients.
This works, but the issue I’m having is that the description displayed on the cooking/collection pages is wrong. Anytime I use SpaceCore to override a recipe, the description changes from the item’s actual description (which is what I want) to just the name of the item. See the screenshot for what I mean.
Does anyone know if there’s a different way to tackle this problem, or if there’s something I’m missing with SpaceCore that’s causing this issue? Thanks!
iirc thats just an issue with spacecore
I thought that might be the case. Is there another way to achieve the same result?
not as far as i know, unless you want to create separate recipes that are identical except for the specific butter used
There is one that’s patched into a vanilla map and it is working perfectly fine, the other is from one custom map to another, the broken one
did you change your location names at all? what does the warp map property you added say?
Hmm, that's not ideal. I'll keep looking to see if there's a workaround, otherwise I'll probably just make the recipes restricted to just a single ingredient type. Thanks!
The location names are the same for the warp and the file, and they were done in the content.json
can you share that please
and the warp from entrance to beach cave was working before?
Yes
do you remember what you changed since you last saw it working
There was a bunch of directory climbing issues and the game asking if it’s data for that map was invalid and I fixed those, I think that was it
i can't see anything wrong with your code besides that maps are usually loaded to Maps/{{ModId}}_Name instead of Locations/{{ModId}}_Name, but i don't think that's your actual issues if your locations are fine. are you able to debug warp to the beach cave?
How do I do that?
in the SMAPI console type debug warp YourModIdWrittenOut_PrairieIslandBeachCave
Yes, that works
ok good
since i don't know why the way you add a warp via CP isn't working, and since it's a custom map, i recommend opening up your entrance map in tiled and adding the warp via map properties instead. if anyone else has advice on what went wrong though you should listen to them
I did try adding warp properties in Tiled but it didn’t work
did it display the same behavior you're seeing now?
if doing it in Tiled didn't work either then i think you should load your maps to target Maps/Name like i said here. there's some wizardry that goes on behind the scenes with targets that i know nothing about, i just know how it's conventionally done
Would I just make a maps folder in the mod’s folder,
hi, uh nic, i need help, the npc is working more but two issues, it says it can't find the portrait and the dialouge files
I wouldn’t be surprised if something depends on maps living in Maps/ though I don’t know of anything offhand
your folder structure literally does not matter at all once its loaded into the game
you don't need to do anything with the files, just change the target of your Load
as long as your FromFile points to an actual file it can be literally anywhere inside your mod folder
make sure your FromFile matches the actual filepath and file name as it exists inside your mod folder
it does
also one of the things in the new tutorial made me make a blank.json and that is also messing things up
a blank.json is not going to mess things up unless it was done incorrectly
Wouldn’t that make it so when someone downloads it they wouldn’t have the files though?
ok, please send your json using the site again and also a screenshot of your files inside your mod folder. as for the blank json, make sure it's a file with only {}inside of it
your files are included in your mod download. why would they not have the files?
targets, despite looking like file paths, are imaginary locations. in some cases you can literally load something to FluffyUnicorn and it won't matter. in this one specific instance of Maps though i believe the game depends on the data you load living inside of Maps/YourNameHere
also i added the {} to my blank.json
button can probably explain targets better than me
no, thats pretty much it
the games vanilla set of Targets match the Content folder bc thats just how it works but you can load to wherever
that's my directories and i also sent my content.json
but i did fix the blank.json to have {}
quick heads up, you can type {{ModId}} instead of having to type out Rabegi.RobertMod each time, since CP automatically converts it
Important note: Your computer username may appear in the log. If your username is your full name, please be aware of this before uploading it.
Please share your SMAPI log file. To do so:
- Open this page: smapi.io/log.
- Follow the instructions at the top of the page to upload the log file. (Don't copy & paste from the console window!)
- After uploading, it will show a green box with a URL to share. Post that URL here.
Please do it even if you don't see any errors. This has useful info like what mods and versions you have, what the mods are doing, etc. If the issue didn’t occur in your last session, please load the game to the point where the issue occurs, then upload the log.
(unrelated to either conversation, but can maps use tilesheets from the Mods/ folder without ATA? I assume not but just wanted to make sure)
no. Mods/ isnt a folder
not mods/ folder, mods/ asset path, sorry
Is Maps not referring to them coming out of the content unpacked in the Stardew folder?
in vanilla, a tilesheet path must have no directory whatsoever UNLESS its using something nested deeper than Maps, like Maps/Mines
the robert.json in data is the npc Disposition
nice, ty for confirming
you are loading to an imaginary target called Maps/YourLocationWhatever
thats the entire purpose of the content pipeline and content patcher
you are making that target exist
otherwise, Locations/YourLocationWhatever wouldnt exist either. where would that even come from?
what modding software do you guys prefer? im currently using Asprite, Tiled, & Visual studio Code... just want to know if theres anything better out there
i use visual studio and libresprite
those are what's usually recommended here 
okay, i looked at the errors in smapi, something is wrong with the dialougue
i suspect that trying to make the NPC spawn inside the farmhouse will be problematic
no that's not the problem
the problem is with the dialogue
that's what smapi said
it works in the farmhouse he spawned in there fine
okay, please send the dialogue and the SMAPI log
you still have not shown us the errors
!log use the instructions here
Important note: Your computer username may appear in the log. If your username is your full name, please be aware of this before uploading it.
Please share your SMAPI log file. To do so:
- Open this page: smapi.io/log.
- Follow the instructions at the top of the page to upload the log file. (Don't copy & paste from the console window!)
- After uploading, it will show a green box with a URL to share. Post that URL here.
Please do it even if you don't see any errors. This has useful info like what mods and versions you have, what the mods are doing, etc. If the issue didn’t occur in your last session, please load the game to the point where the issue occurs, then upload the log.
this dialogue file will not work at all. its not a patch
huh
every file you include needs an action
well, this is the thing
[Content Patcher] Ignored Robert Mod > Include assets/Dialogue/Robert.json > invalid: must set the Action field.
such as "Action": "EditData", which is what you need to do to edit the dialogue
there is an action
Rishant, in the future, please use the log uploader as directed by the governor command
okay
there is no Action inside the dialogue.json you sent
also No-Document you need to not include the Format line in an Included file
no, files that are included should not have format, but they should have changes
OHHH
ignore the validator sayingf that
it does not know its an Included file
do not add the Format line to an included file
what's the target
Rishant, you need to add an actual EditData patch like data/Robert.json
the target will be the dialogue Target you loaded the blank to
wherever you loaded your blank json to for the dialogue
in this case, Characters/Dialogue/Rabegi.RobertMod_Robert
i keep jinxing you button sorry haha
its fine!
do i have to have entries or no
it must be a valid EditData patch
i think i do
an EditData patch cannot exist without either Entries or Fields
otherwise, where would you put your entries
like, your dialogue lines
Changed it, now none of it will load
can you please send your updated json?
and are you seeing an error in your log
this is the new error
https://smapi.io/log/a64bef0e322b443b9f5756f20b884b33
Oops, couldn't parse that file. Make sure you share a valid SMAPI log.
Rishant, you need to include the whole log as the governor command and log uploader says
like even the loaded mods section
do not copy paste, just upload the file
the instructions tell you to upload the entire file
how do i upload it
however in this case that error is telling you exactly what the problem is. it found "Edit Data" but expected "EditData". take out the space
When trying to warp it says [game] Warp to ModId_Name failed: location wasnt loaded or couldn’t be found
1. Drag the file onto this textbox (or choose a file):
please read the instructions at the top of the log uploader page as it is dependent on your platform
ok
and can you please upload the json?
this is my log
https://smapi.io/log/5fecb7d4086944b1b9fc2deba36576c1
Log Info: SMAPI 4.3.2 with SDV 1.6.15 build 24356 on Microsoft Windows NT 10.0.19045.0, with 5 C# mods and 1 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
the npc works but there was an error
I'm sorry if this is a dumb question, but when starting a new C# project, am I finding a .dll in the Pathoschild.Stardew.ModBuildConfig NuGet package or do I need to turn that package into a .dll?
no, you just reference it with Nuget and it gets put in your .csproj and will just work
https://smapi.io/log/5fecb7d4086944b1b9fc2deba36576c1
my log and npc works but i get error
Log Info: SMAPI 4.3.2 with SDV 1.6.15 build 24356 on Microsoft Windows NT 10.0.19045.0, with 5 C# mods and 1 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
(that was for Harrison)
okay
Reference it as a .nupkg?
oh wait, he doesn't gain frienship and his schedule isn't working
Rishant, did you previously have a version of Robert that didnt include your Mod ID?
yes
Hello guys i can't make my mod DLL because the executable stardew valley.exe doesn't allow me to do, even on administrator mode, don't know why, is there a way to fix it?
does this warning occur on a new save?
[[Modding:Modder_Guide/Get_Started#Create_the_project]]
and you don't have any errors in your log upon loading or starting a save?
oh wait
No
did you ctrl F for locations and change it to maps?
This is what I'm looking at but I still don't know what file I'm adding as a reference
okay everything works in a new save
you just choose the package
there is a link right next to that instruction telling you how to add the package
I just typed Maps in place of locations
the patches at lines 38 and 66 need to be editing Data/Locations
[[Modding:IDE_reference#add-nuget]]
it's working now
maps and locations are distinct from each other
however i unfortunately have to go so if someone else would kindly walk you through maps vs. locations that would be grand
What program are you using, and what specific error are you getting?
(The only case that comes to mind is that you need to close Stardew/SMAPI when building something with the SMAPI nuget package)
visual studio code (the normal one)
the exe file was closed and i was using the package, but i don't know if it's microsoft store problem because my stardew is not from steam, maybe it's that, once i execute it says System.UnauthorizedAccessException: System.UnauthorizedAccessException: Access to the path 'C:\XboxGames\Stardew Valley\Content\Stardew Valley.exe' is denied.
ah, yeah, I've had issues with that store's files being overly locked down 
I'm not familiar VSC, but I imagine you could copy the whole game folder somewhere else & target it with your project, if nothing else works
i can copy the entire game folder except the exe lol
That worked for the vanilla map warp, the other one is still broken though
if you can't even copy it, I guess you'll have to mess with Windows file permissions on it
your Target on line 85 in the last json you sent says ((ModId)) instead of {{ModId}}
(parantheses instead of braces)
That worked, thanks
Any ideas as to why the game isnt adding the water effect on tiles that have the Water property set to true?
Yeah it is, it’s working now. Think it was just a bug
did I do something wrong here?
At a glance that doesn't look wrong though the indentation on the second and third patches { hurts
yeah lol
does anyone know whats causing this? [game] Event script error: Common Language Runtime detected an invalid program.
[game] In event #festival_winter8 for location Temp
[game] On line #10: specificTemporarySprite iceFishingCatch
[game] Error running event script #festival_winter8 on line #10 (specificTemporarySprite iceFishingCatch).
InvalidProgramException: Common Language Runtime detected an invalid program.
at StardewValley.Event.addSpecificTemporarySprite(String key, GameLocation location, String[] args)
at StardewValley.Event.DefaultCommands.SpecificTemporarySprite(Event event, String[] args, EventContext context) in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\Event.Commands.cs:line 1810
at StardewValley.Event.tryEventCommand(GameLocation location, GameTime time, String[] args) in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\Event.Commands.cs:line 307
im going into the ice festival and after the competition i just immediatly get teleported home, no judgement from lewis
generally that error type means a broken Harmony transpiler
(or other lower-level stuff that generates un-runnable code)
That or mobile
makes sense, though I haven't had to run into that yet 
why does it hurt? could that be causing it to not show up
its not showing up in game since I added the the third line 
do you need from and to area?
(the {} spacing doesn't affect functionality, it's just a formatting nitpick
)
uploading to https://smapi.io/json might help, but I see nothing wrong with the setup there
(yeah generally most ppl like to keep the brackets on the same indentation level, like so)
maybe not the best example now that im looking at it, just randomly grabbed smth from my recolor :P
thank you I figured it out and fixed it ❤️
guys i wanted to make a mod that lets profession increase speed by 0.1x>1x(configurable) each level, with the dependency fast animations but i can't make the DLL
because the exe archive denies it and no matter what i do
unfortunately i haven't got a clue what you're doing hahah
oh i see, skill levels increase animation speed from 100% to 200%
did you make a C# mod following the instructions on the wiki and/or are you editing an existing mod
still, have you written the mod already, or just having issues compiling? what's the 'exe archive'?
yes i did it already
i just cant do the DLL because trustedinstaller doesn't let me make vscode access the exe archive of stardew from microsoft store
i have a github and i can share if yall want
what is trustedinstaller and why do you need to use it? typically we use the .net sdk (dotnet) to compile our mods
it is from windows, and yes im using dotnet 6.0
net sdk 6.0 i mean
are you using pathos's ModBuildConfig nuget package?
you might want to specify more - I think a lot of people here use Windows for C#, but don't know what "TrustedInstaller" is
yes
it is a thing that even on administrator mode blocks you from copying that archive and even accessing it with vscode
mm, trustedinstaller is a windows feature
figures it'd show up in a microsoft store managed folder
yes
i can't even copy the folder with the exe
it lets me copy the entire folder except the stardew valley.exe
well, the .dll is the file you really need for e.g. decompiling, so maybe that's fine?
this is possibly a silly question given how long i've been making mods, but why do you specifically need the exe? shouldn't the modbuild package be referencing the stardew valley DLL anyway? what's the build output in the console?
I have a question, didn't find any thread related to it, but, does anyone know of any mod that just gives you a massive expanse of land for the farm? Think something along the lines of 4 corners but each space is of the size of the standard farm
the nuget package asks for the exe
try asking in #modded-stardew ☀️
we just make the mods hahah
Do you guys do commissions?
the readme of my mod explains what my mod do, can i post it here?
!modcommissions
!commissions but i'm fairly sure i've seen an enormous four-corners-like farm
If you're looking for people who do mod commissions (either art or code), here's a wiki page with a non-comprehensive list of people who do them: https://stardewmodding.wiki.gg/wiki/Stardew_Mod_Commissions
so how are you compiling the mod? dotnet build? what's the console output?
yes
it is dotnet build
i cant make the dll
but i was giving instructions to copilot and he made the coding
so what's the console output when you run the build
lemme see
i'm not familiar with building directly via dotnet for vscode, nor have i ever used the microsoft store to run into this issue in the first place
but someone might be ☀️
Falha inesperada da tarefa "ResolveAssemblyReference".
System.UnauthorizedAccessException: Access to the path 'C:\XboxGames\Stardew Valley\Content\Stardew Valley.exe' is denied.
at Microsoft.Win32.SafeHandles.SafeFileHandle.CreateFile(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocati
onSize, Nullable`1 unixCreateMode
i can't make the dll because of microsoft basically
I'll be honest this sounds like whatever vibe code you got acting up
have you followed the wiki guide to get a basic button press mod up and running
Following the instructions instead of ai probably hallucinating the instructions is far better of an idea
!chatgptcode
Please stop trying to get ChatGPT to write your C# mods for you, especially if you don't know how to write C#. It won't work without heavy editing, and it wastes everyone's time.
Large language models fundamentally are reguritating something from their input—which is roughly speaking, the written output of humanity up until 2021 or so, for ChatGPT. For specific, niche topics like "is this framework going to do what I want" or "which things does Game1.cs have access to", it probably has no idea! But it's good at detecting that people in the past have....said things about frameworks and written things in C#, so it does its best to assemble words and symbols into a nice order for you. Sometimes it tells you true things, and sometimes it tells you false things, and if you can't detect when, you're in trouble. When you're writing code, this usually produces garbage, because you can't be "sort of similar", you have to be exactly correct or it won't work.
i forced copilot to learn it tho
i can't even imagine what kind of code it's cooking up to try and integrate with someone's niche stardew valley mod
...by telling it to patch Stardew Valley.exe?
If you're feeding it the docs just read the docs yourself
but i actually readed somethings
i just can't make the dll because of that
microsoft problem
pls just follow the wiki guide and get a button press mod actually load in game
look, just forget about what you have for a second, and follow this page: https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#Create_a_basic_mod
maybe it's your computer acting up, but if you get this up and running it helps eliminates that possibility
if you don't and it fails with the same errors, well that's helpful too
System.UnauthorizedAccessException: Access to the path 'C:\XboxGames\Stardew Valley\Content\Stardew Valley.exe' is denied. explains it all
https://docs.google.com/document/d/1jlaweFaWlkVkJqtRZ4KzUITITJ8_deqDi0Ci1TrYQbA/edit?tab=t.0 -- my idea/plot doc, wip, only for one out of the like 10 npcs i would add, but im very proud of it so far as a writer :)
oops sorry yall are talking haha
well that's the problem, but it doesn't explain the cause. putting together the simplest possible mod as laid out on the wiki would help narrow down whether it's a problem with your environment or with your project though
im making a content patcher custom npc mod and i have a problem, my npc will just go through walls to get to where it needs to, do you have to add pathfinding?
NPCs will pathfind on their own, you don't need to do anything special. is it happening only on your custom maps or on vanilla ones too?
i don't have custom maps yet, i made it spawn on my farm and then it just wen through the building wall and now i don't know where he is
oh, NPCs can't be on the farm. big no
just pick almost any other map, lol (not Backwoods, that one is also verboten)
yep
k
i'm finally diving into tiled hell. send moral support 
good luck
tiled is fun & relaxing. just keep all your files in one folder, use normal layer names, snap to grid, don't copy tiles between files, never use save-as, ..
don't color outside the lines--don't copy from other maps' tilesheets if you already embedded that tilesheet--
actually what's considered easier to make, an indoor or outdoor map 
oh definitely an indoor map, since you don't need to write IsOutdoors
huge time savings there
noted
will keep working on this interior then
Water
Outdoors
Fish
Do you want artifacts? Hell
sweats nervously ahhaahahahaha i totally don't want a museum with artifacts or anything
thats down the line tho.
where is bug meat I need to make it bread
in bugs, mostly
check Maps/springObjects and Data/Objects
you'll probably also want to update the Bug Steak to be some kind of wonderful pull-apart roll
a bug fruit roll-up
i want to make my npc spawn on a tile but i don't know the exact tiles of every map, is there like a website with pelican town with coordiantes or something
Tiled shows you x/y coords
definitely for now just pick a map that's reasonably similar to what you're after, load it into the game as-is for your new map to be sure it works how you like, and then worry about repainting the tiles and map properties
of stardew vanilla?
When you open the vanilla maps yes
okay
anything, really, so long as you have the correct tilesheets and tmxes in the same folder so they can grab whatever's necessary
you're right I know just the thing >:)
um i've never used tiled or any tile editor
if you cbf, if you have farm type manager, opening the game and it's what, whereami shows the x/y coord that you're on, in smapi
you really don't need FTM, you can just type debug ppp to find your current tile
idr the vanilla command 
(short for print player position)
okay
or you can use this mod to check wherever in realtime:
https://www.nexusmods.com/stardewvalley/mods/679
hmmm I found the bug steak but not the meat
lately I just use Lookup Anything with extra info and press F1 on the tile 
though it's awkward with objects etc
ty lol
another progress shot of the farm I’m working on!
I would’ve done more but I got distracted
HOLY COW IM FANCY
I finally found it
now the question is
would a clump of dough or chunk of bread be better for the meat itself 
yeah maybe
perchance
indeed
i guess dough, since you have to get the recipe to "cook" it into something edible
however, counterpoint: it's funny if the bugs drop fresh hot bakery rolls
on the other hand you don't cook bug meat into bug steak, you craft it
its like slamming raw meat together to make a burger patty
but like, idk you can't just kill bread to get dough
bc it's already cooked
see i would've said dough simply because the sprite would probably end up more legible, not sure how you'd make a readable chunk of bread
once again i have made myself think about odin sphere, where enemies literally drop hot cross buns and they emit steam sitting on the ground waiting for you to pick up and consume them
just a lumpy beige glob is fine
huh?
I am thinking maybe bread crumbs for bait, ball/clump of dough for bug meat, fish shaped bread for wild bait, and monkey bread* for bugsteak maybe?
(odin sphere is a perfectly normal game where you plant seeds that grow into sheep. also the main characters struggle against an inevitable ragnarok, but focus on the main thing please)
Cat wearing farmer's green shirt
THAT’S SO CUTE-
are you gonna turn the entire valley into bread
just the bugs
but theoretically most things will be food or books by the time I am done
😔 i have to defeat my enemy: elliott
why is he so hard to write
i hate writers
and poetry
because writing
i went to finally go look at updating my mod to 1.6 and see a page on the wiki for a 1.6.16 version
when is that supposed to be coming? should i wait
uhhh it's "coming" but not really something to worry about atm (as in, the release date is unknown)
it's fine to update your mods now i think, keep in mind that 1.6 had a year-long alpha period
i was active during that time, just too lazy to update
Hello, does anyone know how the parrot express works? And how I could go about adding an additional stop?
I'd build mod and get it working on .15 first then try alpha if bored
Which mod is yours btw? Im just curious
The method is native to SMAPI, just need to implement asset requested
i was hoping someone made a wrapper around asset requested that handled the boilerplate
you can't.
rats
oh well less work for me
Tbh i think content patcher kind of is this lol, if you are willing to hard reference
But imo everyone's desire with asset edit is different once looking at it from C#
wren has been doing a codegen thing to make asset handling easier but i don't have any more details than that
my 1.5 solution was to have a key/value replacement where value was my modified data string e.g Galaxy Soul/200/-300/Crafing -2/..., but my understanding is that in 1.6 this is all json right?
assetrequested is already quite lean, if i'm honest. i'm all for shortening stuff i do all the time but it might be best to just have your own version of that
is working with json easy here?
many more things are data models now, but not all
Oh yeah u can load complex models from a json if u want
for editing vanilla data model assets you can look at StardewValley.GameData to see what the types are and have classes for editing them
This one's my asset so i can just load the default data from a json
But ofc for vanilla I'd want to not load over whole thing
this is more along of what i'm looking for
do you know if anyone's built something that only updates the vanilla asset using the keys present in your json?
basically only updating a single data attribute of a whole object without replacement
sounds like content patcher, tbh
minus content patcher :p
or a fairly simple foreach keys
it would be a simple foreach but if someone already made something small with nice ergonomics i don't want to reinvent
I don't think so tbh maybe suggestion for wren source gen eventually
And if it was stuck in someone's core mod i would still not reference it just for something like this
it would be more like a <50 line class that could be copy pasted
i'll put one together myself
i would just write it, yeah. we've already spent longer than it would have taken you
fair enough
just got my first tiny map edit to work. i'm cooking. except it's like. a slow roast. 
now back to the interior i was working on...... getting something to work is good motivation 
@cobalt gust I have been!
Right now how it works is you make properties and add an annotation to them, and it generates the code needed to handle invalidations and pazy-loading, as well as loading from a local file optionally.
In future it will also let you use annotations to mark methods as loaders/editors for specific assets, as well as "including" entries in dictionary and list assets from local json files, plus exporting all translations to a text asset so they're usable with token strings
It's a bit messy right now and I haven't had time to sit down and learn how to make nuget packages, so it's not available yet, but it should be reasonably soon
Oh very useful!
tbh nuget packaged libraries are a double edged sword for stardew while the private assembly feature isn't available
if it is pure codegen and not a library reference then it could work
Pure codegen
Right now there's a library for attributes but I'm pretty sure I can set it up so that it's only used during compile and the attributes are stripped after codegen runs
If I can't get that to work I'll do it the old fashioned way and embed them
Ahhh, what's going to happen there?
probably nothing lol i just wanted to do a quick map edit to make sure i was understanding how to do cp map patches correctly

Oh yes, I understand.
even then it can codegen those attribute definitions (or stubs at least) so it originates from within the assembly
Conditional will strip out the attribute it's applied to when a given flag isn't set, but since the initial phase of sourcegen runs on syntax, I suspect it will still be there when that happens
As I said, if I can't get that to work I'll do it the old fashioned way
I'm wondering if someone can shed light on why my randomized dialogue isn't working...I'm trying to use dynamic tokens paired with i18n to generate a pool of dialogue to randomly choose from that gets bigger when certain conditions are met, like heart level. When my NPC reaches 6 hearts, I want her pool to contain the previous 0-5 heart dialogue and the new 6 heart dialogue for example. This is my set up:
Everything else is loading fine, files are valid, and my specific day dialogue and gift dialogue and everything else is working
i believe local tokens are formatted something like this?
"BuildingId": "{{ModId}}_DeluxeStable"
}```
-# Disclaimer: Am not a local token expert so I'm just strictly going off of the documentation
I'm not using local tokens, but dynamic tokens - unless those are the same??
JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.
If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.
When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.
from a probability perspective, the odds of getting your original 0-5 to happen in the 6-10 version of the world is rare due to the nested random
Oh, I should send the link version!
also a dynamic token I don't think can self reference itself
I'll be honest, I was using this wiki guide written by Airyn, but I checked the history and it hasn't been updated since before 1.6 so it might not work now? https://stardewmodding.wiki.gg/wiki/Tips:_Using_i18n_for_Easy_Dialogue_Randomisation
With the game's default dialogue setup, you would be limited to 168 lines of dialogue: one per season, alternate heart level, and day of the week. However, you can use i18n to easily create a pool of randomised dialogue, either to extend the amount of dialogue beyond the 168 line limit or to remove the season/heart level/day conditions without r...
iirc they can self reference as long as they reference an earlier defined value?
first link is just a block comment, no content
you may have accidentally only copied the top part
no the validator just breaks with comments at the top
but the Range token is your friend
sorry about that, I forgot I needed to send it in link form! I posted a link to the json log that should hopefully work
the entire file is there if you edit it, it just doesn't go past the comments for some reason if the file starts with them
ah okay thanks button! didnt know about that
Oh I see, sorry folks 
It would get the first valid json structure, and permitting comments means the first structure is just a comment node
that one's not really your fault since it's a bug with the validator
just maybe wanna skip the comments in your selection when uploading to the validator in the future
the top ones anyway
In what way is the dialogue not working? They don't appear at all? Or they random chance are skewed? Or the defined pools are not firing?
actually no, it survived for the dual document case and then warns there was extra data https://smapi.io/json/none/dff57ed7f7454682929170afbb09ad87
not sure then
Not showing up at all when I click my NPC in game, but when I gift an item or it's a day where I have specific dialogue it works just fine.
I didn't consider how the nesting would skew the probability though...so I might just re-work that whole section
If the numbers are sequential anyway, you may want to try something like {{Random:{{Range: 1, 44}}}} instead.
Yes, I think in my head that's how I wanted it to work anyway, I was just majorly overthinking it😅
{
"DynamicTokens": [
{
"Name": "aurelDialoguePool",
"Value": "{{Random: {{Range: 1, 30}} }}"
},
{
"Name": "aurelDialoguePool",
"Value": "{{Random: {{Range: 1, 44}} }}",
"When": {
"Hearts: {{ModId}}_aurel": "{{Range: 6, 10}}"
}
}
]
}
yeah something like this would fix the probability issue, and remove the intra dependency
performance wise Range is free when giving it literals as it will "bake" the resulting value into the parent string
Oh I think I see how that works 🙂 thanks for the assist folks, I'll go back to the drawing board and see if I can get her to speak to me
So the the game wouldn't read something like this at all: "summer": "{{i18n:aurel.summer.dialogue.{{aurelDialoguePool}}}}"
🤦♀️ You're right!
Looking on the wiki now I see it doesn't have just season as an available key
If you want to make a dialogue that's randomly chosen every day, you can do a Query that calls every day of the week as a Dynamic Token.
Omg I'm glad you spotted that or I would've run into problems again! Okay, that makes sense.
I've got some tinkering to do!
(If you need to see an example of the query. My mod Jinu in the Casino does that wink wink)
Haha thank you! Examples are really helpful to me 🙂
On my end I just use Randomization, say I have 10 good lines, I have the game randomize and pick from the said 10 using tokens
Ah, I found a mod that lowers the ore amount in a furnace to just 1 needed
Now how do I copy that code and apply it to normal furnaces and dehydrators...
Im trying to learn how to learn how make mods so that im able to update mods for myself that dont seem to be getting a 1.6 version and would like to use them, following the Modder_Guide/Get_Started on the stardew wiki i was able to get to the point where I can build it but for reason its telling me that manfest file doesnt exist but i made one
!json
JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.
If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.
When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.
show your manifest
{
"Author": "SkyrimKnight22",
"Description": "Just trying to make a test scrip!",
"EntryDll": "TestScrip.dll",
"MinimumApiVersion": "4.0.0",
"Name": "TestScrip",
"UniqueID": "SkyrimKnight22.TestScrip",
"UpdateKeys": [],
"Version": "1.0.0"
!manifest exists, too, I think?
manifest.json is the file that tells SMAPI that a folder is a mod. Here's the wiki page on manifests, which has some things you can copy-paste into the manifest.json if you're making a mod: https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Manifest
You’re missing the closing bracket.
oh i didnt know that manifest command existe
odd cause I copied pasted that and the closing } is there
(i'd imagine that a manifest-not-found error would be a file/folder layout issue or a manifest saved as a .txt file?)
this the error i get ( [mod build package] The mod's manifest.json is invalid: The mod's manifest.json file doesn't exist. )
when viewed in the file explorer, does your manifest file have a JSON File type?
(Make sure to turn file type endings on if you haven’t.)
its there
!log - share your log file then so we can see the full load sequence
Important note: Your computer username may appear in the log. If your username is your full name, please be aware of this before uploading it.
Please share your SMAPI log file. To do so:
- Open this page: smapi.io/log.
- Follow the instructions at the top of the page to upload the log file. (Don't copy & paste from the console window!)
- After uploading, it will show a green box with a URL to share. Post that URL here.
Please do it even if you don't see any errors. This has useful info like what mods and versions you have, what the mods are doing, etc. If the issue didn’t occur in your last session, please load the game to the point where the issue occurs, then upload the log.
I see what i did wrong now, i typed manfest not manifest
the heart knows what the heart wants
its mainly cause i sometimes type faster then what i need to spell so i end up with missing letters
the amount of errors I have to correct because I do this very thing as well is....a very large amount lol.
i love pretending i know how to write events...
what im guessing i need to update in this is
"CustomLocations": [
{
"Name": "Shop",
"FromMapFile": "assets/Shop.tmx"
}
],
which is set before "Changes": [ stuff ]
I’m pretty sure CustomLocations is the old way of doing things.
Check the wiki: https://stardewvalleywiki.com/Modding:Location_data
WIP non-cheaty autofisher that actually plays the game -- I've tried a couple of "strategies" for the fishing minigame, but only the one originally implemented by the now-broken "Fishing Automaton" has been achieving decent results.
Does anyone have experience or ideas regarding control systems like this? Target selection and positioning is the easy part, of course, but the velocity control is a real head scratcher
it works... (i forgot to change the recolor palette for the piano
the farmer stands in the sink but honestly i do not care the animation is 2 seconds long and you're never gonna see this again
Hey modders quick qn, is the information on the Stardew Wiki about modding maps accurate? Max width 200 max height unlimited?
ChatGPT is giving me different information and i just want to sanity check it
both are technically unlimited iirc but things start to go wrong at ~200 in width/height (max being 255 sounds familiar?)
i think 150 is when trees don't like being trees
but yea please dont trust chatgpt over the wiki
trees don't like being trees, interesting side effect
Hes facing the wrong wa
but it works? I think. I had to patch reload this thing like 5 times to get this far...
Thinking of taking the tea shop mod and adding ability to let NPCs visit and buy/drink tea/sit down. Is it possible to edit existing NPC mechanics for this or would I need to create new NPCs? https://www.nexusmods.com/stardewvalley/mods/28730?tab=posts
thats a farm building right?
baby's first functional event...
🤔 the advancedmove command is acting a little funny. it's like, speeding up, and thus elliott ends up slightly out of place
bleh i'll fix it later. im tired 
For the sake of testing, does anyone know how I could increment a value in my mod when succeeding / failing the fishing minigame?
the simplest way would likely be adding a handler on Helper.Events.Display.MenuChanged that checks for e.OldMenu is BobberBar, though it wouldn't tell you the outcome
from there you could check if (e.OldMenu is BobberBar booba) booba.distanceFromCatching > 0.9f for success, since it's what the game appears to use
I found a way to do it from my update function.
Global:
internal bool played = false;
internal int caught = 0;
internal int missed = 0;
In the update:
if (Game1.activeClickableMenu is BobberBar) played = true;
if (rod.fishCaught)
{
played = false;
caught++;
}
if (played && Context.CanPlayerMove)
{
played = false;
missed++;
}
I dont like inferring state like that, seems janky, but it works
Oh yeah, bear in mind that is assuming that fishCaught only stays true for one frame, which is the case for my automation only basically
i assume u dont want to just patch playerCaughtFishEndFunction?
chatgpt gets its information from the internet. Best case scenario, it gets it from the (very reliable) wiki and they agree. Worst case scenario, it hallucinates and they disagree. Either way, agreeing with the wiki is the most correct it will get, so you should just read the wiki.
I've managed to avoid harmony so far ;D But in terms of "cleanliness" yeah, that might be better
(It's already been said that you shouldn't use ChatGPT for modding in general, but if you want an example of how badly things can go pear-shaped, scroll up to a few hours ago)
DISCORD ATE MY REPLY PING
(well to be fair we don't actually know whether that problem was caused by autogenerated code, it could just have easily been any number of things)
(but to be petty, since we know it was apparently fully auto generated we can blame the ai anyway)
IIRC mods that contain AI generated code or content also arent allowed on nexus
they very much are
pretty sure they are allowed
Ah sry, I was thinking of this servers rules, which prohibit linking to ai generated mods
it's not like you could effectively ban ai generated code from something the scale of nexus anyway
makes sense
no way to prove if it is or isnt if they dont want to tell you (which they wouldnt cause its banned)
getting it tagged is a better strategy
You could totally use an automated system (also a neural model) to rate how likely some source code is to be produced by an LLM and use that rating to flag things as "likely stolen", but risk of false positives/negatives is still high.
But also, nexus doesnt even require you to publish source code so that aint viable anyway
from what i've seen these systems work VERY badly
also nexus is still a company that likes money, and investors don't like "anti ai"
Also true
Something you might be able to do instead is hook Farmer.fishCaught
That's a net collection right 
On th other hand idk if you get events for not fish
It's actually a list of the unique types of fish the farmer has caught
nobody wants the menuchanged method 
Technically im just recreating that myself by tracking the last menu, but as you said id still have to figure out the outcome, and i believe the capture progress gets reset as soon as the minigame ends so i cant check that. Im okay with how im doing it now, however whiny i may be about how it's hacky
Appreciate the help, though.
The net types in this game have events that fire when they change, which you can repurpose
I didn't know bobberbar fired a menu change every time you reel tho that's probably easiest 
You can combine with inventory changed too
don't sweat it, i made fish instead of worrying 
Here's other stuff u might use https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Events
i just Harmony-patch everything and call it a day, imo that's the best way to achieve cross-mod compat anyway
Eh it depends on the usecase i feel
It definitely does. There's a reason why the wiki calls Harmony out as a last resort
"Action": "EditData",
"Target": "Characters/Dialogue/FC.John",
"TextOperations": [
{
"Operation": "RemoveDelimited",
"Target": ["Entries", "reject_809"],
"Search": "reject_809",
"Delimiter": " "
}
]
},```
is this written correctly im still learning this method
im trying to remove a dialogue string
or does nullifying it work?
"Action": "EditData",
"Target": "Characters/Dialogue/FC.John",
"Entries": {
"reject_809": null,
"MovieInvite_Invited": "{{i18n:MovieInvite_Invited.John}}",
},
"When": {
"Relationship:FC.John": "Married"
}
},```
like wouldnt this work
TextOperations is for searching inside the value of a field (or an entry if its fields are slash-delimited, which dialogue is not). Just setting the line to null should work.
also if i have voth moveinvite and rejectmovie ticket will they both work
If you're updating his dialogue it might be a good idea to replace the obsolete reject_<item_id> key with RejectMovieTicket or at least RejectItem_<id> so if the obsolete key ever gets removed your dialogue won't break.
oh shoot ok
From what I can tell, RejectMovieTicket is only for if the NPC is going to use the in-game reasons to reject the ticket (going with someone else, divorced, etc) so if you want him to always reject movie tickets until he's married you'll need the RejectItem_<id> key I think.
Having both the MovieInvite_Invited and RejectMovieTicket keys looks fine, since one is dialogue for when they accept and one is for when they reject - neither of the keys actually make the NPC accept or reject the ticket.
ok cool
Does anyone know where the Hat Mouse sprite is located in the game files?
I can find the house itself but not the mouse overlay
the mouse? cursors probably
its i cursors yeah
Ah! Thank you!
damn beat me to it
Oh, are you changing the Hat Mouse?
I've finally figured out that is for some reason causing issues with my custom forest mod
Basically some kind of clash is happening between the vanilla files, my modded Forest.tmx and the Way Back Pelican town mod
And I have no idea how to fix it
The game glitches whenever it tries to spawn the area of the map that the mouse sprite would appear
uh yeah
ok so it sounds like maybe cursors is cursed? i know way back pt changes that
Wow I saw Japanese shrine, is this a new expansion mod?
What's annoying is that this happens even when I haven't used the Way Back tilesheets
i have a question. Does your .tmx edit the mouse area?
No, I even remade the .tmx edit so that it was identical to the vanilla map and it still did it
or, to be more accurate, does your EditImage action include the mouse area?
Okay, so the first thing you want to do is try EditImage instead of Load
unless it's a different size?
No, it's the same size
So I should do
"Action": "EditImage",
"Target": "Maps/Forest",
"FromFile": "assets/Custom_Forest.tmx"
also, make a separate folder to launch tiled from, with the map and the tilesheets. Keep only the map file (copypasted from the workshop folder after any edits) in the mod folder
yes, the file should be .tmx
sweats in tbin
I don't know how that works so I can't help if Gef tries that XD
i know my custom forest edit works
shhhh just look at the fish
I'm slightly confused about where I'm putting things
Right now in my mod folder I have an asset folder which contains the tmx file and the tilesheets.
So I should move those tilesheets into a separate folder, keeping only the tmx file? And then reroute the tilesheets in the tmx file to the new location?
no!!!!
it's a kite 🎏
you make a new folder. You copypaste the entire contents of your asset folder to it. The tmx file and the tilesheets. And if you want to edit your tmx file, you launch it from there in Tiled
in the meantime, your assets folder should have just the tmx file
you will not be able to launch it in tiled from there without it giving you a fuckton of errors
that's normal
i mean. How do you edit your tmx file
open yor map
Oh I see, sorry I thought you meant launch it like in the game
no
ohh damn I've been looking for a mod like this
you should do that with the mod folder, which does not contain the tilesheets
I'm continuing to be very dumb, where should this new folder be?
Okay
all references in your .tmx file should be to tilesheets being in the same folder as it
if moving it around breaks it, that means it cannot work as a mod lol
Okay I have copied and pasted the tmx and tilesheets into a new folder on my desktop
kay
remove the tilesheets from your mod's assets folder now
do the EditImage, and test your mod
Okay
(if it doesnt work yet, there's a next step)
(it is very, very cursed, but probably necessary for any compatibility anyway)
Right, now my content.json now reads
{
"Format": "2.7.0",
"Changes": [
{
"Action": "EditImage",
"Target": "Maps/Forest",
"FromFile": "assets/Custom_Forest.tmx"
}
]
}
EditMap
Okay I've changed it to EditMap
(btw thank you so much, I am not a modder as you have guessed this is all me flying blind)
Should I launch the game and see if that's worked?
i was born a modder, actually (im kidding lol)
you can probably tell im not a professional mod advice giver either from the editimage fuckup >.>
im too used to copypasting code between mods ive already made and not needing to remember shit >.>
Omg it's not crashing
I think you've fixed it!
nice!
Thank you so much this has been like a full week of trying to figure it out
means theres no need to do the final uncurse/curse step... but you rpobably want to anyway. How much of the map does your mod edit?
Like is it every tile on the map or is it a limited area?
It's just making some paths and changing the spite designs of the buildings
can you isolate it to a reasonable number of separate rectangles?
So you use ToArea/FromArea and not just replace the whole map?
It's pretty much just the top corner by Marnie's ranch
code example:
you find the top left corner of your rectangle, then you count the tiles until your edit is over (min is 1, obvs) in both directions
this way you won't mess with other mods that also want to edit the forest (which is very, very many of them)
What's annoying is that this worked completely find with my Town.tmx edit (which was far more edits to the cliffs and buildings), but for some reason the forest just didn't want to work with a few paths and adding an island to a river
Edit instead of Load is best modding practice, Load is for when you're adding entirely new assets
or when you want to change the size of the original asset 😔
I'm now wondering if I go back and do this editmap change to my town.tmx mod but now I'm worried I'll somehow break it
editmap instead of load shouldnt break anything
toarea/fromarea is better, too. Like you probably wiped the East Scarp exit, unless you got lucky and ES loads after your mod
Here's my town.tmx mod, that I've now done the same editmap change to. Are there any huge errors?
It contains changes to the town square festivals too
i dont want to test your mod im sorry itd require restarting my own game 😭
have you done the toarea/fromarea?
Progress
In related news, I am not looking forward to doing balanced groups / recursive regular expressions in javascript
'tomb it may concern'. ha ha.
cool tool, does it give you a preview on-hover for i18n strings in your ide, or something different?
That's okay!
This is a cp debugger
You can view token values basically
In different context per cp pack
i was rather wondering about the json breakpoints hahah
making vscode think debugging a json file was a good idea has been an interesting experience
fun fact, jsonc is hardcoded to not be breakpointable, bypassing extension config or the debug.allowBreakpointsEverywhere config
json5 lobbyists at microsoft i see
microsofts stance is that jsonc is for internal vscode use only for their config files
I'm really glad to hear that you want it!! Honestly I still am dumbfounded that I could be the first person to make a mod like it because it's so dang useful.
are recursive regular expressions a type of regular expression that CAN parse html? because if so I’m scared 
all objects inherit a virtual drawAboveFrontLayer() method that's never used. i feel so betrayed thinking it'd be perfect for kites
no overrides, never called
I need a regex that can handle nested CP tokens and end when the curley braces are balanced
I need to figure out why Content Patcher isn't accepting this as a valid content.json, and is throwing a small error about not having a Changes field
Well....why use regex here
It seems contented in believing that I've filled out the Format field, but not Changes
What's the exact error message and is it yellow
Don't judge the mod name, but it's in red
hii, i'm trying to make my first npc mod, and I want to ask is there any way I can get rid of the bush and grass?
i've tried different patchmode (Replace and ReplaceByLayer) but nothing seems to work
How would I make something like the bridge to get to the tide pools in vanilla? Like a broken bridge that requires X amount of wood?
I'm in javascript and vscode is giving me the text document and I need to find the things that look CP tokeny in it to give to DAP
and because people use cursed syntax, I can't parse the document as json (not that it would help much)
if you're trying to test this mod on a not fresh save you should know that things on paths layer will stay unless you use something like reset terrain features.
they should go away on a fresh save
Well that Changes field is indeed empty. It doesn't seem to have anything between those two brackets.
The Wiki suggests that it just needs to exist, not that it necessarily needs any contents. The field exists, right? Or am I misunderstanding JSON?
Got it kinda working and it can correctly find {{i18n:Core.Hector.{{Season}}.{{Random:{{Range: 1, 15}}|key={{Time}}}}}}, but a nice to have would be for it to successfully find the inner tokens too.
I just made a fresh save and it goes away 😄 thank you very much
But if it doesn't have any content, then your patch does nothing.
So naturally Content Patcher "cannot load the pack", per the error message, because there's nothing there.
it seems likely that content patcher expects Changes to be an array of non-zero length (specifying no changes is probably seen, correctly, as equivalent to not having provided the Changes field)
I mean, not yet, obviously. I'm trying to make that error go away before adding stuff, though, because it persisted if I added a Config Scheme, and didn't make a config. I'm converting an old mod to the new version, and I'm trying to add stuff one at a time.
CP can't tell the difference between the absense of Changes and it being at length zero due to how it initializes the data structure
This is probably it. I'll add something and see what happens, then
being valid json is only step 1 in being a valid semantic content patcher content pack
Ah, gotcha. Honestly, it seems like being a valid JSON isn't even strictly required. The older mod I'm currently migrating has comments in the JSON, which VSCode is loudly informing me is against the rules
the json has to be valid according to newtonsoft's json parser, which is notoriously lenient
Oh, I see. I'm not familiar with any specific JSON parsers
(some to most of what it accepts are valid features in jsonc and/or json5)
the top corner of the map also get replaced, did I get anything wrong with my json?
are you sure you don't have another patch in your mod doing this? maybe in the content.json file?
i just checked, and no, i only have the patch in that json file
!patchsummary 
Can you do these steps to provide more info?
- Load your save and view the content that should be patched.
- Type
patch summarydirectly into the SMAPI window and press enter. - Upload your SMAPI log to https://smapi.io/log (see instructions on that page).
- Post the log link here.
Dont worry
I think having this many opinions on json parsing is abnormal and a sign of a broken mind
oh nvm I found it xD it was indeed in the content.json file
tysm!!!
also is a source of security issues if you have multiple systems parsing the same document and disagreeing on some of those opinions https://bishopfox.com/blog/json-interoperability-vulnerabilities
is that even possible? I'm guessing thanks to some javascript black magic
\{\{ ([^\{\}]++ | (?R=100))* \}\} using a third party regex extension to support the recursion, and heres hoping someone didn't go deeper than 100
I don't fully understand the regex as none of the sites I normally test regexes with understand this syntax
it's not technically regex in the strict sense
once you introduce recursion it's a different type of monster entirely
it does spit out a RegExp javascript type
yeah I just mean it's not technically a regex in the formal definition of the term (to do with formal languages and finite automatons etc) which is what most regex parsers are designed to do
taking a peek under the hood it effectively just becomes syntax sugar as if I copy+paste nested the query a bunch
oh so not "true" recursion
its up to depth N recursion, not infinite
oh I think I get you now (kind of, I'm half asleep lmao)
interesting capture group there
what's the extension?
the .NET balanccing groups syntax would have done this job great, but only .NET (7?) has it
I hacked up their balanced parentheses example to do the double curley brace instead
looked that up, that is DEFINITELY not technically a regex 
but it's interesting that so many platforms are extending regexes beyond what they originally were
its become the canonical text pattern match solution so has expanded to do that role better
the fact that no one agrees on any of those exensions is typical software, much like how no one agrees on any of the SQL extensions on top on ANSI SQL
this is just fun syntactic sugar for doing a kind of messy series of {1,100}s ig
I vote we go back to implementing regexes purely via finite state machines though /j
You know that dotnet has a fsm regex right
What are all the ways to add warps in tiled? I added one and I want to remove it but I don’t remember where it is
well, there's warps in map properties, and Action Warps in TileDatas
Hi, I'm interested in making SDV mods as someone who has a little coding experience with mostly web stuff like HTML and Javascript and have been lurking here for a bit. I have a quite a few questions:
-
If I wanna do stuff like make it so that any small decorations like lamps, plants, and other small furniture can sit on fences the same way torches do, can I do that with SMAPI and CP, or do I need C#? There's probably a good reason I haven't found any mods that actually do this...
-
Is there also some built-in game limitation for why building interiors all have to have the exact same type of interior map? Like, let's say I want my farmhouse to have Kisaa's Cozy Rustic Farmhouse interior, but have my first cabin use Aimon's Tidy Cozy Farmhouse and the second cabin use something else. Is that possible without having to create them as pocket spaces and use custom warps to get to them?
-
Somewhat related to the above, but I noticed with cellars the first one created is always tied to the farmhouse regardless of if you upgrade a cabin fully first to get a cellar and have not upgraded the farmhouse, with the warp for that cellar going back to the farmhouse and putting you in an iffy place. That's just how the game works right? Edit: Just wanted to add that I used the Anything Anywhere mod to do the builds on day 1. I really should try the vanilla way as well just to see.
-
Is there something like the mod Debug Mode that can help me tell which mod or folder an asset is associated with? I have a bunch of CP mods that change furniture but I have so many I can't tell which mod is changing my kitchen even after thinking I disabled all the kitchen changing mods. Really wish CP had an AT-like feature to click on something and access all mods that can affect the asset...
-
I'm a fan of watching Blade's videos and I noticed that he can take a look at the game's code and see how things work. Would I be able to do that too so I can figure stuff out? Like why AT can't change signs when they're added to Fish Ponds...
Sorry if this is a lot!
short answers:
- C# i think
- yes, game limitation. farm building interiors including farmhouse are instanced copies of the same map
- ???
- lookup anything can do this about items (sometimes), but not about textures afaik
- yes, decompile the game
- need C# cus torches are wacky
- Farmhouse is also wacky but check out PIF
- This is a vanilla bug iirc forgor which mod fixes it
- Lookup Anything shows the ID but not precisely what mod
- Check smapi.io/mods for source code otherwise decompile the mod dll
If you want to make SMAPI mods with C#, one important resource is decompiling the game to read the game code. Here's how to do it: https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#How_do_I_decompile_the_game_code.3F
Now the reason why AT magically knows what pack is cus it is managing the texture itself
CP itself would also know what pack an item came from but it doesn't express this info to the user
Mostly cus it'd be hard to express i feel
I mean, textures are editable
Lol
I could even be a dick and directly edit the texture
Oh, I see. Thanks so much for the answers everyone! Guess I gotta pick up C# for real now.
You know I'm not a real programmer because I cry about mutation lol
Anyways chue
When will you make it so I can right click on a mannequin to swap out my equips and inventory with it
Dont say "can't you do that yourself?" or "you don't play the game, atra."
When game no longer crash on bad mannequin draw 
I can't hear you over soda pop
I need help. I can't find in the SMAPI documentation how to add new functionality to the tool. I'm trying to create a new tool - a notepad based on GenericTool
yes, it is on image 2
there is some C# happening here but i'm not familiar with tools
Ah my bad
If you want to subclass you need to use spacecore to a) make sure the serializer doesn't explode and b) you need the fully qualified type name so spacecore will allow you to use it as a tool class
The alternative to subclassing is using harmony to patch functionality directly into GenericTool
Where I can see examples?
Vanilla tool data without spacecore only allows vanilla tool types
I have some demo code on my desktop I think from when I was testing it for the pr, not sure if it's still there
The basic gist is you register your tool type using spacecore (documented on the github page for spacecore) and then you use c# to edit tool data, and for ClassName you would do
typeof(MyTool).AssemblyQualifiedName
What do you want the tool to do?
this will be a notepad for taking notes. First, I need to open a custom menu or dialog box that I can customize for taking notes.
(It may be easier to use smapi events tbh)
In that case it is probably simpler to just harmony patch DoFunction on GenericTool
The main issue with using smapi events for item interaction is that you have to manually handle all the weird edge cases that the game normally does for you
True but if all you're doing is launching a menu
one of those times when harmony feels like the best/correct solution to me
I mean ideally generictool would just have events you could subscribe to, but alas
But harmony is not too odious
For #2, there is a way to differentiate. If you look at the way I've done this tropical kitchen mod: https://www.nexusmods.com/stardewvalley/mods/29525 you can see that I differentiate between the Farmhouse and Cabin kitchens (plus the island kitchen as a bonus). It's not perfect, because it's all or nothing for the cabin kitchens, but it does give some finer control. The only thing is you have to use OnLocationChange to make sure the correct map/patch is chosen, otherwise it might show the wrong version on entry. Too many OnLocationChanges can slow down the game a bit. Still, it's useful particularly for cases like this.
There's also Location Unique Name (rather than just Location) that might be able to let you differentiate between cabins.
What if u just make Buildable kitchen
i think the problem is more the renovations though, can't do those via just cp edits on location change
You can, of course, but it's a different thing. If you want to replace the vanilla kitchen in the farmhouse and not the cabin, this is the way I know how to do it. It will also work if you want to replace the whole farmhouse map with CP as the original ask was about
Hmm, it depends - you would need to check if the owning player hasFlag indicating whether that reno is toggled on or off
I think it's doable
Having spent the last 2 months or so working on a mod that lets you modularly upgrade the farmhouse, can confirm. The farmhouse is Very cursed
But as far as the question was concerned, it's definitely possible to use CP to use different farmhouse layouts for a farmhouse and cabin. Renovations might be tricky, but I believe they would be possible with the right CP conditionals, provided it was checked OnLocationChange. With "LocationUniqueName": it might even be possible to do it by cabin, but I think the cabin names are unique to each game, so it might not be easy. @weary pivot LMK if you have any questions.
@twilit quest Oooh, so there's that way to do it as well! Thanks a lot for sharing that! I don't have anymore questions atm because I don't know enough to ask good questions yet but when I do, I will!
Please feel free to reach out if you decide to try to do anything with that.
um this is my first time with temp actor shenanigans, can anyone tell me what the tile x and y are for?
the position on the map?
There’s a warp in tiled that I can’t remove, what do I do?
ohhh okay thanks that makes sense 😅
so I have an odd request:
got a friend makin a mod and he wants to modify the position of the player when they kiss certain villagers, so the question is where to start XD if anyone has recommended tutorials or forums I could scour that'd be helpful hehe
!decompile you will need C# and most likely harmony to do this
If you want to make SMAPI mods with C#, one important resource is decompiling the game to read the game code. Here's how to do it: https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#How_do_I_decompile_the_game_code.3F
ooooo oki oki
you would need to find the code that sets up the kiss animation and edit it to change the coordinates where the player is drawn
i want my custom content patcher npc to dislike artifacts but i don't want to find the seperate item ids for all 42 artifacts
use a context tag. there's an automatically-generated one for every item's category. it will be called category_arch or something like that
what is it exactly called?
item_type_arch
okay ill try it
also i believe artifacts are already automatically disliked or hated so
hmm
strictly speaking, no, since mods can add new ones whenever they want with no restriction
oh okay
however, here's a pretty good one https://stardewmodding.wiki.gg/wiki/Context_Tags
i guess those are mostly tags that mods are using/trying to standardize
Why is an action warp in tiled not working?
can you post what it looks like
the key should just be Action, and Warp should be part of the property value
Hey, does anyone know why this sprite is so downcaled? I formatted it the exact same way I do everything else
is it a big craftable
What is that
It’s still not working
post another screenshot
I think you're either missing the from x and y or the to x and y
It is a craftable, it's a staircase. Didn't look like the sprite was upscaled on the tilesheet tho
is the 82 39 the tile on the beach you want to warp to?
it's the warp action, not the warp property



