#making-mods-general

1 messages ยท Page 64 of 1

vernal crest
#

I really need to do a cull

ornate locust
#

I sort tabs into environments so I can have even more tabs without getting lost! ...that might be a problem

spice inlet
#

Closing your browser with 30 open tabs across 3 windows, thinking "My work here is done!" is super satisfying

brave fable
#

you don't need to find stuff, you just need to open another tab

blissful panther
#

And let's be real, once you reach a certain TPI (tabs per inch), they start looking much more crisp.

inner harbor
#

Some people actually enjoy hunting and reporting bugs.

vernal crest
#

I also sort my tabs into environments but maybe I need more because I have 160 tabs open in my Stardew window

inner harbor
#

And they're not paying for the privilege, theyre finanically supporting a mod they enjoy.

velvet narwhal
#

(my one bugtester who makes reports on my mod because i'm dumb and i miss (1) event command ๐Ÿ™ )

inner harbor
#

It also helps cos people play different combinations of mods.

#

Many of my event bugs come from Fast Animations.

vernal crest
#

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.

inner harbor
#

And that's fine too. Its not obligatory.

frigid hollow
#

early access in products that will be paid anyway makes some sense (since there may be a price increase at full release)

inner harbor
#

I appreciate my bugtesters.

frigid hollow
#

of course, you run the risk of the product never coming out... or staying buggy

uncut viper
#

(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)

inner harbor
#

Then again, i also reead a lot of Advance Proofs

vernal crest
#

I'm not very good at bug testing but I do it where I can.

inner harbor
#

There is a difference between "join patreon for advance access" and "join my patreon for exclusive content".

vernal crest
#

Yeah I do greatly prefer the people doing patreon for advanced access lol

inner harbor
#

We have exclusive content too i guess, but it's not locked.

uncut viper
#

both are equally disallowed under nexus rules, though

vernal crest
#

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.

inner harbor
#

I just link to my kofi, which is permitted and doesnt do anything except make me smile and feel appreciated.

covert river
#

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

velvet narwhal
covert river
#

thank u!

fathom rapids
covert river
fathom rapids
#

That's a mood right there. Archiving should be much easier though, what program are you using for it?

covert river
#

last time i tried to archieve something for school and it didnt work so i just gave up

fathom rapids
#

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

covert river
#

everything just takes forever and sometimes it freezes and goes blue screen

fathom rapids
#

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

oak dragon
#

In multiplayer game, will helper.Events.GameLoop.SaveLoaded still be raised when farmhand connected?

uncut viper
#

it will be raised for the farmhand when they connect to the world

oak dragon
#

oops

oak dragon
# uncut viper it will be raised for the farmhand when they connect to the world

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!

twin mantle
unique sigil
#

oh my god i am absolutely at my wit's end. the ores will not spawn no matter what. nothing i did fixes this SDVpufferwaaah

#

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 SDVpufferchickcry

lofty ruin
#

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)

rancid temple
#

!npc

ocean sailBOT
#
Creating a Custom 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:

rancid temple
#

!startmodding

ocean sailBOT
#

Making mods can be broadly divided into two categories:

Usually itโ€™s easier to start with making content packs, since you don't need to learn programming.

half gazelle
#

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:

rancid temple
#

Unpacking unpacks whatever version you have installed

half gazelle
#

i have 1.6, and the excel sheet with sound effects hasnt been updated in a while :(

rancid temple
half gazelle
#

thank you!

#

i found the excel file from 2019 instead while searching up!

#

*that was, very outdated

#

thank u for sharing :D

royal nimbus
#

where would dialogue in rooms be located? like when you click on an object in a room and it says what it is.

round dock
#

Strings?

royal nimbus
#

yeah im looking in strings and in data

#

also looking for npc dialogue again. i found it before

rancid temple
#

Strings/StringsFromMaps for the object dialogues

royal nimbus
#

tysm!

#

;o;

rancid temple
#

NPC dialogue is Characters/Dialogue/<whicheverCharacter>

royal nimbus
#

tysm

rancid temple
#

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

blissful panther
#

(It's embarrassing how many times that's happened to me.)

rancid temple
#

I couldn't find any info online as to why it was happening since it's a SMAPI specific thing lol

lucid iron
#

maybe something can be done in mod build config

velvet narwhal
#

SDVpufferthink seems intrusive

lucid iron
#

just dont start things until you come up with good name AquaThumbsup

#

when the project name is lame there is less motivation

velvet narwhal
#

Just Don't Build It โ„ข๏ธ

rancid temple
#

I'll never make another project again, I often don't come up with a name until I'm posting it to Nexus lmao

blissful panther
rancid temple
#

Right, I have the bad habit of just lumping all that together under SMAPI lol

velvet narwhal
#

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%

lucid iron
#

ur not that wrong its in the smapi repo n everything

brisk kraken
#

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?

velvet narwhal
#

SDVpufferthinkblob syntax looks correct

brisk kraken
#

Yup, thats why I wonder what is going on??

velvet narwhal
#

is your entire file valid?

brittle ledge
#

Is it playSound? I thought music was another command

velvet narwhal
#

sound is the sfx, so it'd be playMusic iirc

brisk kraken
brisk kraken
brittle ledge
#

Yeah, that may be your issue

velvet narwhal
#

but putting it in the first command should be valid cause i have something wild

#

"junimoKart_ghostMusic/-10000 -1000/farmer -100 -100 2

brittle ledge
#

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

velvet narwhal
#

and plums is a valid music file cause i use it for one of my locations SMCPensiveMove

unique sigil
#

farm update: still not working :))

rancid temple
#

@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

unique sigil
#

