#making-mods-general
1 messages Β· Page 358 of 1
okay guys ill comeback tomorrow i do think i see htis being completed ill stick to smlal for now use c sharp for more ambitious projects
translating OpenFire sure was an. Experience with trying to figure out portraits LOL
beacause im wayy too fucking tired to ask qeustions now
please go get some sleep, ur questions can wait till tomorrow
hmm im trying to figure out how to make someone do a sequence of sprites for an animation during their schedule but i cant figure it out, can anyone aide me if they know the answer or can point me at the correct direction, im loooking at the schedule section but cant seem to find what im looking for from a quick perusal
wait i think i found it
sorry for the trouble!
@_@ i found the answer but dont exactly know how to understand what its telling me
Are you trying to figure out how to set up animation data?
yes
i think
basically i want them to move from point a to point b and then do an animation
Ah yes I was going to hop on my computer to help you with that
your so kind π«Ά
https://stardewvalleywiki.com/Modding:Schedule_data
If you scroll down to the schedule script section and open it there's a schedule point section that explains how to use the animations!
So what you're looking at is a schedule animation, which you'll create by adding a new key to Data/animationDescriptions.
Actually I just reread your message. Were you already reading that?
do i add that to content json or is this a seperate json going in my data folder
You asked about looping: the "repeat frames" field is the part where you put the frames that you want to repeat.
oh im reading it i just have trouble grasping what its trying to explain
That's up to you. Content Patcher sees it the same regardless of whether it's in your content.json or an Included file.
hmm alright!
Separate json files only exist so we can organise our stuff if we want to rather than having one gigantic content.json file
One of my NPCs is made entirely in the content.json, no other json files at all (except manifest.json and default.json because they do different things)
πββοΈ
i think probably for organizations sake i might make it its own seperate json in my data section then, just so i can make sure to understand what it means better if i make another npc eventually
So the format of an entry in Data/animationDescriptions is this:
"{{ModId}}_GeckoNPCAnimation": "entry frames/repeat frames/leaving frames/message key/offset X Y/laying_down"
Which in practice might look like this:
"{{ModId}}_GeckoNPCAnimation": "10 11 12/12 13 14 15/16 17 18/Characters\\Dialogue\\{{ModId}}_GeckoNPC:GeckoNPCDancing"
(I invented a name for your NPC for this example: {{ModId}}_GeckoNPC)
:0 oooh ok isee
- The entry frames are the frames that play once starting from when they arrive at the schedule point.
- The repeat frames play on a loop until near the end of the time that they're meant to be there.
- The leaving frames play once right before they leave.
- The message key is for if you want them to say something specific while they're doing their animation (and you can put a dialogue portrait command in there to make them use the specific portrait you want).
- Offset is for if you want them to visually appear somewhere slightly different to where they actually are. An example of this is if you wanted them sitting on a fence - you'd have them actually at the tile next to the fence and would use offset to move their sprite so it was aligned on the fence.
- Laying_down just removes their shadow.
:0 awesome that would solve both of my questions in one ty! now i just need to format the animationdesc json right
question: this would read as "true, true" if the config is set to "true" for theFriendableNPCs, right? "CanSocialize": "PLAYER_HAS_SEEN_EVENT Host 57873022, {{FriendableZuzuNPCs |contains=Kennedy}}"
FriendableZuzuNPCs needs to contain the value Kennedy
yeh, it will.
Was that a question or you just saying "now I have to do this correctly"?
then its fine i think
just trying to sae myself from "When" conditions.
I guess it should be a question i just realized i dont know hwo toa ccurately do a json im learning as i go a bit
I'll give it a burl
Well, you've got json for your character currently, right? You've got them working in game?
polishing up stuff for the beta release
Ye but i dont know how to do the animation one as im mostly copying the bones of how to do dialogue and such from an old npc of mine but ive never done the animation thing before
also its probably been a couple of years since that abandoned project
im afraid i lost all that information sorry >.<
im trying to follow the wikis as close as possible to adfjust
*adjust
No need to apologise! I'm just trying to ascertain what you already know so we can build on that. Do you have any EditData patches in your json anywhere? (A patch is a bit containing an "Action" field within a set of curly brackets, let me know if you need to see an example.)
Ah i do think I have an edit data one!
its for egagement dialogue it looks like
i imagine i change that to uh "Action":EditData:,
"Target": DataAnimationDescription"?
If you don't mind popping it into the json validator (https://smapi.io/json) and sharing the link, I can check it's what I'm expecting and then guide you through changing it.
(Close, it'd be "Target": "Data/animationDescriptions")
Okay cool yes that will work.
So you can just straight up copy what I've got here in to replace the "Alicia0": "", line (delete the "Alicia1": "" line) and then adjust the numbers and things to match your NPC.
gotcha!
"LogName": "Animation",
"Action": "EditData",
"Target": "Data/AnimationDescription",
"Entries": {
"{{ModId}}_GeckoNPCAnimation": "16 17 18 19/16 17 18 19/16 17 18 19/Characters\\Dialogue\\{{ModId}}_AliciaGummyNPC:GeckoNPCDancing"
}
}```
does this look right
Yes, except I think your NPC's internal name is actually GummiGecko.AliciaGummyNPC? Going off the existing dialogue, schedule, portraits etc you have for them.
Oops no sorry your Target is wrong. It needs to be exactly what I put in my message.
And then in their dialogue file you will add a dialogue line called "GeckoNPCDancing" (perhaps change that to "AliciaDancing" or something?) and then add what you want them to say.
so tomoroow ill have alot of quesitons but tonight guys im eating a holemade triple cheeseburger
Aah gotcha
@pine elbow please refrain from posting AI gifs here, thank you!
does it matter where i put the dialogue line for the dancing anim or can it just be anywhere in the entries section?
By entries section are you referring to inside your characters/dialogue/Alicia patch or inside your data/animationdesc patch? (I'm using shorthand for the targets because I'm back on mobile now)
inside the characters dialogue entry patch in the dialogue json
like where it says "introduction" etc etc
Ah yup dialogue. Yes anywhere in there works
alrighty!
Did you manage to find this...?
didnt know it was ai
i want a chessburger mod now
would you by chance know how i put it in schedule so I can have her scheduled to do the animation?
It should just be the name of the animation after the schedule string I think?
[time] [location name] [x] [y] [animation name]
Sorry I'm out working in the backyard now so a bit slow to respond. The schedule page should show it, plus you can look at the vanilla schedule files to see how they're written. Iirc sneaky ham has it correct though.
omg i'm so sorry, i never pressed send! https://stardewmodding.wiki.gg/wiki/Adding_a_Custom_NPC_to_Festivals_template
I put together a template for adding your NPC to custom festivals, mostly because I don't feel like coding everything from scratch each time I do an NPC. Just change the positions and add your dialogue and you'll be good to go! If anyone wants to add in code blocks for the festivals I haven't included, go right ahead!
Custom NPC Tiles is a gre...
oop i must have done something wrong because she moved to the location but didnt do the animaition but theres no smapi errors π€
@twilit quest fyi the farmhouse stuff u were testing is officially out on nexus now
It's okay!
I have this part set up though. The issue I'm having is that if the character data has FlowerDanceCanDance set to true, I don't have the prompt to ask them
Everything works properly if CanBeRomanced is true, but I don't want them to be romancable
do they have dialogue keys for rejecting and accepting?
Yes
hmmm
It's like the FlowerDanceCanDance entry just isn't working?
i'd offer to take a closer look, but right now i'm watching the sandman with my family, sorry! i could look later though
Did you add the animation key to Data/animationDescriptions?
i think i actually had this bug as well and i couldnt figure it out...but mine was after marrying the npc
great reminder to check it out tmr
π€ is it possible that they cant dance unless they're romanceable
no, mine are non-romanceable and can dance
That's how it was originally, but 1.6 updated it so that non-romancable npcs would be able to dance with the "FlowerDanceCanDance" disposition
Pathos said something about the edit patch not setting correctly on Nexus
But I didn't want to ping them on here unless no one else could figure it out π
hmm can you send the json file with the disposition stuff?
Patchsummary possibly also worth it
Can you copy patch export Data/animationDescriptions into your SMAPI window, then follow where it says to go to find the file, and then put the whole thing into the json validator and share the link here? We will use that to check if it got added to the game properly. Then do the same with patch export Characters/schedules/GummiGecko.AliciaGummyNPC.
If you ping me when you share the links I'll see it faster :)
Sorry I haven't let you know how the new one works yet; I have a house full of guests and haven't had a chance to test it yet. ^_^;;;;
π€ if i have two accept gift dialogue that's for a taste and a context tag, but an item matched the taste and context tag for both dialogue lines, which one would win...
Like the whole file?
!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.
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home, with 3 C# mods and 2 content packs.
When statements MUST have a { } enclosing the value
however, you must remove the outer braces on the key inside the when token
Also that, yes
"When": {
"YourToken": "Value"
}
Wait which one of my when conditions is wrong? All of them?
Line 17 and 25 in the validator
Removed my example because it was not strictly correct and button's is better
(I'm on mobile, so it's harder for me to pull the CP docs right now)
from the code, seems like the order is specific item > context tag + taste tag > context tag > taste tag
Okay, well I've fixed that, but my original problem is still present lol
The FlowerDance field not working?
Yeah
how much dialogue does the npc have for the given event?
Did you already add the accept and decline dialogue entries?
Decline is required I think, but Accept can use the generic, according to the wiki?
Unless the wiki is misleading me
i know, that wasn't what i meant
Per the wiki: If the NPC can dance, you should also add the dance sprite frames and FlowerDance_Decline dialogue text. You can optionally set the FlowerDance_Accept dialogue too (though NPCs have a default accept dialogue if not).
Accept and decline dialogue
And normal dialogue for both years
It all works perfectly fine if the NPC has the "CanBeRomanced" disposition
But the prompt to ask doesn't show up if it's just the FlowerDanceCanDance disposition
didn't you mean which dialogue line would trigger if you gave an item that matched both taste and context tags?
what i wanted to know specifically was if i had these two lines, and something like spaghetti was a loved food, it would fit into both of these, so i wanted to know which one would take precendence
"AcceptGift_Loved_color_red": "{{i18n:Gift.Placeholder.Red}}",```
hmm, looks like a bug in the code flow, looks like it needs to be datable to actually make it far enough to even get to the FlowerDanceCanDance check
Would a workaround be making them datable only during the festival?
Until it gets fixed in the code
oh yeah that's a known issue, tia worked around it for Jort and Jeans by temporarily making them dateable during the festival (while rejecting the bouquet via gift rejection iirc)
Ah ha, yes, that's what I was remembering
if (
(
(
tile.X != tileLocation.X ||
(
tile.Y != tileLocation.Y &&
tile.Y != tileLocation.Y + 1
)
) &&
!n.GetBoundingBox().Intersects(tileRect)
) || (
n.CurrentDialogue.Count < 1 &&
(
n.CurrentDialogue.Count <= 0 ||
n.CurrentDialogue.Peek().isOnFinalDialogue()
) &&
!n.Equals(this.festivalHost) &&
(
!n.datable.Value ||
!this.isSpecificFestival("spring24")
) && (
this.secretSantaRecipient == null ||
!n.Name.Equals(this.secretSantaRecipient.Name)
)
)
)
{
continue;
}
need to get past this block to stand a chance.
First section will hit the continue if not actually near the npc, second block checks:
- If there isn't dialogue, hitting continue
- the festival host (lewis) is exempt
- if its not datable or its not spring24, hit continue
- if its not the secret santa recipient
ah sorry i misunderstood, from your question i thought you meant you had two dialogue lines, one with taste tag and one with context tag.
i guess i'll just have to test it in-game and see
yeah, a theory would be that it's take the one on top, but im not sure if that's how it works. maybe it'll use either one randomly, but i think that's up for testing
So it's an issue with content patcher just exiting the prompt before it can read if flowerdancecandance is true?
its a stardew bug, nothing to do with content patcher
The game, not CP
I also read Forsy's message that way!
If you download Jorts and Jean you can copy what Tia did.
I would look it up to try to help you figure it out but the gift tastes code is scary lol
yeah....
Hello! I am having an issue with a multiplayer game where an NPC won't load for my game but loads for the hosts game, I am not sure what to do. Link to Smapi log: https://smapi.io/log/3c328927a09f44818f5c14da4b611e30
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Pro, with 14 C# mods and 20 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
digging in c# code hurts my brain
!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).
bye bye ppl gotta sleep, my brain is turning off 
i havent eaten anything so i should probably take a break
you shouldddd
Yes, modding on no food is bad for brain
at a guess i'd imagine it simply iterates over the gift tastes and compares them with the context tags on the item, so it'd depend on the order the tastes/tags are added
but it could easily go either way
My guess was going to be that it chooses the first applicable context tag line based on the context tag order on the item, but since I don't actually know if those are ordered I did not say it because it's a guess based on a guess haha
its likely entirely dependent on dictionary insertion order, which is usually the order things are added in/the order you see them in the export but is technically not guaranteed to be that way
idk if that was to me but if so, we just downloaded the files today, like an hour ago.
Vinilla directed you to the #1272025932932055121 section. this is not the channel for help with mod errors
ah, sorry.
That's a bot, it just lists info about your log :)
the wiki describes gift tastes in pseudocode https://stardewvalleywiki.com/Modding:Gift_taste_data#How_a_gift_taste_is_determined
Good morning. In CP - if I use Fields to add a Context Tag, does this overwrite the existing Context Tags or does it add my new Context Tag to the bottom of the list?
For example, let's say we set the target field to the ContextTags field above. Then the data your patch sees is this:
[ "color_green" ]
/ That means each value in the ContextTags is now an entry, so you can add/replace/remove context tags without editing the rest of the object data.
in short, you want to use TargetField instead of Fields, with the appropriate syntax
I'm not sure if that's applicable in this situation since we're talking about the precedence of AcceptGift dialogue where two lines are both AcceptGift_<taste>_<context tag> but with different context tags. However! I might just be missing it because I can't read the pseudocode at all haha
you'll find some useful examples if you follow the target field link in the above paragraph
Oh, fantastic! I knew I'd read something about it, but I couldn't remember exactly what or where. Appreciate it!
apologies, I was reading quickly so I missed the relevant context of dialogue responses - just more evidence to the point of the complexity of gift tastes and related code
No worries!
wait now iβm scared how do mine dance successfully if theyβre not romanceable haha
that pseudocode could definitely use a readability rewrite tbh 
Is there a dedicated place to suggest features for Content Patcher - or check if they've already been suggested?
what feature are you looking for?
I'd love to see conditional configuration (i.e. be able to use "When:" in config to stop options from showing up if a mod isn't installed), and the ability to define Dynamic Tokens outside of content.json.
like, in an include?
What's the use case? because I think I'm missing something
Because mine is getting ridiculously large, and thus difficult to read.
why not move everything else into includes though?
I already did - and my content.json is still massive π
iirc dynamic tokens outside of content.json has been talked about before, mostly as a "maybe one day but low priority thing" iirc
with just dynamic tokens etc?
but like, very low priority
Yep.
Ah, okay. Well, I can wait.
You could use regions to split your content.json up
That way you can at least collapse bits you don't need in the moment
Regions?
I think Visual Studio Code already does that, to some extent
But I'm not sure how I can create more inside of a block
#region Region!
Bla bla bla
#endregion
Ah!
I use it to split my events testing json into categories since I have one patch per event, making patches not a useful way for me to collapse things
dynamic tokens outside of content.json are scary because CP really likes knowing all the tokens at startup.
though I guess local tokens have built the infra needed to do it at least in a limited scope
I liked using it for my .cs files in Visual Studio so I went hunting for whether there was a way to use it in json files
VSC doesn't like me using #region anywhere π₯Ί
Tada
At any rate, Dynamic Tokens outside of content.json is a "nice to have", but conditional configuration would be a big one for me.
Oh in VSC you need to comment the #region line (and #endregion)
omg this is so helpful
i usually break up my i18ns into various "sections" via comments but to be able to actually hide them at will
I don't think it needs an extension 
it doesnt need one
Commenting them works a treat.
Sorry to not mention commenting them in the first place, I'd forgotten that part until I actually went to look at my file
NP.
Well, that's one less headache - that just leaves the suggestion for conditional configuration. Honestly, just being able to check if a specific mod is installed would be a big win.
ooh ive learned a new thing
I think a lot of people would celebrate if conditional config became a thing
I'll bet. Here's hoping it'll become a thing π€
im making a mod includes Chinese translating correcting function,for example,"juice" should be translate to "θ¬θζ±" in chinese,but its "ζζ±" in the game,i want to correct it,but i dont know how to do,i use CSharp,how to write the code?
you can/should do that with Content Patcher
i dont know how to write its content patcher code too...
Content Patcher's documentation is available in Chinese now too, if it helps
https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/zh/README.md
as an example, you can write something like this in the content.json file to replace "Juice" item names:
{
"Format": "2.7.0",
"Changes": [
{
"Action": "EditData",
"Target": "Strings/Objects",
"Entries": {
"Juice_Name": "θ¬θζ±",
"Juice_Flavored_Name": "{0}θ¬θζ±"
},
"When": {
"Language": "zh"
}
}
]
}```
i got it to work, pretty sure i can fill out my spritesheet now and it will all function properly (many of the sprites look fine just flipped anyway)
ty for the help
though i dont really understand why i need to put hairstyles in the entries rather than hairtestthing, but it works so
The game doesn't actually know about mod files like hairtestthing.png; only Content Patcher looks at those.
The "Load" part tells CP to load your image into the game's "asset" pile with a name like Characters/Farmer/hairstyles. The game creates extra hairstyles from Data/HairData, and it looks for an asset named Characters/Farmer/ + whatever you write there, so it'll find your loaded image. 
ah... makes sense ty
solved,thanks
@vernal crest sorry for such a late reply!
here are both json validation links
animationDesctiptions: https://smapi.io/json/none/63c968d6b26942ce8ee17e376b47083f
schedule json: https://smapi.io/json/none/82ad72cdbbc34065a8d595f0cfdd234b (it has a repeating basic schedule i made just for testing tbh XD
Here is the animation entry you are calling from your schedule: AliciaDancing.
Here is the animation entry that actually exists: {{ModId}}_AliciaGummyNPC.
Your schedule is trying to find a non-existent animation.
(No worries about the reply time!)
It's an easy thing to miss
Your brain goes "yep, done that bit! I distinctly remember putting something there so I definitely don't need to read it again" lol
question, if I want to have both custom sprites and portraits but both need to be named Shane.png how do I do that
Why would they both need to be named Shane.png?
cuz that's what they're both under in the unpacked data - am I going about it totally wrong?
Your files don't have to be named anything like what the unpacked files are called. All of my files are called "aba_hiria_portraits_default.png" and so on.
The only time the name of the files matters is if you want to use the {{Target}} or {{TargetWithoutPath}} tokens, because then CP is going to look for files that are named the same as the Target.
Oh okay. So if I did one called Shane-portrait.png and Shane-sprites.png that would work?
They could be called stinkbug-for-prime-minister.png for all the game's concerned. 
Yup, call them anything you want.
Okie. Do I need an include too or just a load?
You never need includes.
They're just for file organisation (and LocalTokens if you want to use them, but you never need LocalTokens either).
And you can't Include a .png file anyway.
So just a Load. I assume your mod is intended to be incompatible with other mods that change Shane's portrait and sprite? If not, Load won't work (you could make it a low priority Load but then any other mod with a default Load would stop yours from working anyway).
oh, okay. It keeps saying it can't apply because the from file doesn't exist but the file is right there when I go look at it
yes
Then you have written something incorrect. Feel free to share your json if you want some help checking ^_^
okies one second π
"Action": "Load",
"Target": "Portraits/Shane",
"FromFile": "Assets/Shane-portaits.png"
},
{
"Action": "Load",
"Target": "Characters/Shane",
"FromFile": "Assets/Shane-sprites.png"
},```
And can you show a screenshot of your Assets folder with the folder path visible, please?
It does look okay
Can you share your log so I can see the error message directly?
woohoo it worked! now to add more frames so she isnt moving like sonic the hedgehog
ty again aba
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Unix 6.8.0.60, with 17 C# mods and 6 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
Oh wow that took me a while. You've accidentally spelled it "portaits" without the second r.
In your json
oml
yup, yup that'll do it. Ty!
Also, I can get to a map by warp on the forest map but I can't get my event to work there when i use changetoTemporaryMap
Is it a custom map of yours?
yis
It's more important that it work for the event than it is to be able to get there via forest warp
I can't remember if changeToTemporaryMap requires a Data/Events file, but have you got one?
like a blank json?
no, I hadn't thought of that! but I did have to make one for my JojaMart event so that actually makes sense
I don't know why it would affect it because unlike changeLocation it's not actually moving location, but it's the first thing I'd try if I couldn't spot any obvious issues like a typo in the location name or something.
ok I tried a blank json and it gave me a bunch of angry red text
said could not find file
I would need to see a log to know what it might be upset about
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Unix 6.8.0.60, with 17 C# mods and 6 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
Hm, looks like the Data/Events file didn't help (as I mostly expected). Can you share your json where you Load that map? And the location patch if they're not in the same file.
"Action": "Load",
"Target": "Data/Events/FloralGlade",
"FromFile": "Data/Events/blank.json",
},
{
"Action": "Load",
"Target": "Maps/{{ModId}}_FloralGlade",
"FromFile": "Assets/Maps/FloralGlade.tmx",
"Priority": "Low"
},
{
"Action": "EditData",
"Target": "Data/Locations",
"Entries": {
"{{ModId}}_FloralGlade": {
"CreateOnLoad": {
"MapPath": "Maps/{{ModId}}_FloralGlade",
"DefaultArrivalTile": {
"X": 16,
"Y": 18
}
},
}
}
},
{
"Action": "EditMap",
"Target": "Maps/Forest",
"AddWarps": [
"111 83 {{ModId}}_FloralGlade 16 19"
]
}
]
}
Your event appears to be trying to go to Maps/CacklingCaracal.TheWolf_TheWolfFloralGlade.
Your json is Loading Maps/CacklingCaracal.TheWolf_FloralGlade.
Mismatch!
i cant seem to make the dialgoue i want for the animation i got working to pop up when i interact with the character doing the animation, ive tried "{{ModId}}_AliciaGummyNPC
and
AliciaDancing"
and
{{ModId}}_AliciaGummyNPC:AliciaDancing"
is it possible to send the json to see where i misstepped?
Yes of course. You never need to ask before sharing a link to your json! Just pop it in and ask your question and odds are that someone will have a look ^_^
alright thank you :3
oh lmao once again yup that'll do it hahah thank you!
@lucid iron I'm finally getting a chance to test the new farmhouse upgrade trigger action. So far it works great, except that it looks like it takes three nights (like the regular farmhouse upgrade) instead of happening overnight as detailed in the documentation.
https://smapi.io/json/none/7f576783896d439396f40e712e7bd65e
heres the dialogue json file, the section im trying to fix is at line 20 btw
Ah, so the dialogue line in your dialogue file should just be "AliciaDancing".
And this part in your Data/animationDescriptions patch needs to be your actual NPC's internal name, not the dummy one I made for her lol.
Characters\\Dialogue\\{{ModId}}_AliciaGummyNPC:AliciaDancing.
"AliciaDancing" is the dialogue key.
Characters\\Dialogue\\{{ModId}}_AliciaGummyNPC is the Target for your NPC's dialogue. It needs to match the Target of your EditData patch for her dialogue.
oo ok let me change it then
what do I do if SMAPI refuses to work
!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).
Where are sleeve textures stored?
on your arms
*Your
farmer spritesheet
theres no textures per se, but the sleeve variants are on there
hello! If I do a custom tiledata action "message" on a custom map where/how do I store the actual message data?
So depending on the shirt colour, it recolours part of the farmer base arms?
interesting, i set it to 1 in the source here https://github.com/Mushymato/MiscMapActionsProperties/blob/main/MiscMapActionsProperties/Framework/Location/FarmhouseFurniture.cs#L48
You'll need a content patcher mod:
"Action": "EditData",
"Target": "Strings/StringsFromMaps",
"Entries": {
"ExampleString.1": "This is an example of a string to be used on a map.",
}
},
It tells you on the maps page! It's in Strings/StringsFromMaps like glymr is showing.
ooh awesome ty do I just add that to my content.json?
Yup!
perfect ty
(Psst if it's json it's always going to go in your content.json unless the person is telling you it's i18n or something for your manifest.)
noted, ty :3
Where are the sleeve textures in the farmer base sheet? Are they part of the arms?
I think it's just arm recolor depending on shirt
I've run both these lines to edit the shirt data when it's loaded, on what logs reveal to be the correct shirt, and the sleeves have neither disappeared nor changed colour
shirt.HasSleeves = false;
shirt.DefaultColor = $"{Game1.player.hairstyleColor.R} {Game1.player.hairstyleColor.G} {Game1.player.hairstyleColor.B} ";
What am I doing wrong?
Is default color a string 
So yeah don't think this will work, because this is doing the no good very bad modify game data without AssetRequested
Would look at transpile FarmerRenderer.ApplySleeveColor
Also need to set _shirtDirty and call executeRecolorActions
Hi! I was wondering if anyone knows how to make a hat have an attachment slot like how fishing rods have? I wanted to make so certain items could be attached to a hat to give the player some buffs
C#
mind giving me some directions?
Are you generally aware of how to make a C# mod? Asking so I know where to start explaining
Yes, I got an idea
Ok so the game only implement fishing rod type attachment slots for Tool and Hat does not descend from Tool
Discard all thought of reusing that and create custom system for tracking what is attached to hat, modData useful for this
Hat is extra annoying in that it doesn't descend from Object either so no heldObj to use
So recommendation is toss things into a globalinventory, store the guid to the inventory in modData
Next thing is adding draw to show attachment on tooltip, probably some kinda transpiler bc draw codeβ’
Also need to implement the place into/remove from attachment behavior, not sure off hand where that is. Will have to think about gamepad compat too
Lastly do the stuff to check hat got attachment and perform effects
tl;dr gotta do it from scratch
got it, a lot of work lol. thank you so much for the help!
If the attaching part aint important there are framework mods that detect if a specific hat is equipped/unequipped
Majority of this work is just doing the attachment tracking
would be great to have it visually there but considering the amount of work for this simple ui thingy I might reconsider
ui is never simple in sdv 
However if icon not that important, it is possible to alter the description text and skip a transpiler
I was thinking maybe using Item Extensions to make the interaction and then changing the hat description to include the fact certain item is "attached" to the hat, would this still require C# or can it be done with content patcher/IE only?
I don't know of a framework that alters the description per instance like that off hand
I also didn't know item extensions had features related to attaching items 
not really attaching but interaction
What is this? ```json
StardewValley.Tools.WateringCan.DoFunction_PatchedBy<Rafseazz.RidgesideVillage>(WateringCan this, GameLocation location, Int32 x, Int32 y, Int32 power, Farmer who)
at StardewValley.Farmer.useTool(Farmer who)
at StardewValley.FarmerSprite.currentAnimationTick()
at StardewValley.FarmerSprite.animateOnce(GameTime time)
at StardewValley.Farmer.Update(GameTime time, GameLocation location)
at StardewValley.Game1.UpdateCharacters(GameTime time)
at StardewValley.Game1._update(GameTime gameTime)
at StardewValley.Game1.Update(GameTime gameTime)
at StardewModdingAPI.Framework.SCore.OnPlayerInstanceUpdating(SGame instance, GameTime gameTime, Action runUpdate)
100s of these... multiples per second.
will have to show full log
(you also accidentally cut out the actual error part of the trace log)
it took me reading this five times to put that together in my head for some reason 
mostly out of idle curiosity since things are working... For a transpiler on the following IL:
// if (this.EnemyCount == 0)
IL_011c: ldarg.0
IL_011d: call instance int32 StardewValley.Locations.MineShaft::get_EnemyCount()
IL_0122: brtrue.s IL_0132
// num6 += 0.04;
IL_0124: ldloc.s 6
IL_0126: ldc.r8 0.04
IL_012f: add
IL_0130: stloc.s 6
I'm matching on that second chunk of four lines. This is in MineShaft.checkStoneForItems, btw. Right after that code is another if statement
// if (who != null && who.hasBuff("dwarfStatue_1"))
and I want to insert code after the above block and before the null check (between the ifs). So my transpiler includes:
matcher.MatchEndForward(
new CodeMatch(OpCodes.Ldloc_S),
new CodeMatch(OpCodes.Ldc_R8),
new CodeMatch(OpCodes.Add),
new CodeMatch(OpCodes.Stloc_S)
)
.Advance(2)
.Insert(
So my question is, why is it that when I do Advance(1) the insertion only gets called if the enemy count is 0? i.e. it's still within the if statement. I have to advance 2 (as shown) to get my insertion to be called. Is this as simple as: my insertion when I advance 2 is actually happening after who is loaded onto the stack? Can I not actually insert "between the if statements" since that's not part of the IL?
Wow learning even how to make basic mods is hard, but I'm getting there I understand the basics of JSON.
I told the commenter to send me their smapi log is this not it?
That is part of a line of a log
I think if you insert right after that block of IL, youβre inserting before the IL_0132 label that the if statement jumps to, and therefore are still inside the if statement
you need to move that label to the code youβre inserting after you insert it
a brtrue does not actually just jump to line 132. it jumps to a specifically labeled point, and ILSpy just knows that the labeled point is IL_0132 here. inserting more instructions between them does not change where the jump goes
(moving the label to your IL is thankfully not too difficult iirc)
you could add 1,000 lines of IL between that second block and what ILSpy calls IL_0132 and the jump would still work the same
(in fact, when you write your own labels, they donβt have to be IL_xxxx at all, they can be whatever you want)
the heavy lifting that the phrase βmore or lessβ does in anything relating to code is truly impressive
Oh, I forgot to include the important detail that this is a matcher.MatchEndForward( so in theory it's setting the position at the end of that
right, thatβs unrelated to anything that has been said so far afaik though
its setting the position at the index of the final instruction
if you insert at that index, the final instruction will end up after your instruction
isnβt that matchstartforward, button?
i dont believe it works differently no matter which direction you come from?
direction is the forward part, start and end refer to where it puts you relative to the match iirc
but I could very much be incorrect
and probably am
right but no matter which one it is, it still ends up on an index of an instruction in the match
not one before or one after the match
matchend means you'll stop on top of the Stloc_S
but anyway this changes nothing because the label is still tied to the first instruction of the next block (the start of the βifβ)
So once it runs through the CodeMatches the position is at the stloc. Then advance 1 would move it after that, correct? The confusion I have is that advance 1 is keeping it dependent on the enemy count being 0
because you havent moved it past the jump
isn't advance 1 moving it past the jump?
imagine a long road with two houses on either end of it. the house at the start of the road is sending a package to the house on the other end of the road using house 2's address
you can add as many new houses as you want between them. house 1 is still addressing its package to the original house 2
not unless itβs putting it past the first instruction of the βifβ statement, no
your instructions you're adding are the new houses being added in this analogy
and house 1 is the Stloc
"LogName": "Add Furniture",
"Action":"EditData",
"Target":"Data/Furniture",
"Entries":{
"{{ModId}}_BlueChickenPlushie/decor/-1/-1/2/350/2/Blue Chicken Plushie/0/Mods\\CacklingCaracal.TheWolf\\Furniture"
}
}```
Double checking that this is the correct way to add furniture?
(actually i guess House 1 is the brtrue, and the Stloc is one of 4 houses also on the road, but hopefully you get the idea)
youβre definitely missing something
point is, a jump does not say "go 1 instruction ahead"
it says "go to This specific instruction, no matter where it is"
idk furniture syntax off the top of my head but there should be a key or value inside that βentriesβ entry
what are you using as reference, caracal?
I've just been staring at the wiki page for the most part
the only reason the instruction has a label in ILSpy that looks like its just a couple instructions ahead is bc thats what ILSpy decided to show it as. the lable is meaningless
can you link the one youβre using right now?
it could just as easily say "br.true_s MyCoolLabel"
what did you use for the content patcher syntax, though?
(Iβm just trying to figure out where we stand haha)
oh uh sorry remind me what syntax means haha cuz I borrowed some of it from how I've been adding my other objects and food items which has been modding item data
(and should be. cool code works 50% more often)
but mostly it's just been patching together what I kind of know already and what I find on the wiki
syntax in this case is just structure
but hold on, let me find some good resources
Oh, ok, I had definitely been stuck in the "ilspy's lines are one instruction" way of thinking of this. The fact that stloc.s 6 is two labels and the line count is meaningless was what was confusing me, if I'm following correctly
definitely try not to rely on line numbers or ILSpy labels at all if you can help it, unlearning that will help a lot
adding your instructions will change the count of instructions but the labels are basically memory addresses and you must change them yourself
Yeah, definitely get that. The actual IL is what's relevant... very obviously
as iro said luckily the ILGenerator can do this for you easily
or maybe its a harmony extension on CodeInstruction. i dont remember
https://stardewmodding.wiki.gg/wiki/Tutorial:_Making_Custom_Furniture_With_CP try following this tutorial!
This tutorial explains how to add custom furniture using the new 1.6 game update features and Content Patcher. The tutorial assumes you already have the game unpacked and that you have some basic familiarity with the Content Patcher format. The mods referenced as examples in this tutorial are Bonsaiβ¦
somewhere there's a MoveLabelFrom/MoveLabelTo or you can always just create your own new label with the ILGenerator, attach it to the first part of what you wanna add to the if statement, and then change brtrue's operand to your new label instead
iirc I did it mostly manually and it still worked
I missed that comment from iro that you're referencing
omg thank you!
(tbh i also usually just do it manually with the last way i just described)
these youngins and their fancy generators have no ideaβ
yeah, now that I understand this better, making my own label and replacing brtrue's operand makes more sense - I'm glad I asked
ofc you can also just avoid messing with labels altogether by just adding your if stuff entirely after the original if IL
and then jumping out of the if-block yourself with your own brtrue
which ig doesnt avoid them "altogether" but it means you wouldnt have to mess with the first one on the existing brtrue
(which of course would just mean you have to mess with other labels
)
I previously had written one transpiler like a year ago, but I'm a much better coder now so it's nice to revisit this now that I have a better understanding to grasp all this with
i think all harmony mods should be rewritten as transpilers instead
i love transpilers
it's addictive
once you learn them it becomes a βwhen all you have is a hammerβ situation immediately 
or at least compelling to draw you into its grasps
Why stop with Harmony mods. All mods can just be written as transpilers. Including purely content mods.
all mods should be rewritten as Mono.Cecil prepatchers
I can be trusted with Mono.Cecil access.
can you imagine the load times if all Harmony mods were Cecil instead
much better
sounds great lets bug pathos to make it happen
anyway, thanks for the insights - glad I asked so I could understand this a little bit better
Does it make a difference if no one is doing patches after gamelaunch
bit bold to assume no one is doing that
No i mean, is cecil and harmony perf the same at runtime
i was kidding, but if we were to really do it, i'm saying to only do Cecil patching once
that's not something you can do with Harmony
but even if you were to patch again each session, i think Cecil would still be vastly faster than Harmony
it was a while since i profiled my mod loader for Cobalt Core, but i believe about 50% of load times were due to mods doing Harmony patches
i assume it's similar in Stardew modding
Can u do this but sensibly with cecil
i mean, uh, maybe
I thought it's mainly cp content edits especially EditImage/EditMap
unfortunately i've lost my free dotTrace license
so i can't check
and i don't even have a big modded setup right now
Have you looked in the couch cushions? I'm always losing things in there.
I am curious about the stuff cecil can do that harmony can't tho
Yeah that's my vague understanding too
Yeah, you can add new members
You can also patch methods which normally get inlined
Or generic methods
Add interface conformances
what was the technical reason that a mod cant do this already by taking Cecil from smapi-internal, does it just have to be done like, super duper early and by the time your mod is loaded its too late
Whatever you could do normally with C#, while building said assembly, really
Can i add more enum
Technically? But you can do it anyway, by just using different values from all of the defined ones
Has to be done before the assembly you want to patch is loaded
By the time mods get to load, Stardewβs .dll is loaded
Well do it in a way that satisfy enum try parse from string
could i patch SMAPI to do this to another mod if i knew that other mod was going to be loaded after mine
Probably (to patching another mod)
I can be trusted with Mono.Cecil access.
New quote added by atravita as #6474 (https://discordapp.com/channels/137344473976799233/156109690059751424/1390772091347009626)
Not sure about that.
Actually
(not that i have any idea how id guarantee that load order without owning the other mod anyway, though, in which case... why)
Pathos will turn around and you'll have Cecil via content pack
SMAPI loads all assemblies one after another, before creating mod instances, right?
I don't trust myself with anything
I remember it being weird
i dont know how SMAPI does it
Static constructors lol
still though, if my instance is created first, surely i could just patch SMAPI to reload the assembly right
Static ctors donβt get called until their types are referenced
We're getting dangerously close to 6480
dangerously? i think thats like 90% of the reason for most of atras quotes the last month
This would explain mods packing 0harmony.dll then breaking stuff afterwards
Breaking being making smapi think they r not compat
Hi
New quote added by spiderbuttons as #6475 (https://discordapp.com/channels/137344473976799233/156109690059751424/1390772904660045824)
I contribute nothing useful to the conversation
Atra go quote 4 things and 6480 real quick
No you
hello, does anyone have experience with conversationtopics? I can't get the dialogue to show up after adding it into an event
did you add a corresponding dialogue key to your NPCs dialogue?
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.
I actually caught myself pathing wrong yesterday, I was doing Data/Characters/Dialogue/Character.json but when i changed it the dialogue still didnt show up
your targets all have file extensions
remove them
yes!
thank you
i got mixed up with loading custom npc dialogue and editing dialogue 
I'm supposed to use streamedvorbis: true for both custom sound effects and music that will only play once in a single event, right?
Yeah usually
There's jank related to using that on short sounds but if it works u good
Anyone know where the dialogue is stored for when you reject adopting a pet?
Strings/StringsFromCSFiles:Event.cs.1798
would it be possible to stop marnie from saying this when you reject adoption or is this hardcoded?
well you can change it to something else...
hm yeah but i would need marnie to not be there at all
its ok it'll just be a funny little goof if players choose not to adopt
marnie will appear out of nowhere
maybe although i dont know if there are many mods that change adoption altogether
if u just null out the event i think ppl just get a little black screen and then nothing
thats not the problem cause i do want the question to be asked, it just wont make sense bc the event is different xd
oh u can just edit that string then
its fine though if ur downloading a pet and choosing not to adopt idk why you downloaded and chose the pet
target Strings/StringsFromCSFiles editdata entries Event.cs.1798
the string doesn't mention its from marnie
that only changes the text,not the fact marnie will pop up and say it
this.eventCommands[1] = "end";
this.eventCommands[0] = "speak Marnie \"" + Game1.content.LoadString("Strings\\StringsFromCSFiles:Event.cs.1798") + "\"";
dire times

what is the behavior you want if ppl download the pet mod and get toothless as pet 2
or 3 or 4 etc
well if you BETAS harmony patch the array index accessor...
fear
I didnβt look into this cause I thought you would need to buy the pet license
I briefly considered having the wizard sell the pet license although I donβt like the idea of selling a license for him
its hardcoded to marnie rn
Then 
or more accurately hardcoded to the PetAdoption shop
which u could open from a tile action, but wouldnt filter to just toothless
isn't the pet license an item query
all ive done up to now is extremely simple stuff
i need to play a cutscene first thing in the morning, when the player leaves the house "OnNewDay"
of just a random character talking to the player
i dont know if i can link/send a picture here
you can yes
i essentially dont know how to do it, and the api docs are somewhat confusing for me
you can add an event to Data/Events/Farm and set the preconditions to what you want
are you in C# or content patcher?
im tryiong to get specific dialogue and portrait to show when talking to my npc but it keeps throwing errors but idk how to understand if its looking for a seperate json im supposed to make or if i messed up the pathing
this is the smapi log: https://smapi.io/log/134642f14d4b4a48ab3e05cff51ed882
I can supply whichever json it needs but im not sure which one that would be and i dont want to spam like 4 json parser links
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Pro, with 3 C# mods and 1 content packs.
me?
yea
doing it all on c#
are you invested in doing that?
i think chu asks bc what you want is very simple to do with Content Patcher
then use assetrequested to edit this asset
but it works similarly in C# anyway
thats fair but i already know c#, and my project requires reading into a .json file
have you loaded a blank.json for your NPC's dialogue file?
content patcher does this (and other stuff) for you based on json files
ive seen the docs, i just find it really confusing
a lot of docs online about how to format event is targeted at using content patcher, but the concept is same really
i still prefer the freedom of c#
I think I did yes!
is cp really all that good? ive only ever considered modding in c#
you are going to edit a Dictionary<string, string> asset by subscribing to the AssetRequested event, and handling stuff accordingly
can you send the json responsible for your blank.json load?
i mean its qol if u need to do a lot of content edits?
ofc
which is the case for things like npcs
Content Patcher mods account for literally over half of all Stardew mods
itβs easy and powerful to use too!!!
something like 66% of all mods
but if your main mod is going to need C# then yea its fine to do the asset editing yourself
can cp read .json files and use stuff like randints?
this is my content json it should be the first section that loads in the blank json i have πββοΈ
all CP does is read json files that you write
and assets to go with them ofc like pngs and wavs
doodle it'll prob help us if you give a high level summary of the mod
but thats like its whole purpose
you can combine content pack and C# too if you want 
its super simple really. OnNewDay, waits for a player to leave the house, and a cutscene plays of a random NPC (will be changed later) says something (that is read from a .json full of messages and their likelihood of being chosen).
you're loading it to GummiGecko.AliciaGummyNPC but your log says GummiGecko.AliciaGummyNPC_Alicia
is your NPCs internal ID the former or the latter?
i think this entire mod can be done in content patcher actually 
as long as the random npc is a fixed list
not only that but itd be even simpler with Content Patcher
i need to be able to replicate this in cp if that is the case:
`string path = Path.Combine(this.Helper.DirectoryPath, "messages.json");
List<GreetingMessage>? messages;
try
{
using (StreamReader reader = new StreamReader(path))
{
string messagejson = reader.ReadToEnd();
messages = JsonSerializer.Deserialize<List<GreetingMessage>>(messagejson);
}
}
catch (Exception ex)
{
this.Monitor.Log($"Error reading messages.json: {ex.Message}", LogLevel.Error);
messages = new List<GreetingMessage>();
}
int totalWeight = messages.Sum(m => m.likelihood);
int choice = new Random().Next(0, totalWeight);
int cumulative = 0;
GreetingMessage? selected = null;
foreach (var msg in messages)
{
cumulative += msg.likelihood;
if (choice < cumulative)
{
selected = msg;
break;
}
}
if (selected != null)
{
Game1.addHUDMessage(new HUDMessage($"Hey {Game1.player.displayName}! {selected.text}", 1));
Game1.playSound("ding");
}`
oh it doesnt format
crap
the hud message not quite, would need spacecore
(and the sound)
who is providing messages.json?
it wont make a hudmessage, that part is to be replaced by the cutscene
messages.json is already in the mod folder, its made for customizability, so that anyone that gets the mod can change what messages get displayed
internal id is the unique id right?
mod itself then 
How do I make it so that an extra json file is only included when a certain mod is installed?
or is that different i tried setting it as her name because i wasnt sure
Or does it not matter?
im assuming its the former since thats where you've loaded all your portraits and stuff to as well
yea so in CP land you'd define a token that has the list of NPCs that can appear and use the {{Random: {{NPCList}} }} token to pick one
well aslong as i can replicate the same in cp ill try it
itll take some time to learn cp
can you link cp docs?
tyty
you can also use Random to pick a line to say
which of these themes seems most interesting for a bundle?
- Witchy / Wizardry
- Flowers, Vines & Roses
- Pirate Treasure
Flowers, Vines, & Roses
ooh
Though Pirate Treasure sounds pretty awesome, too
(also even your C# was on hard mode you dont need a streamreader to read a json in your mod, theres something in your ModHelper for reading jsons for you)
all three of them could be real pretty 
oh lix unrelated suggestion
ok so i should change the part back to AliciaGummyNPC
what if pif doors can be only door on part of the furniture
someone made big castle PIF door and rn the entire big castle furniture is a door
its up to you, but whatever your NPCs internal name is, is what all your targets will use when loading blanks, portraits, etc
πββοΈ
on my phone rn, but does the game even provide the clicked tile when checking for action, or only the furniture?
ok i changed everything back to {{modId}}_AliciaGummyNPC:AliciaMagic
oh didnt know that
not in Furniture.checkForAction but you do get it in Furniture.doesTileHaveProperty
so a really easy way is to register a tile action and tell ppl to use spacecore to add that tile action on the tile that should be a door
I mean adding a tileaction would be quite simple to do
but i dunno how you'd want to associate it to the furniture in that case 
you'd need to provide the furntiture id as an argument
ah i was imagine something different actually
you mean how placing the furniture would set the tileaction?
basically in mmap i have added some warp type tile actions that automatically grabs the building on the current tile, and warp the player inside
This is added because the indoor map is instanced and some long guid location name, so you can't use a normal warp
this is intended for usage with building ActionTiles
pif can work similarly, so as long as you somehow give the property via Furniture.DoesTileHaveProperty
spacecore does it ofc but nothing wrong with rolling your own 
from there you'd have the relative x y as well as the Furniture
the location names are generated and I think you could do the same checks PIF does
How do I fix this? (Yes, Expanded is installed) https://smapi.io/log/fa62ad62a62a43a0a063acebd86ecb74
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home, with 8 C# mods and 11 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
or I could add an api
I feel like it makes the most sense as part of the pif door custom asset model though
If u don't mind i can draft a PR for it (eventually)
sure
Hello? Anyone?
That said the easier workaround is just separate the door from the big castle 
I think you're way too mentally invested in this than my sleepy head can follow on the phone now anyway 
Yes i am very deep in the map sauce
do these patches have a when: has mod condition?
No.
How do I add that and how does it work?
i would recommend either doing that and/or adding a false dependency in your manifest
https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide.md#tokens this page has information on conditions and tokens
Okay.
and if that isn't enough, then adding a false dependency on SVE will ensure that your mod loads after it (if that's what your issue is)
If this is a silly question I apologize, but... has anyone else ever run into an issue with SMAPI not reading a content.json file even though there is one in the mod's folder?
well, Content Patcher reads it if your mod is a content pack for Content Patcher. SMAPI isn't what reads it, in case that's relevant to the issue you're having.
Well that's just a lack of general understanding on my part, but my question remains the same... Why would this happen and how do I fix it
do you have content patcher installed?
and its actually a .json file and not a content.json.txt in disguise? i.e. do you have file extensions turned on
JA is irrelevant
I double checked that, it's for sure a .json file
That doesn't matter
Json Assets is an outdated mod
you don't need it to work with .json files
Gotcha
pretty sure they were just replying to me asking if it was a json
someone correct me if I'm wrong there
does your manifest have
"ContentPackFor": {
"UniqueID": "Pathoschild.ContentPatcher"
}
as said JA is completely irrelevant
if you check for what Cam just posted and its there, then send a log
Yup
!log
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.
Just making sure, because once upon a "trying to figure out mods" time I did momentarily think I needed Json Assets to work with jsons
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on macOS Unix 15.5.0, with 1 C# mods and 1 content packs.
can you send a screenshot of your mod folder within Stardew Valley/Mods?
Just the two of 'em in there
can you turn on file extensions
do you have any images in your assets folder? do you see them say .png at the end of them?
idk how that works for mac(?)
Yes to both
Not sure how to turn on file extensions (they may already be on?) but this is how the info panel on my computer identifies the file
Nope
I also made sure the .json was all valid and parsed correctly
So I
Oops
I'm kind of at a loss π
can you double check that its not actually named content.json (with a space at the front)? since i noticed your mod folder name in the log has an extra space at the end, so i wonder if that mightve happened with the file name too
Im confused by why this folder doesn't have Json Assets
It's not that you needed it, but more that the log shows it was there
Which makes me think this isn't the actual mod folder
I just removed it
It was in the folder when the log I shared was created
Double checked for spaces in the file name, still no dice
Same error
the only thing i can think of then is that this is either not the mods folder that SMAPI is using or maybe something is preventing read permissions on your file
Hmm, I'll check the permissions
That's been an issue with loading other mods. But it was typically a different error in the log in those cases
I replaced a few of the mods that I use (I had removed them so that I could load everything up faster while testing this mod) and everything else is loading up just fine
Also no luck in changing the permissions (typically changing all of the permission to read & write fixes that issue for me)
then i am unfortunately out of ideas
Do u wanna zip up r mod and send it here
isn't the uniqueid case sensitive?
the p in pathoschild should be capitalized iirc, not sure though
That sounds accurate, tbh
thats not an issue
k just checking jsut in case
the log indicates that Content Patcher already found the mod folder
it just cannot find the content.json
which means its also not an issue with the manifest in general
It literally just can't identify the content.json for some reason
Everything else is in order as far as I can tell
I did just correct that but haven't reloaded since
no
Makes sense, it already found the folder like you said
this shouldn't be a problem, right?
I just tried to open the game with it and CP couldn't preload it. I then moved the internal folder out of it and deleted the rest since it had a __MACOSX folder in it with more content. Then ran the game and it worked
(this is at you SMae)
that just means theres an xnb mod installed
What does __MACOSX do...
my game was able to load it just fine
I always get these files and i just toss em
This seems to have worked!
im confused what you even did
me? I extracted the zip. It extracted to a folder starting with [CP]. Inside it was a folder named the same and the __MACOSX folder. I moved the first of those two internal folders to my Mods folder and deleted everything else.
I've seen a few people who make CP mods on a Mac have that folder but I have no idea what its purpose is or why it was affecting this case
Logo, for example
but SMae did not have the MACOSX folder inside their mods folder, right? it wasnt in their screenshot
and even if they did, SMAPI and content patcher did find their mod
it read the manifest.json perfectly fine
Remind me what the "WARNING: Mismatched UI Mode Push/Pop counts. Correcting." error means?
that can happen for a lot of reasons
I remember it being a simple fix but not what the fix was lmao
it's probably a hidden folder on a Mac
I think that folder is invisible on mac
but SMAPI clearly read the correct folder fine
and read the correct manifest inside the correct folder
This could be anything
im just confused where things went wrong, bc i wanna see where in the code it happened
yeah, idk why it fixed things which is still concerning
and i dont really understand what SMae did to fix it if they cant see the MACOSX folder
It's a menu glitch. Now that the mod is loading correctly the menu isn't displaying it. It's an issue I had before, I just don't remember how I fixed it
SMAPI also specifically ignores that folder to further add to confusion https://github.com/Pathoschild/SMAPI/blob/16234fe5f423901968f0986efccf4e11f2520163/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs#L25C1-L25C114
Also: I tried just re-extracting it as normal and making certain that folder wasn't actually there
It then worked
Yeah i am aware, but menu mods are not the sole cause of the warning
I am truly just as βοΈ as y'all
Ah, understood
All that warning really means is that something did a bad and could have exploded UI but thankfully smapi/game caught it
Huh. I see
We'd need context basically
https://smapi.io/log/3e878630f0d1476bab43f8957232f4d4 This is my current log. As far as what I'm doing - just scrolling through the build menu at Robin's
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on macOS Unix 15.5.0, with 6 C# mods and 6 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
It could just be the fact that a bunch of my mods are wonky and pieced out because I've been testing. I'm just gonna put everything back where it belongs and give that a go lmao
Try new save first
Warping to ScienceHouse
You went to Robin's and opened the carpenter menu?
I did
did you used to have Alternative Textures in this mod list?
I did, yes
do you still have the broken tools
or the AT tools
or maybe really any errored items in your inventory
I think I did have an error item in my inventory
trash it then and try again
No such luck still.. do I maybe need to reload to clear out the error item?
i dunno then. but its finding null object data, so. make a new save for testing.
I believe I changed the correct things back to the internal id of my character but the special animation dialogue still wont pop up >.< , if it helps she says her regular intro dialogue and spring dialogue but then even though theres another chat indicator when i mouse over her she wont tallk further and errors will spring up in smapi log
https://smapi.io/log/07406ecc8eff4a8fafcf1eebe129ca72
heres the log
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Pro, with 3 C# mods and 1 content packs.
let me also grab my dialogue json because im wondering if thats what i have wrong
ther eferenced line is at line 20
https://smapi.io/json/none/5b94198482d34c789739f337a0ce1b3b
okay i actually think the way you do it would work but once again you have mismatched targets
with how frequently itβs confusing you, i would honestly recommend simplifying your NPC name. {{ModId}}_Gummy (or something like that)
you also donβt have to type out your Mod Id inside of content patcher, which i suspect is also causing confusion
aa ok ill change all instances to modid and a simpler name
i hope that works! and if it doesnβt then iβll show you how i set up mine with strings the way vanilla does it
alright thank you!
oof i messed something up i think, now she wont do an animation XD time to go back and fix that first
How do I fix unnamed items?
hi, can someone help with a mod issue?
you can just ask your question without asking for permission first
hi, i'm working on a translation of a mod called Ailisia and everything was going ok till i got an end of day error
19:20:59 ERROR game Failed loading special order 'Ailisia'.
System.Collections.Generic.KeyNotFoundException: The given key 'ResetEvents' was not present in the dictionary.
at StardewValley.SpecialOrders.Rewards.ResetEventReward.Load(SpecialOrder order, Dictionary2 data) in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\SpecialOrders\Rewards\ResetEventReward.cs:line 21
at StardewValley.SpecialOrders.SpecialOrder.GetSpecialOrder(String key, Nullable1 generation_seed) in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\SpecialOrders\SpecialOrder.cs:line 731
this is only day 8 of a new file so i'm unsure how a spcial order is causeing an error, unless it's trying to load up one of her 2 quests but i'm unsure. need help knowing which part of the code i messed up as you posts in the og mod dosen't seem to have this problem and removeing the mod lets the game go on as normal
can you post a log instead of copying and pasting from the console?
that way it's easier to see 
Woo, first event coded from scratch rather than modifying an existing event!
Master Sword is from JazzMinK's mod, sword pedestal and Deku Tree are from mine. We are having a fun time collaborating. π
I know %revealtaste is a thing, but is there a way to randomly pick a random NPC and item to reveal the taste of?
(thinking about letting the Deku Tree give insight on likes/loves/hates)
you could probably do something about it if you abuse dynamic tokens enough
can u just let people talk to the big tree
error fixed, sorry to bug you guys π¦
I mean, I am already gonna be abusing random a bit
I figure there's a 75% chance the tree won't even talk to you because he's sleeping, LOL
The big tree is a map tile NPC
(it'd be cool to implement a hint feature for archipelago with him but I am not that code savvy to even begin to make a specific integration with archipelago)
my greenhouse is cursed. actually cursed.
is it meant to be cursed?
two people have reported the issue that when they go to sleep, they can't plant anything in the greenhouse the next day
but i could not replicate it
and of course nobody attaches a log
no log no bug
Is there some documentation I can read on how content packs for a specific mod are provided to that mod through the SMAPI?
also possibly relevant https://stardewmodding.wiki.gg/wiki/Tutorial:_Making_Framework_Mods
Thanks
I'm making a mod that dynamically chooses between any number of assets that I'd like to be provided through content packs
the rec is to have custom asset ppl can editdata
You got any documentation that's less instructional and more theoretical? I want to know what the file and data structures look like for a content pack
its json. if youre using content packs for your mod then you decide the structure
thats up to mod and anything newtonsoft.json accepts is fine
Dictionary<string, CustomDataModel> fairly common pattern
So a content pack can't add arbitrary assets to My mod's assets folder?
i think you are misunderstanding what a content pack is
*You
?
you can put your assets into the game's Content and then mods can add to that. Then you can use that modified asset as you please
(following the example in the link I provided)
a content pack is for people making non c# mods to put in data as desired by mod handing the actual custom behavior
so in my example here i ask for certain strings and Actions which is then turned into a question dialogue menu
no ones putting any assets into my mod directly they provide it to the game's content pipeline and then i look at it
And can assets be provided to the content pipeline by content packs without replacing or editing some other asset provided by the base game or another mod?
a content pack for content patcher is just a manifest.json to load in the mod, and then the content json and whatever other shenanigans that might need to be included
assets that add a unique thing to the game are possible and very common
yea the special asset i expect mods to edit is called mushymato.MMAP/QuestionDialogue
don't have to replace or edit existing game assets if that's not the goal
this one's a data asset, but ofc theres also texture assets and map assets
those can also have whatever name the content pack author desires, as long as my mod is told to use em via a data asset it's all good
(anyway, seems like there's a more complicated convo going on here than my sleep-deprived self is willing to partake in, so back to my stupid exam I go. Or maybe I should take a stretch break first...)
Hmm. I think based on what you're all saying, the ideal solution would be to read a json included in each content pack, create extra asset folders and assets based on the content of those jsons, and allow the content packs to edit those assets I dynamically created.
no
that sounds like a very convoluted solution and im not even sure thatd work out with the timing
I'm not sure I'm following the solution here, to be honest
for something like this the back o napkin design is like
List<BodyTypeData> // could use a dict too, depends on goal here
public sealed class BodyTypeData
{
string Id; // unique id
string Condition; // a game state query
string Texture; // name of a texture asset
}
please stretch!!!
perhaps the Texture is actually several and perhaps theres option for sleeve i dunno
Condition is here to control when apply
perhaps the apply is actually via trigger action tho, might not even need a custom asset if trigger action args sufficient
Okay but the string Texture part is what I'm struggling with. Where do the textures that the content packs add get stored?
Stretch and then exam!
(I hold this in threat)
also goes to content pipeline
honestly go look at how Data/FarmAnimals work it should illustrate most of what i speak of
a custom asset is not really different from vanilla asset besides the fact that a mod added it 
i do have examples but slightly complicated
heres the 2 bits that define texture + a rectangle portion to use
https://github.com/Mushymato/MiscMapActionsProperties/blob/main/MiscMapActionsProperties/Framework/Location/Panorama.cs#L42-L43
i load texture here
https://github.com/Mushymato/MiscMapActionsProperties/blob/main/MiscMapActionsProperties/Framework/Location/Panorama.cs#L224-L226
Okay, so suppose someone writes a content pack that replaces the image at Characters/Farmer/Shirts/140/shirts.png
This file does not exist in the base game, nor will My mod create it. If a content pack replaces the file, will the file be created, such that I can then use it?
the file is created by using content patcher Load
like this
{{ModId}}/critters/rabbit (which resolves to mushymato.MMAP.Example/critters/rabbit) is arbitrary asset name i use
and then later i give this to my C# as a string
Oh awesome. So if someone puts My mod ID in there, they could create an asset that the content pipeline believes is in My mod's assets folder?
Can they use the game's content folder?
asset names aren't folders despite the convention to use /
merely string
coulda called this asset mushymato.MMAP.Example-critters-rabbit and it'd work same way
every mod has access to content, hence need to uniquely prefix so 2 mods arent both loading to rabbit
"Changes": [
{
"Action": "Load",
"Target": "Characters/Farmer/Shirts/140/Shirts",
"FromFile": "assets/shirts/140/shirts.png"
}]
So if a content pack does this, can I then call
this.Helper.ModContent.Load<Texture2D>("Characters/Farmer/Shirts/140/Shirts");
And will that load the texture provided by the content pack?
Thanks
(you'd use GameContent, not ModContent)
the royal you
but remember if its a Content Patcher mod then you cannot get access to the content pack's files directly ever, if that still matters
(not without reflectiony means)
so you cant get the .png directly
I just need a way to load textures from content packs, and a way to count and search the textures by type and number
Pls dun make contentpackfor without good reasons such as "i wish to replace content patcher"
With this setup content packs can simply tell c# mod what texture
And it allows some reuse
one solution would be to create a custom asset called MyUniqueID/Textures which is a string -> string dictionary, with content patcher mods adding entries to that asset where the key is their texture name and the value is an asset name (e.g. Characters/Farmer/Shirts/140/Shirts)
then you can load the entire dictionary at once and then load every texture
There are reasons for My design which I am following the server rules by not explaining here
I think if the earliest point the asset needs accessing is GameLaunched + 3 ticks then custom asset will do just fine 
Farmer aint getting drawn b4 then I hope
ok but what if my reason is not that
i dont trust anyone with cecil button
My mod doesn't currently load any assets until a save is loaded. I'd like to find a way to load assets on the save selection menu, but that's a low priority I'd rather work on after I get to 1.0
i did not have cecil plans
Save selection menu is many ticks after game launch
Yes
So it's fine no?
its not a file system once the game launches
That is why i suggest a list custom asset too
No, it's very likely. I'm planning on supporting up to hundreds of farmer bodies. Currently I know of four farmer body content packs, and I'm planning on implementing two of them within this system. But I'm hoping My mod will encourage the creation of many more. I want to be able to support any number, that's why I was concerned about content packs replacing assets. Thanks for explaining the Load action in Content Patcher, it makes this a lot easier.
Yea np, though by asset reuse i mean more like 
Where ton of stuff for unrelated things all belong to 1 asset
Farmer body, a very complicated bit of asset, is not usually gonna show up on a random tas 
"Changes": [
{
"Action": "EditData",
"Target": "Data/Vi-'sModExtraTextures",
"TargetField": [
"Shirts"
],
"Entries": {
"140_{{ModId}}": {
"Mod": "{{ModId}}",
"Asset": "{{ModID}}/Shirts/140/Shirts"
}
}
}
]
Like this?
If using TargetFields the Shirts key must exist (can be provided by the default asset ofc)
Cp tokens are {{this syntax}}
But the value resolved by the time it hits content pipeline
So if the data file looked like
{
"Bodies": [],
"Shirts": [],
"Pants": []
}
It would be all groovy, and I could have a central repository of all the shirt numbers added by content packs?
Yeah
Thanks!
Could consider separate vimod/shirts vimod/pants vimod/bodies assets too
Becomes 3 different loads but removes need for target fields
Is removing the need for target fields important?
"Changes": [
{
"Action": "EditData",
"Target": "Data/Vi-'sModExtraShirts",
"Entries": {
"140_{{ModId}}": {
"Mod": "{{ModId}}",
"Asset": "{{ModID}}/Shirts/140/Shirts"
}
}
}
]
Like this?
Yeah sure
It is anything goes so as long as the c# supports it and ppl have docs to read
I want to do as much as possible with the C# code to reduce the amount of knowledge artists need to have in order to add textures. That's why I wanted to be able to search the content pack's files. So artists can spend less time editing JSONs and more time drawing
I think needing to Load a texture and then put the Target to some assets is well-known pattern
Since vanilla does this for many things
It does trip new people up sometimes ofc
Yeah I've never made a content pack so I don't know what artists are used to doing. You're saying they expect to do something like this?
Yeah try doing a content pack that add a new object perhaps?
With new texture and all
Should make sense with hands on experience
I'll be making content packs for My mod right away once I finish setting it up to read from content packs
content pack creator here (items) - we usually do the jsons ourselves, too, it's not new to do all of that. gotta do the work needed to get the shinies in the game!
the more prolific ones among our numbers have templates, even 
Some people who only do retextures don't necessarily know how ofc
Awesome
Since EditImage is all that is needed
yeah some people do only editimage but adapting isn't too hard
just gotta read the docs
I have a simple philosophy when it comes to UX design: People are dumb. Make it easy to do the right thing.
I think that's true of users but i got only the highest expectations for fellow modders 
yeah, that's not really fair to expect so little of content modders π
we're not dumb, just working with a different set of tools, and most people work very hard on their stuff
Philosophy is provide more knobs so ppl don't have to ask me to expose more knobs later
there are a few lazy eggs out there but by and large people have sufficient Figure It Out in the community
But make the knobs optional
put all your shinies out to play with and people will be less likely to ask for more shinies to be brought out of the basket
not a week goes by without me asking if some random thing is hardcoded haha
Game state queries are very versatile knob for example
i gave people the ultimate shiny with BETAS Harmony but chu still tries to offload ideas onto me for other things
(I do not expect much from the average mod user, mind. nexus comments are a depressing landscape these days and it is fair to assume low FIO from them)
Alright so suppose I removed the requirement to append the number with the ModID, and two different content packs try to EditData with an entry for 140. Does the second one to load wipe out the first one?
Yeah
to be clear, there is 0 way to actually require the modid
you can only strongly, strongly suggest it
This is intentional bc 2nd mod might wish to edit 1st mod
Well I can make it so the asset doesn't load if they don't include a ModID, but let's suppose I don't do that.
They can just lie
you can, however there is no way to guarantee its their modid
I wouldn't worry that much cus {{ModId}} token exists
If the example packs all have this ppl tend to just copy and accept
Right so if a user downloads two different content packs that add a shirt at 140 (and also other textures at other numbers), a user might want one of the 140 shirts to not load, and in that case, it's better if the ModID isn't included in the number key?
the second mod pack can just manually write the other mod id to overwrite it
I think the user should not install 2 mods that add shirt 140 
Okay so I'm thinking I don't want the ModID to be part of the number key, and if two different mods add 140 shirts, that's a user problem and not something My code should be sorting out and choosing between.
It's more specifically a content modder problem
A vanilla example is like
I shouldn't add a NPC with internal Claire bc I'd be incompatible with older mods that also add Claire
Instead i add internal name chu.ClaireNPC_Claire
it's essentially the butter problem
One content pack might want to add a 140 shirt for female characters, and another content pack could want to add a 140 shirt for male characters. In that case, I'm thinking it's the user's responsibility to choose between the two mods and uninstall or disable the one for the sex they're not using
I would hope the content packs use more descriptive names
no that is the content modders responsibility
Like chu.ShirtMod_MaleShirt1 or quill.VictorianShirts_FemaleTop
I sure hope not, because I really need the number to be an integer corresponding to a particular game state, in this case 140.
bold of you to assume I have the skills to draw victorian shirts 
I'm flattered 
Just have an int field in the data model
I thought shirts have string ids tho do they not?
If there are multiple shirts that should be loaded at game state 140, then I have to choose between them, and I don't want to do that. I think that's the user's job.
