#making-mods-general
1 messages ยท Page 111 of 1
the sometimes-ability to change method signatures or properties withou complaining about harmony will forever elude me, at least a full understanding of it โจ
or complaining about hot reload rather
@frozen cedar If you do end up wanting to try the SpaceCore route, this build lets you do HD texture overrides. You'll need to specify a new field "SourceSizeOverride", which is a Vector2 size of the new texture source rect to use. (I did it this way so you could still in theory use animations with this feature.) Here's an example:
{
"Action": "EditData",
"Target": "spacechase0.SpaceCore/TextureOverrides",
"Entries": {
"testhdportrait":{ // Of course change testhdportrait to something different for each entry, preferably using {{ModID}} as well
"SourceTexture": "{{InternalAssetKey: hdportrait.png}}",
"SourceSizeOverride": { "X": 256, "Y": 256 },
"TargetTexture": "Portraits/Penny",
"TargetRect": { "X": 0, "Y": 0, "Width": 64, "Height": 64 },
}
}
},
When I publish this build it'll be 1.27.0
whens spacecore gonna get a 2.0
this is amazing
Well, I'm following semantic versioning, so... Probably when I decide to revamp the format of all the features and break every single mod that depends on it ๐
(I'm not as strict about semantic versioning for the C# API, probably should be...)
i think you should just go straight to 3.0 when that happens
Maybe I should jump straight to version 2147483647.0. Then I can never break compatibility again per semver, since I'd be at int.MaxValue
...I wonder
@ Pathoschild - How would you feel about a PR allowing negative versions in SemanticVersion
(I would have to give up the manifest builder since assembly versions can't be negative)
Thank you!
I'm still trying to figure this out. I was able to figure out how to theoretically draw something on screen. I say theoretically bc it doesn't give any errors, but the chicken doesn't seem to appear.
This is the code I have so far
private void OnUpdateTicked(object? sender, UpdateTickingEventArgs e)
{
texture ??= Game1.content.Load<Texture2D>("Animals//Blue Chicken");
spriteBatch.Draw(texture, new Vector2(1280, 800), null, Color.White);
}
My plan is just to create an image in paint that's just black, and load that instead. Though this seems like a lot of effort just to get a black screen to appear. I still need to do text, and I'm not sure if my current plan is the best way. Does anyone know an easier way, and why the chicken isn't appearing?
if you want to draw to the screen, you likely want to use Rendered instead of UpdateTicked
i would guess that you are drawing too early, so the game is rendering over you
well after several hours of trial and error i have now figured out how to apply high/low/band pass filters on audio in the game
totally not an obtuse process at all to do so (send help)
im like relatively sure thats about all you can do besides change the pitch and volume though... the reverb fields/properties/methods seem to do absolutely nothing, which is a shame i think
psa: dont fuck with the frequency/filterq/etc values too much bc if you keep them the same but switch from e.g. highpass to lowpass, and the lowpass doesnt like the values you just had set (even though they worked just fine for highpass), it'll just kill the music with an absolutely ear piercing screech noise for a split second and then not work until you restart the music again. very fun
Didn't seem to work unfortunately. This is what I put in my Entry method, and moved the code accordingly so that it it's called in OnRendered
helper.Events.Display.Rendered += this.OnRendered;
oh yeah discord was super fucked for a while there
the question i wanted to ask was... uh. oil maker is not letting me make specifically sunflower oil instead of normal oil..
(i wanted to add recipes for actual types of oil)
outside just. nondescript oil
Did you move entry
move it where 
To the top
how do i do that?
I believe the Reverb APIs were inherited from XNA but never actually implemented in MonoGame.
So it dun get swallow by normal egg mayo rule
even volume fights back when you try and use it. never touching cues again (until i need to (i dont need to (i want to))))
if only discord hadnt died, i mightve been spared the 20 minutes of trying.... rip
why discord why
Oh blueberry I wanted to ask about your error with the tokens
Yeah, I actually saw your message 20 minutes ago and my replies went red, then everything went to hell, and I decided to take a whiskey break.
i had an error?
Content patcher
nested token thingy
Not error but issue
Oh, is that why this happened?
content patcher
dictionary key
I sent that message and looked away and looked back wondering why my message was red
Yeah, the red text was Discord shitting itself.
pretty sure all discord messages everywhere died for about 30 minutes there
like, for realsies died, not even resending was possible for a while
Check out the impressive graph at https://downdetector.com/status/discord/
Is it only broken for dynamic tokens?
oh the token issue. content patcher
I was think about it cus I use ModId in nested stuff all the time
no idea, only tested with dynamic tokens in a custom model
i think it might be the model somehow but unsure

i remember noticing some token-key entries with tokenised values a bit ago and thinking that was odd given i had absolute definitive reproducible proof that mine didn't work
https://github.com/Pathoschild/StardewMods/issues/1056
issue report here in case you want to try out the solution yourself
yay, dc is working now xd
a lot jumped to X rq. We were laughing over the tweets xd
@brittle pasture Sorry for the ping (again) but can you please take a look on why this happens? It's just visual bug and I still get the fishes but only the normal bait seems to show a normal popup. Maybe I did an oopsie in the code?
C# code: https://pastebin.com/FmbKNSCV
Content Patcher machine data: https://pastebin.com/RGC5M1bU
Content Patcher EMC Data: https://pastebin.com/QcCqK59U
output.heldObject.Value = chest looks awfully suspicious to me. I thought that only worked for auto-grabbers.
It's what Selph suggested me to do. Did I use it wrong?
ยฏ_(ใ)_/ยฏ don't mind me, maybe it's an EMC thing.
But weeds are object ID 0 so seeing weeds generally means either "Item ID wasn't set" or "Item ID was set but we didn't understand it and drew a default item instead of an error item".
Idk how this bubble thing works, but it looks like you'd have to manually tell the game to check inside the chest to know what to draw
is it a used-a-bigcraftable-index-where-the-game-expected-an-object-index issue
chest and weeds looks like that sort of problee
That weed is an item from EMC itself I'm pretty sure of it. I'm not sure how that works tho. Even then, they all use the same method so I have no idea how only normal bait work normally lol.
I didn't think EMC added items
See, that's what I figured, but there's probably an extra step in there somewhere, because chests are BC 130, and the corresponding (O)130 is Tuna.
So it might be something passing in the full ID where it expected an unqualified ID - tried to do an (O)(BC)130, got nothing, and rendered a default (zero) item instead of error item.
that weed is definitely index 0 in springobjects
Gotta love it: visual studio 2022 is complaining about an int being fed into a method that takes an int, saying that it cannot convert a float to an int.
^ I doubt that, you've probably got the wrong overload
Could be maybe passing an int without a value set and then converting it to a string
Yes. Either wrong ID or missing ID.
Don't know for sure if it's because of the chest, that's just what stood out to me.
fishID = x.Key; what is the typing of x.Key and is being implicitly converted to something weird?
I'm setting up a GMCM addnumberoption for an integer slider, and the method signature even says the value I'm using is an int, and the contextual highlighting says it's the same variable in both places of the lambda expression. So I'm not sure what I'm doing wrong. If I try to explicitly cast it as an int, other lambdas break
Depends on what the dictionary expects
Could just be an int, something dictionary so the key could easily be 0 lol
Visual studio has many quirks, but not knowing the difference between a float and an int isn't one of them.
Nevermind it's a string KeyValuePair<string, ObjectData> x
Oh, VS complains about the wrong shit when you do GMCM wrong
Oh, I have both int and float overloads in the api.cs file, maybe I'll just remove the float overload
It's usually because some other parameter isn't matching, and so it's causing VS to think you used a different overload.
Probably you are passing some ints and some floats which makes it ambiguous which overload you wanted.
I have no floats anywhere in the project lol
Ok, whatever you say... we all use this mod API and none of us have that problem.
I have had the problem, but it's usually because I wasn't doing the () => thing correctly lol
There are two overloads, one takes all int (or Func<int>, etc) parameters and the other is all float.
I commented out the float overload and that particular error went away (others came up so I'm obvs messing up somewhere)
If you cause VS to choose the int overload, and one of your arguments is/returns a float, then it's a compilation error.
The Key there is the JSON key of ObjectData, so it would be an unqualified ID ("0" would be weeds).
(It's a strangely-written and hard-to-read function, but I think whatever the error is lies elsewhere)
if you use (namedArgs: 1f, inThisWay: () => i18n.get()) then you can sidestep param confusion and force VS to show you the mistakes you made in the overload you actually want
It might be somewhat less effective with those GMCM overloads in particular because their parameters have exactly the same names, just different types.
The other way to force it is by adding explicit casts to each param and seeing which cast it considers invalid.
So you get the correct fish and the correct number of fish, it just doesn't show the correct item on the popup?
Yes, even UI Info Suite shows what fish I'm getting.
I'm pretty sure the fault is on me, so I'll still keep fiddling things around lol.
or I'm just an idiot and I just use the "param: value" directly instead of a lambda, when adding the GMCM option
Eh... there is no non-lambda overload.
You can use named parameters or positional parameters but it is going to be a Func<int> or Func<float> either way.
I'm just an amateur, if I'm misunderstanding then I'm stumbling into a valid solution
Those are all lambdas. Except for the min/max/interval which don't take functions.
Now that you explicitly mention it: that's what I was overlooking
I mean, it looks fine and all, with the caveat of us not knowing any of the types involved, I just don't follow the "just use param:value instead of lambda", that's not what's happening here.
the min/max/interval are int constants I defined elsewhere. I naively assumed because lambdas were used for earlier params, that they would be used for all following ones
it's ok, the frustration is just ignorance leaving my brain
I see. Well, glad you got it sorted.
Hm does season override not work on farm maps?
it should? island west is permanently summer
although that does use location context specifically
Yup got both those but I just tested it but I did use a previous farm and switched with easy farm switcher
Ok yeah something to do with easy farm switcher maybe its not so easily compatible. The map property doesn't get modified.
ah yeah I see what's happening. it's because the bait types outside of the default bait doesn't have a color defined, so CopyColor, which is required to force the holder item to be drawn as the first item inside it, doesn't work
so a workaround is to manually add a color tag to deluxe bait/magic bait/challenge bait
but I should ask why are you using the holder item in the first place? you're only returning fish, which are all Objects
it shouldn't be necessary
There's a chance it can return a furniture which causes the machine to parse an error.
Noticeable in Volcano Forge
Do I not need to use it?
got it, though your C# function is already filtering them out
Yeah, I tried to get the fish as much as possible. It's just a failsafe option.
So I just append context tag to other baits?
yes
or actually, item queries support color fields now
ah doesn't work because of the C# method
since you're doing C# anyway, instead of Object output = new("selph.ExtraMachineConfig.Holder", 1); do Object output = new ColoredObject("selph.ExtraMachineConfig.Holder", 1, Color.White);
Yep, it works great! Thank you very much!
And my apologies for the occasional pings! I hope it doesn't bother you much.
It's fine, I totally don't mind pings
Hello there, I'm struggling a bit with moveentries ๐
I'm trying to move chocolate valley's water bottles after the juice entry added by realistic seasonal shop inventory but smapi says the id for the juice entry doesn't exist... What am I doing wrong ? 
{
"Action": "EditData",
"Target": "Data/Shops",
"TargetField": ["SeedShop","Items"],
"When": {
"HasMod |contains=boringvlln.rshops": true,
"HasValue: ChocoValley_Water": "true"
},
"MoveEntries": [
{ "ID": "ChocoValley_Water", "AfterId": "boringvlln.rshops_JuicesP" }
]
}
What does the log say?
It says "Can't move record "MRSSI - Chocolate Valley > Include data/shop_pierre.json > EditData Data/Shops #5" > MoveEntries > "ChocoValley_Water" AfterID "boringvlln.rshops_JuicesP": no entry with ID 'boringvlln.rshops_JuicesP' exists."
https://smapi.io/log/de6f3d8f113f4d2ca1951a513df7477a
Log Info: SMAPI 4.1.7 with SDV 1.6.14 build 24317 on Microsoft Windows 10 Famille, with 18 C# mods and 3 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
Here's the shop entry from rssi
"boringvlln.rshops_JuicesP": {
"Condition": "!PLAYER_HAS_SEEN_EVENT Any 191393",
"RandomItemId": [ "FLAVORED_ITEM Juice (O)613", "FLAVORED_ITEM Juice (O)256", "FLAVORED_ITEM Juice (O)635" ],
"Id": "boringvlln.rshops_JuicesP",
"AvailableStock": 6,
"AvailableStockModifiers": [
{
"Modification": "Multiply",
"RandomAmount": [
0.1,
0.2,
0.3,
0.4,
0.5,
0.6,
0.7,
0.8,
0.9,
]
}
],
}
Try adding rssi in dependencies with IsRequired False?
My guess is your mod is probably loading first before rssi.
I'll try that right away !
I'm speechless
An entire day wasted because of something so simple
Thank you very much GalaxY
Now, to implement that obvious correction to all my patchs 
You don't add it to the code blocks, you add it to your manifest
Yeah but each of my patch has a manifest as they patch different mods
...why are they all separate mods instead of just being Includes in one mod? ๐
Honestly, I just followed in boringvlln's steps when creating mrssi ๐
Also for future reference here, you can enclose your code with three ` to format it as a code block. Makes it look nicer & easier to read
Like this (except pretend there's three of them haha)
{
code goes here
},
Okay, thanks for not doing the thing, Discord 
!codeblock i think shows it
You can embed code in Discord using a series of three ` :
```
Your code can go here
Even if not a haiku
Just an example
```
For syntax highlighting, add the language code on the same line as the first
``` (with no space, like ```json).
The usual codes are cs (C#) and json.
(codeblock command also used to be broken and i had no idea if it still was)
Thanks, Button!
Yep!
Okay that excellent to know, thanks Airyn !
But yeah, I'd recommend looking at the CP docs for how to set up Include files because then you can have all your patches in one mod and just turn them on or off with a HasMod check
Makes things a lot easier both for you and for your users
My futures mods won't be like that I promise
I'll try to merge them when all patchs are advanced enough
Oh, your code's already got Includes
Also do you use VS Code? If you do, it's got an option to auto format your code for you that helps line it all up & make it easier to read if you're interested
I'm on sublime text for now and plan to switch to vs code when I get my new computer. I read it can check json files format as well ?
Yep! It's pretty handy ๐
Can't wait to try it then ๐ I've lost so much time over missing comas and other shenanigans ๐ฅฒ
Hey John, mind if I DM you for a moment?
Huh, you should be able to?
Do you have DMs from server members disabled?
It was disabled earlier but now it looks like it's turned back on
I didn't know it would prevent me from answering ๐
Hello-
I modified an existing mod's art for personal use- but it's a minor change (like- deleting the vase in a potted new crop)
if other people are interested in it- should i contact the mod author to ask them if they can add the no-vase option in the mod configs perhaps and hand them the edits i made if they want to use them to make things faster?
You can ask, but the author might not be interested
if other people are interested in my no-potted personal change, what should i do?
i do not want to step on the author's feet to be honest, and i really did it just for myself
If other people are interested but the author isn't, then there's nothing you can do. Personal edits can't be shared
okke!
Thank you for the insight! โค๏ธ
@drowsy lake You leveled up to Cowpoke. You can now speak in our voice channels and share images in all channels!
don't advertise changes if you don't know if the author will be ok
you dont have anything to lose by asking. worst they can say is no
but u an always check the mod's permissions, some mods do have open perms
(a minority but always better to check first anyway, it will answers some questions)
Thank you guys! 
Still keeping them for personal use for now and asking the author if they want or not- if not, i'll just keep everything for myself 
good luck with the project!
hmm
would it be too powerful to have a crop growing in fall, winter and spring?
i miss ancient crop mod
me too ๐
some new person offered to update it and they were making progress but disappeared
it is how it is lol
Yup
hmm
another question
can i check if a CT like "harvestedcrop_mycrop" (whatever) is active and set a flag/send a mail based on that?
cool, this may be easier than "you have to ship whatever number of this crop"
(maybe i'll check and adjust aster event too, one day)
Well that is easy enough too since there is a gsq foe that
For
Unless you mean player easy not modder easy
yeah checking is easier, but the player may transform/gift the crop instead
so if they never ship stuff they never progress
while stuff like "set flag if crop is grown then do whatever" may be one more step but more flexible
Ooh, new vwv crops goodness?
currently it's for serene meadow hybrid plans
i like the idea of having some "hey you got an hybrid, cool" mails here and there
Oooh that'll be cute!
I love the idea of hybrids tbh
They're like
One of the really fun parts of gardening
Or like, random mutants
(Irl gardening ofc)
yeah! mine are a very simplified version (and more color variation than hybrid) but it's fun to have
Is Trent okay with anyone updating it and then sending you or him the files? 
I think so, but it's better to chat with us first in case there are any design changes that need to be made/would be better for player experience
(also to chat with us so I can gauge how much they know about what they're doing and how much work I'd have to do to bugtest it later LOL)
Kinda tempted to take a stab at it myself 
I really liked Ancient Crops back in the day
Well I definitely trust your experience
beautiful scopecreep happening right under my eyes
(I shouldn't, given I have DSV update stuff to do, but hey ๐ )
I've always kinda wanted ancient crops to have more integrated feel with the game so I kept putting off updating/etc because I wanted a rework at the same time
it'll be easier with a working base i feel
So it's kinda like, if you (general "you") offer to update it you can also take artistic liberties
because you can then just change stuff on the fly
What sort of things were you thinking for integrating it more? 
(are plural of iris iris or irises or something else?)
Irises, yep
When we spoke with this person they discussed working it more into ginger island (such as with the shop or finding seeds or stuff), since GI was added after ancient crops was designed but both were intended to be later game content
oh the trade shop can be a pretty good failback way to get seeds by trading stuff as long as you already shipped them once or something
Like a lot of endgame content has been added since we made that mod
It would be neat to have an additional way of finding the seeds in case you lose or accidentally sell the originals
Well if anyone who happens to be listening to this convo happens to decide to work on the mod, let me know so I get a kick in my ass to make the giant crop sprites 
Lol
If it's "just" CP recoding I could knock it out in an hour or two but no sooner than xmas
i considered personal conversion, and JA>CP should be quick and fast, it's the MFM>CP part that i didn't want to think about
Oh yeah, I forgot we have a JA to CP converter
"i just have to patch export data from JA to CP then i will... have... to do the mails... ok nope"
This is the mod right https://www.nexusmods.com/stardewvalley/mods/4472
Delete every existing item made from this mod. If you miss any you can crash your game!
Our ancestors had difficult lives
Would need to convert pfm to cp machines too
Hahahahah
Yes, trying to achieve perfection with json shuffle?
Or the old-old days, when crop modders had to make compatibility files by stitching together crop tilesheets so that people could use multiple crop mods when replacing the xnbs
the council of fish for aquarium position ๐
Does anyone know where the slingshot resources are in the content folder?
(Which didn't work too well
)
yeah the ability to have specific tilesheets pretty much everywhere now is really great because this works on a small scale, but not really for lot of mods with lot of updates and such
resources as?
the slingshot images must be in weapons
the munitions in maps/springobject i guess
If it is in weapons but the texture only changes when it is in the inventory, I wanted to modify the texture when the slingshot is used.
it's possible it's requiring some C#
I think all slingshots shared the used sprite
I changed the texture of ammon but it doesn't change
i believe the fishing rod for ex requires C# for some color change in hand
Wow
Which is in farmer base?
When was this
Will need C# to retexture them separately
Also I rly hope u r make content patcher mod 
Where can I get c#?
2017-2018-ish, I'm pretty sure
!startmodding
Making mods can be broadly divided into two categories:
- Content packs are formatted text files, and don't need any programming knowledge. They can add/edit NPCs, maps, new items, shops, and more. To get started, see the list of framework mods, the wiki tutorial for Content Patcher, and there might be relevant guides on the tutorial wiki.
- C# mods use programming code to change fundamental game mechanics. See getting started with C# modding.
Usually itโs easier to start with making content packs, since you don't need to learn programming.
if you look at all the old mod threads on the starbound forums they talk about it a lot
i remember when we were happy to have extra crops that would do basically nothing except being sold, because it's all was possible with xnb
Wrll, now I want more! (Plays a wordle clone instrad)
Can someone explain to me how to use contentpatcher to change the texture?
I have no idea how to use it.
You need to first make a content patcher with the manifest and content json
Then use edit image to alter texture
I already did it, now how do I change a texture?
.
!json to show us what you have
JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.
If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.
When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.
I found a page that explains all the events, https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Events, and I assumed AssetRequested would allow me to see if one of my assets was being checked. I'm just trying to draw something to the screen, but having no luck on doing so. This is what I have so far
private void OnRendered(object? sender, RenderedEventArgs e)
{
Log("OnRenered");
texture ??= helper.ModContent.Load<Texture2D>("assets/Apple.png");
spriteBatch.Draw(texture, new Vector2(1280, 800), null, Color.White);
}
private void OnAssetRequested(object sender, AssetRequestedEventArgs e)
{
Log("OnAssetRequested");
if (e.Name.IsEquivalentTo("assets/Apple"))
{
Log("Apple.png is requested");
e.LoadFromModFile<Texture2D>("assets/Apple.png", AssetLoadPriority.Medium);
}
}
private void Log(string message, LogLevel logLevel = LogLevel.Debug)
{
this.Monitor.Log(message, logLevel);
}
Although OnAssetRequested OnRenered do get printed to the console, Apple.png is requested does not. I have also tried changing the if statement in OnAssetRequested to be
if(e.Name.IsEquivalentTo("assets/Apple.png"))
with no luck either. I'm not sure what else to try. I feel like I've spent way too much time (about 8 hours) just putting a picture on the screen.
you're listening for something targeting Content/assets/Apple.xnb
you would need to deliberately pass a target through the game content pathway to do that
this is useful mostly for, like, letting other people edit your textures
also
like
spriteBatch.Draw
I forget the arguments, but I would expect it to be position to the top left
try
spriteBatch.Draw(texture, Vector2.Zero, null, Color.White);
(for example, this draws a semitransparent black rectangle at the top of the screen: https://github.com/atravita-mods/StardewMods/blob/89b54742d1808b7177252410ece31d795759485e/SinZsEventTester/Framework/MonitorPerformance.cs#L76 )
Am I misunderstanding the wiki? It states The asset doesn't need to exist in the game's Content folder. If any mod loads the asset, the game will see it as an existing asset as if it was in that folder.
it has to possibly exist in the content folder
it doesn't have to exist at the moment you add the listener
How would I use OnAssetRequested in order to check if an image from my mod's assets folder? I'm aware of doing something like this
helper.ModContent.Load<Texture2D>("assets/Apple.png");
which I tried to change helper to e with e being AssetRequestedEventArgs, but that gave me a syntax error
you don't do OnAssetRequested for internal assets
what are you actually trying to do
frankly, I think your actual error is you're drawing off the screen
This, but i've been using a random image in the meantime
you can use Game1.staminaRect (in most situations)
it's a single pixel
There's also a Utility method that draws a rectangle to the screen
what's it called?
Does anyone know how I can rotate a Sprite without destroying the image?
It did work, thank you
Do we still need Producer Framework in 1.6 to add new items to machine inputs/outputs?
yey
there's a few features that are pfm not but in machines yet
u can check out extra machine config for extra options
Can chatgpt make stardew valley mods ?
No
Ohh
!chatgptcode
Please stop trying to get ChatGPT to write your C# mods for you, especially if you don't know how to write C#. It won't work without heavy editing, and it wastes everyone's time.
Large language models fundamentally are reguritating something from their inputโwhich is roughly speaking, the written output of humanity up until 2021 or so, for ChatGPT. For specific, niche topics like "is this framework going to do what I want" or "which things does Game1.cs have access to", it probably has no idea! But it's good at detecting that people in the past have....said things about frameworks and written things in C#, so it does its best to assemble words and symbols into a nice order for you. Sometimes it tells you true things, and sometimes it tells you false things, and if you can't detect when, you're in trouble. When you're writing code, this usually produces garbage, because you can't be "sort of similar", you have to be exactly correct or it won't work.
!startmodding
Making mods can be broadly divided into two categories:
- Content packs are formatted text files, and don't need any programming knowledge. They can add/edit NPCs, maps, new items, shops, and more. To get started, see the list of framework mods, the wiki tutorial for Content Patcher, and there might be relevant guides on the tutorial wiki.
- C# mods use programming code to change fundamental game mechanics. See getting started with C# modding.
Usually itโs easier to start with making content packs, since you don't need to learn programming.
(for similar reasons, chatgpt is also ass at dialogue - you can't get it specific to stardew)
(could've stopped before "at dialogue" tbh)
now can chatgpt generate me a picture of a donkey
here is a generic anime girl with gigantic boobs and 14 total fingers
I have started to make (some) headway into proper events...
Once I finish updating all my mods for 1.6 it's back to the big mod I've been working on for 3ish years. Been delaying more work on that one b/c of the 1.6 conversion and the fact I have heart events still to come up with and I've been struggling to think of good ones.
3 years? That's enough time to make a whole game.
I think 3 months feels like a long time for most of us. (In some cases, maybe even 3 weeks!)
didnt vmv take like 4 years
๐ค can you make configurations show and hide with other configurations? or do i have to add all the clutter
is there a guide on how to update mods to the new stardew valley?
1.6 or 1.6.9?
1.6.9
thank you very much!
No prob, it should cover basically everything though you can ask here if you have specific errors
Itโs been off and on work. Not like Iโm working on it daily. Iโve had months-long breaks from modding and then I come back.
Didnโt realize there was a 1.6.9 migration guide. Been using the base 1.6 guide this whole time.
Is this something that can still be implemented?
๏ปฟusing Netcode;
using StardewValley;
using StardewValley.Monsters;
namespace ToolGeodes.Overrides
{
public static class RockCrabPiercingHook
{
public static void Prefix(RockCrab __instance, int damage, int xTrajectory, int yTrajectory, bool isBomb, double addedPrecision, Farmer who)
{
if (who.HasAdornment(ToolType.Weapon, Mod.Config.GEODE_PIERCE_ARMOR) > 0)
{
var shellGone = Mod.instance.Helper.Reflection.GetField<NetBool>(__instance, "shellGone").GetValue();
if ( !shellGone.Value )
{
shellGone.Value = true;
__instance.shake(500);
Mod.instance.Helper.Reflection.GetField<bool>(__instance, "waiter").SetValue(false);
__instance.moveTowardPlayerThreshold.Value = 3;
__instance.setTrajectory(Utility.getAwayFromPlayerTrajectory(__instance.GetBoundingBox(), who));
__instance.moveTowardPlayer(-1);
__instance.currentLocation.playSound("stoneCrack");
Game1.createRadialDebris(__instance.currentLocation, 14, __instance.getTileX(), __instance.getTileY(), Game1.random.Next(2, 7), false, -1, false, -1);
Game1.createRadialDebris(__instance.currentLocation, 14, __instance.getTileX(), __instance.getTileY(), Game1.random.Next(2, 7), false, -1, false, -1);
}
}
}
}
}
This code is pretty old, and I'm unfamiliar with Stardew Modding, for now...
That's not really going to answer my question on if the effect would still work in 1.6.14. I have an already built copy of the old mod. Unless there's some form of building mods outside of Visual Studio, like a stardew specific plugin or something that gives Stardew specific errors that I'm not aware of
i mean a code snippet without context doesnt really tell anyone what the effect is intended to be
or what specific part you're asking about whether its still possible or not
Old school effect that would break/kill those annoying rock crabs
without having to smack them a bunch of times
I don't think anyone has an encyclopedic knowledge of all the methods that have changed either
unfortunately we dont have any fancy intergration testing framework
i mean any effect is possible if you wanna write the C# for it
u would get farther just by getting in game and trying
you can still write code to kill rock crabs same as you always could
I don't think any methods have been straight removed without any replacement possible
and even if they were, you could just reimplement them
personally i suspect this will be fine but i dont even know what method this bit o code is supposed to Prefix
yeah theres no patch information besides it being a prefix
RockCrab.takeDamage presumably
I've taken to naming all my prefix methods after the things I'm patching, since I refuse to move to Harmony attributes lol
you could still put that information in an attributed function
and tbh from a quick glance it seems like everything this method need are still there
i wrap all my patches in try/catches and put the function info in the error message
https://github.com/spacechase0/ToolGeodes/tree/master is all of the og code on github
in the catch
just build, see if it throws errors and fix them as you go
And honestly, I just want to learn how to add the rock killing effect to a weapon, if possible
then later learn how to make my own weapon, but 1 step at a time.
wow it's enchantments b4 enchantments 
Yeah but there were more of them heh
it was a nice way to dump minerals too
It was one of my favorite mods back in the day
Second to maybe Magic
Making a new farm map: Any considerations which need to be taken? My plan was to copy paste the Vanilla Meadowlands farm map.
hey everyone, a quick question
it was pointed to my attention that my polished gems appears in the gem and mineral collection
they aren't donatable to museum (using the tag to exclude them), before they were completable anyway, but with the 1.6.??? change they aren't
what are my options?
(and do you believe this would deserve a pathos signal so the tag exclude them from collection now that it's the actual donation that matters in every case?)
yeah it seems like the part of the collectionspage that checks whether the mineral should show up drawn just checks if it exists in the museum, not whether it should in the first place
i think i recall that change being made in 1.6.9
yeah it's pretty recent
"The collections tab now shows artifacts, gems, and minerals once theyโre donated to the museum (not as soon as you find it)."
case "Minerals":
whichCollection = 3;
farmerHas = LibraryMuseum.HasDonatedArtifact(id);
break;
hi @ivory plume do you think the collection list of donatable items can check and exclude for items having the not_museum_donatable?
If it fits in one of the bug fixes changes and is, of course, not a breaking change?
see context right above here
i dont remember what the 1.6.8- version of this code looked like but it should probably do an || and the original check if its not a valid donation item, i agree
Unless I'm reading this wrong, it should?
thats not checked on the collectionspage
(i wonder if the items WITH the donatable tags should count)
that code snippet i posted is what checks whether or not the gem should be greyed out or not on the collections page
and HasDonatedArtifact just checks whether the item exists in the placed museum pieces
Oh, I see
which it wont, ofc, bc it cant be donated
you cant just change HasDonatedArtifact though bc i imagine thatd mess up other checks for all items that are not donatable items
so changing CollectionsPage would be best
id think, anyway
yeah basically i think it means that VMV players will get uncompletable collection currently.
my workaround would be to make the gems something that isn't gem as category, but obviously it's not the cleanest
it wont?
achievements/perfection
nah the perfection checker only checks if you have the total number of valid artifacts
and that total excludes items with that context tag
if you have the total number donated* i mean
that is something good to share with the person that asked me about them
i suppose tracking stuff is still confusing but this means it's a lower issue
funnily enough it actually checks if you have exactly the nubmer of total artifacts
so if you ever somehow add an item to the museum collection through means other than specifically left clicking a slot in the donation menu while you are in the museum
and reach or exceed that total
you cannot complete the museum
(actually ig if you force the museummenu open from anywhere, it will work, but its hard to force it open when it really wants you to be in the museum for it to exist)
i would almost say thats also probably something that should be changed to check for >= instead of just == but i dont think its exactly common to be able to exceed the limit or reeach it outside that menu, but like, theres not a safeguard in place for it afaik. any mod can just manually add an item to the museumPieces dictionary
could be an issue if someone makes a "mail your items to the museum" mod
C# mods i assume?
yeah CP mods cant do it
(the same also applies to the flag you get for donating 40 pieces, its an exact == check)
this.Museum = (Game1.currentLocation as LibraryMuseum) ?? throw new InvalidOperationException("The museum donation menu must be used from within the museum.");
(and only in MuseumMenu)
I see what you mean, even Marnie's shop isn't that rude
yeah all of the MuseumMenu checks check the current map so
it kinda HAS to be in there without a lot of patchiung/reworking
apparently i did actually notice this when working on Custom Museum Framework bc i wrote iun >= instead and just forgot to ever bring it up lol
Lmao, this is why I don't like to sit on fixes for stuff, I will absolutely forget about it
tbf it wasnt a fix, i was writing a new GameLocation subclass and was already writing a whole lot of custom logic
so it was just one of those things i did slightly differently from LibraryMuseum.cs among many many other small things i did slightly differently
what's the proper way to check if the current Game1 is non-main splitscreen?
actually wait I think Game1.options.gamepadcontrols will do what I want
maybe
yeah based on the decompile it looks like a combination of that and snappymenus
I'd recommend Context.ScreenId > 0
in 1.6.9 have there been any changes on changing audio? i noticed my game crashes whenever i try to pet my cat and i made a mod that changes the meow of a cat, however other audio changes i did dont cause this issue
well do you have your crash log?
where do i find the crash log?
!log
Important note: Your computer username may appear in the log. If your username is your full name, please be aware of this before uploading it.
Please share your SMAPI log file. To do so:
- Open this page: smapi.io/log.
- Follow the instructions at the top of the page to upload the log file. (Don't copy & paste from the console window!)
- After uploading, it will show a green box with a URL to share. Post that URL here.
Please do it even if you don't see any errors. This has useful info like what mods and versions you have, what the mods are doing, etc. If the issue didnโt occur in your last session, please load the game to the point where the issue occurs, then upload the log.
thank you!
hmmmm the description for SButton.Select says it's a keyboard key, but I've never seen a select key on a keyboard. Does anyone know if it's actually a controller button? and if it's not, what on earth it's bound to?
Iโve seen one on old keyboard maybe??
it doesnt look like it logs anything about the crash itself https://smapi.io/log/c7609a15228f4c1ab0fbe1aeefb7acc9
Log Info: SMAPI 4.1.7 with SDV 1.6.14 build 24317 on Microsoft Windows 11 Home, with 2 C# mods and 1 content packs.
Can we see your code
huh! the more you know
Oh, IBM.
was this log actually made after a crash or did you load a save again after and then quit out without crashing?
after the crash
I'm gonna guess what I want is "ControllerBack"? despite the weird name
FWIW, if SMAPI crashes on me, it never logs anything about the crash itself
Just everything up until it happens
(the only time i've seen a crashless log it's the AVE thing, prior to uh, the other mod that actually crashed cp)
Aside from there being some kind of issue with me having not restarted my computer in a while, I almost never see SMAPI crash
here's the part where i change the cat meow audio
{
"Action": "EditData",
"Target": "Data/AudioChanges",
"Entries": {
"{{ModId}}_joltik": {
"ID": "cat",
"Category": "Sound",
"FilePaths": [ "{{AbsoluteFilePath: assets/audio/joltik.ogg}}" ],
"StreamedVorbis": true,
"Looped": false
}
}
Usually just a mod in SMAPI will crash and warn me that it might not be working
Take it out of .ogg. use .wav
all the other .ogg files work tho
Disable StreamerVorbis
ogg is kind of prone to issues isn't it?
kay
Do not use it for short sound effects (ie a meow)
ill try those changes
(time to replace the cat meow with Nyan Cat music)
Someone else please make sure the wiki has this info pls 
I'll let you know when the wiki loads sometime today
iirc it does
turning off streamedvorbis fixed it :0 Thank you so much!
odd that it worked up until this point
Yeah recommended but I guess it could be more strongly worded
there have been audio related changes in the patches
Yup
the transition to uhhhh OpenAL right?
i see!
its not a guaranteed crash so i think the wording is fine, plus if you word it stronger you run into needing to define what "longer" means
Separate section talks about using ogg for larger files like music and wav for smaller sounds
(which I probably should have read before I started plopping minute long .wav music into a test mod)
i thought it had something to do with the changes about pet data i saw in the wiki, since that also includes sounds, but there were no code examples so i couldnt wrap my had around it lol
Use your good judgement
You're a programmer
its not me i need the definition for
its the newer modders who will see it on the wiki and come in here to ask what the cut-off is and no one in here will be able to answer
(strongly recommended)
Ask yourself: is it likely that mendelevium-247 will decay in the time frame?
The cutoff is probably vibes, honestly
i was gonna say, time to make some babbling .wav files of increasing lengths until it crashes on me
.ogg
oh ogg, ok
ogg is the weird one because it has to deal with file compression and streaming off your drive instead of being cached
but is it actually a strong recommendation, though? or is it a "technically its better but the actual impact is minimal most of the time"?
like, i know it crashed for them and changing that fixed it, but idk, i kinda feel like thats probably also a symptom of a different cause, because i feel like streaming a shorter length file shouldnt, just, instacrash the game. but im also just talking without any knowledge, so
if its a consistent "if you stream something shorter than x seconds it will crash" then i think that should be listed for sure, but is it really gonna do that every time or was this a weird fluke
Yeah, I mean the fact that it is on the wiki at all is probably fine, there's a lot that comes here that we have to explain further anyways
Would need to test further to know for sure if it's consistent or not
Could also be specific to their computer set up
Maybe it depends on what kind of device it's streaming off of
There are too many factors in computers to be 100% sure
The tl;dr is music goes to ogg and StreamedVorbis
sound effects, ESPECIALLY SOUNDS EFFECTS PLAYED MULTIPLE TIMES go to wav
(did that "too many ogg" error get fixed in the recent hotfix?)
that's an ask-myuu
that was fixed
i just wouldnt wanna get into a similar situation like "dont overuse LogLevel.Alert bc of alert fatigue" where if things are strongly recommended when they really work fine even if not followed 99% of the time too much people might underestimate when something is actually strongly recommended
but this is just one girls onion. im no wiki maintainer
do cp mods that are adding a rescipe to a machine automatically overide any data in vanilla for that machine?
If you do it wrong
https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide/action-editdata.md#edit-a-deeply-nested-field
TargetField can be used to add entries without overwriting surrounding entries
Alert what
if you use Alert too much for things that dont need to be Alerts then people start ignoring Alerts
Almost no one uses Alert except for smapi update checks and for debugging lol
yes thats the point
is Alert the purple one
ah yea ive only seen it used in smapi update check and graveyards lol
Does anyone know what folder contains the dialogue portrait frame/background?
pretty sure thats a cursors
tiny little box cause code stretches it
its in the top-ish right of LooseSprites/cursors.png
the relationship indicator isnt part of it though
its somewhere else
somewhere else in cursors i mean. dunno where
I think I need a bracket somewhere in here or another curly brace. But I've always struggled with figuring that bit out when I've got it wrong. I'm trying to add 2 furniture items to Robin's shop with CP. https://smapi.io/json/content-patcher/dfc1a031adf64e76b1c828f86f4e37a0
THANK YOU, I was looking for so long in loose sprites and didn't realize I should have looked closer at the sheets
need another entry key, you have one that's "Furniture", which you should probably make unique
You want your entry key to be unique for the list, usually making it the same as the ID you're putting there is the convention
I'm just adding vanilla furniture that normally can't be bought with gold. But I think I sorted it.
i am now curious as to where the palpitating ball is for the relationship thing
Cursors I think? Or cursors2.
I did not know this page existed. Bookmarking ASAP. TY!
ah it's the base one
this seems a bit more plausible
Changed the When condition because it looks like you were trying to use a GSQ?
Shop item entries themselves have a condition field that you could use a GSQ for
TY. I made these mods with STF and am converting to CP for the stability. Still learning all the nuance of when conditions v. gsqs and such.
Oh, I need to do that GMCM API fix
simplified: When conditions outside of Entries are Content Patcher's thing. "Condition" lines inside an Entries block are GSQ's
@teal bridge Here's a build with the API behavior for OpenModMenu reverted (and a new method for the child menu behavior). Would you mind testing to see if it works as you'd like? I don't have any mods that use that API method.
(No worries if not, if you're not interested in testing I can just release it as is)
love of cooking alpha uses openmodmenu from a button in the cooking menu to go to the gmcm loc page, should i give this a look or
Possibly yeah. In 1.14.0 it started setting the new menu as a child menu of any active menu instead
huuh i should really look at a loc release now i think about it lol
So this build reverts to the old replace the whole menu approach, with a new method for the child menu thing
what was the reason for the change (and the revert)?
I ultimately made the change originally because GMCM now largely functions based on child menus outside of the title menu implementation. What inspired this change was the trigger action action I added for opening a mod's config menu - I added this so you can open a config menu from a SpaceCore guidebook, but it felt better to have it as a child menu instead of a replacer so that closing the config menu brought you back to the guidebook. And it also felt like it made more sense to me in general. (I don't recall child menus existing when GMCM was made - or at least, I didn't know about them.)
Once I released that update focustense ran into some backwards compat issues: <#making-mods-general message> So this change should make the old code work fine, and it people prefer the child menu behavior they can use the new method
I'm not entirely sure just reverting the behavior of the API method will be enough for focustense's use case though, hence why I would like some testing
Wow, Pathos's message disappeared before I could click on the link ๐ข
(I was going to repost it when the current discussion is done.)
clearly not just experimental, but highly volatile
smh Pathos you don't want it to get buried?
i think the child menu behaviour is perfectly good, obviously people will have different use cases so having it optional is good. i don't think i had any particular expectations in mind when i added the go-to-config button to the cooking menu though, so as long as it works i'm happy
Clearly you just need to pin it - because everyone reads the pins regularly, riiiight?
i'll quickly pop open sdv and see if the gmcm changes work alright
(Normally I'd just let it get buried, but I think reinventing how the mod compatibility list works is probably a big enough topic that we don't want it buried.)
Not enough changed with special orders (if anything?) in 1.6 that I need to worry about tweaking the special orders in my mods to make them compatible? They were already added by CP and I don't see anything about special orders in the migration guide beyond some of the descriptor text for new changes or being able to add a special order via mail.
There's also the event command for adding or removing a special order now
But if I just want it to be added to the special order board rotation I don't need the event command right?
Correct
do i need to update my gmcm api file for the new update?
TY. Realizing as I look at this mod I should have built when conditions into all sorts of things lol. As it stands, the player could get special orders from Sandy before they've even met her. hahahaha.
Not unless you want to use the child menu method
oh, they're separate methods, not a param?
Yeah
You can't really do new optional params with pintail
Add that to the list of todos of atra-of-two-years ago
I think it's technically doable but like
smh why isn't atra taking care of every problem in the modding community
Because atra is old and tired these days
seems to open and close just fine with the old method
any specific issues you wanted looking out for?
Nah, opening and closing was all
so this would be case where i want to put entirely custom menu into GMCM
like what a fishing sea did through crimes
Matter of fact, it seems to have the same issue. Is there any possibility that the binary you posted doesn't have the reversion in place?
So everyone shut up
Otherwise, I suppose I can try to play around with GMCM's source myself and try to narrow it down further.
Came back from not touching my mods for a while and you're telling me my mod with ONE harmony patch broke in 1.6.9 ๐ unlucky
(fwiw, I'm confused that we are talking about reverting an API method here, since the method that changed was never exposed to the API... it's accessed with reflection)
Hmm, I just checked the decompile and the changes are definitely there. 
Where are you calling the API method from?
Wait, your original message mentions callign OpenListMenu which isn't in the API
Hmm
It's not OpenModMenu, it's OpenListMenu: https://github.com/focustense/StardewFishingSea/blob/a64d489f63a536d55431935baf84aafe275d548e/FishinC/Integrations/Gmcm/GmcmPatches.cs#L46
So when you mentioned reverting, I figured you were going to have a version of OpenListMenu that did the old thing, tied to an API method that also did the old thing.
Ah, that explains it. It's still using the new method
But ultimately it comes down to how ActiveMenu (or whatever it's called, I forget) is implemented
I assumed you were using the API only for that part
I have a OpenListMenu and OpenListMenuLegacy now, I'll just rename them so that OpenListMenu is the old impl instead
Ah, ok, if it's an easy change then sgtm. I think I did mention at the time that it was messing with GMCM's internals and not going through the API, but maybe I was too flippant and it sounded like I was describing something else.
You did, I just didn't realize you meant that part too
What about this?
Although.... hmm
Calling the old implementation would affect how all subsequent menus are opened 
If it's an issue, I can switch AFS to call the legacy method instead; it's due for an update anyway once I finish with the StardewUI milestone.
Well, in the build I just posted, I renamed the legacy method to the original name and made the new implementation with a different name
Right, I will try that in a moment, though it sounded like you were reluctant to keep the change you just made.
Ah, no. I'm worried about, even with the other method names, calling the legacy implementation might act a little odd, especially if multiple mods are doing what I think you're doing. Like
- You open mod A normally. It does custom menu stuff instead.
- You close mod A and go back to the main list - GMCM is now operating in legacy mode as far as opening the menus is concerned.
- You open mod B, which also does custom menu stuff. Something might go wrong because it expected the menus to be operating a certain way, but no longer is
It might not be an issue, just something that crossed my mind
Oh, I didn't realize it was "modal" like that.
The underlying issue here is that I can't just set TitleMenu.subMenu to null because of how GMCM does its own reflection thing to override the title menu's state and makes it think it's not loaded. And the legacy version of OpenListMenu has the requisite logic to recover the loaded state.
Possibly the workaround could be limited to title menu scenarios, then? Does the guidebook/nested list menu stuff need to operate from title menu?
Not sure what you mean by the "modal" thing.
I guess I could make it where only the initial opening is affected by the legacy method, and subsequent things GMCM does still use the new method. That might make more sense...
All that's really going on here is that GMCM opens (through Harmony patching, yes) some menu that is not a SpecificModConfigMenu and therefore doesn't have full access to GMCM's internals. So that menu "B" just needs a way to say "I'm done, take me back to GMCM's main menu in whatever state it was in".
What's fragile about the ActiveMenu thing is that it does an explicit type check for SpecificModConfigMenu and won't recognize any other menu type; if both menus could announce that they are going "back" to the list instead of having that static property rely on the type of the menu (e.g. through some API method maybe?), that would solve it for AFS and any future mod as well.
Actually, I don't see this check in the setter anymore, how does SpecificModConfigMenu even return to the list menu now?
SpecificModConfigMenu takes in an Action that handles turning to the list. (I believe Pathos refactored it to be that way back when he was maintaining it)
Yeah, I think that hasn't changed. I'm not even sure what the issue is now... that is, not sure why it happens with this menu and not all settings menus.
Are you having this issue on the title menu GMCM, in-game, or both?
The returnToList callback is a delegate for OpenListMenu which is what I'm calling.
So this issue is for both title and in-game. The original issue, the reason for using OpenListMenu the way it does, is specific to the title menu. But this issue is easily repro at any point the menu tries to return to GMCM.
Hmm
Oh, the new ReturnToList sets Mod.ActiveConfigMenu = null when not done from title?
Yeah, which just clears out the most recent child menu.
I sorta hacked in the child menu stuff into the ActiveConfigMenu, probably should refactor it
Ok, I just confirmed, this bug actually only happens when not on the title menu.
And it's probably because of what I just mentioned, OpenListMenu is not the correct thing to do in that case.
Hmm, and the issue is the list menu being a child menu of itself?
The list menu makes itself a child of the menu that opens it, i.e. the AFS config.
Ah
What is the mechanism by which setting Mod.ActiveConfigMenu = null causes the game to return to GMCM's main menu while the game is running?
When you set ActiveConfigMenu to null in-game, it will clear out the most recent child menu (or the main menu if it's the root Game1.activeClickableMenu)
However, if you set it to a specific value, it just adds it as a new child menu
Like I said, it's very hacky
So SpecificModConfigMenu now opens as a child menu of the list menu, instead of replacing Game1.activeClickableMenu?
Yes
(Except on the title screen of course, because that didn't work properly)
I really should've approached the whole wanting a child menu thing very differently looking back
Hello! Does anyone know if it's possible to modify the stats of monsters from SVE and RSV using Content Patcher?
If not, what are possible alternatives to modify them?
Ok, I think there might be a way to work around this, if I make AFS a child menu of GMCM also - basically if I change the reflection code to use ActiveConfigMenu instead of OpenListMenu.
I'll have to see if it actually behaves correctly as a child menu, not sure if the list menu intercepts any events or does anything else weird.
It shouldn't - it handles all input on Update, which isn't called for any menu except the one "on top"
Hopefully you're right and the receiveXyz methods behave the same way
At least for SVE I don't think so - it spawns monsters through FTM, which has a dedicated content pack and I don't think you can edit it from another content pack
I see! Thank you for the reply.
That saved me a lot of time on reading around.
Alright, my multitasking ability tops out at 2-3 concurrent tasks and I'm now trying to do about 6, so I'll catch up on the AFS/GMCM business a little later - Pathos, if you're still there and waiting for a lull, here it is.
(Guess he decided to take a coffee break instead of hanging around)
should the game clear hud messages after each day? weird plowing through days for debugging and seeing them linger
How,, hard is it to make a custom farm map? I kind of want to experiment in making one but I have no experience in making any mod whatsoever
everything's hard when you have no experience whatsoever
once you learn the ins-and-outs of the programs though, it's all really very simple and just up to your creativity
!mapmaking
If you want to make mods that add or edit maps:
-
Use Tiled to edit .tmx or .tbin files.
-
Refer to the Maps wiki page for details on how maps work in Stardew Valley.
-
Content Patcher allows you to create custom locations through editing Data/Locations
-
Vanilla Maps can be edited via Content Patcher as well: EditMap
as the docs say, it's best to decompile the game assets first with stardewxnbhack, and then poke around in the game maps with Tiled
after scribbling and ruining those for a while, you can look at remaking them as you like for your own map 
afaik it's based on real time, not game time, so if you're just sleep sleep sleeping then they might stick for a few seconds.
so. i've been working on some nice and simple ui recolors/customizations aaaaaand just learned that most of the dialogue box border comes from four lines of single pixels getting repeated (one each for left, right, top and bottom), not multiple blocks each ._.
not lookin for a solution here, since i am aware thats c#, just ... need to share my ruined plans somewhere while contemplating if this is worth setting up a whole environment and dusting off my c# skills >.>
also funny having the console gradually fill up with ```
[SpaceCore] Doing skill menus
[SpaceCore] Doing skill menus
[SpaceCore] Doing skill menus
[SpaceCore] Doing skill menus
[SpaceCore] Doing skill menus
[SpaceCore] Doing skill menus
[SpaceCore] Doing skill menus
as you sleep through the days
mmm...I'm sure I'm doing this wrong. Moved on to the next mod on the list and now I need to add one cooking recipe to Gus's shop at the saloon. This is within the changes block but only copying the relevant bit. I feel like this is going to add the cooked dish not the recipe. Recipes don't have a numerical key in the raw data (unpacked content) while the output does so maybe this will work?{ "LogName": "Add cooking recipes from island trader to Gus' shop at the saloon.", "Action": "EditData", "Target": "Data/Shops", "TargetField": [ "Saloon", "Items" ], "When": { "HasFlag": "willyBoatFixed", "Season": "Summer" }, "Entries": { "Banana Pudding": { "ItemId": "Banana Pudding", "Price": 1500, "ApplyProfitMargins": false, "AvailableStock": 1 } } }
I'm staring at the page for modding shop data and not seeing anywhere to specify this is a recipe to add not an object.
simply add "IsRecipe": true, to your entry
TY. I had that in the STF version of this mod but wasn't sure if that was STF specific or not
saloon example:```json
{
"Price": 100,
"Id": "(O)195 (Recipe)",
"ItemId": "(O)195",
"IsRecipe": true
}
where (o)195 is the omelette
The wiki compatibility list is now right under the max complexity the wiki can render on a single page. At this point, most edits to the page time out and editing it is enough to slow down the entire server.
So, here's an experimental Git compatibility list to replace it. This combines all the data into one place (e.g. data overrides with the mod data), uses relevant data type (e.g. numbers for mod IDs), and adds a validated JSON schema for the data format.
It's not as easy for anyone to edit, but we do get benefits like automatic validation for those edits. (And I've always been a bit uneasy about anyone being able to instantly edit the compatibility list, since that can trigger update alerts to get players to install a mod from a custom URL.)
I like the idea of having all the data in a GitHub repository. I'm not sure having all the data in a single file is a good idea though.
Fixed it๐ ๏ธ
do u have to do all the merging or will u give perm to some group of helpers too
like say all the junimos in this server
I'd probably give commit/merge access to any known mod authors who are interested in helping maintain it.
And yeah, giving some trusted people permission to handle PRs would probably be good for this, if not setting up a bot with some automated checks to help.
Re splitting the file, I mainly want to avoid arbitrary divisions where people will add entries to the wrong file, or we need to commonly cut & paste entries between files (e.g. because a mod changed its name).
(Plus there's a tradeoff, since multiple files mean the update-check server will need to fetch each file individually every 10 minute and merge them locally.)
what if you load it into a sqlite db
You can use a GitHub Action to compile them into a single file and just download that.
I sincerely hope this works: https://smapi.io/json/content-patcher/446573194a1b45d7862332728ba68272 I'm confident with the additions to hat mouse and Robin but Gus and Pierre not so much. Also still need to add a patch for if players choose joja instead of community center but that can be after I get the Pierre patch right.
in another thing i was involved in, we had a msql crud setup
the data there was mostly automated but sometimes incorrectly parsed so gotta manually fix via the crud
I know it's not quite the same purpose, but the Dalamud (FFXIV client mods) team uses a GitHub repository for managing their official plugin list. Every distinct add-on has its own file(s), and that seems to work quite well.
You just do a PR to update your add-on's file when relevant, and their CI handles everything.
In my experience, GitHub works better with many small files than with one large one. The blame tool, for example, breaks down for particularly large files.
And with separate files for each mod, you'd have a more useful history.
That isn't necessarily important, admittedly.
Splitting per mod could be messy, since the line between mods can be fuzzy (e.g. sub-mods popping in and out of existence, mods getting merged into or split from another mod, mods getting reposted/forked, etc. And validating a JSON schema for 2000+ JSON files and re-merging them on each commit sounds a bit slow.
But we can certainly look into some sort of split between all-in-one-file and one-per-file. I need to update all the surrounding tools and finish updating the compatibility list though, so I'll keep it at one file to start with so I can get back to the 1.6.9 compatibility list updating.
I could mess with it a bit if you're interested in seeing what it looks like.
@next plaza I think I've sorted out a solution that doesn't require any workarounds on your side - more or less copying what the updated version of the returnToList callback does using reflection.
By the way, I noticed a bug with the released version, not sure if you fixed it already, but if I open up GMCM while in game and go to a mod menu, GMCM keeps drawing tooltips behind the specific mod menu. This is not just AFS, it's every mod.
Mods get transferred around too though.
My thought would be to use a mod's unique id for the file structure.
(I wish the unique ID was static and unique, but that often changes over time too.)
nexus id 
Not all mods have nexus ids.
yea
And there are some mods where several mods share the same nexus id.
I know the unique id can change, but there's no reason you can't just rename the file at that point I would think
Technically yes from a Git perspective, but it becomes a bit tedious to update hundreds of mods if it also involves renaming and editing hundreds of files, instead of just a quick CTRL + F in a JSON file.
(Though with a proper JSON format, hopefully that can be automated more in the future.)
... are you expecting hundreds of mods to change their unique ids? 
(I wonder if any of this is automate-able)
like
a bot downloads a mod, launches the game + smapi + that mod, and see if smapi loads it
Yeah, having lots of files ultimately shouldn't matter since we can just write some tools going forward.
Processing one big file or lots of little files isn't significantly different for automation.
sleeps for 20 minutes, tries the next mod
I'd expect something like 100-200 mod changes per month (new mods, abandoned mods, broken mods updated, mod info like the name or ID changed, etc).
(20 minutes was a random guess but I'm surprisingly close
That's assuming you don't get another aedenthorn posting another mod every day.
there's plenty of other things like, say, Modder X deciding to rename all their mods
Yep, the compatibility list updates I'm doing are semi-automated. I have a tool which fetches the compatibility list, crossreferences the other sources like the mod dump, installs every known compatible mod, validates dependencies, etc. The simplest compatibility checks (i.e. does SMAPI load it) are easy, but Harmony mods have an annoying habit of throwing runtime exceptions that need to be individually evaluated to see if they're actually incompatible or just have a minor bug.
Modder X is a jerk.
I'm so sorry :pufferhug:
...that's not an emoji?
That helps, although I found the second issue, and it is a SDV? or CP issue: If you tag your item as a gem or mineral, it shows up in the collection page. But if you also then use the tag to make it not donateable to the museum, you can never donate it, so it'll be an eternal silhouette on the page.
lumina pinged pathos about that same thing earlier
hah. That makes sense, because it was playing VMV that I discovered that.
it doesnt actually affect perfection or achievements
it only affects the collections page
(and then found out I was looking at the wrong source code!)
(I'll be back on game fixes in a few days, trying to finish the 1.6.9 compatibility list update first or die trying.)
By the way Khloe... not sure if you're aware, but on the latest VS tool chain your ModManifestBuilder raises warnings about a security vulnerability due to a very very indirect dependency on an ancient version of System.Drawing.Common.
It's... not really very important, being a build tool and all, but I think you can get rid of it by updating a few dependent packages.
Yeah, that's fixed in the upcoming release
hopefully you'll get there before 1.6.15
In any case, I think moving to git is a good idea to solve the complexity limit
(Also, I have now had the joy of seeing SDV swallow nearly 10000 MB of RAM.)
changes all my unique IDs to be kittycatcasey instead of spacechase0
the heck are you growing on your farm
Mass chaos
(sheep, apparently)
Not much, but at 143 mods with SVE being one, SDV is uh.. swallowing RAM up
That sounds like a leak.
It most likely is, since it hangs at random times.
143 is definitely not a lot
stardew 1.5.6 with SVE and 200 + other mods on an endgame save was between 2-3GB ram
that saidI
hm ๐ค
I do feel a leak is likely
(And a textbook case for how GC doesn't solve all memory problems magically, despite the protestations of certain individuals)
i have ~400 atm, also sve and sitting at 6,7GB
hm. I've been running this for..
yeah, I've noticed that Frontier Farm, for example, seems to be reloading much more often than its CP patches should indicate
which feels like some sort of...hmm
which is the one I'm using, yeah
I know that map reloads currently leak a little memory ๐
by that I mean, there's a cache that doesn't get emptied right
Getting to 10 GB by maps alone seems unlikely.
The maps just aren't that big, even if the entire maps were being kept in memory.
This is something reallocating like, every frame.
Anyways, I've been poking at the game's rng
xtile assigns a dictionary to every single blasted component on every map
it's stupid
it's bad.
it's obnoxious
Yes, but not 10 GB bad.
Right now it's.. 6.9GB at 5:51 running
(it took me some time to dig up the powershell code to get runtime)
five hours
Anywhere between 3-5 GB could be normal with a lot of mods. Double that is suspicious.
.. I am actually tempted. Might as well.
Wouldn't the VS profiler be more helpful here?
Gotta... uh... spend memory to make memory?
you know, this entire time I thought xoroshiro was some japanese dude
Ok so yeah I had a dummy mineral items before I changed it to the vanilla category for minerals. Now it shows on collection page? But you say you still cannot donate item? Hmm I guess the only other way is to add it to the list with code right?
No you didn't, I remember months ago when I was talking about Xoshiro RNG and you made a point of informing me that it's never used in Stardew because Stardew is only seeded random.
(You're not the only one with a long memory)
no, I knew it was an algorithm, I just thought was some dude's name
I wonder..
Oh. You didn't know it was based on xorshift?
I guess that's what happens when you try to invent clever names, no one knows what you're talking about.
like, I knew xors and shifts were involved, I've looked at the algorithm, it just didn't click that "xoroshiro" was...not a name
I read that and was like "okay, the algorithm made by xoroshiro, makes sense, moving on" and didn't thinka bou tit
Well, that's partly because "xoroshiro" isn't the name, it's "xoshiro".
was looking at this on the modding maps properties and was just wondering SpawnMountainFarmOreRect <tile X> <tile Y> <tile width> <tile height> is it : " 10 9 3 4" or "10 X, 9 Y, 3 width, 4 height" or another way?
some of them are indeed called xoroshiro https://prng.di.unimi.it/
just the numbers, e.g. SpawnMountainFarmOreRect 10 9 3 4
thanks
is a half-second first-time init considered bad for a mod? just taking a glance in profiler for fun and noticing most of my mods are around 100ms, but the bigger ones are closer to 500ms
... yeah, I found the cause. There's a leak overnight of ~500MB. Somewhere.
it all looks pretty tame relative to mail framework mod sitting at 4.5 seconds though
And now I need to wait for SDV to crash so I can restart it..
I think that depends on who you ask.
I spent a few days optimizing a 275ms frame down to about 110ms. But there are modders out there quite happy with 12-second load times.
Just for you I'll put in time.sleep(120)
Sometimes a long load time isn't entirely your fault either, it can be asset loading shenanigans.
(I used to waste roughly that long per game day, if anyone spawned stuff in town-sized maps
)
Hm. Reloading the game drops it to amuch more reasonable 3.1GB
(Emphasis on sometimes, don't just assume that please)
Still has a very suspicious hang during loading
I'm trying to see if the player has a certain item, and if so how much of it in their inventory. I found the GameStateQuery.CheckConditions method which does give me a range of the number of items the user has in their inventory, but it seems the only way to check the exact amount is to call the method multiple times. Like so
GameStateQuery.CheckConditions("PLAYER_HAS_ITEM Current 472 1 1");
GameStateQuery.CheckConditions("PLAYER_HAS_ITEM Current 472 2 2");
GameStateQuery.CheckConditions("PLAYER_HAS_ITEM Current 472 3 3");
I could improve this by doing a binary search, but I wanted to know if there was a better way. Additional related question: is there a way to get all the chests in the game, and their content? I'm looking to do something like the fair helper, but in game https://mouseypounds.github.io/stardew-fair-helper/
That's suspicious? I'd be suspicious if SDV didn't hang while loading. Several times.
It normally doesn't go unresponsibe for me, but I usually stick to sub 100 mods, admittedly.
love of cooking has a 600ms startup time, since it's loading assets and interfaces, registering queries, commands, events, menus, skills, serialiser types, and tokens, reflecting translations, applying harmony patches, ...
^ a good amount of that can possibly be done in parallel.
other than cutting out the reflection (my beloved) i doubt i could reduce that much other than distributing it through other game events
Something to keep in mind is that since you're initially running on the main thread, you can branch off to any number of async tasks you want as long as they don't conflict with each other. You don't have to worry about them conflicting with vanilla or with other mods as long as you ensure they're all completed by the end of your entry method or other event handler.
Obviously you can't do certain things like load textures on a thread. But other things, you can.
try Game1.player.Items.CountId(string) (Inventories/Inventory.cs)
i wasn't aware people actually threaded their mod setup
I don't think many people do, just saying you can.
Calling it "threading" makes it sound more complicated than it is, it's just Parallel.ForEach and stuff.
(But don't do that with asset loading)
you can thread as long as you aren't loading assets. i had a thread setup for loading .ogg files back in 1.5.6 (they were added directly to the sound bank, so they didn't go through the pipeline)
i can believe that, even Gift Wrapper and Greenhouse Entry Begone have a 100ms+ load time and one of those is just a glorified harmony patch
(but it also fucks with assets later)
Harmony probably has to run on the main thread, but even there, you can parallelize or background certain things, like getting the MethodInfo and PropertyInfo and such that need to be patched. Maybe not worth it for just a couple of patches, but I'd say it's worth a trace or two if you're actually halfway concerned about load times.
at one point of time I tried to run harmony off the main thread and mod integrations (ie pintail) on the main thread
but it wasn't worth jack
Pintail is actually probably a huge sink since it's doing IL emit.
Parallel.Invoke(
// Game state queries
() => Queries.RegisterAll(),
// Harmony patches
() => HarmonyPatches.HarmonyPatches.Patch(id: this.ModManifest.UniqueID),
// Game events
() => this.RegisterEvents(),
// Reflection
() => Utils.CopyTranslations(from: ModEntry.ContentModUniqueID, to: this.ModManifest.UniqueID),
// Console commands
() => this.AddConsoleCommands(),
// Mod APIs
() => Interfaces.Load()
);
// Assets and definitions
this.ReloadAssets();
// Cooking skill
ModEntry.CookingSkillApi = new CookingSkillAPI(this.Helper.Reflection);
SpaceCore.Skills.RegisterSkill(new CookingSkill());
so you think this could shave off a couple ms if it works 
AND it would deadlock randomly
Haha, well that's not good.
wow what is this
grasping at seconds as they fly past me into the void of the past
Maybe? It's really hard to say. Depends if all of those can actually run on background threads, and how long they take.
anyways
Atra's also correct that if your breakdown includes one task that's vastly longer than all the others, then you can't optimize any further unless you can parallelize that specific slow task.
I wonder how hard it would be to take stardew prng and like
hack it into some semblance of not weird.
"some semblance of not weird" isn't exactly a clear goal.
Most of SDV's randomness makes a lot of sense, even if it's sometimes implemented in a clumsy hardcoded way. In other game engines you'd have "derived entropy" as opposed to hardcoded stuff like "day-save random" but it's the same principle. True randomness is reserved for things that aren't relevant for save-scumming, like animations.
yup, but then you get like, 40 day dry periods
(and fish, sigh)
Ah, so you want a more uniform distribution (like Poisson), which is subtly different from randomness.
I would like to get above the W/W for expected runs, not way below
we'll start there
And W/W is...?
That worked, thanks. I assume a chest would also be from the Inventory class. Do you know how I would find a chest? Let's say on the player's farm?
Wald-Wolfowitz
Oh. But for what? Randomness applies to specific things in game, not the entire RNG.
right now? I'd be happy if rainy days had the W/W predicted number of runs
You mentioned rain, and that's not even random in the conventional way, it's based on weird shit like step counts.
that's what I'm focused on
ah, very good. parallelising that handful of methods has brought the load time down from 640ms to 680ms ๐
that was the case in 1.5.6 which was fine it's not the case in 1.6 which is what has caused this issue
Impressive!
Congratulations! I knew you could pull it off.
Which of the tasks is heaviest 
so have it on map like this and have type as dirt but still cant get any spawns can anyone think of what im missing?
If it's HarmonyPatches.Patch, you might see if you can parallelize that specifically, run a task for each patch, assuming it doesn't deadlock or break.
sure, i won't try it
known there's a lock
Hm what is copytranslations about
Haha... yeah I figured it was iffy, Harmony being what it is.
copytranslations is phat reflection
But, look, just stick a Stopwatch on the sequence of tasks and measure each one. See what the individual tasks take, before guessing at a solution.
well that reflection could be one place to start optimizing
see, ideally I do want less long runs than what true random would produce
because, well
runs aren't fun
Do you have ur own non i18n translation thing going on
but.
I thought the TAS with 48 straight days of rain was pretty fun. Or funny. Something fun-ish.
it's reflecting score/smod to take translations from the CP mod to use in the C# mod
pretty awful, we had a discussion about this just yesterday
well for a TAS, yes
i left that discussion still unsure of the decision making process there
Are you using reflection invoke each time instead of creating delegates?
Ah so ur own cmct
but for a normal player, well, by the time they get to the third
why the hell
just grab the other mod's translations by stealing their translation helper
But if it's ur cp mod why don't u just use Strings/
that's somehow the "normal" way things are random in stardew ๐
you can just load it to your own asset...
like for a video game, if you open ten chests in a row and it's the same thing
no this is fine, the fact that they changed it is the problem here
the step count is at least one additional source of entropy
"Target": "ModId/Translations",
"FromFile": "i18n/default.json"
you can just do this
it was more convenient to just steal the entire translations obj since there's a few hundred uses and i couldn't be bothered using loadstring each time
Wouldn't that be just default button
thats just to get the idea across
i've done this for a different mod i think
please understand every mod i have uses a different translation setup
usually more stupid than the last
Adventurous
{
"Action": "Load",
"FromFile": "{{FirstValidFile: i18n/{{language}}/{{Lowercase:{{TargetWithoutPath}}}}.json, i18n/default/{{Lowercase:{{TargetWithoutPath}}}}.json }}",
"Target": "Mods/{{ModId}}/Translations/{{language}}/Books, Mods/{{ModId}}/Translations/{{language}}/Config, Mods/{{ModId}}/Translations/{{language}}/Debug, Mods/{{ModId}}/Translations/{{language}}/Dialogue, Mods/{{ModId}}/Translations/{{language}}/Mail"
},
this is what BEB does
beb...
I make it a goal to write less text in each mod
buttons extra books
it was cleaner before i moved to i18n subfolders
it also loads the default as a fallback. i just handle things OnLocaleChanged if necessary
my other mod uses```json
{
"Action": "Load",
"Target": "{{PATH}}/Strings/Strings",
"FromFile": "{{FirstValidFile: i18n/{{language}}.json, i18n/default.json }}"
}
thats pretty much what i had before subfolders too yeah
How are you reading it, though? If you're getting a single Dictionary<string, string>, then it's probably as fast as it's going to get; but if you're using reflection invoke to get every translation string individually, you can definitely speed that up with delegates.
Anyway, pointless speculating, just Stopwatch it
i'm not reflecting translationHelper.Get(), i'm reflecting SetTranslations with the values of the other mod
https://github.com/b-b-blueberry/CooksAssistant/blob/feature/sdv-1-6/LoveOfCooking/Core/Utils.cs#L1295
h
absolutely
"This allows us to share a single group of i18n files between all mod components."
i have to respect the confidence here. yes. this is what allows us to do this.
just this.
yeah i had to put my 'pushing the world's worst PR past my manager' hat on for that comment
why not just reflect for your other mod's translation helper?
i mean this lightheartedly and with the awe and respect of someone else who loves reflecting to do some bullshit, but this is maybe one of the worst ways i couldve thought to do this i think
Notwithstanding the glaring design issues, it doesn't look that suspect for performance.
of course, feel free to suggest a better solution. i fucking hate this mod
the less time i have to look at it the better
ive got a suggestion
i think you should remove the Parallel.Invoke
i think you'll shave off 40ms with that change
-40ms actually
oh my bad sorry
I mean you can remove the Invoke and save 680ms and also get nothign done
I can't seem to get info about mod dependencies from nexus api
no more spooky server...
stopwatch marks // evil plans at 20ms, and harmony at 644ms
so unless i can speed up harmony that's all
what do your harmony patches look like, are you reflecting for every single methodinfo
there's 3 files of harmony patches actually
https://github.com/b-b-blueberry/CooksAssistant/blob/feature/sdv-1-6/LoveOfCooking/Harmony/HarmonyPatches.cs
plus the other 2 in the harmony folder in the navigator
it wouldnt surprise me if they just didnt think about it when making the api
atra you'd know this better than i would, is RuntimeReflectionExtensions.GetMethodInfo significantly better than AccessTools.Method or are they the same or is the former actually worse
didnt you mention one time something about rewriting the harmony guide to use it or something
i feel like you're the one i got it from but i could be mistaken
blueberry what if you replace one of those AccessTools.Method calls with that one i just mentioned instead and stopwatch it again
you'll need to using System.Reflection;
oh you already are ok
You may or may not be able to speed some of that up by parallelizing the AccessTools.Method, or if Harmony doesn't like that, doing conventional GetMethod on parallel threads.
But, I stress may. I wouldn't do a whole lot of work until profiling it. I'd start with promoting all those AccessTools.Method inline calls to fields, and then measure how long the Harmony patching takes on its own. If it still takes 620 ms or whatever, then that's pretty much all you can do.
One thing I'm pretty sure of is that AccessTools.Method is not cached, so you are doing some repeated/unnecessary work in there, and might save time just by making them fields and reusing them.
arent they all grabbing different methodinfos anyway? does it matter if those are cached?
Some of them are. I know I saw multiple references to drawHoverText.
it wouldnt make a difference for the ones that aren't being reused and refetched, which is none of them, but fielding them does at least mean they can be parallelised
oh right that one has a prefix + transpiler
My guess is you won't see a huge improvement from getting the methods separately, you might gain 20-30 ms if you're lucky.
IL emit is slow, thus Harmony is slow, and while you can do IL emit in the background, I guess you can't do Harmony in the background. Sad.
As a general rule of thumb, parallelization tends not to yield very significant improvements until you've got dozens to hundreds of independent tasks, or a small number of extremely slow (each at least hundreds of ms) independent tasks. If the tasks ever have to wait for each other, fight for locks, etc., then the yield goes down even further. And eventually the overhead of scheduling and joining the work is larger than whatever time is saved on the main thread.
I'm kind of surprised Harmony doesn't have any of this built-in, since patches per method have to be applied sequentially but each individual method is independent of any other method.
at least in the main harmonypatches file, the accesstools calls from the initial Patch method alone make up 200ms for 8 calls, so probably -150ms is the best you could hope for
how would i format parallel calls for locals? worth finding out what i get, anyway
I don't think you can parallelize field initializers, you could just stick them in a list an iterate over it with AsParallel()
Or do the Parallel.Invoke thing to assign values to the fields, it's stranger syntax but it'd work too (I think).
this is definitely going to take more than 150ms of my afternoon
Just beware of ordering, unless you specify AsParallel().AsOrdered() your results won't be in the same order as the inputs (and AsOrdered slows it down considerably).
Well, you asked! I'm actually surprised it adds up to 200 ms, that's far more than I would have expected.
Pretty sure 99% of modders would not trouble themselves over 200 ms. I only care about that stuff myself in frameworks.
You need a compile-time reference, though, it appears?
yup!
i'm only really interested because this mod used to have a lot of users
i was doing tests too but was getting much worse stopwatch results with runtimereflectionextensions vs accesstools 
maybe with enough reinstalls they'll almost save enough 150ms increments between them to reach the time it took to type this message
I mean, 6600 upboats is nothing to sneeze at.
Does anyone have a schedule json just so i can test my mod and make sure everything shows up as intended
But past a certain point, performance optimization is rather more about your own sense of perfection than it is about your users' tolerance.
my long-suffering users have had to tolerate a bit over the years
So I was bored and decided to let SDV run a bit, and I'm seeing memory gain (down from 3GB to 2GB when not in focus in the mines) from idling it.