i mean i could just make it into a hilltop replacement. but i would be so fucking disappointed

velvet narwhal
#

oh lol

brisk kraken
velvet narwhal
unique sigil
rancid temple
#

I can zip you up all three if you want or we can troubleshoot yours

brisk kraken
velvet narwhal
#

your manifest id

unique sigil
#

either way, i appreciate it SDVpufferheart

brisk kraken
velvet narwhal
#

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

rancid temple
#

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

velvet narwhal
#

i still haven't gone back to do the farm cave because i'm not in the mood for it

rancid temple
#

If you move your farmhouse, does that mess up events that happen in front of it?

velvet narwhal
#

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

brisk kraken
#

The events load and play properly, I have one with the playsound, just the music is the one not working

velvet narwhal
brisk kraken
#

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!

velvet narwhal
#

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

brisk kraken
#

Hmmm, I also notice that some emotes command dont work, while the others do... I will send the full file

royal nimbus
rancid temple
#

Do you mean the map dialogue for Krobus's spouse room?

royal nimbus
#

stuff he says when he lives with u and in general

velvet narwhal
#

characters/dialogue/marriagedialogueKrobus

royal nimbus
#

wow... i see it now

#

xDD

#

tysm

brittle ledge
#

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

velvet narwhal
#

i always presume people aren't gonna do the ff14 thing and actually put the bus warps on the right side of the map SMCKekLmaoDog

brittle ledge
#

As in a custom farm with it moved already? SDVpufferthinkblob That sounds like a vanilla bug if that's the case

royal stump
unique sigil
#

oh, thank you!!

royal stump
#

I also fixed some of the related phrasing in the examples article, though it's still pretty outdated, unfortunately

unique sigil
#

tsym for the reply anyways, i'll correct some stuff

unique sigil
royal stump
blissful panther
#

How does the maximum checking work, out of curiosity? SDVpufferlurk

royal stump
#

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 SDVpufferdizzy
but I think Max vs High is mostly whether it respects NoSpawn

blissful panther
#

Ahhh, I see! I was thinking it was some level of strictness to attempt to detect things being placed in inaccessible area!

royal stump
#

that'd be nice to have, but FTM was especially slow back when I added this, so it's all single tile checks SDVkrobusgiggle

#

originally it was just "use medium for weird layer-related obstructions on custom maps, or low to completely ignore tile properties"

lucid iron
#

maybe if u do a flood fill and cache the accessible tiles

royal stump
#

yeah, and I'm pretty sure a few people have figured out decent accessibility checks for NPCs and such SDVpufferthinkblob never looked into it myself though

lucid iron
#

there was a neat mod recently

royal stump
#

FTM does cache the safety checks now, which helps a lot, it just doesn't actively look for pathing

lucid iron
#

for checking if player can get out of a map

blissful panther
#

Does a flood fill or some search from the player position until it hits a warp I guess?

royal stump
#

oh yeah, I think I saw that in the showcase at some point

heady crest
ocean sailBOT
#

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.

lucid iron
#

does she have flower dance sprites

heady crest
calm nebula
lucid iron
#

Event 'festival_spring24' has command 'warp MalkeTFC.MaxineCustomNPC_Maxine 13 24' which couldn't be parsed: no NPC found with name 'MalkeTFC.MaxineCustomNPC_Maxine'.

lucid iron
#

this id correct?

heady crest
#

no??? she appears before the dance so i can ask her

#

and the id is the same

#

just copypasted

royal nimbus
#

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

calm nebula
#

You also need to add to the main event additional characters

heady crest
#

thanks

brittle pasture
royal nimbus
#

i tried hide too. i will try again and ty

calm nebula
#

ModContent.LoadAsync could be a thing, huh

brittle pasture
royal nimbus
#

its edited vanilla

royal nimbus
#

lmfao it worked for this one x'D

#

needs work lol

#

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

acoustic summit
#

Wow that looks awesome!

royal nimbus
#

ty -o-

acoustic summit
#

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

royal nimbus
#

im hoping to finish this mod in 15 days so it will be out by halloween

royal stump
#

(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.

royal nimbus
#

but yeah i cant brain why the hat thing isnt working right. they're set the same but it only works for one. idgi <_>

blissful saddle
#

Someone knows how I can check if a chest was opened through events?

uncut viper
lucid iron
#

do you need to know a chest is opened by a different player?

blissful saddle
#

I don't think so, as all update is thought to be on local

royal stump
#

SDVpufferthinkblob 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)

blissful saddle
#

I am trying to do it through the MenuChange event, but failing to build a logic to check it

uncut viper
#

i was gonna suggest the MenuChange event too, just check to see if the menu is an ItemGrabMenu

lucid iron
#

what is the desired behavior if i like

#

open a chest and close it without changing anything

lucid iron
#

i ask bc i feel like you can use inventory changed

blissful saddle
lucid iron
#

i think you should do it on daystarted

#

for automation mods

blissful saddle
#

hmmmm

rancid temple
#

What if a chest isn't opened that day?

blissful saddle
#

didn't thought about it

uncut viper
#

i agree with that

lucid iron
#

or maybe day ending

#

either way an apple ought to have spoiled without me observing it, no quantum shenanigans there

uncut viper
#

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

blissful saddle
#

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

lucid iron
#

hm that'd be pretty confusing to me as a player think

blissful saddle
#

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

lucid iron
#

yea that's realism

blissful saddle
#

so is spoilage

uncut viper
#

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

brittle pasture
#

not related to your questions and only out of curiosity, how do you handle stacking

lucid iron
#

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

blissful saddle
lucid iron
#

going back to the implementation side

