#making-mods-general
1 messages · Page 223 of 1
Finally, Better Chests. The first android exclusive mod.
while i love ca, i genuinely feel like an idiot trying to figure out where he does things 💀
Maybe I'll make that workout tracker in android smapi
I have been bitching that there isn't a workout tracker I like
i aspire to be able to do this sort of thing on a whim
Learn C# first (or any programming language really)
Here's the thing. Knowing how to code well in C# is an entirely different skillset than knowing how to essentially reverse engineer someone else's code.
After that it's really just using a specific set of libraries
It's something I'm pretty well-practiced in since I've had to take over codebases at my job, and it's always a pain trying to understand what other people's intentions are.
i mean i know c# but reading ca’s code makes me want to fall down and not get back up 😭
yeah
It's like you have to understand, wth they were thinking when they wrote that
I have Strong and Vaguely Justified Opinions about code style so i trip over other people's code a lot
parsing his code makes me feel like a beginner bc im like Huh. What. How
Not all of SDV is CA's code, that's part of why it's sometimes so hard to understand.
(not the entire reason why, but part of it)
And there's ppl out there with a equally Strong set of opinions completely opposite of mine
Sometimes it's difficult for me to understand at my own code after not looking at it for long enough
me hanging out in Game1.cs like 😼
I don't have opinions about code, only stone cold facts.
Game1.cs is apparently a big ol partial in the real source
The fact that u r read decompile further complicate things
*big ol partial as in, it's several presumably more organized files
Each supplying some portion of Game1
A bunch of stuff in the Stardew decompile is way different from the original code, because the compiler Does Things™️ and there's no good way to decompile that back into what CA actually wrote
Game1 is undoubtedly a lot more readable in the original source, but methods like Update and pressUseToolButton are special in and of themselves.
you’ve heard of Game1, now introducing… Game2
Like, it does crazy weird optimizations for some switch statements on strings, as an example
you can call me out by name if you want
You never gave me the impression of having particularly strong opinions on those things.
not sure I hate that more or the string interpolation
on code style? i do. it just rarely comes up because I'm rarely working in someone else's code
Ohhh you missed the snarky
String interpolation in the decomp is way better now that I pushed for updated ILSpy
No i think u r fine button 
I am not fucking making a workout tracker in android smapi
button makes me feel silly sometimes abt code so u just havent witnessed it 🤣
oh my god i thought you were serious and possibly deranged
||its casey, spacecore very scary and doesn't use nullable||
I misread that as "workout tractor" and was just confused.
Well, some of us do chafe when we see things like ridiculous indentation patterns, don't know if that's you or just others.
can't believe atra finally came back from retirement to make an android exclusive workout tracker mod 
But that's not really "code style" so much as... I don't know, like making your bed?
me indenting five hundred times
Would you say that they... push your buttons?
NO i’m just intimidated by button 😭 also hey button whats good
until I do a deep dive into trinket tinker source code /j
howdy hey
Don't look at my generic crimes idk what a oop is anymore
i try not to be intimidating it just clashes with my also strong opinions on how people should answer questions/teach new modders is all
speaking of android, if hypotheticaly I have to reference an android-specific function for an android-specific patch would I need IL so the compiler that builds against the PC version doesn't cry and beat me up
Allow me to introduce my innovative new way to indent my code ```cs
static int Fib(int x) {
if (x == 0) return 0;
int prev = 0;
int next = 1;
for (int i = 1; i < x; i++) {
int sum = prev + next;
prev = next;
next = sum;
}
return next;
}
Of all the people here, I think Pathos has the weirdest code style to me. Not weird as in inherently bad (it is style after all), but unusual and foreign.
I’m crying
(or reflection)
If you want to compile once run everywhere then you'd need to dynamically do things
How long did it take for you to format that?
Reflection or just write in a way that works both sides yea
Reflection or conditional compilation and multiple releases.
It would be more zenful if it was all center aligned
I'm pretty serious about the workout tracker I'll just learn Java for it
It's not difficult to read, but style and readability are different things. Enforcing pascal case on private fields is an... unusual style.
I can't imagine doing 2nd build just for phone
Not that long, I just right aligned everything to a width of 40 and then subtracted. But that's also a very short method, lol
No offense to pathos but i don't like how I gotta pass something through 5 constructors bc pathos uses very little static
Haha, you'll have to blame me for that too.
That's probably related a certain belief in limiting the surface area of dependencies. It's not so bad if we had a good DI framework to handle all of that stuff.
I find statics fine in mods but stay far away from them in framework/library code.
im glad no one looks through my repos enough to know what they don't like about my style and vice versa with me and theirs, ignorance is bliss 
And they're fine in mods because (a) they're generally siloed (if you reflect on them, that's your problem, not mine) and (b) everything they do is single threaded.
i just find it easy to read that’s all 😔idk abt anything else
im not Built like you guys….
youve made AMAZING mods btw i need u to know ur a legend
Just think about reading and understanding anyone else's codebase is like exercising that skill
That's ultimately what it takes to become an effective C# modder, imo
It comes into play more when there are actually multiple contributors... there's no point in commenting on code you're just reading.
i stand on the shoulders of giants or however the saying goes
Yeah i wouldn't worry too much about nitpickings
I snoop on everyone's repos
It's a game mod, make it work first
consider me at level 1
Pretty comes later
That goes for any codebase tbh. I can't count the number of times I've had to go to an OSS repo at work bc something didn't work the way I needed it to
static int Fib(int x) {
if (x == 0)
return 0;
int prev = 0;
int next = 1;
for (int i = 1; i < x; i++) {
int sum = prev + next;
prev = next;
next = sum;
}
return next;
}
ive read atra’s code, i found it slightly more difficult to parse but i could understand it well :’D

i like everyones code ur all clear coders muah
Very Mindful, Very Demure
(am I doing that right?)
It's centered but not indented; you need to half-indent.
It's almost poetic
abt to change my vs font to be obnoxious cursive for the real coding challenge
challenge: code a mod in wingdings 🏌️
Well, one good thing about centered code is that you don't need to use a monospace font.
My VS is rainbows and ligatures, and I know some people would hate that
plsno atra I steal so much code from you
atra noooo ur fertilizer …. i want to read it….
I'm glad my professional side is on gitlab
𝓼𝓽𝓪𝓽𝓲𝓬 𝓲𝓷𝓽 𝓕𝓲𝓫(𝓲𝓷𝓽 𝔁) {
𝓲𝓯 (𝔁 == 0)
𝓻𝓮𝓽𝓾𝓻𝓷 0;
𝓲𝓷𝓽 𝓹𝓻𝓮𝓿 = 0;
𝓲𝓷𝓽 𝓷𝓮𝔁𝓽 = 1;
𝓯𝓸𝓻 (𝓲𝓷𝓽 𝓲 = 1; 𝓲 < 𝔁; 𝓲++) {
𝓲𝓷𝓽 𝓼𝓾𝓶 = 𝓹𝓻𝓮𝓿 + 𝓷𝓮𝔁𝓽;
𝓹𝓻𝓮𝓿 = 𝓷𝓮𝔁𝓽;
𝓷𝓮𝔁𝓽 = 𝓼𝓾𝓶;
}
𝓻𝓮𝓽𝓾𝓻𝓷 𝓷𝓮𝔁𝓽;
}```
YESSSSS so coquette and mindful
I respect your life choices but no
That's not really cursive, what is that Brush Script or something?
me when i code
I got a shirt from them back in 2018 when MS bought GitHub that says "I used GitLab before it was cool" lmao
tbf I'd more hate it for being VS
To everyone here worried that their code might have been read, I'm here to tell you you no longer have to worry
Because I most definitely read it
I mean I do occassionally refresh the mod dump
selph if you've never brought it up then I'm just gonna have to assume that means you were so in awe of my code that it left you speechless
real coders use eclipse
real coders use 3 different IDEs and a bunch of terminal windows
i used eclipse once maybe 13 years ago and wouldn't recommend the experience
I would rather use vi (literal vi, not even vim) than Eclipse.
I see you're spying on me at work
(It's possible I have VS, VSCode, Notepad++, and Rider all open right now.)
You've heard of camelCase and PascalCase, but have you heard of igPayatinLayaseCay. (Pig Latin Case)
ah Eclipse my bel-, well, you were there
are you counting npp as an ide or a terminal window there
I have been using VS and VSCodium side-by-side lately just because there are some things that are nicer to edit with VSCode extensions
neither beloved nor beloathed
I use vim at work
I wonder why kebab-case isn't a more popular coding style.
Particularly markdown is a much more pleasant experience in VSCode
||we have nothing else installed||
I wOnDeR wHy ThIs IsN't A mOrE pOpUlAr CoDiNg StYlE 
hey thats that spongebob meme!
atticstay intyay fib(intyay x) {
ifyay (x == 0)
eturnray 0;
intyay evpray = 0;
intyay extnay = 1;
orfay (intyay i = 1; i < x; i++) {
intyay umsay = evpray + extnay;
evpray = extnay;
extnay = umsay;
}
eturnray extnay;
}```
also re: terrainfeatures holding mod data, is that………. what did you mean by that
i May be silly
I hate you
It just keeps on getting worse
We are gonna stop using mod manifest builder if you keep that up
modData is a string-string dictionary that can hold whatever custom data you put it in
oh!
Gibberish next
okay swag thats what i thought, just had to make sure
They are sync'd in multiplayer and per instance of crop (or whatever thing)

It's convenient
yippee
Khloe is obviously very bored right now, somebody file some bug reports on Better Crafting to brighten things up.
its purpose is to allow mods to store any data they want without having to deal with serialization/mp syncing
Hmmm
I'm waiting for a very big project to compile lol
There is that whole unsolved mutex thing...
... what unsolved mutex thing?
aren't you supposed to be foam sword fighting on office chairs when waiting for compiling
Isn't ticking chests in unloaded locations for farmhands still a white whale?
OH oh that reminds me too. what feels more legible when appending the tier onto seeds? example is for silver star seeds
“Silver Turnip Seeds”
“(draw actual silver star) Turnip Seeds”
“Level 2 Turnip Seeds”
“Turnip Seeds Lv2”
That's why I have spooky action, to force some things to tick
or maybe “Turnip Seeds (Silver)”…. ergh i dont like that one
My answer to that was to just make them global
fourth option doesnt mess with sorting, I think
How many Tiers Do you have?
Do objects normally represent their quality in the display name?
Foam swords are a myth. Goating is totally real, though.
(That was a reply to Button above)
but for these seeds to signify visually what they can grow, i felt i needed a universal indicator of some kind
is the star icon not that indicator?
normally its just a symbol in the corner, If you can draw a silver star i think that works best
If only there was a way to signify that a message is in response to another one... If only... /lh
Yes, thanks for the tip. If only there were a way to do it retroactively, after the message has already been typed, which there isn't.
you've heard of "no ping on reply please" but actually i fall under the "no reply to me at all please" camp. focustense was lucky
Make informat compat maybe?
(/j)
you could technically delete the old message and reply on the repost. 
yeah i was thinking i’d have to do informant compat
My preference is that anyone who wishes to address me tags everyone, but this server doesn't allow that unfortunately
You've heard of no-ping, but what about only-ping?
or add an item that lets u see quality of a plant when equipped…. haha….
i think if i had to choose one way to force people to be consistent about it i would actually choose only ping
magnifying glass rune factory i love you…
I have seen people with always @ me, in their name
That seems like something that would be useful on hover info description, or maybe even as part of UI Info.
(That's a riff on onlyhello, btw, but I'm not obnoxious enough to actually do it here)
[at]everyone.filter(x => x.name.contains('Matt')) nice
I'm a reverse no-pinger - I almost never reply ping people
I've been considering putting "Please ping me, I have ADHD" in my profile 
Good news, that thing finished compiling so I can theoretically do work now
(That is also bad news)
Ah, another one for the "I am checking Discord while I wait for my work task to run" crowd?
Hate to be on topic for a second, but the vanilla Machine data model only supports a single drop, does anyone know?
Does it not do random item ids
Hi
Random picks one from the list with equal chance
so dont add the item or do
Yeah, it can do that.
how does the seed maker do it? pretty sure there's some non-equal chance going on there
LFL uses it.
was mostly some sort of “vanilla” failsafe in case someone doesnt have uiis or informant installed (which is a very low amt of people)
eh fuck it informant/uiis now necessary
Seed maker is c#
The SeedMaker is not in Data/Machines so I'm guessing it's C#
Yeah that's fine. This mod was a PFM mod but I'm trying to update it using only CP and vanilla data models.
So I guess it's getting nerfed.
rip
it is ye
hehe…. i would know….
😎
I think you're telling me we need a weighted item query
finished my frog mod, now I need another project...
too bad I don't have a big project that I'm avoiding my rewrite of
you can do weight with machines, the output supports multiple entries where one gets picked
so have one with RANDOM: 0.3 or something
Yeah, outputitems can do that, but the field within an output item has RandomItemId which does equal chances
Didn't you already have a bunch done on the UIIS rewrite?
@tawny ore yk what I miss? I really miss the filter you had in BetterChests where only certain items could go in. Convenient Inventory just doesn't have the same type of thing, it only works with stuff that's already in the chest
I thought there were even screenshots and stuff.
right
I had that thought about a weighted item query before, when I was making a version of LOCATION_FISH usable in machines for MTF
106 files changed, 7378 insertions(+), 3374 deletions(-)
So... I started working on a mod that did just that, and I'm having a coders block because I'm stuck on what I want the UI to be
I'm not sure whether to interpret that as high or low in your opinion.
just steal the UI from one of the various minecraft pipe mods, of course
right now you can use the weighted, location-accurate version which will only ever return one item (meaning you can't do filters on it), or use the unweighted version which returns every fish, but you can filter it
theoretically you can make a weighted item query by stuffing the output with duplicate entries, but wehh math
I still say think about getting away from the infinitely nested boolean search, it's more of a programmer's curiosity than an end-user feature. 99% of use cases can be solved with a filter that is either purely additive or purely subtractive.
Yeah I don't plan on recreating that
But I don't know yet what I do plan to create
I want something better than individually selecting items
Make users learn sql
make users learn linq
Ah, fair enough. For me one of the challenges is always the iconography, there are no icons for things like categories or context tags or whatever and SDV is heavily dependent on that kind of visual style.
But not as convoluted as a whole search parser which is what the last one did
give them the ITEM_ GSQs
as long as someone's doing it lol, I was going to tackle it if no one else did
If you're willing to go for just text, though, it seems fairly straightforward.
cant wait to store my fish "; DROP TABLE Fish" in my fishing chest
An earlier version of filtering was literally just search text, and I got a flood of complaints that it was confusing and not flexible enough
I wouldn't do just search text, yeah. Item categories would be a start. Context tags are likely a bit mysterious to players since they don't have friendly names, but they are very useful for that type of thing.
tbh the best option that will guarantee you maximum nexus user satisfaction is probably a manually curated category screen
text scary
You can probably do a hacky category thing by just picking a representative item from that category and displaying it as an icon (and don't even bother with a name, since categories technically don't have them; you could add manually-named tooltips but if a mod adds its own category then that'll break down)
idk either way it's just a lot of thinking about how I want everything to mesh together that's the burnout part for me.
the point was more like I've already been gutting the thing lol. more than half the new modules are done, just agonizing over how to do some parts in a way that'll make me feel good about maintaining it because right now there are parts from like 1.3 that haven't been touched in years
That's what I'm basically thinking is there needs to be a visual (UI) way to select things like category, quality, etc.
Various item properties
I don't get a lot of complaints about the filtering rules in Better Crafting but I"m also not sure many players actually do anything beyond use the defaults.
But that's what I'm stuck on is an intuitive UI for that
The only custom one i use is "not yet crafted"
Personally, I just throw away and rewrite the old crap, like my last release.
266 files changed +14629 -7383 lines changed
I split them by mod (which I just use text search)
It would be nice if that updated as i craft things but not big deal
Don't know if that's inspiring or demotivating.

I rewrite my mods all the time, but that's only because an idiot wrote them
For chest filtering i think category + quality gets me a long way
your past self is seething rn
Then maybe uh, mod id prefix?
honestly this isn't a terrible idea. I'm thinking about one where you'd have a filter "item" and add things to it, and different filters could have different settings.
Like click "add filter" -> "add option" -> "sell value" -> "> 500g"
and compose them that way
So i can put my wag butter in a different chest than my cornucopia butter and a third chest for my vmv butter
sometimes when i look at my old maps i was like, i was so proud of that, but its eh when i look at it now.
Meh, in my case I don't think an idiot wrote 0.2.x, just someone who was still pretty new to modding, and doing it when there were fewer tools around for doing it "right".
But wait, don't you want a chest filled with just butter?
No that'd be confusing they r all called butter
brb, I'll just make AE2 for SDV
I thought about doing that
More seriously these big artisan good mods tend to have like
but then automate and better crafting existed
Their own system of recipes
you never know when another Butter crisis might strike
What is AE2
I mean... tell me this storage doesn't make sense to you?
Applied Energistics, very popular minecraft mod, been around for forever
very fun
also the code for it is some wizardry
And it's super easy to setup too
Yeah you can do a ton of good with just a few toggle/option/dropdown buttons, starting with category and quality. Maybe later add some bespoke filters like "food items" or gift tastes.
275k ender pearl 
not enough ender pearl
Amateur numbers
started running low after their farm turned off, i guess
random thought - just copy factorio and implement logistic junimos
i thought that was Junimatic
oh I've thought of something that bothers me that I can make a mod for
Logistic dorf sentries
(ive never tried junimatic)
unless it already exists
Little dorf bots that carry stuff
Junimo Hut Sprinklers
junimatic is just the "bring items to/from machines" part of logistic bots
Do they just walk around and spray everywhere?
Where is that liquid coming from, and is that water?
no, like they water the area around the hut because they fucking ALWAYS screw up my sprinkler layout
its grape juice
When my vaporware starlog is done I'd like to have little Joja drones or Junimo carriers depending on the path.
Not functional or anything, just to add some flavor as the amount of shipping ramps up.
I'm imagining a system where you don't care which of your 13 chests you're putting your 3 butters, just that they are present somewhere, and a junimo can dig them out and give them to you on demand
I'm on github looking at the applied energistics 2 code rn and it's still just as fucking crazy as ever
While you're at it, they should also scare away the birds too
oh trueeee
Also they should only take up 1 tile.
brb making every junimo hut a pocket dimension
Are you just making Junimatic with a few more steps?
Junimatic should become a framework so that you can code those guys to do your bidding
that's better junimos
fuck
they water, they hoe, they shake fruit trees, they plant seeds, they even grow and chop trees
personally I don't use it anymore since it's a bit too much, but the option's there
This is starting to sound a little disturbing.
Ah, ComputerCraft for Stardew. Computimos?
SDV as an RTS using Junimos, when?
can't break game balance, I said as I vroom around in a tractor
Compact Machines is just a shed definitely
that's better junimos again, it has a framework to make your own addons
every day I battle against my own laziness to not just use the tractor in the skull caverns
well not quite, since it's only hut junimos
I usually turn on all the SVE stuff to make the game harder to compensate, along with mods like Challenging Community Center
I do timed mod installations so that I don't skip the early grind
the only "cheaty" mod I use are Junimatic, Tractor and Time Speed, and it's mainly to reduce late game tedium
How do you go about adding i18n for the config/what shows in gmcm? Someone asked for translations of that for my fence mod
I did always wonder how harvesting could possibly make sense
do you mean for a CP pack?
I play Stardew like I play Minecraft, I pick an enormous farm map and fill it with as much shit as I possibly can, so TimeSpeed is necessary just to be able to complete a day while still being able to plant my seeds lol
sorry, yeah, selph's link
(unless you werent sure how to do i18n in the first place, in which case, both links
)
I don't have much farming space, time speed is more so I can experience more of the expansions' content
even then I only add 2 extra seconds
I have CJB Cheats solely for the purpose of 2x walking speed
aka time everywhere's the same speed as in the skull caverns (which remain the same)
Although I have done cheatless playthroughs where I just have to constantly drink coffee to get my desired speed
Just like irl
(I use Faster Path Speed and bump up the base speed a tick, when on my maps at least)
I may or may have not made FFP's competition solely for an immersive method to give myself permanent +1 speed late gate
I'm not big on using teleportation much other than farm to/from island, so I typically bring my horse everywhere anyway
A lil follow up on this, because I don't want to step on any toes... so say instead of replacing Clint, I have a mod that introduces a new NPC, what's the vibe on adding dialogue to other NPCs added from mods (i.e. SVE's Susan) that talk about the new character? I think it would help immersion but adding dialogue to someone else's character might be frowned upon?
yes, always check permissions
I think flashshifter's perms for SVE is fairly open?
That's funny. This is why I have the frog and bunny rings
so I think you can for SVE's Susan, but don't take my word for it, and check the others' permissions
Got it, I'll check. Thanks!
OUUUUU im so excited to postfix after work i’m so excited
i know exactly what i have to do and that makes me pleased as cheese
(i say this and then as soon as i get home i will suddenly forget how programming works)
I forget how it works like 10 minutes after i remind myself, its why i struggle with it so much i think, my memory is amazing at concepts, bad at definitions and specifics.
so excited i said i was excited teice
literally me too
once i have the proper variables i can plug it into my logic but half the time i write code in my head like “if this is true, set that value” but i dont know what This or That explicitly is when i think it
actuslly thats an easy statement nevermind ignore that ik what that is 😔😔😔
My brain is also really good at spacial mapping, mazes, structural layouts, that kind of thing, probably why i took to mapping like a fish to water.
yeah your maps are NUTS
i cant map worth a damn unless its uniquely square
and then when it comes to decor, i have a bad habit of sticking everything in corners
i cannot fathom the idea of something being in the middle with no barriers
I have a bad habit of planning out these immense systems while I'm doing something else and not programming, and then forgetting key details when I actually sit down to work on it... largely because ADHD brain is mad at me having to type stuff out cause it's like "I already did this why am I doing it again"
mood
i planned out the crop quality overhaul thing at work on scratch paper like a madman
Yeah, ADHD brain is like arguing with a toddler trying to get it to do chores, except its your own brain, and you want to get it done, but have to convince your own brain of that.
drastically overcomplicating it in prose but in code its like “check this… uh huh… ok assign”
I didn't ask to be tagged here
and then sometimes the toddler gets obsessed and only wants to do one thing, and will throw a fit if it doesnt get to do it.
@latent mauve #making-mods-general message pinging you bc of this message since it's part of the same convo. I just realized how many checks it would be to check if one shop is open (seed shop) that I assume it would be better to just to make the dynamic check now. Though I have to admit this is very confusing as I am still very new to modding this game, and I don't understand how the game works internally. I'm unsure if you guys are suggesting the same thing. I will assume you are right now, but if I'm wrong, please let me know. This is the psudeocode I have rn. The comments with 3 / are things I'm confused about. Apologies for the abundance of questions, but I feel lost with what I assumed would be a simple thing to do.
public static bool ShopOpen(Dictionary<string, ShopData> shopData, string shopId)
{
ShopData shop = shopData[shopId];
//todo find all OpenShop tile actions in the game, check whether they are behind locked doors
///what exactly are OpenShop tile actions? I tried look at perform action through the code, and I don't understand it
//todo if they got no conditions or an open/ close time then great thats it
/// but how do I check if a shop is open? I'm looking at the "SeedShop" object, and I don't see any condition variable in that specific object. But I do for "Owner"
if (shop.Owners.Any(owner => owner.Condition)) ///how do I make to make this string a bool?
{
}
//todo if they got a npc rectangle then you need to do the fun business of figuring out when the npc will be there(using schedules) and whether they would be valid owner today
///how do I parse the schedules to make sure it's the correct day and time?
///wdym by "valid owner"?
///I figure an npc rectangle is position of the npc, but how I check 1. who the correct owner is 2. where that exact spot is (besides trial and error)?
return false;
}
[[modding:maps]]
OpenShop is a tile action used for modded shops to open a shop
Vanilla shops don't necessarily use these: they often have CarpenterShop and such instead
For the purpose of your mod, are you trying to know the locations for every shop?
I know from earlier that you want to know if they're open, and what they have in stock, right?
Currently I am trying to get all the shops that sell a specific item (parametrized) and then filter out the shops that are closed at the game's current time. I then want to know which one sells the item the cheapest, which I can do simply with a linq query
Okay, so for that you probably don't need to know the tile action necessarily
The tile action is what launches the shop when the player clicks on that tile
The tile action can have open close time and npc rect though
Going from a tile action to "is this map accessible at this specific time of day" sounds horrible, lol
Which determines whether shop's open
Honestly if i was doing this mod i'd skip part where i check "can player go to the tile"
flood filling time 
Ah right, you can include the times in OpenShop
I was thinking that only accepted a shop id for some reason
Graph theory beckons thee
Unrelated to the current discussion, but just for my future knowledge if I decide to see how far I can go with just CP and Tiled to make a post-perfection farm based on the unused content in 1.6.9: is there an easily accessible token that returns the player's exact current currency?
I know there is a GSQ looking for if it matches between a provided min and max but that's the closest I could find
Yeah, I didn't either, which is why I was wondering if anyone knew of one that I just missed or that wasn't documented somehow
I currently don't have a modded shop in order to test this, nor do I plan for the first version of my mod to support modded shops. I would preferably like to focus on vanilla for now, and then maybe I can add support later. I'll move on to the "owner" condition, though I'm confused on what those conditions even mean as I'm unsure hy some shops have multiple "owner" objects.
The Owner name is usually the most important thing there, I think. If there is an actual NPC name there (or Any) and that is the current Owner block that is being used (has a Condition that returns true), then that's where the NPC rectangle comes into play
AnyOrNone means you can disregard the NPC rectangle
so these are the owners for the seed shop. With on name being "None" and the other being "Pierre". Do I just ignore the "None" and just focus on Pierre's location to check if his shop is open?
None is what is selected when the shop is closed
Ok, but where is current owner set? Currently I just have access to ShopData object that shares the shodId. I assume I need another object to know who the "current owner" is, but I'm unsure of what that is. I looked at SeedShop ShopLocation and didn't find anything relevant there. That leaves me with GameLocation, and the only thing I see that may be useful is performAction, but from what I'm understanding from previous messages, that not what I want. Or it's a lot of effort in order use it
Look at Utility.TryOpenShopMenu
A lot of the places where a shop is opened ends up calling that, and it includes some owner logic
Are you messing with tools? 👀
New mod idea, Super Hoe. I don't know what it does yet, but I just want to call it that.
You can use hoe to do everything
Hoe down tree hoe that rock hoe your spouse instead of kiss
-# Netherite Hoe
no-
i mostly meant hoe as in "the thing i am working on"
slang is such... an interesting thing
but no im about to postfix crop.cs and hoedirt
ok, coders
cropQuality = MathHelper.Clamp(cropQuality, data?.HarvestMinQuality ?? 0, data?.HarvestMaxQuality ?? cropQuality);
the data prefix... what is it. do i need to include it when i set HarvestMinQuality?
look above that in the code to find where the data variable is being assigned
presumably just a call to crop.GetData
ah
i dont know which method you eventually decided on, didnt matt (or someone?) suggest simply postfixing GetData
so when i do this i stil prefix it with data? or do i just...
???.HarvestMinQuality = 1;
???.HarvestMaxQuality = 2;```
Yeah you can basically change the data it returns so that you override the Min/Max quality
that was before the getdata suggestion i think
So instead of doing (whatever min/max) the data model would normally return, you just reassign it to the desired values.
but yes if you were to transpile crop.harvest you would need the data part. "HarvestMinQuality" doesnt exist on its own, its a property of the crop data
but you should just postfix GetData in all likelihood
look at Crop.GetData()
you can change what data is before Crop.harvest gets it
or what the values inside it are
within Crop.GetData() you have access to the crop, its Data/Crops data (obv), and the HoeDirt that it is on
i dont remember what you were doing to track what quality seeds were planted
What I didn't account for is that GetData is on the Crop and Crops don't have mod data
(just brainstorming but I wonder if it's "better" to return a new instance of the modified crop data instead of modifying in place. I know ultimately it doesn't matter and modifying in place is better performance but it still feels weird modifying what's supposed to be read only data)
So we're back to thinking about how to remember the quality of the seed planted
wdym crops have mod data
HoeDirt does though

oh and yeah so do Crops
Oh you're right crops do, oops
now im concerned
its only "read only" because the code doesnt modify it before returning it, though
theres no good reason it has to be read only
No but you're modifying the original instance and actually changing the data
I had thoughts about this too
are you? i was under the assumption it was making a new CropData
further down the line
uh
i didnt look into it too far
i dont know what im even doing if im being honest
LMAO. so i dont know
i mean, i do know what i want to do, i just am a little foggy on the ... "proper how"
Something like this:
private static void Crop_GetData_postfix(Crop __instance, ref CropData __result)
{
if (!__instance.modData.TryGetValue("YourMod.Id_Quality", out var quality))
{
return;
}
switch (quality)
{
case "Silver":
__result.HarvestMaxQuality = 1;
__result.HarvestMinQuality = 1;
return;
case "Gold":
__result.HarvestMaxQuality = 2;
__result.HarvestMinQuality = 2;
return;
case "Iridium":
__result.HarvestMaxQuality = 4;
__result.HarvestMinQuality = 4;
return;
}
}
i thought that was why previously planted crops wouldnt benefit from patch updates, but i might be misremembering that
Where you've already saved mod data to the crop for your quality, and depending on that quality you're changing the min/max to whatever you want the crop quality to be
No, some of the data is backed into the crop instance
But getdata refers to the single global data instance
yeah when you change cropdata for one you'll change for all, that's why I'm worried
even though ultimately it probably doesnt matter
You're right, this is using Game1.cropData so you should clone
oh... maybe my confusion is just carrying a misconception from when i did something similar for GiantCrop
which does just call DataLoader every time lmao
how would i clone
Would it be a sin to DeepClone here?
It's still the same instance if you call dataloader
tbh I think you dont have to worry about it for now and work on getting your postfix on GetData working first
bokay
I mean if you want to clone, you can do this, but I don't know if that's bad:
private static void Crop_GetData_postfix(Crop __instance, ref CropData __result)
{
if (!__instance.modData.TryGetValue("YourMod.Id_Quality", out var quality))
{
return;
}
__result = __result.DeepClone();
switch (quality)
{
case "Silver":
__result.HarvestMaxQuality = 1;
__result.HarvestMinQuality = 1;
return;
case "Gold":
__result.HarvestMaxQuality = 2;
__result.HarvestMinQuality = 2;
return;
case "Iridium":
__result.HarvestMaxQuality = 4;
__result.HarvestMinQuality = 4;
return;
}
}
what is "deep clone" exactly
Makes an identical copy so that you can change the harvest quality without affecting all crops
is this a harmony thing
no
damn they aint go over this in college 😔 but ok noted
(dont overuse it)
There's a "cost" to doing deep clones and it's easily abused
so to further complicate this, if i wanted to calc quality based on farming level, will the game still do that? it'll just clamp the values in Harvest later?
Most of the time I've seen people use DeepClone here in making mods, it's been the wrong usecase
like this is just a check to see the seed type
and then it fixes the crop quality
right
or seed tier whatever the wordage
This patch is trying to manipulate this calcuation here
Because it'll get the data, then apply that calculation which forces it to the quality you want it to be
the only time to date I've gone anywhere near deepclone it was for an earlier attempt for map caching because maps are mutated so heavily a cache needs to be deep cloned to not be mutated itself
Only I sort of mislead you because GetData is on the Crop instance, so it's probably better if you assign quality to the Crop's mod data instead of the hoe dirt.
assign the seed quality?
@tawny ore a custom bush isn't a TerrainFeature right? since it doesn't exist on HoeDirt?
just to be stupidly clear: we assign the seed quality in the crop's mod data, right
a bush is a terrainfeature of type Bush
So when you plant the seed, there is no mechanism for the crop to remember what quality it was. You need to store that somewhere.
No CropData is a shared thing by all crops of the same type
You need to store it on the mod data for the specific crop instance
Crop modData, not to be confused with CropData
thank you for that button i thought i was just stupid
LMAO
okay okay okay now i can cook
Look at HoeDirt.plant that's when the Crop is created, and it's the last time you'll know what the seed quality was (is when that's called)
i have great temptation to name mod StardewQL despite lack of desire to actually make SQL in sdv
ok swag
modData is data tied to instances of things, CustomFields is data tied to the "blueprint" of that thing.
For stuff that doesn't do instances like a Location or something, the only other characteristic between them is CustomFields is mutatable via asset pipeline directly and so content patcher can do it
locations do instance tho
entries in Data/Locations don't have multiple instances*
i shall cook the rest of the way and return if i have questions
thank u for the start
that's what I thought... but the farm computer isn't reporting the cornucopia grape bushes as crops ready in the greenhouse
and the farm computer supposedly iterates terrainfeatures
I'm assuming FarmComputer works for Tea Bushes
it does, and checks that they are HoeDirts
Does it?
/// <summary>Get the number of crops currently planted in a greenhouse within this location.</summary>
public int? getTotalGreenhouseCropsReadyForHarvest()
{
if (Game1.MasterPlayer.mailReceived.Contains("ccPantry"))
{
int amount = 0;
foreach (TerrainFeature value in Game1.RequireLocation("Greenhouse").terrainFeatures.Values)
{
if (value is HoeDirt dirt && dirt.readyForHarvest())
{
amount++;
}
}
return amount;
}
return null;
}
Looks like it's only checking for HoeDirt, and not other terrain feature
is that in response to me bc thats what i said isnt it
What I'm saying is that this logic wouldn't count tea bushes, and thus wouldn't count CustomBushes either
Since CustomBush are just modded tea bushes
don't mind me I'm just blind... I read terrainFeatures and then stopped reading.
either way, mind if I make a PR for it? it bothers me
So that's why because it's hardcoded to HoeDirt
I need to know when my grapes are done
I don't have any more releases planned for the 1.x branch of Custom Bush since it's relatively "stable" at this point. I've been doing a rework to support Medium and Large bushes.
isnt this also a problem with the computer and not custom bush anyway
Behold, my super high quality "Green Bush"
good for hiding spots
very green
nbd, figured I'd ask lol maybe you wanted it.
I'm probably gonna make my own custom build though for my playthrough
yay open source 😆
I'll add that to 2.0. Which I suppose is also a vanilla fix.
what if you make like
better farm computer
ppl can use it to SELECT COUNT(Bush) IN Greenhouse WHERE CanHarvest=true
nah, Worse Farm Computer. It's just a guy whose like,
How many crops are ready?
I dunno, maybe more than 5 or something.
I mean even if it said "at least 1" I'd still be happy lmao
I check that thing religiously
the current computer also only works for the singular Greenhouse
and not additional greenhousi
a silly idea i had once is like
Instead of a computer, I'll make an immersive info mod that just makes the Greenhouse glow whenever anything is ready in it.
I'll call it Obvious Indicators
Glowing Greenhouse with a big Exclamation mark over it
i wont download it if its anything short of implementing linux within the farmcomputer
no its gonna run Plan 9
brb porting hannah montana linux to stardew valley
I swear I saw a static method in order to check a GSQ given just the string condition, but I'm unable to find that now. Does anyone know the name of the method I'm looking for?
Big glowing greenhouse would totally solve this usecase
i would download glowing greenhouse if it had a config option to make it flash rave colours and play a muffled version of caramelldansen
GameStateQuery.CheckConditions with just the condition parameter. The rest are optional.
Minus the stardewui part I had that thought too
Prismatic, you say?
thank you
no actually specifically preset rave colours
well 1.6 added the farm computer for current location
so the "no stardewui" version would be pretty simple matter of adding 2 buttons to cycle locations
I do like me some obivous indicators. This means hat or possibly another special item.
and no gradual transitions between colours

could even repurpose my existing muffle-the-audio mod code to make it become normal dansen after you walk inside
project the brain power lyric video to the greenhouse window
i dont usually have any sensitivity to flashing lights or anything but this video is pushing the envelope
its so green
Thankfully, whenever I need art for a mod I intend to publish, I know who I can turn to
you're too sweet
if im just trying to add a new artisan item, im best of making a content patcher mod, right?
Ye
also, is there something like a generic starting point for the content.json and manifest.json?
wdym generic starting point
that would be the content patcher docs i suppose
fair enough
Can someone explain this code in TryOpenShopMenu (the overload with less parameters). I'm familiar with sql databases, so I understand some of the things going on. I'm mainly confused on the use of orderby and descending. Is this saying the sort shopOwnersData by having all the types with NamedNpc first, and have None be last? If that's the case, why not just filter out the types that are not NamedNpc if looking at the first element of the collection? I assume it's a failsafe, but this is under the case where the ownerType is NamedNpc. I just trying to make sure I'm understanding this correctly
(from p in shopOwnersData
orderby p.Type == ShopOwnerType.NamedNpc descending, p.Type != ShopOwnerType.None descending
select p).FirstOrDefault((ShopOwnerData p) => p.IsValid(ownerName)
this stuff is LINQ
forget all about SQL tbh its not really that, more like functional programming with enumerators
(LINQ is based on SQL, so it's very similar.)
It's a priority order in this case rather than a filter; the game will choose the owner matching a named NPC if found, else any value except None, and then None if no other entry was matched.
hm i wonder if you can just directly use TryOpenShopMenu to figure it out 
the main trouble is the Game1.activeClickableMenu = at the end
instantly unassigning it is probably fine, the draw code wouldnt even get to it right
yea but close menu things will fire right
perhaps if you can ensure this only ever gets called with no menu
ah yeah forgot that the user may already have a menu
a use case for reverse patc- * yoinked *
hmm how about storing Game1.activeClickableMenu somewhere if assigned and restoring it
also, i assume here's the right place to ask balance questions?
sure but no one plays game here
i think we tend to be focused more on "is ur mod working"
"ok cool parsnips now worth 999999 sounds good"
FWIW, Agentbla, I would take a look at similar mods and see how they price things (or even vanilla items, but I think modded items tend to have a bit of inflation to incentivize people).
Sorry to bother you guys. What is GreenRainFinished for? Is it for the day after the green rain event? If you don't have a greenrainfinished line, will the character just resort to their other dialogue for that day, or will it cause an issue?
yes and yes it's fine
cool, thank you
so uh
how do items with coloration/name based on ingredients work?
i.e. roe/pickles/etc
Take a look at pickled egg in cornucopia
those need to be machine output
The vanilla ones r bit hardcoded hence why mod example better
which json(s) is that in?
im not sure, ctrl+f it from vscode/notepad++/etc
oh i wish people would make smaller mods so the usual answer to "how do I make a parsnip orange?" isn't "download stardew valley expanded and these 12 small dependencies, it's in one of these 21,000 lines of json i'm sure"
y e p
surely there's an orange parsnips mod out there somewhere
I mean Artisan Machines have like 1 dep outside of CP
and not a lot of mods out there add custom flavored items in the first place
(mainly because it wasn't possible before 1.6.9 without said dependency) ignore me, it's multilevel flavored items that isnt possible
well a small enough mod is just Content Patcher docs and/or a tutorial
theres not much difference between tiny tiny mods
think flavored honey into flavored mead
Smoked Blueberry Snail Jam?
its more because the ones that actually do contain one or two items arent known by us. So we never refer people to them
ok so
pickled eggs are suposed to have a sell price of:
3 x Base Ingredient Price + 50
but their actual sell price in the json is
"Price": 300,
which
confuses me
oh, i see
so just put whatever there
the object price is for unflavored variants that you can spawn in CJB cheats, or rarely some other mod's RANDOM_ITEMS query
i have my own mod with a single crop, but the only time it gets recommended as an example is if i'm actually in chat. Other people know the big name mods--VMV, cornucopia crops, etc
Flavors
a balanced breakfast, lunch and dinner
i could really go for one of those right about now. i just don't think i know how to order it
i like how squished they are
I wish someone would make a "pickled fish" mod. Pickled fish are delicious.
i think you have to order the individual slices yourself
cornucopia has em
it's easy, you go into the local subway, and then you get beat up by the restaurant workers
never order spooky spaghetti
Oh, cool. I have not done cornucopia yet, as I am waiting for the recipe addon.
so how do people determine edibility?
trying to make fish sauce so it's not something you should chug normally
but then
you can chug mayonnaise and it gives positive energy/health soo
maybe it's the marketing. we should be able to search nexus for it if we need some kind of Multilevel Flavoured Pickled Pizza (Fresh) for reference
the thing is mayonnaise edibility is balanced out by the dramatic damage to your social life
you should be able to chug fish sauce
sodium poisoning
Someone should make a database of every item in the game modded+vanilla
CA did drinking mayo as a joke. He is on record as saying it is disgusting.
so what youre saying is
someone should make a mod that adds the social malus of digging through trash
to drinking mayo near NPCs
NPCs already have unique dialogue reaction to drinking mayo, it would be simple to slap on a reduce friendship trigger
i was under the impression that's already ingame 
My test Custom Bush mod produces Mayo
And if you leave the mayo alone for a couple days, it matures into Duck Mayo
oh it is??
never tried drinking mayo near NPCs so i wouldnt know
is :puffermayo:
but with mayo or like, a white and blue puffer
NPCs react badly if you drink mayo. Not sure if it actually effect friendship.
also makes for a viable pufferpepsi
I imagine it to be like 
so what's up with this?
That's actually not the recommended way to do that anymore
ah, localisation
Localized name/description goes into Strings now
Otherwise when you change the language, the non-localized name/description persist
This is the object data not the machine output
Tokens let objects get new translated text after they have been crafted
Otherwise whatever name they are assigned is permanently attached to them without deleting and crafting again
I'm pretty sure these swap too. I'd have noticed while testing translations
That's why Strings/Objects and Strings/BigCraftables exists
that's only if you explicitly set DisplayName in the item query
otherwise it just fetchs the name from the object data
Ah, well I just started copying the conventions from vanilla objects
(yeah I thought bla's screenshot was from machine rules. it's totally fine to use raw i18n in object data)
So, is there a proper way to make sound effects loop during events? I ended up just making my sound into a music track but doing it that way means it can't play at the same time as actual music 

can you just make the sfx like a minute long
but still keep it as sfx
and just hope the player doesnt take longer than a minute 
if you're talking about the fact that it also benefits from the profession that increases fish sell price
that's hardcoded
It would probably keep playing the sound even after the action it was needed for is over if I did that 
all items will always only ever be one Category. everything that doesnt act like it is exception based
oh damn
yeah that is what im talking about
Oh yeah i noticed my smoked fish count as fish for FFP instead of artisan, is that why?
different reason, that's a manual exception I specified in the competition rules
the artisan goods category count every artisan goods except for smoked fish and honey
and aged roe
Interesting, i thought i was going insane selling smoked fish and my artisan count wasn't going up lol
Hey guys! Another question :D How would I assign a separate texture to the second item in my content.json? I had it loading just a singular png for a single item, but I want to add a second item art to be used for the 'aged' mead https://smapi.io/json/content-patcher/484ea46938e34c73bb6e612a2fa23cd4
I need to get serious with FFP. I currently just take whatever rank I get. I need to aim for first place at least once.
!json
JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.
If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.
When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.
please use the json uploader
but you can add a second sprite to your same png and just change the SpriteIndex
or you can load a separate png to a separate Target
Would I need to pack the sheet with texturepacker to get the index? Not sure how that works
SpriteIndex: 0 means use the first 16x16 square in your PNG, 1 is the second
you can use whatever image editing software you want to put them in one png
just extend it in your image editing program
huh, cornucopia tags allergens and vegan-ness
is that just a thing mods do or is that cornucopia specific
I would add the "SpriteIndex": xxx inside the item entry right?
Sweet, thanks!
its just something we do for npc modders to use
context tags are entirely arbitrary and up to you, for the most part (some things look for specific tags)
other mods can look for those context tags on items too, so if another mod wanted to look for all items with the gluten_allergy tag or w/e, having it on cornucopia items will make it compatible
automatic asynchronous compatibility as ichor put it
I have another question about the commas in the JSON files, I have some experience with C++ and I know a random comma can break everything. VSCode is throwing errors at me for some erroneous commas, and I know the mod works with them there, question is; is there any specific reason there are commas on the end of lists from a function standpoint, or can I cull them for my OCD
!vscodejsonc
SMAPI uses a different json parser that is less strict
trailing commas are NOT standard json, but they work fine for stardew content packs
!vscjsonc
In Visual Studio Code, go to File -> Preferences -> Settings, then search for "associations", and in the "Associations" setting, click the Add Item button to add an item with key *.json and value jsonc (see image).
If you are making a content pack for Content Patcher, you should consider using its json schema so that VSCode can tell you if your patches are valid, you simply have to add
"$schema": "https://smapi.io/schemas/content-patcher.json"
at the start of your content.json file.
Answers for everything haha thanks!
but from a function standpoint they are irrelevant
i dont believe jsonc does trailing commas
i might be wrong. but i assumed it was just for. the c.
comments
json5 will do both though
JSONC does cover it apparently
If json5 is so great, what about json6?
Is there a reason why breakpoints won't hit for decompiled code?
yaml
please do not make me write yaml
Yeah, not as long as toml is an option
So I can easily cull these commas and not worry?
if someone ever makes a second smapi, they should call it Yet Another Mod Loader
please do not make me write toml
you can, but personally I recommend keeping them
Is there a way to find out why the sprite for my dwarvish mattock is using the sprite for combine fertilizer in my game? Or do I just have to live with it because they are both .dll mods.
they're there to cover your ass in case you add a new entry to the list
Proper formatting does that really well as well :D
Yup, that's what I use them for.
this is true, if you remember to follow it. by default you can take every "its recommended you do this" message in here as "we have seen other new modders fall victim to things a thousand times before and this will avoid that"
if you can handle not having the commas then its completely fine
is doing multiple actions like this in just the content.json allowed?
you need to separate your patches
also those patches arent in their own objects anyway
so it wouldnt work even if there was only one
oh got it
so i cant just throw everything in content.json and not think about it
You can if you do it right
Look at someone elses mod and keep track of the brackets
you have to read CP's documentation to follow its syntax
and then beyond that you have to follow json syntax
You can, I hate mods that do that. It is so frustrating to try and find stuff.
i was
i just collapsed the first entries block
generally mods arent made for users to find stuff in the internal files so if you prefer one big file then dont worry about it
are those in game items?
No your bracket syntax is wrong
"Changes" is an array [ ... , ... , ...] of JSON Objects { ... }, { ... }, { ... }
if yes you can enable data mining fields and see what their Texture/SpriteIndex fields are
ooh i see
soo
like this?
Yes, the dwarven mattock is an artifact for the museum. The combined fertilizer is well... fertilizer. It is just weird that the mattock is for some reason using the sprite for the fertilizer. The fertilizer I using the correct sprite.
decompiled code needs to be recompiled before you can debug it, and any ILSpy decompile you do yourself isn't able to be recompiled without major changes (though users with the Mod Author role here can request access to a recompile-ready decompiled codebase)
to add a custom field to the crop i'm postfixing, i need to do an injection into ___CustomFields...? or, wrong track
you cannot add CustomFields to something that doesnt have it
oh
CustomFields are just an edit using AssetRequested or ContentPatcher
a Crop has modData which you can access from getting the crop instance
what are these used for? i assume an item produced by a jar doesnt actually need any of those tags?
ok so Crop __instance, ref Crop.....?
CustomFields aren't part of an instance though, they're shared by all crops of the same id
Syntax looks good now, but i'd recommend that your item ID start with your entire mod ID, which is typically your username + mod name, such as Agentbla.GarumMod_Garum
oh is it for like
a "give me 12 wines" quest?
tldr ignore them, those are weird internal tags
oh
Adding the tag jelly_item to an item allows that item to be used to make jelly, etc
so useless in your case
but button said the crop instance
is custom fields not mod data?? https://stardewvalleywiki.com/Modding:Common_data_field_types#Custom_fields
CustomFields is what you find in Data/Crops, which is different from modData
notice how your second Target key is highlighted? that's because your json syntax is inconsistent and won't work.
re-read the key name carefully, and check your , commas: there should be a , comma between each entry in both a [] list and each key-value pair in an {} object.
oh. i see.
ah i scrolled down and found it 💀
I recommend VSCode to help with syntax and formatting
AFAIK CustomFields and modData are both for the purpose of mods sharing data with each other though. I don't think there is any vanilla use of CustomFields.
What is considered a major change? Can I just initialize a variable and then press the green button to run the mod and game (I'm using vs as my ide)? Or is it more complicated than that?
Does adding the tag order matter? If it had juice and jelly as a tags how does the game handle it?
so in said moddata, i need to set the quality or i need to get the quality?
i'm assuming set, but after ... getting
the process of how you use them is very different, though
tag order doesnt matter, if it had both the jelly tag and the pickles tag the machine rule order is what matters (as always)
in this case, major changes involves rewriting a significant amount of the game code to resolve decompiler inconsistencies. it's not something i'd suggest any sane person try and do themselves
once you have access to the modData you can set or get whatever you want whenever you want as needed
oh, i wrote "Target**:**":
instead, you're better off telling us what you're trying to find by breakpointing the game code, and what your goal is here @shadow pagoda
wait matt, is that what the hellif (!__instance.modData.TryGetValue("HMMSCropQualityOverhaul_Quality", out var quality)) { return; } is?
i see the issue now
is that the modData bit
that's one major issue solved, but do also review your commas.
Yes, in that patch __instance refers to the crop, and modData is that crops mod data
also did that, yeah
oh my god so i just grab and set it in there
why was i reinventing the wheel
my bad bro
should probably sleep now https://pillow-might.loves-you.xyz/ThqZ0VfcgJ
You can grab it in there, but you need to set it somewhere else around plant
In Object.placementAction when it calls HoeDirt.plant is when you'll have the seed and Crop
so that is when i do.... an injeeeection? [looks at harmony docs]
(well you need a harmony injection to get the crop)
You don't since you can just get the placement target again
Expanded Storage is able to postfix placementAction to make placed big craftables into Chests
how would you get the placement target from HoeDirt.plant
soo
thats more of a #modded-stardew question?
it could be
injections are also not mutually exclusive with postfixes, are we referring to different things here
I have a mod that turns the SVE Bear Honey into Honey Mead, since the pig truffles can artisan I figured why not the bear "truffles" too. Reason I bring this up is I'm not sure how 'long' it should take to convert the jar of honey into mead. Right now its 8 hours and the mead hsa a base price of 1950. What would be a reasonable time/price for the mead? Additionally, I am working on the ability to age the mead in a cask, which will take 40 days with a base price of 4215. Does that feel balanced? Both artisan goods are configured to retain their input quality as well
I asked #modded-stardew and was told to ask here since its my mod haha
well.... im not a junimo but i would kinda say they were wrong to direct you here if you just wanna know what people think good balance is lol
retaining quality means at max friendship a bear is digging up 3900 gold per bottle
i think it fits in both
I ask modded farmers balance questions all the time
I thought #modded-stardew was a better place to ask too :p
but again, im not a junimo
You just have to do it in a way thats interesting
that's nearly four times as strong as pig
this uses injections too 
do you want bears to be four times as good as pigs
arent bears already really strong
I'm pretty much just trying to understand how the TryOpenShopMenu method (the one with more parameters works (as suggested here #making-mods-general message) in order to dynamically know when a shop is open, and the player can buy something from that shop. Since this is a mod related to perfectionist, I would need to do this will all shops in the game.
Right now, I think I need to "hard code" the location, ownerArea, and maxOwnerY given the seedId. I know this is very vague, and I'm honestly not sure for what I'm looking for exactly as I'm still wrapping my head around the code. I think right now I need to know what the values are for the 3 vairables I said earlier given the seedId. But I think this is the method I need to dissect in order to make the method I want. I hope that makes sense.
If I can't get what I'm looking for through someone else recompiling the code, my next plan was to make a prefix of the method, but just copy/paste the original code so I can put breakpoints.
"How do you guys feel about a late game machine that does this at X amount of profit?"
vs "I'm making a machine can someone look at all of these formulas and my spreadsheet and stuff and tell me what to do"
so im assuming i change sobject to Crop
if i were to.. reference this
No, SObject is your seed
oh ok
I didn't have that perspective thats why I asked, good points Selph. Four times? I would say that is a bit much
It's the action that happens when the player places a seed
You'd need to look at the hoedirt at tile to get the crop
It did take me personally a long ass time to get bears fwiw
ahhhh ok
You have to ask us mysterous questions about seemingly random things
exactly
People who have the game open right now, how many fingers do you have
(though keep in mind Lani SObject isnt a thing, its StardewValley.Object and people just usually alias that to SObject. i dont know where Matt's doing that in his code)
hmm.... give me a sec to count
yeah that was my next question lemayo
So something like:
if (!location.terrainFeatures.TryGetValue(tile, out var terrainFeature) || terrainFeature is not HoeDirt hoeDirt || hoeDirt.crop.Value is not { } crop)
{
return;
}
switch (__instance.quality.Value)
{
case 4:
crop.modData["YourMod.Id_Quality"] = "Iridium";
break;
...
}
Note all untested since I'm not on my computer. so you may need to fix a few things.
does this go in the object placement postfix or the crop getdata postfix
Object placement
This is where you set the mod data so that the Crop can remember what quality the seed was
follow up to the last sentence, is there a way to differenctiate between overloaded methods? Or C# smart enough to know if I give it a specific set of parameters, it will "override" the method that shares the same set?
Okay, new question lol. I made a map mod that swaps a single tile at the bus stop, and I placed the grass it sits on 'behind' the art on the tile so it matched and lined up, but now fall hit and its still green grass because I added the grass tile from spring_outdoorTileSheet. How do I make my mod swap with the seasons? Is that something I can do in the tmx through Tiled? Did I use the wrong tilesheet for the grass?
(usually that just means you used var instead of the specific type)
if you're using a tile from a seasonal tilesheet it should swap automatically
Okay sweet I just need to use a seasonal sheet, thanks!
spring_outdoorTileSheet is a seasonal tilesheet
as in, if you use a tile from a tilesheet that starts with "spring_" it will work
do you still have the tilesheet in your mod folder next to your tmx?
remove the tilesheets from your mod folder
when you put your mod in your Mods/ folder and launch the game, there needs to be no tilesheets next to your .tmx
I see
if they are already present in the games Maps/ folder or the image is loaded into a target that starts with Maps/, it will work fine
they do need to be there when editing the tmx ofc, but you remove them after
if you keep the png in your folder with the tmx, SMAPI will always use that specific png
also, just to be clear, i should say there needs to be no tilesheets if you WANT to use the ones present in the Maps/ folder or ones loaded into there
if you do want to specifically use the pngs in your mod folder for some reason, you can leave them
same with custom tilesheets
but ideally for custom tilesheets you Load them so that they can be removed from the .tmx folder
My first mod was a custom item so I just rolled with what I knew haha
I'm reading this to learn more about prefixes https://harmony.pardeike.net/articles/patching-prefix.html . It says that the return value says if you should run the original method or not, since I'm basically rewriting the method, I shouldn't run the code again. However, TryOpenShopMenu return type is also a bool. How do I return if the shop should open or not without telling the end early and either run the original code accidently?
@shadow pagoda You leveled up to Cowpoke. You can now speak in our voice channels and share images in all channels!
wait, why are you prefixing it (i was not following earlier)
The return of your prefix method governs whether the original code runs. You can’t access the return of the method from a prefix iirc because the method hasn’t run yet
you can access the return result
But from a postfix you can separately get the method’s return with a ref and change it
it's still just __result
Ah fair, but the method itself should be the main thing that changes __result
(Assuming the method runs)
probably a stupid way, but I'm trying to get breakpoints to work for that method. I think I need it in order to dynamically know when a shop is open. #making-mods-general message
you can let the original run, and then another prefix after you can check if you set it to something and THEN skip
I am confused about what “breakpoints” is in this context
If you just want to know what the method returns, do a postfix
And grab it with __result
You should never need a breakpoint because you don't have a breakpoint when you release the mod
isnt the actual issue like
you can't easily probe TryOpenShopMenu bc it changes your menu
why it no like 🤔
i dont think harmony helps with this except maybe reverse patch
Are you just trying to detect when a shop is opened? If so, you can just hook SMAPI's MenuChanged event and check if e.NewMenu is ShopMenu.
they want to get every shop that is currently open
the goal is to check without actually spawning menu
to build a informational ui mod of some sort
most likely every frame
the idea was to probe tryopenshopmenu and if it worked you'd know the shop was open
That won't be very reliable; e.g. Pierre's shop is always accessible via TryOpenShopMenu because it's restricted in the location code (which is fairly common for vanilla shops).
if i remove __instance how will it know what object i'm after 🏃♂️
yea i think for some vanilla shops you will just have to hardcode it bc its not going through TryOpenShopMenu directly
Actually, I was more informed that I should just look at the method in order to figure it out. Though I guess if I could not actually open the menu and just run that code, that could technically work as well
this is mostly for modded OpenShop things
you should listen to the other warning first, use the property not the net field
Sorry, what do you mean by this exactly? I thought the entire purpose of breakpoints were for debugging. I wouldn't need them in a released version of a mod. They're just there for me to better understand the code. I don't plan to have this prefix permanently, just until I understand the code better and make make custom method.
your "I think I need it to know" made me think you were expecting to use it in production code which is why I said that
it was clearer after that it was just for debugging though
So question! The dwarvish mattock mod I not able to break the nodes that mistyspings item extension nodes. Who do I report that too? Item extension or the mattock mod?
assuming there's no error in the log when you try, probably dwarvish mattock who would then determine if it's bc of them or because of IE
i think IE does some strange thing there bc tool code strange right
(or a third party)
hence why mistyspring had to patch cjb cheats
ive no idea what IE does personally
but i would say if dwarvish mattock has C# component report to them first
see if theres api integration
Yay, no error. Just nothing happens when you hit the nodes. It is like they are not even there.
Ok will do. Mattock it is.
Heyo quick question.... I set the days tell ready to 1 and this is happening and when I set it to 3 it triples
dont understand whats going on and I am looking at the wiki and the machines.json
https://smapi.io/json/content-patcher/06306641aeae45b6bdc1fbff48167e10 My json if anyone wants to peak
I know UI Info Suite 2 special cases the time display for casks which is known to cause strange behvior with modded rules
Does the minutesUntilReady field on the machine look right
you can check with LA + data mining fields
Yup, UI info suite is wrong sometimes. It does not do tea bushes in a green house correctly either. Not sure where it pulls it's info from.
Sorry had to step away for a sec Ill give that a shot
says 790 for minutes until ready if that is correct
So I guess it is working after doing the math in my head slowsly XD
Is there any fields I could add from the machine.json into my json to make the time show properly? Or is it just a lost cause for that
so how do i add that to other items?
you need C# sadly
you use C#
now there's a workaround where you increase the machine/object price if the player has the profession
that wouldn't change any existing unsold items
maybe that's good enough for you, maybe
honestly, yeah it is
or wait right you couldnt do the "wait around until fishing 10 and bulk sell"
That is just cruel to all the hoarders that keep there stuff to sell once they get the profession. Sorry, you made it before you had the profession no bonus for you.
well once u got the profession
you have become good
and therefore make higher priced things
Honestly, it doesn't make since that profession are retro active anyway.
lol