#making-mods-general
1 messages ยท Page 64 of 1
I sort tabs into environments so I can have even more tabs without getting lost! ...that might be a problem
Closing your browser with 30 open tabs across 3 windows, thinking "My work here is done!" is super satisfying
you don't need to find stuff, you just need to open another tab
And let's be real, once you reach a certain TPI (tabs per inch), they start looking much more crisp.
Some people actually enjoy hunting and reporting bugs.
I also sort my tabs into environments but maybe I need more because I have 160 tabs open in my Stardew window
And they're not paying for the privilege, theyre finanically supporting a mod they enjoy.
(my one bugtester who makes reports on my mod because i'm dumb and i miss (1) event command ๐ )
It also helps cos people play different combinations of mods.
Many of my event bugs come from Fast Animations.
Bug testing and financially supporting mod authors are both concepts that I understand and things I participate in. Being a user who isn't intending to do any bug testing paying extra money to get access to a mod two weeks earlier than everyone else is not a concept I get.
Which is probably related to me also not being interested in pre-ordering, seeing movies in theatres, or owning anything newly released if I could wait for it to be cheaper instead.
And that's fine too. Its not obligatory.
early access in products that will be paid anyway makes some sense (since there may be a price increase at full release)
I appreciate my bugtesters.
of course, you run the risk of the product never coming out... or staying buggy
(my only annoyance with it is just the uneven moderation of it on nexus's part ๐คทโโ๏ธ so entirely directed at nexus. shouldnt be lettin some people do it but take other peoples mods down if they do it)
Then again, i also reead a lot of Advance Proofs
I'm not very good at bug testing but I do it where I can.
There is a difference between "join patreon for advance access" and "join my patreon for exclusive content".
Yeah I do greatly prefer the people doing patreon for advanced access lol
We have exclusive content too i guess, but it's not locked.
both are equally disallowed under nexus rules, though
Not that I ever get worked up about it. I just move on. Nobody owes me anything even if it's legally iffy to be charging people money for mods.
I just link to my kofi, which is permitted and doesnt do anything except make me smile and feel appreciated.
hey guys, i want to start modding and have a question
im just wondering if when i create a new save and test the mods in there, can it impact/break my other save files? my pc is not very good and it is lowkey not possible for me to create backup files without it crashing LOL
as long as you don't save in your other save files, you can move around mods to your heart's content
thank u!
You can't zip up a folder without crashing?
Im glad when i can start the game without waiting for am hour lol
That's a mood right there. Archiving should be much easier though, what program are you using for it?
I think just 7zip?
last time i tried to archieve something for school and it didnt work so i just gave up
And it crashes your PC when Stardew Valley doesn't? ๐ค Something seems odd with your setup, but then, I remember having a shitty laptop. Things were weird.
Try zipping and unzipping small files sometime when you've got nothing critical open. I can see it crashing if it's trying to zip up a large amount of data, but Stardew Valley saves aren't that fat
also try this mod: https://www.nexusmods.com/stardewvalley/mods/435
Automatically backs up your saves when loading the game and every night when you sleep.
my pc is almost 10 years old and im playing with about 350 mods ๐ญ
everything just takes forever and sometimes it freezes and goes blue screen
thank u so much!!
My first serious mod ever was skip fishing minigame because my pc at the time stuttered enough that fishing was functionally impossible ๐ญ and i love fishing, too
In multiplayer game, will helper.Events.GameLoop.SaveLoaded still be raised when farmhand connected?
oops
The basic function of my mod has been compeleted, and I'm now trying to adapt it to multiplayer. In my mod it creates or loads a data model from the gamesave. I've read the wiki about them, but I don't know how to get the farmhand ID when a farmworker is connected to the world(I want to send message to a player who has just connected and not to someone else who is already connected)
thanks for any suggestion!
@light jasper If you get a sec, would you mind PM-ing me? It's regarding this ticket for UI Info Suite: https://github.com/Annosz/UIInfoSuite2/issues/292
oh my god i am absolutely at my wit's end. the ores will not spawn no matter what. nothing i did fixes this 
i've added map properties on the .tmx, added them through the content files, tweaked my FTM settings, followed the FTM faq, they still won't spawn and i have no idea what to do now
i can't release this map without a working quarry, that's the entire point of the map 
Hello! So I'm like super new to mod creation, but I'd like this to be my first, so I'm wondering how I'd go about making a mod for Stardew Valley (A new NPC to be specific or just character customization)
!npc
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!
!startmodding
Making mods can be broadly divided into two categories:
- Content packs are formatted text files, and don't need any programming knowledge. They can add/edit NPCs, maps, new items, shops, and more. To get started, see the list of framework mods, the wiki tutorial for Content Patcher, and there might be relevant guides on the tutorial wiki.
- C# mods use programming code to change fundamental game mechanics. See getting started with C# modding.
Usually itโs easier to start with making content packs, since you don't need to learn programming.
heyo! i couldnt find the ostrich sound effect in sdv, i wonder where i could find em, i tried unpacking content, but its only up to 1.4 D:
Unpacking unpacks whatever version you have installed
i have 1.6, and the excel sheet with sound effects hasnt been updated in a while :(
https://stardewvalleywiki.com/Modding:Audio#Unpack_audio_files
Did you already find this page? Ostrich is listed in the table down below
thank you!
i found the excel file from 2019 instead while searching up!
*that was, very outdated
thank u for sharing :D
where would dialogue in rooms be located? like when you click on an object in a room and it says what it is.
Strings?
yeah im looking in strings and in data
also looking for npc dialogue again. i found it before
Strings/StringsFromMaps for the object dialogues
NPC dialogue is Characters/Dialogue/<whicheverCharacter>
Apparently if you rename a C# project you have to make sure to delete the previously built projects out of the bin folder, otherwise it keeps moving the previous dll into Mods
(It's embarrassing how many times that's happened to me.)
I couldn't find any info online as to why it was happening since it's a SMAPI specific thing lol
maybe something can be done in mod build config
seems intrusive
just dont start things until you come up with good name 
when the project name is lame there is less motivation
Just Don't Build It โข๏ธ
I'll never make another project again, I often don't come up with a name until I'm posting it to Nexus lmao
I'm 99% sure it's just the default ModBuildConfig thing that copies any assemblies in the output to the mod folder/zip file because it has no way of knowing whether it's the mod's assembly, a dependency, etc.
Right, I have the bad habit of just lumping all that together under SMAPI lol
I need to look up creating vs22 templates because the amount of times I open old projects to copy paste the csproj files is a 100%
ur not that wrong its in the smapi repo n everything
How can I make music play in an NPC event? I tried with playsound, with the starting line, with the song name and the id, and nothing. Does someone has an example?
syntax looks correct
Yup, thats why I wonder what is going on??
is your entire file valid?
Is it playSound? I thought music was another command
sound is the sfx, so it'd be playMusic iirc
It is, should be
I will try this one
Yeah, that may be your issue
but putting it in the first command should be valid cause i have something wild
"junimoKart_ghostMusic/-10000 -1000/farmer -100 -100 2
I'm on mobile so I don't have docs on hand, but a couple of the Jorts and Jean events change music
The Vincent one I'm pretty sure does
and plums is a valid music file cause i use it for one of my locations 
farm update: still not working :))
@unique sigil took a while but I finally got a map spawning with the base game map property, a different map working with just ftm, and a third map with both
i mean i could just make it into a hilltop replacement. but i would be so fucking disappointed
oh lol
Nope, didnt work
what does patch summary <uniqueid> say about your edit?
oh?? ๐
what exactly did you do
I can zip you up all three if you want or we can troubleshoot yours
What should I place in uniqueid?
your manifest id
you can DM me the zip files first; if i can't make it work then i'll send my files over
either way, i appreciate it 
Hmmm there is a lot, after the command, what should I look for?
should say at the bottom of "changed entries" for data/events/forest, unless you have multiples of them
though i would just upload into smapi just so we can also help parse what is and isn't working
I cleared the ranching farm of debris and was considering making a farm map, but just the little bit of editing I did definitely made me not want to do that anymore lmao
i still haven't gone back to do the farm cave because i'm not in the mood for it
If you move your farmhouse, does that mess up events that happen in front of it?
uh, if you do stupid things like i do like going back and forth, yes
though that's like, an iffy sometimes? maybe? like sometimes it screws the viewport sometimes it doesn't
changetotemporarymap farm definitely makes the farmhouse disappear though, don't suggest that one
I have multiple, but all vanilla locations
The events load and play properly, I have one with the playsound, just the music is the one not working


Some days ago I asked here about other problem with events and it got fixed, Now i only added the music so... I didnt even touched anything else!
plums is Definitely Valid โข๏ธ but i'm unsure, unless the standard "is your music on" tech support thing
because i have playmusic sweet and it goes just fine
Hmmm, I also notice that some emotes command dont work, while the others do... I will send the full file
im not finding a specific file for this. im looking for krobus dialogue specifically. perhaps itd be in spouse files? idk i checked in StringsFromCSFiles and ExtraDialogue
Do you mean the map dialogue for Krobus's spouse room?
stuff he says when he lives with u and in general
characters/dialogue/marriagedialogueKrobus
If you're doing "NPC at the front door" presumably no because the vanilla ones seem to work fine
If you do movement, well, those were always dicey with custom farms anyway
I know at least one NPC that got totally borked by custom farms that didn't have room on the right side for an event
i always presume people aren't gonna do the ff14 thing and actually put the bus warps on the right side of the map 
As in a custom farm with it moved already?
That sounds like a vanilla bug if that's the case
Hey, I just replied to your question on FTM's Nexus page, but feel free to ping me here for help if needed. (Either way's fine, but Nexus doesn't tell me about new comments
)
oh, thank you!!
I also fixed some of the related phrasing in the examples article, though it's still pretty outdated, unfortunately
tsym for the reply anyways, i'll correct some stuff
it worked! thanks!
question: should i still set StrictTileChecking to Medium?
good to hear 
as long as everything's spawning in acceptable locations, you can probably leave it there; testing with Maximum or High again might avoid things appearing out of bounds in certain maps, though
(medium allows things to spawn in water or on "NoSpawn" tiles, etc, but isn't too different from the others)
How does the maximum checking work, out of curiosity? 
it's a little less clear in 1.6, since all the checking methods got reworked internally & I just kinda made them check "more" at each level 
but I think Max vs High is mostly whether it respects NoSpawn
digging up the code, yeah, it should still be like that: https://github.com/Esca-MMC/FarmTypeManager/blob/master/FarmTypeManager/Utility/Tiles/IsTileValid.cs#L54-L73
max just adds "IsNoSpawnTile" (and avoids those)
Ahhh, I see! I was thinking it was some level of strictness to attempt to detect things being placed in inaccessible area!
that'd be nice to have, but FTM was especially slow back when I added this, so it's all single tile checks 
originally it was just "use medium for weird layer-related obstructions on custom maps, or low to completely ignore tile properties"
maybe if u do a flood fill and cache the accessible tiles
yeah, and I'm pretty sure a few people have figured out decent accessibility checks for NPCs and such
never looked into it myself though
there was a neat mod recently
FTM does cache the safety checks now, which helps a lot, it just doesn't actively look for pathing
for checking if player can get out of a map
Does a flood fill or some search from the player position until it hits a warp I guess?
oh yeah, I think I saw that in the showcase at some point
whys is she not showing up?? https://smapi.io/log/b26f2869f98c4981ad4a0359a29c057c
Log Info: SMAPI 4.0.8 with SDV 1.6.8 build 24119 on Microsoft Windows 10 Home, with 19 C# mods and 5 content packs.
does she have flower dance sprites
yeah
Flood fill from doors and warps oui
Event 'festival_spring24' has command 'warp MalkeTFC.MaxineCustomNPC_Maxine 13 24' which couldn't be parsed: no NPC found with name 'MalkeTFC.MaxineCustomNPC_Maxine'.
What's your events json
this id correct?
no??? she appears before the dance so i can ask her
and the id is the same
just copypasted
this
struggling with hat values. im trying to make it so it hides the hair but it just wont do it and it keeps changing the hair cut as well. those black lines are from one of my custom hair styles and arent part of the hat. i tried changing true/false but it isnt changing anything. from what the wiki says the first true/false is regarding the hair showing and the second false/true is to ignore the style but it stays the same no matter what i do
You also need to add to the main event additional characters
oh :( that wasnt on the page i read
thanks
Try changing false to hide for "whether to show hair" (the first value)
i tried hide too. i will try again and ty
ModContent.LoadAsync could be a thing, huh
Also just in case, is that hair FashionSense or vanilla
its edited vanilla
this didnt work ;o
lmfao it worked for this one x'D
needs work lol
bald!
thats actually weird that it's only working for one of them
x'DD
also this is what i did with the yoba altar xDD
i wanted to make it something chill but didnt rly kno what to do so did that lol
Wow that looks awesome!
ty -o-
Is there a better way to check for the click of a keybind than to check on ButtonPressed? It works fine but feels inefficient to check that much
im hoping to finish this mod in 15 days so it will be out by halloween
(I'm fine with pings about my mods here, so no worries)
I'm pretty sure that's a bug with how placed objects currently work in FTM (fences, big craftables, furniture). They currently despawn overnight even if they shouldn't; the intended behavior is that you can spawn them with expire set to null and they'll persist.
I'm pretty sure that's fixed in the next update, but I've been on hiatus for a few months and haven't finished some other bits yet. I'll try to get that out soon.
but yeah i cant brain why the hat thing isnt working right. they're set the same but it only works for one. idgi <_>
Someone knows how I can check if a chest was opened through events?
how else would you check if the right button for the keybind was pressed without checking what button was pressed?
do you need to know a chest is opened by a different player?
I don't think so, as all update is thought to be on local
I'm not sure if I've actually tested CanBePickedUp on fences/gates yet, so that might not work correctly. I'll make a note to look at that for the next version. (It sets the internal "indestructible" setting for most objects, but that doesn't work on some item types; fences might ignore it)
I am trying to do it through the MenuChange event, but failing to build a logic to check it
i was gonna suggest the MenuChange event too, just check to see if the menu is an ItemGrabMenu
what is the desired behavior if i like
open a chest and close it without changing anything
trying to do exactly that
i ask bc i feel like you can use inventory changed
I am trying to redo the Spoilage mod. To make it short, instead of looking for every chest on the world to update the items on DayStarted, I want to update them only when a chest is opened
hmmmm
What if a chest isn't opened that day?
didn't thought about it
i agree with that
or maybe day ending
either way an apple ought to have spoiled without me observing it, no quantum shenanigans there
the ForEachItem functions won't add noticeable amounts of time to the overnight screen for anyone. maybe if a player had like.... a metric fuckton of chests. but then i feel like the automation stuff they likely have would be a lot more of a problem than your iteration
yeap, the point is that I am not thinking solely about one-day-check-spoilage
I would like to make it so some items, like fish, could spoilage on the same day
hm that'd be pretty confusing to me as a player 
if you fish a fish on the early morning, it would hardly be good to go at late night
unless you put it on a fridge
yea that's realism
so is spoilage
sometimes people want realism, i dont think a mod should always be limited by what a typical player may find confusing
a typical player wouldnt install a spoilage mod
not related to your questions and only out of curiosity, how do you handle stacking
but sdv is like "plants only die over night", "seasons change in a day", "planting stuff at 2am is same as planting stuff 6 in the morn"
so you have to communicate to the player that things are spoiling in real time
maybe tooltip work there
I yet need to check it on the original Spoilage mod. I am going throught it by little steps and seeing if my "plus" idea would be feasible or not
going back to the implementation side
I also think about updating the original Spoilage mod, but got disgusted with this updating all the items in the chests over the world every morning. Could cause lag in very big and cumbersome saves
i think its prob ok to have ForEachItem at 10min update
I'm tempted to put a chest in every available space on every map and foreach the whole game to see how long it takes
u can perf test it to be sure
seems an awesome test to be made
the more elaborate approach would be to have a big ol event manager that knows about all the things that can spoil
monitor it basically
iirc chests anywhere have a similar thing, for chests
is there anything that shouldnt happen with a rotten item vs a fresh item if an automation mod grabbed an item that shouldve been spoiled but isnt?
spoiled fruit wine becomes vinegar trust
bc if its stuff like machine processing i feel like it might be easier to store a like, "this item was created at" timestamp in the objects mod data, and check that on, say, the machines side when it gets an item
the original mod may take care of it when it changes the fresh item for a 'rotten/spoiled' new item
so the automation may not take it anymore
I never tested it though
oh maybe u can steal the qi cooking thing
I intend to do the same, something like 'spoiled vegetable/fruit/etc'. but the first thing will change them to 'trash'
need to patch displayName getter
it does the "for every item" check in the morning iirc
and have some way to ban your thing from being eaten when its got tag
i thought qi cooking is in create item
thought about it, but would also not want to affect the save file...
why not?
adds the orderData.Value = "QI_COOKING"
mod data in the save file is harmless, its just strings
ah I was talking about "yeet qi tag when order expires"
you are inevitably affecting the save file though
for spoilage data modData works
giving the Spacecore warning on the SMAPI, I thought changing it could cause corruption in case of taking out the mod later
no, dont worry about that
there's no practical diff between "swap item for rotten item" and "give item a modData tag"
SpaceCore does save serialization stuff which is much different
both is making it into the save
mod data is an officially supported and safe way to store data like that
and you want it like that, cus ppl would expect rotteness to persist between load
I was thinking both, and do the former when it's so rotten it shouldn't be treated the same and should be tossed
unless you want an intermediary stage of "not usable in cooking but usable in machine"
yeap, that's right. I thought about circunventing it changing the item. but need to store something on item
cant believe grandpa farm inc. is selling out of date strawberry jelly
moddata dictionaries are vanilla things on many classes that are supported by the game to write into the save file
what SpaceCore does is let other people add new classes and things that the game doesnt know about without breaking the save file by doing its own file writing
which is what the warning is for
the spacecore warning is also misleading cus
spacecore doesnt put the extra info in the save file
bc if you remove spacecore but not those custom things the game doesnt know about, your save will not be happy
it goes in the spacecore-serialization.json
good to know how it does
i mean its not misleading to say it can muck up your save if you remove spacecore
so its actually fine to yeet either the mod that added the type and spacecore
cus its not in your real game file
pathos should add a hardcoded exemption for SpaceCore
you could always write your own serializer too
When automation ticks, it changes the item on the chest, right? like it raises some kind a 'Item/stack changed' event...
there's chest inventory changed event
it doesnt catch when an item is changed but not removed though, does it?
but it likely will raise after the item is eaten by the machine
but it also needs to check the inventory before changing it, to look for an item that it can use
you can just patch MachineDataUtility
you could always patch Automate too
though I feel like if you're going that route just make them a different item
I am yet on the checking and updating thing, to avoid updating everything at X time
are there cases where you still want an apple to be considered an apple but not make it eligible for a machine
if different item
they'd then need to go back to iterating over every chest to find items that should be changed to another item, though
i guess u can make a rotten item that can have flavor?
to achieve displaying "rotten apple"
ah I slightly misunderstood the assignment, I thought we're (still) doing 10 min update
these r all suggestions on how u might implement pick what vibes with you 
i feel like changing the item somehow is the most compatible way
if 10min update is on the table then just a ForEachItem is best, there'd be no need to worry about machines or automation at all if you're just checking them all beforehand anyway
but yeah you can patch machine data utility to not accept an item for machine input if you don't want to do 10 min updates
and doing the watch items approach seems most fun
I first want to avoid forcing the game to check and update every chest every 10 min though
if there are no way, maybe I will resort to update once a day...
for that you need to do a ForEachItem on save load to build the initial list of items to watch
Yeap, that would be optimal
and some way to map timeline of item spoilage
the data to store is create time and time to live
this I think would get to Buttom suggestion, what was in my thoughts already
putting a timestamp to when that item was taken
it needs to be done when the item goes to a chest and player inventory as well
oh also need like
where item lives
plus changes to this on inventory changed
lots of shenanigans 
will be fun trust
where item lives?
yea
whether it's in a fridge which should slow spoilage
if fridge completely prevent spoilage then i guess u dont have to watch the item at all
yet, fridge is a chest with a different texture to the code. I yet need to find how to check them both
fridge is a different big craftable
Somehow I think the game knows where is each item already... would be better to access that
Chest also has a fridge NetBool field
i dont think i understand how you can watch an item without iterating over the items though
right but how do you access that same exact instance of the item after?
thats not optional cus how else would you know
You make the items that can spoil register themselves with a manager
Then the manager knows where they are and can handle their spoilage
just keeping the Item object should work
cus this is all within 1 game session 
im not sure if things reset on new day though
I like this approach
thats what i been describing this whole time 
Was gonna say lmao
and what about when things update for different CP patches and whatnot?
sorry? lol
I think it can be taken by registering the items that matches certain categories
those categories can change over the course of a game session
new things can be added to those categories
things can be taken out of those categories
Yeah, having CP able to interfere in an item is kind of a problem
Actually, I guess it's not
well CP currently cannot change a item that exist
(Personally any mod that does this and breaks seems like a them problem)
unless you use button's mod
Right
so i dont think thats an issue
I mean, on load save, load manager with all item instances that match certain categories, like fruits, vegetables and whatsover
That makes me wonder, can item's with different data stack?
actually I guess there are mods that change stuff like dandelion to flowers
if items are added with CP and corresponds to that categories, they will be added
Like if I spawn a fish and then change it's data and spawn another, will they stack?
i think one set of data just gets yeeted in that case
pretty sure ive seen one mod before too that changes tomato category depending on your answer to the demetrius robin event
and when such items are produced, they will also added
Sounds like patching the ItemRegistry lol
Without further changes, the existing item's data gets kept and the newly added item disappears into the void
its only purpose being incrementing the original item's stack size
Oh lol, that's interesting and also seems kind of backwards
But I guess that's the more performant solution
well, usually an items data is not supposed to change 
so would not be possible to have a stack of good parsnip spoiling in different rates
you can make them not stack...
and so cumbersome the inventory
but the avg user isn't going to like that 
honestly this just goes back to
imagine having to have another space in the inventory because you fished a fish 10min later than the first one
realism and gameplay streamlining is at odds with eachother
that is why i think spoiling once per day is fine
Yeah, I would also go the route of daily, getting too granular is a problem
but so you can also not stack parsnip that you collected in different days in the fridge
the problem is just extended
that is gonna explod me fridge
you can average out maybe, two 1 day old parsnips + three 3 days old parsnip = five 2 days old parsnips
I think if the original Spoilage had this problems circunvented or if it was cumbersome lol
but hey u have modData
You kind of have to decide how you want to handle that, you can make all of them use the same spoil timer, or make each spoil timer only remove part of a stack
u can record how many things in this stack are X days away from spoiling
and patch wherever stacking happens to make sure u merge modData correctly
Lol, the most hellish sounding answer
gotta patch the unstacking too ofc
the same can't be done each 10 minutes?
tbh if the time to completely rot away isnt that long anyway, it sounds like the stacking problem will eventually resolve itself by putting everything into one stack of trash lol
sure, just more complexity
i dont think you can retrieve information from previously separate items when you unstack them
unless you store information about every single parsnip in the stack in moddata
I think that was the idea lol
That's how I took it anyways, hence why I said it sounded hellish
do you want to have mod data for 999 parsnips
no i mean, say if the modData said something like
37 parsnips rot in 2 days
23 parsnips rot in 5 days
(irrelevant note, but this is why when I bounced around my own ideas for a spoilage mod months ago, I only had two stages - fresh and old, with fresh being the day of harvest and having something like 2x sell price. The idea was to encourage selling fresh crops, like an actual farm, instead of hoarding everything for jars/kegs)
I am laughing on this solution, because I see how this can broke in thousand shards and enjoying it at the same time
then if you take one parsnip out of the 23 stack, what do you put for the mod data in the 1 parsnip?
So then stacking and unstacking would kind of just be nebulous lol
arbitrarily decide if users want the rotting earlier ones first or later
the closer to rotten one
could be like
36 parsnips rot in 2 days
23 parsnips rot in 5 days
and u obtain the 1 parsnip rotting in 2 days
im not sure what you mean there. there's no information about that single parsnip except for the fact that it came from a stack of 23 and rots in 5 days
I like this
so it would be impossible to grab a fresh parsnip from the stack?
alsot the stack shows the closer to rotten 'on top'
so the player doesn't have a surprise
the advantage is that u got 1 stack
disadvantage is that u need to display more info
since ppl dont read mod pages
what do you mean by 'display more info'?
I would make it so the stack info would copy the closer to rot item
so when taking one, player would "take that item"
So ostensibly your mod data would go up to whatever the max rot time is, more depending on if you're doing 10 minute vs daily
add in game way to see this data
Which could still end up being a lot of mod data lol
yeap. need to calculate the gains and cons over each one
i should mention that this is unrelated to like
the earlier q about how do we update items
new question about this weird mod data stacking though
need to track some kind of rotting state no matter how u update
what happens if i take the parsnips out of the fridge and put them into my inventory?
the whole stack
one thing that I disliked, and not sure if it was a thing back then last time I played this game, is that chests auto-stack items
would be a question of choice to stack different rotting stances of the same item or not
otherwise I mean
if doing 10min updates, then they start rotting starting from the next 10min update
if doing monitor, then listen to inventory changed events and update the watcher with new item context
(off question, how are you gonna handle qualified items?
)
the rate of rotting would go to the default, but they would yet have the same 'durability' when taken
but the time to rot should be different in my inventory vs in the fridge, right?
what do you change the time to rot to in the mod data?
yep, thats why the monitor must know about it
i actually think monitor approach would want to store create time + time to live though
Oh I thought fridge just stopped rotting or it could just skip rot ticks
rather than a raw count down
the original spoilage mod has the fridge slow down the rate of rotting but not stop it completely
maybe having a 'durability' date instead of the timestamp would be better in this case
like it goes down slower on each update when on a fridge, and faster when out of it
Either way, if a parsnip has e.g. 5 "durability" in the fridge, what does it get changed to when i put it in my inventory?
Yeah that could work
(to answer this old question, IIRC it doesn't, so we're really going further and beyond)
Parsnip takes psychic damage when not in the fridge
or does it not get changed?
Time until rot is just a different way to say durability lol
At the end of the day, all health bars are just integers ticking down
thats true but if you call them days it kinda locks you in to ticking down 1 per day
let's say a parsnip has 50 durability full (it takes 50 updates to rot). if it stays on fridge, it losts 1 every update. outside it losts 5.
if its a durability it can be a float!
yeap
Sure, but you can substitute that for how many ever 10 minute ticks it has to live too, it's the same thing just a different way to display it
I think button took the idea
i mean changing it from 1 per tick of "damage" per day to an arbitrary number does just solve the problem i was thinking of
this is deep if you consider it makes sense irl too
ok guys this is entirely unrelated but how the heck do i add an id to "Caroline": "You're giving this... to me? I'm speechless./213 614 593 907/Oh, goodness! Are you sure?/-7 18 815 402 418/No, no, no.../-81 330 300 306 307/This is absolute junk. I'm offended./80 296/Oh, that's sweet. Thank you.//",
My favorite thing in game design is when we're discussing how to implement a new system and it just ends up being a health bar that's displayed differently
if you have 5 days left on a parsnip then that would mean it has to go down 1 per day no matter what inventory its in, and thered be no way to update that when it moves inventories without being able to cheat it
but if it has 5 durability and takes different damage depending on the inventory then it doesnt matter
but you cant take 0.2 days off a parsnip every day
the main problem here is how implement and update this 'health bar'
what are you trying to do exactly?
Unless you're trying to do a bunch of UI dev, just add it to the description of the item lol
fields, yes, pain
avi will know
//Lance's gift tastes
"Action": "EditData",
"Target": "Data/NPCGiftTastes",
"When": { "HasSeenEvent": "6951319" },
"TextOperations": [
{
"Operation": "Append",
"Target": [ "Fields", "Lance", "1" ],
"Value": "218 {{ModId}}_Khanjar {{ModId}}_Book {{ModId}}_camping {{ModId}}_mishaps {{ModId}}_Rope {{ModId}}_shenanigans {{ModId}}_Razor",
"Delimiter": " "
}
]
}```
the problem here was less the information display and just making sure the internal data would be consistent and not exploitable
so the following should work to add to Caroline's loved items?
{
"Action": "EditData",
"Target": "Data/NPCGiftTastes",
"TextOperations": [
{
"Operation": "Append",
"Target": ["Fields", "Caroline", 1],
"Value": "Test_GreenFries",
"Delimiter": " "
}
]
}
might need to put the 1 in quotes
(i dont know if you need to but avi's example does)
I think you do
yeah id expect aviroen to be right
ok slight side mission but what does the delimiter actually do
i am not usually right, but that code was trial and error over some odd 20 versions of my mod
between each item id is a space
Ok. So to sumarize it here:
By manager approach:
- Do ForEach item on SaveLoad to Load the Manager
- Manager updates every item on each UpdateTime
- When an item is used, take it out of Manager
- When an item is produced, put it on the Manager
that space is the delimiter
basically means "whaty should i put between each of the entries to keep them separate"
this are the operations the game will need to do during the session
ok makes senes
ty
omg why cant i spell
so you need a delimiter of a space so the text operation will put a space between your new item IDs and the ones that already exist
it needs to write on savefile too
Also when items are stacked together, one of the items is going to need to be removed from the manager
maybe load it from save file if the info is there
Because the specific instance it's tracking will no longer exist
theoretically ive made a new crafting recipe and made a gift taste for it ๐ค
if you store spoilage data in mod data on each item that automatically gets saved and loaded from the save file
you don't want to save the manager itself to the save file
need to read how to work with mod data
Yeah the manager should only exist when it's doing its job
its just a dictionary of strings to strings
Just like manager's in real life
Item i = ItemRegistry.Create("bla");
i.modData["UniqueId/SpoilHealthBar"] = "50";
something like that
not sure if manager means the same to us. I internally takes the manager as the class that will manage the stored data
correct. dont save that
its created when the save loads and exists as long as the game is open
I will not. it will be in the cs running with the mod
It manages the stored data but it doesn't store that data
the manager that I understood are the collection of methods in c# that will do the trick
Essentially
we're on the same page we're just makin sure that you understand that its not you thats going to be writing to or reading from the literal save file on the computer
ok, so we are at the same feet. what will be stored and updated is the data of each item.
ok, good.
I just need to learn how to work with the mod data to access and update it
just .modData is fine
It's just strings, so you'll be doing a lot of converting back and forth
the lil snippet i put above is literally all it takes, you can also use TryGetValue and whatnot
I am learning c# while trying to work in these mods 
Ah hard mode
I know c, python and R
on Save Load you'd do the ForEachItem thing and check if the item has mod data that you set last time and if so, add it to the manager's watchlist
but c# is more friendly to this kind of thing and I am enjoying it
I think you want to add all perishable items? in case installing mid save
they only need to worry about items that already exist in the save when they load
since i thought the plan was to patch ItemRegistry.Create to catch perishable items as they are created
sounds lovely. I loved that
oh wait i misunderstood
yep, it should be old save compatible
okay yeah you might as well check if it should be perishable and doesnt already have the data too
now thinking if new items added on save should start with random durability
for havoc
the serious answer is absolutely not
the funny answer is make everything rot immediately
realistic answer, calculate DAYS_PLAYED
you dont know when the item was made though
there's no telling if that parsnip in the user's fridge is there for 5 days or 500, clearly we should be safe and assume the latter
ah flat modifier as a handwave
how would it help to determine things that were taken mid game?
I think the question was should new items have random durability
health safety in first place!
Not should items that were already in the save have random durability
nope. it was the other one
i thought it was about the new items that would be added on save loaded
oh new items, i was thinking items that already existed
the only new items during that stage of the mod loading would be already existing items
paradoxically
like if manager take a new item on save load up, it was in the game before the mod was installed
Oh, then Avi's answer would technically work if you wanted chaos lol
so what would be the durability of such item? max? average?...
Just assume everything has always been in their inventory since the beginning
there's no nice way about it to be like, "if this item was a seed item in fall yada yada yada"
i would just apply whatever calculation you'd do if it was freshly created
And if they installed too late, everything rots
The real answer is just to make them all start at the beginning of their timers
"DAYS_PLAYED"
"But this is a pumpkin, and we're in fall year 1-"
"DAYS_PLAYED!!"
tbh i'd expect it to rot everything if i installed something mid save, but i am also someone who reads descriptions
Personally, I don't use realism mods because even when it's being fair that's just how it feels all the time
the nicest way possible is button's suggestion, flat calculation as if it were brand new
huge
I know of a realism mod that's purely beneficial though, it's called Animals P-
Can't decide if want rest of name
i don't even want the butcher mod, i am a weenie
Oh lol, no thanks I already spent a few years cleaning up after farm animals
well you can add it as an item to pet drops
Not a very good farm dog if you gotta walk it lmao
"You were expecting a fish, mother? Unfortunately..."
Yeah, the cats you can at least pretend they catch critters
testing my mod and just got my first gift from good ol lewie (im already married and have hundreds of thousands of gold and literally omnipotence through cgb and vsc)
so you enjoy to keep a fish on your backpack since day 1 without suffering the consequences I see
New mod idea: coyote's attack your animals if you don't have a dog
Oh I cheat left right and center, I have no qualms about it either
me personally
yes
I don't play games for realism, I get enough of that every time I have to wake up
im framing the tutorial fish on the wall
my steam games list is well over 200 strong, i just pick one of i'm feeling in the mood for survival
how do i make the game load the sheet from isntead thej game instead from the mod folder???
make sure your mod folder doesnt have file of that name
If you are using a vanilla tilesheet, make sure it's not in your folder
I prefer moving my maps into the unpacked Maps folder when editing and back to my files when testing to avoid this issue lol
i have only the spring sheet on the folder
You can't have that
oh thats kinda smart
The game automatically looks for matching seasonal outdoor sheets
Your folders shouldn't have any of the vanilla sheets in it if they're in Maps
The only time you have to include vanilla sheets is when you're loading something into Maps that isn't normally there
Or using something in your map that isn't normally there anyways
new mod idea: farm critters
your crops are attacked by rabbits and moles if you don't have a cat
also rats in your silo
to be clear you can have the sheets in your folder when editing the map if you want to, you just need to make sure to delete them later
how do i make that also apply to mod sheets like daisy/lumi outdoors
manifest dependency
If you have those mods installed, you keep the sheets with your map while editing then remove them while testing or shipping the mod
tbh use the unpacked Maps folder to work, put all of the tilesheets you want to use in that folder, copy over tmx, no tilesheet climbing problems
As long as you remember that you have to move your updated map 
if i could get the stupid windows symlink to work properly--
wdym remove it
im so confused ๐ฎโ๐จ
(tbh i much prefer to work in my mod folder and not the unpacked folder personally since i don't wanna forget a custom tilesheet in the unpacked folder and think it's vanilla later lol)
oh i sort by date so it's always staring at me, menacingly
If you have those mods installed and you have set your mod to be dependent on them, when you're done editing your map (assuming it's in your mods folders) you would delete those tilesheets
but just making the mod dependent will make the game know where to find the sheet inside the other mod folder?
Since those mods load those tilesheets into Maps, when your map is loaded by the game it'll check your folders, not find the sheets, and then check Maps
Making your mod dependent just makes it so yours loads after, to avoid any load order issues
basically Malke if you have a tilesheet PNG in your assets folder next to your map, the game will look in your mod folder first for it's tile sheets
You want it to look in the games files, not your mod folder, so you need to make sure you don't have any PNGs in your mod assets folder, that way the game won't look there
That way you don't accidentally load before another mod has had a chance to load the sheets you're dependent on
tile sheet mods like Daisyniko will load their tile sheets to the game files on their own in their own content patcher mods
(usually)
i think i got it (emphasis on think)
Unless you're doing C# reflection crimes, your mod can't access other mods files
they do the same thing to load their tile sheets that you would do to load, say, a texture for a custom object
They just target "Maps\daisyniko" or whatever instead
But if another mod loads its files into the content pipeline you can access the content pipeline
The game will look in that Maps\ target if your tmx says it just wants the "Daisyniko" tile sheet
(side-question) how is stardrop tea done and can i recreate its effect for a specific npc in CP?
(It's me, I'm the one doing C# reflection crimes)
Should affect every NPC though right?
damn.
I was also thinking of Button when I said C# reflection crimes :P
Star drop tea affects every NPC yes
i see
My crimes predate Button joining the community
Maybe only social ones
That's true lmao
my crimes let everyone else do crimes too so clearly they're... better? Worse?
you were doing crimes before it was even considered a crime 
./j
you're both mafia bosses /lh
I think you both do great(?) crimes for the good of the community
sometimes it is correct to do crimes - ichor 2024
not what i meant but its irrelevant if its hardcoded unfortunately
That was in response to roku
anyway does category 0 exist is that a thing
can i use that to not give it a category
I think that's Basic?
you dont have to set any field you dont want to
I think you can change their dialogue reaction, but they will always love it and gain a full heart
can you just choose arbitrary numbers for categories? I don't actually know if it enforces them
usually it gets a default value
Category number definitely matters
Some game logic is dictated entirely by what your category is
how many things would it break if you just ignored that tho
Technically yes, but then you have the pre-JA item ID problem
(unless you add negative heart dialogue command to "balance"
it out?)
...-74? will force a juice/pickle
Depends on what you want your item to do lol
(If doing weird C# reflection is a crime, then I'm some kind of super criminal.)
gonna leave it blank then and hope
or well not leave it
no way to do this perfectly in vanilla
just not define it
I did weird C# reflection crimes in base game, beat that. (The local multiplayer state holder thing)
https://stardewvalleywiki.com/Modding:Items#Categories
Though this doesn't list 0 for some reason
there's no way to check how much to balance it by based on quality of the gift given
Sadly I cannot. The only thing I've done that beats that is data-driven harmony transpilers, but that isn't the same kind of crime at all.
yeah i was using that thats why i ask about 0
would category null break things?
Category isn't listed as an optional field actually
seems likely
So not filling it out might actually break the item
Like if you don't fill out the Description the item loses its entire tooltip lol
ah, i am an i18n fiend so the game just screams about no translation if i've forgotten do anything
Most of what I do is testing so I'll leave fields blank sometimes lol
Glad I'm not the only one. These mods always sound so much better in theory. If I'm in the mood for realism, the door is only 10 feet away.
From the code side of things, making a realism mod work sounds fun
But I would never actually use one lol
it was fun to watch ya'll wax and wane as i sat like a stupefied dog
(tbf i don't use most of my own mods anyway)
I think I've only made a few released ones that I don't use lol
I may have a problem.
When you split an item stack, the new stack copies the previous one's mod data; when merged into another stack, the merged items adopt the target stack's mod data. Otherwise mod data has no effect on item split/merge logic (e.g. you can still merge items with different mod data).
Reading through Mod Data
does that not work for the furniture sheet on TileSheets folder?
Any sheet not in Maps basically
You might enjoy this little snippet of code/ASCII art: https://github.com/focustense/StardewUI/blob/dev/Framework/Descriptors/ReflectionMethodDescriptor.cs#L201
nope works fine
ah a crimis tree
Correct, there is no real good way to use a tilesheet that isn't in the Maps folder
Can you screenshot the tooltip? I would like to see what it shows
just doesnt show a category
Interesting
did you set Category or Type?
no
Intentionally didn't
ah i see
oh wait
til then
i think thats not valid
I do wonder if there's any repercussion to it
I think making an invalid item was like. Kind of the intent
:(
oh?
nvm Type isnt an enum 
Ah yes generic "just let me call this MethodInfo" wrappers. Stardew modders (C#, intermediate+) love reinventing this solution. (I say as someone who also reinvented this solution.)
its just a string
You can patch Item.addToStack to handle the stacking/modData merging logic
(ive tried to find ways to make a mod be able to load tile sheets from other folders but wasn't able to find anything that'd work or I'd be happy with unfortunately)
I could just literally call MethodInfo.Invoke, but there's a real perf difference between the methods and delegate versions.
uh so
im missing my recipe
"Action": "EditData",
"Target": "Data/CrafingRecipes",
"Entries": {
"Abigail's Perfect Gift": "66 1 Book_Void 1 128 1 276 1/unused/Test_PerfectGift/false/f Abigail 8/"
}
whats wrong with this
i always figured it's less a issue with game being unable to climb directories and more smapi being agressive about no climbing ever
yeah smapi was a big part of the "ways that don't work" with how angry it was getting with me
maybe if we could have it recognize ~
did you sleep a day for the mail to come in
let you do ~/TileSheets/furniture_2 for furniture on yer map tiles
For sure. I've got my own helpers like this, and for field/property access, using dynamic methods and IL generation.
If you get access to their helper, e.g. IContentEvents or IModContentHelper, it works pretty well. For content packs it would have to be the latter.
slept a day at 14 hearts
didnt work so i set to 7 hearts then gifted up to 8 and slept
still nth
okay reading through the code I dont think that works for crafting, only cooking
you need to do your own mail
frick
it's not that hard!
ill have to take your word for it
Unless I'm misunderstanding I'm not sure how this would help a tmx load a tilesheet from the TileSheets folder instead of Maps only
The funny thing to me about Stardew devs making our own helpers for faster MethodInfo/FieldInfo/etc. access is that Harmony has all that stuff already in AccessTools.
ok ill do that and i will get back to you
so does that mean i should get rid of the action i currently have
My field-access version was also a fun crime. It's a combination of reflection-based accessor and expression tree accessor that lazily loads on a background thread. I probably should benchmark it to see if it's really worth it, but eh.
also could you explain why it doesnt work because the wiki suggests it should
I thought the issue was loading an asset from some other mod's directory, e.g. from within the context of a framework mod.
the "f Abigail" part? Yeah
only for cooking recipes
friendship reqs are only for cooking huh
was it because AccessTools and CodeMatcher wasnt a thing in earlier versions of harmony?
ok makes enough sense
nah, that would be super easy, but wouldn't cover recolours either anyway
I don't think Harmony makes the invocations faster? It only caches the members themselves (e.g. Traverse).
Of course the *fixes, transpilers etc. are all IL generated, but AccessTools doesn't get into that.
so i just dont use sheets outside of maps? gotta edit my map
(warning you just in case, do not add a cooking recipe that automatically gets sent in the mail like that for an NPC that already has a cooking recipe they send you in vanilla)
and why is that
if you really want to use a tile sheet not in maps then this is a situation where you can just include the PNG in your assets folder next to the tmx
surely you just get it the day after getting the first one
Or load it into the Maps asset
AccessTools does IL generation for its various FieldRefAccess and MethodDelegate methods, so it should be performant.
nope. You only get one of them, and there's no way to guarantee which one it is
I thought that was fixed?
i think im just using furniture sheet for the brown couch might not even me worth it, thanks tho
is it? The change log for 1.6.9 is huge and unfortunately I've not memorized it
Oh I thought it was in a previous version of 1.6
thats odd given how Y2Spring4 perfection works with kent's recipes?
But I dunno if it's documented, I just remember some others talking about it working properly
like you can activate several cooking heart events with kent and recipes in one day then you wait for one recipe per day
Easy enough to test though
i remember talking about it working improperly but I don't remember when that was or when other 1.6 versions came out
I'm not sure if we're talking about different things, but AccessTools.Field (for example) is just a short wrapper over conventional reflection.
https://github.com/pardeike/Harmony/blob/efb41b4b3fe24c8a17b40b16508e5da4b5b05002/Harmony/Tools/AccessTools.cs#L193
i assume you mean that only for the same heart value as a vanilla recipe
It's possible that HarmonyMethod does some magic maybe.
Oh I see. Yeah, that does look helpful if you know the types at compile time.
Trying to find something about this. Any examples to follow?
And you don't need the specific type, as long as you have an assignable type in the correct direction.
have you used harmony before
The IL generation happens in https://github.com/pardeike/Harmony/blob/master/Harmony/Tools/Tools.cs#L54
Yeah. I based the expression tree decision on some possibly-shaky internet research that seemed to suggest expressions have the same speed once compiled and slightly less setup time than ILGenerator. But very slightly, less than a 5% difference.
My real excuse in this instance is that the types are completely unknown at compile time. So to use those Harmony methods I'd have to do MakeGenericMethod anyway and that's most of the cost/work.
nope yet, but I am aware about it
i don't mean that, no. unfortunately I'm not at my desk right now to properly find/reference what I mean
The world of Harmony is a bit of a lawless land, but it's incredibly powerful. You can pretty much implement anything you want, but you can also break anything you want. With that in mind, you should begin by reading the main wiki's intro to Harmony to get you set up. This tutorial will focus on the actual patching and assumes you already unders...
why is it a problem if you get a 3 heart recipe from vanilla then 8 heart from mod
that would trigger at completely different times
u should give it a try and return here if it explodes
explaining that would require me to be at my desk to properly find/reference what i mean
ok ill just test it
day 1: set caroline to 3 hearts
day 2: nothing happens
day 3: green fries (custom recipe) sent by caroline
day 4: nothing happens
day 5: parsnip soup (vanilla 3 โค๏ธ recipe) sent by caroline
its fixed
I can see how it might be misconstrued as broken though
strange that there are days with no mail though?
we may be talking about different things
i added a custom recipe using f Caroline 3 that requires 3 hearts from caroline
she sent it and also sent her usual 3 heart recipe
is that not what you mean
I mean, I still wouldn't go this route because of the way it messes up vanilla recipe mail timing
Especially given how easy it is to mail stuff
The way this will trigger every single user who runs into it to immediately assume your mod is broken
how do i make mail actually trigger
ive added to Data/Mail with the format from https://www.stardewvalleywiki.com/Modding:Mail_data
whats the difference between "Condition": "" and "When": {}
Condition is the base game's GSQ's and When is CP's conditional patching
If you use a When, and it's not satisfied, then the entire patch won't exist in the first place
But if you use a Condition and it's not satisfied then the patch will still exist but whatever the Condition is gating won't happen
so i should use condition for single entries and when for entire patches
Depends on what you're trying to do generally
condition is only there if the data has it, when can be placed pretty much anywhere
When has to be on the entire patch block, it goes at the same level as Action or Target
is there a page for using Condition
yeah that's what i meant
i'm fighting my orange son because he wants chip
i searched and got When documentation
Condition is only on individual entries, but sometimes you would use a When over a Condition
seems like will be faster to just try to do an unnoficial update of the original Spoilage, at least for now
I thought that was a given 
perfect tysm
tbh sinz saying when is a last resort cause it screws with multiplayer, i've been trying to avoid it like the plague
I'm not sure how it would inherently screw with multiplayer
i think the flag conditions
i'd have to dig again because memory foggy on the details
it is, but between understanding someone else code structure and trying to learn how the code works from scratch, I always prefer to try the second one first
I will do the update and work on my version later
Ah, almost all the C# learning I've done has been dissecting or recreating other peoples code, so I'm more familiar with it than writing my own wholly from scratch
don't take me wrong, brainstorming here with the help of all you also helped me to understand aedenthorn's neat code
he patches the code using Harmony and other things we said here
so updating and trying it may help a lot
can i see what this custom recipe is out of curiosity? the string for it
it was just with regards to NPCs being behind When conditions iirc
like, their existence
"Test_GreenFries": "Test_GreenPotato 4 247 1/unused/Test_GreenFries/f Caroline 3/"
"{{ModId}}_TestObject": "20 1 22 1 419 1/25 5/{{ModId}}_TestObject/f Emily 3/" I also tested this, same result
(i might be remembering a different convo with sinz then, i dont remember that one
)
i was actively in that one, that's probably why it's burned in my memory
whats confusing me is that it was a few months ago that i helped someone with this where it didnt work, it was overwriting the original one. and looking at the code in Stats.checkForFriendshipAchievements, i still dont get how it can work lol
It's possible they weren't waiting long enough
There's a 2 day lag before the next mail comes in
if (npcName2 != null && Game1.player.friendshipData.TryGetValue(npcName2, out var friendship2) && friendship2.Points >= minHearts2 * 250 && !Game1.player.cookingRecipes.ContainsKey(recipeKey2) && !Game1.player.hasOrWillReceiveMail(npcName2 + "Cooking"))
{
Game1.addMailForTomorrow(npcName2 + "Cooking");
}
this just sends the same mail key every time
I am more intrigued to what causes the day lag
so im confused how its getting past that
maybe because of this? "CarolineCooking": "Dear @,^Nothing is more satisfying than cooking with fresh vegetables from your own garden! I've enclosed a recipe to help you out. Take care, ^ -Caroline%item cookingRecipe %%[#]Caroline's Recipe",
since it's a ModId, and not "Caroline", it's not replacing the entry?
Npcs have so many netfields (why is datability a netfield?? i think appearances are also synced?) of course they'd be weird in multiplayer 
but it will still check for and send "CarolineCooking"
bc "Caroline" is whats written in the recipe
so how does %item craftingRecipe <key> %% work because it says <key> is the name but im using the item name and it is not working
[game] Letter 'Test_GiftForAbigail' has unknown crafting recipe 'Test_PerfectGift' or 'Test PerfectGift'.
im not debating whether it works at this point, now im just tryin to figure out why it works when it seems like it shouldnt unless im just, super dumb, which is always a possibility
uh, are you using the internal name or the "Name"
It should be the key you used for your object
(and unfortunately im about to leave the house and wont have signal to even keep up with the conversation so i wont even know! sad)
cause iirc you have to use the "Name", which is why i had to do a little reworking
Actually, looking at that code, if the mail flag wasn't reset, even higher heart levels wouldn't work
"Entries": {
"{{ModId}}_Khanjar": {
"Name": "{{ModId}}_Khanjar",``` yeeuhp
I think the delay is being caused by that mail flag being removed the day after
Your recipe ID posted at #making-mods-general message is named "Abigail's Perfect Gift"
Game1._newDayAfterFade:
...
Utility.ForEachVillager(delegate(NPC n)
{
Game1.player.mailReceived.Remove(n.Name);
Game1.player.mailReceived.Remove(n.Name + "Cooking");
n.drawOffset = Vector2.Zero;
if (!Game1.IsMasterGame)
{
n.ChooseAppearance();
}
return true;
});
...
The mail key is removed every day so it can be sent again
are there any mods with light source relatde features
i want to know how light source textures work 
yeah i figured that might be an issue and honestly i didnt realise that was the id and not a display so when it errored the first time i updated it to match the item name but still nothing
SpaceCore has some stuff
Colored lights and custom texture support for map properties
(i was about to say i remember casey talking about lights at some point)
now im just wondering why the original person i helped had the vanilla recipes completely overwritten
but thank you for illuminating the rest for me
(they were sleeping several days in a row, so it mustve been something else?)
(anyway g2g now bye byeeeee)
cya
"Test_PerfectGift": "66 1 Book_Void 1 128 1 276 1/unused/Test_PerfectGift/false/null/"
thats my entry for the crafting recipe
%item craftingRecipe Test_PerfectGift %%
thats my outcome of the mail
[game] Letter 'Test_GiftForAbigail' has unknown crafting recipe 'Test_PerfectGift' or 'Test PerfectGift'.
thats what smapi says
So, in the matter to update the original Spoilage, someones can enlighten me how to:
-
check if a given Location from Game1.locations is buildable?
-
get the items from a chest?
these are the two big errors that the VS is giving back to me that SMAPI 4.0 can't handle
you're missing the 5th index, the "display name"
"Warp Totem: Artificial Beach": "709 1 340 1 771 20//{{ModId}}_WarpTotem/false/none/{{i18n:Edelweiss.Warp.Totem}}"

going to full restart incase patch reload just isnt doing it
but ireally dont see anywhere there could be an issue
Fun fact
[game] Letter 'Test_GiftForAbigail' has unknown crafting recipe 'Test_PerfectGift' or 'Test PerfectGift'.
having some fun
The display name is optional
It defaults to the display name of the first item to craft
- why does buildable matter
- the Chest class has Items
you wont believe where i messed up
actually no you probably will
no im all on one file at the moment because im too lazy
not sure, but I believe it is checking all locations and filtering where can be a chest there
will use include at some point before starting my real mod
instead of Data/CraftingRecipes
get this
i typed
Data/CrafingRecipes
i'm surprised smapi didn't yell at you for saying "Data/CrafingRecipes doesn't exist"
literally
private void GameLoop_DayStarted(object sender, StardewModdingAPI.Events.DayStartedEventArgs e)
{
if (!Config.ModEnabled)
return;
spoilageDict = Helper.GameContent.Load<Dictionary<string, SpoilData>>(dictPath);
foreach(var kvp in Config.CustomSpoilage)
{
spoilageDict.TryAdd(kvp.Key, kvp.Value);
}
var locs = new List<GameLocation>();
foreach(var l in Game1.locations)
{
locs.Add(l);
if(l is BuildableGameLocation)
{
foreach(var b in (l as BuildableGameLocation).buildings)
{
if(b.indoors.Value is not null)
{
locs.Add(b.indoors.Value);
}
}
}
}
foreach(var l in locs)
{
foreach(var obj in l.objects.Values)
{
if(obj is Chest)
{
SpoilItems((obj as Chest).items, (obj as Chest).fridge.Value ? Config.FridgeMult : 1);
}
else if(obj.heldObject.Value is Chest)
{
SpoilItems((obj.heldObject.Value as Chest).items, (obj.heldObject.Value as Chest).fridge.Value ? Config.FridgeMult : 1);
}
}
}
SpoilItems(Game1.player.items, Config.PlayerMult);
}
the original Spoilage code where it breaks
I thought u wanted to just write whole new mod
yeap, I will. but for now I will update it and see how it works ingame
since it already implements an Harmony patch
want to see to what extend the implementation goes
alright it works and the recipe also works
Is BuildableGameLocation still a thing 
You have the decompile game right
Iirc there's a foreach location method
changing '.items' to .Items seems to solve, and if(l is BuildableGameLocation) was changed to if(l.isBuildableLocation)
I am making a backup of my save an try to run it
Now learning how to change this line foreach(var b in (l as BuildableGameLocation).buildings)
Doesnt the game have a for each chest helper now
so you can yeet like 90% of that
(unless I misremembered lol)
i didnt find such a method 
maybe not looking up right names though
but ForEachLocation is basically there, just gotta iterate the objects in each location and look for chest
There's Utility.ForEachItem which includes items in chests
oh yeah this is what I was thinking
sounds awesome
in that case the each location loop is probably better
Try
Utility.ForEachLocation((loc) =>{
foreach (var obj in loc.objects.Values)
{
var chest = (obj as Chest) ?? (obj?.heldObject.Value as Chest);
if (chest is not null)
// do stuff
}
}, includeInteriors:true);
private void GameLoop_DayStarted(object sender, StardewModdingAPI.Events.DayStartedEventArgs e)
{
if (!Config.ModEnabled)
return;
spoilageDict = Helper.GameContent.Load<Dictionary<string, SpoilData>>(dictPath);
foreach (var kvp in Config.CustomSpoilage)
{
spoilageDict.TryAdd(kvp.Key, kvp.Value);
}
Utility.ForEachLocation((loc) => {
foreach (var obj in loc.objects.Values)
{
var chest = (obj as Chest) ?? (obj?.heldObject.Value as Chest);
if (chest is not null)
{
SpoilItems(chest.items, chest.fridge.Value ? Config.FridgeMult : 1);
}
else if (obj.heldObject.Value is Chest)
{
SpoilItems((obj.heldObject.Value as Chest).items, (obj.heldObject.Value as Chest).fridge.Value ? Config.FridgeMult : 1);
}
}
}, includeInteriors: true);
SpoilItems(Game1.player.items, Config.PlayerMult);
}
now the VS doesn't point error with .items or .Items either
so maybe make a backup and test it?
i hope you are using git 
shouldn't need the else if, the chest.items vs (obj.heldObject.Value as Chest).items is already handled here -> var chest = (obj as Chest) ?? (obj?.heldObject.Value as Chest);
why do you hope?
you have a good point. I failed to check it
I copied the original and changed what I saw
even before you push your code to public git host like github
you can use git to version things
just git init in a folder
as for the reasoning, it is just nice to have version control
I agree. I am just not used to work with git yet
most of my works were local so far. just getting to know how to handle github some months ago
does anyone know what contains the animation data for the heater? i'm making a mod that removes the "wobblewhileworking" function and almost everything is in the "machines" data file. except, for some reason, the heater. i've tried big craftables and objects and everything i could think of, but the heater's wobble just doesn't seem to exist (well, that and the strange capsule which im less concerned about because its not something commonly seen). i'll live with it if i have to but if anyone does know where it exists that'd be super helpful :')
the heater's animation is just scales
I think they're talking about changing the wobbling during winter, which is not tied to machine data and hardcoded
case "(BC)104":
minutesUntilReady.Value = (location.IsWinterHere() ? 9999 : (-1));
break;
Object.cs
ah
yeah if it's hardcoded then i'll just have to live with it i suppose huh?
yea i think u just need to give it a bogus machine entry
then u can set WobbleWhileWorking
i tried doing that it still wobbled
post your code?
(Note to self, avoid making authoritative statements about the game code while on the phone at work)
i mean its pretty simply just. this for each machine as of right now. i'm very new to modding and am not suuuuper sure about what i'm doing lol
do u have to use Entries instead
does Fields work if there's no entry?
:') that's where i get lost and stop really knowing what i'm doing
Data/Machines doesnt have an entry for (BC)104
And Fields is for editing existing entries
just replace it with Entries should work
ohhh so i can add an entry?
yes, change Fields to Entries
Hrm, okay first attempt didn't quite work. FTM doesn't have any full example files listed, does anyone know where to point me for adding an item to the global seasonal forage for every map?
My initial thought is I have to make an entry for every vanilla map (that would have forage) but that seems insane to me
I would assume these but I must've implemented incorrectly
You should be able to add the forage to the default location entry with CP


wacky