blissful saddle
#

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

lucid iron
#

i think its prob ok to have ForEachItem at 10min update

rancid temple
#

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

lucid iron
#

u can perf test it to be sure

blissful saddle
#

seems an awesome test to be made

lucid iron
#

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

uncut viper
#

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?

lucid iron
#

spoiled fruit wine becomes vinegar trust

uncut viper
#

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

blissful saddle
#

so the automation may not take it anymore

#

I never tested it though

lucid iron
#

oh maybe u can steal the qi cooking thing

blissful saddle
#

I intend to do the same, something like 'spoiled vegetable/fruit/etc'. but the first thing will change them to 'trash'

lucid iron
#

need to patch displayName getter

brittle pasture
lucid iron
#

and have some way to ban your thing from being eaten when its got tag

#

i thought qi cooking is in create item

blissful saddle
uncut viper
#

why not?

lucid iron
#

adds the orderData.Value = "QI_COOKING"

uncut viper
#

mod data in the save file is harmless, its just strings

brittle pasture
#

ah I was talking about "yeet qi tag when order expires"

lucid iron
#

you are inevitably affecting the save file though

brittle pasture
#

for spoilage data modData works

blissful saddle
uncut viper
#

no, dont worry about that

lucid iron
#

there's no practical diff between "swap item for rotten item" and "give item a modData tag"

uncut viper
#

SpaceCore does save serialization stuff which is much different

lucid iron
#

both is making it into the save

uncut viper
#

mod data is an officially supported and safe way to store data like that

lucid iron
#

and you want it like that, cus ppl would expect rotteness to persist between load

brittle pasture
#

unless you want an intermediary stage of "not usable in cooking but usable in machine"

blissful saddle
lucid iron
#

cant believe grandpa farm inc. is selling out of date strawberry jelly

uncut viper
#

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

lucid iron
#

the spacecore warning is also misleading cus

#

spacecore doesnt put the extra info in the save file

uncut viper
#

bc if you remove spacecore but not those custom things the game doesnt know about, your save will not be happy

lucid iron
#

it goes in the spacecore-serialization.json

blissful saddle
#

good to know how it does

uncut viper
#

i mean its not misleading to say it can muck up your save if you remove spacecore

lucid iron
#

so its actually fine to yeet either the mod that added the type and spacecore

#

cus its not in your real game file

brittle pasture
#

pathos should add a hardcoded exemption for SpaceCore

uncut viper
#

you could always write your own serializer too

blissful saddle
#

When automation ticks, it changes the item on the chest, right? like it raises some kind a 'Item/stack changed' event...

brittle pasture
#

there's chest inventory changed event

uncut viper
#

it doesnt catch when an item is changed but not removed though, does it?

brittle pasture
#

but it likely will raise after the item is eaten by the machine

blissful saddle
#

but it also needs to check the inventory before changing it, to look for an item that it can use

lucid iron
#

you can just patch MachineDataUtility

uncut viper
#

you could always patch Automate too

lucid iron
#

MachineDataUtility.CanApplyOutput

#

ban items that have the spoiled tag

brittle pasture
#

though I feel like if you're going that route just make them a different item

blissful saddle
#

I am yet on the checking and updating thing, to avoid updating everything at X time

brittle pasture
#

are there cases where you still want an apple to be considered an apple but not make it eligible for a machine

lucid iron
#

if different item

uncut viper
#

they'd then need to go back to iterating over every chest to find items that should be changed to another item, though

lucid iron
#

i guess u can make a rotten item that can have flavor?

#

to achieve displaying "rotten apple"

brittle pasture
#

ah I slightly misunderstood the assignment, I thought we're (still) doing 10 min update

lucid iron
#

these r all suggestions on how u might implement pick what vibes with you sleep

#

i feel like changing the item somehow is the most compatible way

uncut viper
#

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

brittle pasture
#

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

lucid iron
#

and doing the watch items approach seems most fun

blissful saddle
#

if there are no way, maybe I will resort to update once a day...

lucid iron
#

for that you need to do a ForEachItem on save load to build the initial list of items to watch

blissful saddle
lucid iron
#

and some way to map timeline of item spoilage

#

the data to store is create time and time to live

blissful saddle
#

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

lucid iron
#

oh also need like

#

where item lives

#

plus changes to this on inventory changed

#

lots of shenanigans LilyDerp

#

will be fun trust

blissful saddle
#

where item lives?

lucid iron
#

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

blissful saddle
#

yet, fridge is a chest with a different texture to the code. I yet need to find how to check them both

lucid iron
#

fridge is a different big craftable

blissful saddle
#

Somehow I think the game knows where is each item already... would be better to access that

uncut viper
#

Chest also has a fridge NetBool field

lucid iron
#

the game does know though?

#

but i thought u wanted to not use ForEachItem

uncut viper
#

i dont think i understand how you can watch an item without iterating over the items though

lucid iron
#

you do have to iterate all items at least once

#

on loading of save

uncut viper
#

right but how do you access that same exact instance of the item after?

lucid iron
#

thats not optional cus how else would you know

rancid temple
#

You make the items that can spoil register themselves with a manager

#

Then the manager knows where they are and can handle their spoilage

lucid iron
#

just keeping the Item object should work

#

cus this is all within 1 game session Bolb

#

im not sure if things reset on new day though

blissful saddle
lucid iron
#

thats what i been describing this whole time blobcatgooglyblep

rancid temple
#

Was gonna say lmao

uncut viper
#

and what about when things update for different CP patches and whatnot?

blissful saddle
lucid iron
uncut viper
#

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

rancid temple
#

Yeah, having CP able to interfere in an item is kind of a problem

#

Actually, I guess it's not

lucid iron
#

well CP currently cannot change a item that exist

brittle pasture
lucid iron
#

unless you use button's mod

rancid temple
#

Right

lucid iron
#

so i dont think thats an issue

blissful saddle
#

I mean, on load save, load manager with all item instances that match certain categories, like fruits, vegetables and whatsover

rancid temple
#

That makes me wonder, can item's with different data stack?

brittle pasture
#

actually I guess there are mods that change stuff like dandelion to flowers

blissful saddle
#

if items are added with CP and corresponds to that categories, they will be added

rancid temple
#

Like if I spawn a fish and then change it's data and spawn another, will they stack?

lucid iron
#

i think one set of data just gets yeeted in that case

uncut viper
#

pretty sure ive seen one mod before too that changes tomato category depending on your answer to the demetrius robin event

blissful saddle
#

and when such items are produced, they will also added

rancid temple
#

Sounds like patching the ItemRegistry lol

brittle pasture
#

its only purpose being incrementing the original item's stack size

rancid temple
#

Oh lol, that's interesting and also seems kind of backwards

#

But I guess that's the more performant solution

uncut viper
#

well, usually an items data is not supposed to change SDVpuffersquee

blissful saddle
#

so would not be possible to have a stack of good parsnip spoiling in different rates

brittle pasture
#

you can make them not stack...

blissful saddle
#

and so cumbersome the inventory

brittle pasture
#

but the avg user isn't going to like that SDVkrobusgiggle

lucid iron
#

honestly this just goes back to

blissful saddle
#

imagine having to have another space in the inventory because you fished a fish 10min later than the first one

lucid iron
#

realism and gameplay streamlining is at odds with eachother

#

that is why i think spoiling once per day is fine

rancid temple
#

Yeah, I would also go the route of daily, getting too granular is a problem

blissful saddle
#

but so you can also not stack parsnip that you collected in different days in the fridge

#

the problem is just extended

lucid iron
#

that is gonna explod me fridge

brittle pasture
#

you can average out maybe, two 1 day old parsnips + three 3 days old parsnip = five 2 days old parsnips

blissful saddle
#

I think if the original Spoilage had this problems circunvented or if it was cumbersome lol

lucid iron
#

but hey u have modData

rancid temple
#

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

lucid iron
#

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

rancid temple
#

Lol, the most hellish sounding answer

lucid iron
#

gotta patch the unstacking too ofc

blissful saddle
#

the same can't be done each 10 minutes?

uncut viper
#

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

lucid iron
#

sure, just more complexity

uncut viper
#

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

rancid temple
#

I think that was the idea lol

#

That's how I took it anyways, hence why I said it sounded hellish

uncut viper
#

do you want to have mod data for 999 parsnips

lucid iron
#

no i mean, say if the modData said something like
37 parsnips rot in 2 days
23 parsnips rot in 5 days

brittle pasture
#

(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)

blissful saddle
#

I am laughing on this solution, because I see how this can broke in thousand shards and enjoying it at the same time

uncut viper
#

then if you take one parsnip out of the 23 stack, what do you put for the mod data in the 1 parsnip?

rancid temple
#

So then stacking and unstacking would kind of just be nebulous lol

lucid iron
#

arbitrarily decide if users want the rotting earlier ones first or later

lucid iron
#

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

uncut viper
#

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

lucid iron
#

no this is 1 stack of 60 parsnips button

#

that u are taking 1 from

uncut viper
#

so it would be impossible to grab a fresh parsnip from the stack?

blissful saddle
#

alsot the stack shows the closer to rotten 'on top'

lucid iron
#

yep rotting food for you only RushanaSmug

#

well i guess u can add more buttons

blissful saddle
#

so the player doesn't have a surprise

rancid temple
#

Just gotta grab all of them but one

#

Goodbye mouse button

lucid iron
#

the advantage is that u got 1 stack

#

disadvantage is that u need to display more info

#

since ppl dont read mod pages

blissful saddle
#

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"

rancid temple
#

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

lucid iron
rancid temple
#

Which could still end up being a lot of mod data lol

blissful saddle
lucid iron
#

i should mention that this is unrelated to like

#

the earlier q about how do we update items

uncut viper
#

new question about this weird mod data stacking though

lucid iron
#

need to track some kind of rotting state no matter how u update

uncut viper
#

what happens if i take the parsnips out of the fridge and put them into my inventory?

#

the whole stack

blissful saddle
#

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

rancid temple
#

Pretty sure they always have

#

Technically all inventories try to auto stack

blissful saddle
#

would be a question of choice to stack different rotting stances of the same item or not

#

otherwise I mean

lucid iron
velvet narwhal
#

(off question, how are you gonna handle qualified items? SDVpufferclueless )

lucid iron
#

theres no qualified items

#

its already a Item instance

blissful saddle
uncut viper
#

what do you change the time to rot to in the mod data?

lucid iron
#

yep, thats why the monitor must know about it

#

i actually think monitor approach would want to store create time + time to live though

rancid temple
#

Oh I thought fridge just stopped rotting or it could just skip rot ticks

lucid iron
#

rather than a raw count down

uncut viper
#

the original spoilage mod has the fridge slow down the rate of rotting but not stop it completely

blissful saddle
#

like it goes down slower on each update when on a fridge, and faster when out of it

uncut viper
#

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?

lucid iron
#

Yeah that could work

brittle pasture
lucid iron
#

Parsnip takes psychic damage when not in the fridge

uncut viper
#

or does it not get changed?

rancid temple
#

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

uncut viper
#

thats true but if you call them days it kinda locks you in to ticking down 1 per day

blissful saddle
#

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.

uncut viper
#

if its a durability it can be a float!

blissful saddle
#

yeap

rancid temple
#

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

blissful saddle
#

I think button took the idea

uncut viper
#

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

blissful saddle
thorny tiger
#

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.//",

rancid temple
#

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

uncut viper
#

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

blissful saddle
blissful saddle
rancid temple
#

Unless you're trying to do a bunch of UI dev, just add it to the description of the item lol

uncut viper
#

actually you might use fields for this

#

i can never remember for gift tastes tbh

velvet narwhal
#

fields, yes, pain

uncut viper
#

avi will know

velvet narwhal
#
  //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": " "
    }
  ]
}```
uncut viper
thorny tiger
#

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": " "
}
]
}

uncut viper
#

might need to put the 1 in quotes

thorny tiger
#

oh didnt see that

#

yeah

uncut viper
#

(i dont know if you need to but avi's example does)

rancid temple
#

I think you do

thorny tiger
#

yeah id expect aviroen to be right

#

ok slight side mission but what does the delimiter actually do

velvet narwhal
#

i am not usually right, but that code was trial and error over some odd 20 versions of my mod

uncut viper
#

between each item id is a space

blissful saddle
#

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
uncut viper
#

that space is the delimiter

#

basically means "whaty should i put between each of the entries to keep them separate"

blissful saddle
#

this are the operations the game will need to do during the session

thorny tiger
#

ty

#

omg why cant i spell

uncut viper
#

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

blissful saddle
#

it needs to write on savefile too

rancid temple
#

Also when items are stacked together, one of the items is going to need to be removed from the manager

blissful saddle
#

maybe load it from save file if the info is there

rancid temple
#

Because the specific instance it's tracking will no longer exist

thorny tiger
#

theoretically ive made a new crafting recipe and made a gift taste for it ๐Ÿคž

uncut viper
#

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

blissful saddle
rancid temple
#

Yeah the manager should only exist when it's doing its job

uncut viper
#

its just a dictionary of strings to strings

rancid temple
#

Just like manager's in real life

uncut viper
#
Item i = ItemRegistry.Create("bla");
i.modData["UniqueId/SpoilHealthBar"] = "50";
#

something like that

blissful saddle
#

not sure if manager means the same to us. I internally takes the manager as the class that will manage the stored data

uncut viper
#

correct. dont save that

#

its created when the save loads and exists as long as the game is open

blissful saddle
#

I will not. it will be in the cs running with the mod

rancid temple
#

It manages the stored data but it doesn't store that data

blissful saddle
#

the manager that I understood are the collection of methods in c# that will do the trick

rancid temple
#

Essentially

uncut viper
#

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

blissful saddle
#

ok, so we are at the same feet. what will be stored and updated is the data of each item.

#

ok, good.

uncut viper
#

and only stored ephemerally

#

(from your managers perspective i mean)

blissful saddle
#

I just need to learn how to work with the mod data to access and update it

brittle pasture
#

just .modData is fine

rancid temple
#

It's just strings, so you'll be doing a lot of converting back and forth

uncut viper
#

the lil snippet i put above is literally all it takes, you can also use TryGetValue and whatnot

blissful saddle
#

I am learning c# while trying to work in these mods SDVpufferthumbsup

rancid temple
#

Ah hard mode

blissful saddle
#

I know c, python and R

uncut viper
#

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

blissful saddle
#

but c# is more friendly to this kind of thing and I am enjoying it

brittle pasture
#

I think you want to add all perishable items? in case installing mid save

uncut viper
#

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

blissful saddle
uncut viper
#

oh wait i misunderstood

blissful saddle
uncut viper
#

okay yeah you might as well check if it should be perishable and doesnt already have the data too

blissful saddle
#

now thinking if new items added on save should start with random durability

#

for havoc

uncut viper
#

the serious answer is absolutely not

#

the funny answer is make everything rot immediately

velvet narwhal
#

realistic answer, calculate DAYS_PLAYED

uncut viper
#

you dont know when the item was made though

brittle pasture
#

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

velvet narwhal
#

ah flat modifier as a handwave

blissful saddle
rancid temple
#

I think the question was should new items have random durability

blissful saddle
rancid temple
#

Not should items that were already in the save have random durability

blissful saddle
uncut viper
#

i thought it was about the new items that would be added on save loaded

velvet narwhal
#

oh new items, i was thinking items that already existed

uncut viper
#

the only new items during that stage of the mod loading would be already existing items

#

paradoxically

blissful saddle
#

like if manager take a new item on save load up, it was in the game before the mod was installed

rancid temple
#

Oh, then Avi's answer would technically work if you wanted chaos lol

blissful saddle
rancid temple
#

Just assume everything has always been in their inventory since the beginning

velvet narwhal
#

there's no nice way about it to be like, "if this item was a seed item in fall yada yada yada"

uncut viper
#

i would just apply whatever calculation you'd do if it was freshly created

rancid temple
#

And if they installed too late, everything rots

#

The real answer is just to make them all start at the beginning of their timers

brittle pasture
#

"DAYS_PLAYED"
"But this is a pumpkin, and we're in fall year 1-"
"DAYS_PLAYED!!"

velvet narwhal
#

tbh i'd expect it to rot everything if i installed something mid save, but i am also someone who reads descriptions

rancid temple
#

Personally, I don't use realism mods because even when it's being fair that's just how it feels all the time

velvet narwhal
#

the nicest way possible is button's suggestion, flat calculation as if it were brand new

thorny tiger
brittle pasture
rancid temple
#

Can't decide if want rest of name

velvet narwhal
#

i don't even want the butcher mod, i am a weenie

rancid temple
lucid iron
#

say is there a pets poo mod

#

gotta take the doggie on walks

brittle pasture
#

well you can add it as an item to pet drops

rancid temple
#

Not a very good farm dog if you gotta walk it lmao

brittle pasture
#

"You were expecting a fish, mother? Unfortunately..."

lucid iron
#

yea i mean the dog doesnt herd sheep for u either

#

clearly a freeloader

rancid temple
#

Yeah, the cats you can at least pretend they catch critters

thorny tiger
#

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)

blissful saddle
rancid temple
#

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

rancid temple
#

I don't play games for realism, I get enough of that every time I have to wake up

lucid iron
#

im framing the tutorial fish on the wall

velvet narwhal
#

my steam games list is well over 200 strong, i just pick one of i'm feeling in the mood for survival

heady crest
#

how do i make the game load the sheet from isntead thej game instead from the mod folder???

lucid iron
#

make sure your mod folder doesnt have file of that name

rancid temple
#

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

heady crest
#

i have only the spring sheet on the folder

rancid temple
#

You can't have that

rancid temple
#

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

blissful saddle
blissful saddle
#

your crops are attacked by rabbits and moles if you don't have a cat

#

also rats in your silo

uncut viper
#

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

heady crest
#

how do i make that also apply to mod sheets like daisy/lumi outdoors

velvet narwhal
#

manifest dependency

rancid temple
#

If you have those mods installed, you keep the sheets with your map while editing then remove them while testing or shipping the mod

velvet narwhal
#

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

rancid temple
#

As long as you remember that you have to move your updated map SDVkrobusgiggle

velvet narwhal
#

if i could get the stupid windows symlink to work properly--

heady crest
#

im so confused ๐Ÿ˜ฎโ€๐Ÿ’จ

uncut viper
#

(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)

velvet narwhal
#

oh i sort by date so it's always staring at me, menacingly

rancid temple
#

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

heady crest
rancid temple
#

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

uncut viper
#

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

rancid temple
#

That way you don't accidentally load before another mod has had a chance to load the sheets you're dependent on

uncut viper
#

tile sheet mods like Daisyniko will load their tile sheets to the game files on their own in their own content patcher mods

#

(usually)

heady crest
#

i think i got it (emphasis on think)

rancid temple
#

Unless you're doing C# reflection crimes, your mod can't access other mods files

uncut viper
#

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

rancid temple
#

But if another mod loads its files into the content pipeline you can access the content pipeline

uncut viper
#

The game will look in that Maps\ target if your tmx says it just wants the "Daisyniko" tile sheet

thorny tiger
#

(side-question) how is stardrop tea done and can i recreate its effect for a specific npc in CP?

uncut viper
#

Which it should if it doesn't have tile climbing

#

Startup tea is hard coded

next plaza
rancid temple
#

Should affect every NPC though right?

thorny tiger
rancid temple
#

I was also thinking of Button when I said C# reflection crimes :P

uncut viper
#

Star drop tea affects every NPC yes

next plaza
#

My crimes predate Button joining the community

uncut viper
#

Maybe only social ones

rancid temple
#

That's true lmao

uncut viper
#

my crimes let everyone else do crimes too so clearly they're... better? Worse?

velvet narwhal
#

you were doing crimes before it was even considered a crime aSDVpufferdeal

uncut viper
#

./j

velvet narwhal
#

you're both mafia bosses /lh

rancid temple
#

I think you both do great(?) crimes for the good of the community

lucid iron
#

sometimes it is correct to do crimes - ichor 2024

thorny tiger
next plaza
#

People asking me how I make such complex mods:

uncut viper
thorny tiger
#

anyway does category 0 exist is that a thing

#

can i use that to not give it a category

rancid temple
#

I think that's Basic?

lucid iron
#

you dont have to set any field you dont want to

brittle pasture
uncut viper
#

can you just choose arbitrary numbers for categories? I don't actually know if it enforces them

lucid iron
#

usually it gets a default value

rancid temple
#

Category number definitely matters

#

Some game logic is dictated entirely by what your category is

uncut viper
#

how many things would it break if you just ignored that tho

next plaza
brittle pasture
velvet narwhal
#

...-74? will force a juice/pickle

rancid temple
#

Depends on what you want your item to do lol

rancid musk
thorny tiger
#

or well not leave it

uncut viper
thorny tiger
#

just not define it

next plaza
rancid temple
uncut viper
rancid musk
thorny tiger
velvet narwhal
#

SDVpufferthink would category null break things?

rancid temple
#

Category isn't listed as an optional field actually

uncut viper
#

seems likely

rancid temple
#

So not filling it out might actually break the item

lucid iron
#

DokkanStare wacky

#

i never made a crops mod so ive always just put Basic

rancid temple
#

Like if you don't fill out the Description the item loses its entire tooltip lol

velvet narwhal
#

ah, i am an i18n fiend so the game just screams about no translation if i've forgotten do anything

rancid temple
#

Most of what I do is testing so I'll leave fields blank sometimes lol

teal bridge
rancid temple
#

From the code side of things, making a realism mod work sounds fun

#

But I would never actually use one lol

velvet narwhal
#

it was fun to watch ya'll wax and wane as i sat like a stupefied dog

uncut viper
#

(tbf i don't use most of my own mods anyway)

rancid temple
#

I think I've only made a few released ones that I don't use lol

blissful saddle
#

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

heady crest
rancid temple
#

Any sheet not in Maps basically

thorny tiger
velvet narwhal
#

ah a crimis tree

uncut viper
rancid temple
thorny tiger
#

just doesnt show a category

rancid temple
#

Interesting

lucid iron
#

did you set Category or Type?

thorny tiger
rancid temple
#

Intentionally didn't

lucid iron
#

ah i see

thorny tiger
#

oh wait

lucid iron
#

til then

thorny tiger
#

no i set type as object

#

no category though

lucid iron
#

i think thats not valid

rancid temple
#

I do wonder if there's any repercussion to it

uncut viper
#

I think making an invalid item was like. Kind of the intent

thorny tiger
lucid iron
#

nvm Type isnt an enum blobcatgooglyblep

rancid musk
lucid iron
#

its just a string

brittle pasture
uncut viper
#

(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)

teal bridge
#

I could just literally call MethodInfo.Invoke, but there's a real perf difference between the methods and delegate versions.

thorny tiger
#

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

lucid iron
uncut viper
#

yeah smapi was a big part of the "ways that don't work" with how angry it was getting with me

lucid iron
#

maybe if we could have it recognize ~

brittle pasture
lucid iron
#

let you do ~/TileSheets/furniture_2 for furniture on yer map tiles

rancid musk
teal bridge
thorny tiger
#

didnt work so i set to 7 hearts then gifted up to 8 and slept

#

still nth

brittle pasture
thorny tiger
#

dan

#

damn*

brittle pasture
#

you need to do your own mail

thorny tiger
#

frick

brittle pasture
#

it's not that hard!

thorny tiger
#

ill have to take your word for it

uncut viper
rancid musk
#

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.

thorny tiger
#

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

teal bridge
thorny tiger
#

also could you explain why it doesnt work because the wiki suggests it should

teal bridge
brittle pasture
brittle pasture
thorny tiger
#

friendship reqs are only for cooking huh

lucid iron
thorny tiger
#

ok makes enough sense

uncut viper
teal bridge
#

Of course the *fixes, transpilers etc. are all IL generated, but AccessTools doesn't get into that.

heady crest
#

so i just dont use sheets outside of maps? gotta edit my map

uncut viper
thorny tiger
#

and why is that

uncut viper
thorny tiger
#

surely you just get it the day after getting the first one

uncut viper
#

Or load it into the Maps asset

rancid musk
uncut viper
rancid temple
#

I thought that was fixed?

heady crest
uncut viper
#

is it? The change log for 1.6.9 is huge and unfortunately I've not memorized it

rancid temple
#

Oh I thought it was in a previous version of 1.6

thorny tiger
#

thats odd given how Y2Spring4 perfection works with kent's recipes?

rancid temple
#

But I dunno if it's documented, I just remember some others talking about it working properly

thorny tiger
#

like you can activate several cooking heart events with kent and recipes in one day then you wait for one recipe per day

rancid temple
#

Easy enough to test though

uncut viper
#

i remember talking about it working improperly but I don't remember when that was or when other 1.6 versions came out

teal bridge
thorny tiger
teal bridge
#

It's possible that HarmonyMethod does some magic maybe.

teal bridge
#

Oh I see. Yeah, that does look helpful if you know the types at compile time.

blissful saddle
rancid musk
#

And you don't need the specific type, as long as you have an assignable type in the correct direction.

lucid iron
rancid musk
teal bridge
#

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.

blissful saddle
uncut viper
lucid iron
#
Stardew Modding Wiki

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...

thorny tiger
#

that would trigger at completely different times

lucid iron
#

u should give it a try and return here if it explodes

uncut viper
#

explaining that would require me to be at my desk to properly find/reference what i mean

thorny tiger
#

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

rancid temple
#

I can see how it might be misconstrued as broken though

thorny tiger
#

strange that there are days with no mail though?

uncut viper
#

we may be talking about different things

thorny tiger
#

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

rancid temple
#

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

thorny tiger
#

how do i make mail actually trigger

rancid temple
#

Trigger actions

thorny tiger
#

whats the difference between "Condition": "" and "When": {}

rancid temple
#

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

thorny tiger
#

so i should use condition for single entries and when for entire patches

rancid temple
#

Depends on what you're trying to do generally

velvet narwhal
#

condition is only there if the data has it, when can be placed pretty much anywhere

rancid temple
#

When has to be on the entire patch block, it goes at the same level as Action or Target

thorny tiger
#

is there a page for using Condition

velvet narwhal
#

yeah that's what i meant SMCKekLmaoDog i'm fighting my orange son because he wants chip

thorny tiger
#

i searched and got When documentation

rancid temple
#

Condition is only on individual entries, but sometimes you would use a When over a Condition

blissful saddle
velvet narwhal
velvet narwhal
#

tbh sinz saying when is a last resort cause it screws with multiplayer, i've been trying to avoid it like the plague

rancid temple
#

I'm not sure how it would inherently screw with multiplayer

velvet narwhal
#

i think the flag conditions SDVpufferthinkblob i'd have to dig again because memory foggy on the details

blissful saddle
#

I will do the update and work on my version later

rancid temple
#

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

blissful saddle
#

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

uncut viper
uncut viper
velvet narwhal
uncut viper
#

like, their existence

thorny tiger
rancid temple
#

"{{ModId}}_TestObject": "20 1 22 1 419 1/25 5/{{ModId}}_TestObject/f Emily 3/" I also tested this, same result

uncut viper
#

(i might be remembering a different convo with sinz then, i dont remember that one SDVpufferthinkblob)

velvet narwhal
#

i was actively in that one, that's probably why it's burned in my memory

uncut viper
rancid temple
#

It's possible they weren't waiting long enough

#

There's a 2 day lag before the next mail comes in

uncut viper
#
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

blissful saddle
#

I am more intrigued to what causes the day lag

uncut viper
#

so im confused how its getting past that

velvet narwhal
#

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?

finite ginkgo
uncut viper
#

but it will still check for and send "CarolineCooking"

#

bc "Caroline" is whats written in the recipe

thorny tiger
#

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'.

uncut viper
#

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

velvet narwhal
#

uh, are you using the internal name or the "Name"

rancid temple
#

It should be the key you used for your object

uncut viper
#

(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)

velvet narwhal
#

cause iirc you have to use the "Name", which is why i had to do a little reworking

rancid temple
#

Actually, looking at that code, if the mail flag wasn't reset, even higher heart levels wouldn't work

velvet narwhal
#
      "Entries": {
        "{{ModId}}_Khanjar": {
          "Name": "{{ModId}}_Khanjar",``` yeeuhp
rancid temple
#

I think the delay is being caused by that mail flag being removed the day after

brittle pasture
finite ginkgo
rancid temple
#

Mail flags are goofy as hell

#

There are so many that get added and removed

lucid iron
#

are there any mods with light source relatde features

velvet narwhal
#

uh, furniture framework

#

the only one i can think of off the top of my head

lucid iron
#

i want to know how light source textures work think

thorny tiger
next plaza
#

Colored lights and custom texture support for map properties

velvet narwhal
#

(i was about to say i remember casey talking about lights at some point)

uncut viper
#

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)

thorny tiger
#

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

blissful saddle
#

So, in the matter to update the original Spoilage, someones can enlighten me how to:

  1. check if a given Location from Game1.locations is buildable?

  2. 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

velvet narwhal
#

"Warp Totem: Artificial Beach": "709 1 340 1 771 20//{{ModId}}_WarpTotem/false/none/{{i18n:Edelweiss.Warp.Totem}}"

thorny tiger
#

should be optional

#

works without it for the cooking recipe

velvet narwhal
thorny tiger
#

going to full restart incase patch reload just isnt doing it

#

but ireally dont see anywhere there could be an issue

thorny tiger
#

having some fun

calm nebula
#

The display name is optional

#

It defaults to the display name of the first item to craft

lucid iron
thorny tiger
#

actually no you probably will

velvet narwhal
#

is it a missing include

#

cause i do that 9/10 times

thorny tiger
#

no im all on one file at the moment because im too lazy

blissful saddle
thorny tiger
#

will use include at some point before starting my real mod

#

instead of Data/CraftingRecipes

#

get this

#

i typed

#

Data/CrafingRecipes

lucid iron
#

Take a look at chests anywhere code

#

For finding chests

velvet narwhal
#

i'm surprised smapi didn't yell at you for saying "Data/CrafingRecipes doesn't exist"

lucid iron
blissful saddle
# lucid iron Take a look at chests anywhere code
        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

lucid iron
#

I thought u wanted to just write whole new mod

blissful saddle
#

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

thorny tiger
#

alright it works and the recipe also works

lucid iron
#

Is BuildableGameLocation still a thing think

#

You have the decompile game right

#

Iirc there's a foreach location method

blissful saddle
#

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)

lucid iron
#

ok i found it

#

Utility.ForEachLocation

thorny tiger
#

ok im so done for today

#

mining tomorrow

lucid iron
#

this iterates the building interior locations too by default

#

so u dont need all that

brittle pasture
#

Doesnt the game have a for each chest helper now

#

so you can yeet like 90% of that
(unless I misremembered lol)

lucid iron
#

i didnt find such a method bolbthinking

#

maybe not looking up right names though

#

but ForEachLocation is basically there, just gotta iterate the objects in each location and look for chest

finite ginkgo
#

There's Utility.ForEachItem which includes items in chests

lucid iron
#

can u know what chest an item is in

#

from the item

brittle pasture
blissful saddle
brittle pasture
#

in that case the each location loop is probably better

calm nebula
#

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);

blissful saddle
#
        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?

lucid iron
#

i hope you are using git MedStare

finite ginkgo
#

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);

blissful saddle
blissful saddle
#

I copied the original and changed what I saw

lucid iron
#

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

blissful saddle
#

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

pallid kayak
#

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 :')

lucid iron
#

the heater's animation is just scales

brittle pasture
#

I think they're talking about changing the wobbling during winter, which is not tied to machine data and hardcoded

lucid iron
#
case "(BC)104":
    minutesUntilReady.Value = (location.IsWinterHere() ? 9999 : (-1));
    break;
#

Object.cs

pallid kayak
#

ah

pallid kayak
brittle pasture
#

welp I'll be darned, it's only sorta hardcoded

#

no you can change the anim

lucid iron
#

yea i think u just need to give it a bogus machine entry

#

then u can set WobbleWhileWorking

pallid kayak
#

i tried doing that it still wobbled

brittle pasture
#

post your code?

#

(Note to self, avoid making authoritative statements about the game code while on the phone at work)

pallid kayak
#

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

lucid iron
#

do u have to use Entries instead

brittle pasture
#

does Fields work if there's no entry?

pallid kayak
#

:') that's where i get lost and stop really knowing what i'm doing

brittle pasture
#

Data/Machines doesnt have an entry for (BC)104

#

And Fields is for editing existing entries

#

just replace it with Entries should work

pallid kayak
#

ohhh so i can add an entry?

brittle pasture
#

yes, change Fields to Entries

pallid kayak
#

okay

#

thank you both so much that worked!

lucid iron
#

so does this mean you can put like

#

working effects on heaters

undone hawk
#

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

hallow prism
#

i don't think FTM can target all maps

#

CP might

rancid temple
#

You should be able to add the forage to the default location entry with CP