#making-mods-general

1 messages · Page 148 of 1

brisk rover
vernal crest
#

Yeah I do use patch reload but some edits require the game to be restarted

brisk rover
vernal crest
#

Can you share your log please?

brisk rover
#

yup yup

#

i will warn you

rancid temple
#

Is that what it looks like when it tries to display Korean in the default font?

brisk rover
#

I know about the massive errors just...

vernal crest
#

I assume so?

brisk rover
#

no i mean

#

youll see

gentle rose
#

if modders always did what was advisable, would most mods even exist? DogeSmile /lh

brisk rover
#

just dont ytell art nme

vernal crest
#

Sorry DuskyGirl my reply was to rokugin

brisk rover
#

yell at me

vernal crest
#

If they aren't errors relating to this problem we can ignore them, most likely

rancid temple
#

The wiki doesn't have a listing for English translations, you might actually have to swap the en to default and the Korean to ko

uncut viper
#

default does not have to be english

rancid temple
#

Right but I don't think it supports English

#

As like, not default

uncut viper
#

the game will look for en first before default if your language is set to en

vernal crest
#

I think I will just pop that in the wiki so Button doesn't have to repeat this forever lol

calm nebula
#

2021

uncut viper
#

it would be quite an inaccessible and english-centric choice to decide default has to be english

calm nebula
#

That was A Year

rancid temple
#

Oh

calm nebula
#

I remember 2021, aka 2020 part 2

rancid temple
#

The events aren't i18n

uncut viper
#

two of them are

vernal crest
#

The event that DuskyGirl is testing is though

uncut viper
#

one of them is not

rancid temple
#

Which one is being triggered

#

Mk

uncut viper
#

the Woods one

vernal crest
brisk rover
uncut viper
#

top one in the uhh. assets/Data/Events

gentle rose
#

there's a post about a missing i18n for an event in the mod page

ocean sailBOT
#

Log Info: SMAPI 4.1.9 with SDV 1.6.14 build 24317 on Microsoft Windows 10 Home, with 110 C# mods and 378 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

brisk rover
#

and yeah, I know I need to uodate a lot of stuff

gentle rose
#

I think the chinese translator also had issues with that same issue

rancid temple
#

Unrelated: It's still complaining about that duplicate entry

uncut viper
#

complaining about a different duplicate, actually

vernal crest
#

(Extra unrelated: No More Lag is not a helpful mod. It does not improve performance but it does break other mods and sometimes your game. I'd recommend removing it.)

uncut viper
#

strange that it didnt catch them both before?

#

why did the validator only show one dupe warning...

devout otter
#

Well these are all duplicated. "NPC.cs.4293": "As expected, I can't understand your actions at all.$3", "NPC.cs.4294": "I'm not sure why you did that...$1", "NPC.cs.3957": "Why are you handing it to me?", "NPC.cs.3955": "Do you know what it means to give this to me?", "NPC.cs.3956": "Are you serious?", "NPC.cs.3971": "That's a funny joke.", "NPC.cs.4293": "As expected, I can't understand your actions.$3", "NPC.cs.4294": "I don't know why it's doing this.$1", "NPC.cs.3957": "Why are you handing it to me?", "NPC.cs.3955": "Do you know what it means to give this to me?", "NPC.cs.3956": "Are you serious?", "NPC.cs.3971": "That's a funny joke.",

rancid temple
#

I wasn't paying attention to what the dupe was before

#

Oh yeah, they sure are

brisk rover
#

okay, I'll de4lete those

uncut viper
#

dont delete ALL of them

#

just half

#

they repeat

brisk rover
#

i most likely missed that cause well... I'm dyslexic

uncut viper
#

keep the first 6

reef kiln
vernal crest
#

Frog, DuskyGirl asked us not to comment on the stuff like that.

#

I only commented on No More Lag because it's an actively harmful mod.

#

The fact that the game and SMAPI are not up to date is not likely to be the problem here, right?

uncut viper
#

it shouldnt be no

brisk rover
#

isn't the game updated????

uncut viper
#

you're one minor version behind

brisk rover
#

aaaa

uncut viper
#

i wouldnt worry about it

brisk rover
#

k

uncut viper
#

can you send your en.json file itself? like not through the uploader

brisk rover
#

okie

uncut viper
#

(whats the command to test an event again? debug ebi?)

vernal crest
#

Yes

#

Oh drat my SMAPI is way out of date

teal bridge
vernal crest
#

Yeah but I'm a tech support volunteer so I chose this life xD

brisk rover
#

At least I am willing to listen and do what you sayt to do? :>

ocean sailBOT
#

@brisk rover You leveled up to Cowpoke. You can now speak in our voice channels and share images in all channels!

teal bridge
#

Yeah, it wasn't a knock on you personally, just a musing about the overall situation.

brisk rover
#

sorry

vernal crest
#

You have nothing to apologise for DuskyGirl. They were just talking about the fact that no matter how many individual people I warn that No More Lag is a bad mod to use, it will still get used by everyone I never manage to reach.

teal bridge
#

Yep... nearly 250 endorsements and over 15k uniques, it's a runaway freight train.

vernal crest
# brisk rover okie

It looks like Button is testing in her game btw. I am trying but I haven't updated anything for ages so all my mods are broken.

uncut viper
#

ill be honest, i dont know why it doesnt change

#

it does just keep using default.json

brisk rover
#

This mod is a mess tbh. The entrance to his home is behind the cannoli statue behind unbreakabhle objects lol

#

the only way to get in is use a chair, noclip or the move anything mod

#

all this so you can talk to god

vernal crest
#

Does it work if you swap them?

#

So the English is the default.json?

rancid temple
#

What if you swap to Korean and then back to English?

uncut viper
#

yep, works if en is default.json instead

#

i did switch to korean and back, it did not work

#

i also let the game start in korean and did not work, though i know it does actually start in english and then switch to korean once it loads my settings

#

lemme test somethin else real quick

vernal crest
#

Okay so that at least is the fix for DuskyGirl right now? Change en.json to default.json

uncut viper
#

it works if i change en.json to fr.json

#

and then switch to french

#

so its just english it doesnt work for

vernal crest
#

Weird

uncut viper
#

which makes me wonder if its Content Patcher weirdness with deciding not to update because it thinks the locale hasnt changed

#

bc it was en when the game launched

rancid temple
#

Shouldn't it change if you switch to a different language and back though?

uncut viper
#

thats what i woulda thought

rancid temple
#

This is the part that makes me think there's no en

vernal crest
#

Maybe Pathos was wrong about it?

#

Or maybe it's changed?

rancid temple
#

Like default can definitely be other languages, that much is for sure true

vernal crest
#

I would ordinarily trust Pathos over the wiki, though it is probably a bit he wrote anyway

rancid temple
#

But unless there's some problem with CP thinking en is just default, I don't even know where to look for info on how i18n works

vernal crest
#

You don't need CP to use i18n do you?

#

Can't you use it with C# too?

uncut viper
#

you do not, its SMAPI that handles loading the actual files

#

it puts them into a TranslationHelper thingy which is what CP uses

vernal crest
#

So it should be possible to write a C# mod to test if it's CP?

uncut viper
#

i could try editing one of my C# only mods for it rq

vernal crest
rancid temple
#

Could probably just throw in an en.json into one with wildly different text

#

If it works it should load it even if you have a default

uncut viper
#

yeah thats what im doin real quick

#

though maybe one where the i18n is just used in GMCM wasnt the best one to test with lol

vernal crest
#

xD

uncut viper
#

take two

#

nope, its just using default.json... so its not CP

covert laurel
#

hiya! i heard we were talking translations over here ? 👁️ i scrolled back a bit but i cant exactly tell what the issue is

brisk rover
#

WINRAR

#

I changed en to default

rancid temple
#

Not the most user friendly approach, but the base mod also apparently doesn't care about users so it'll fit right in

vernal crest
#

The issue is that English might have to be default.json after all, I think

brisk rover
vernal crest
#

Not en.json

brisk rover
#

name and dialogue work

uncut viper
#

the fact that its not user-friendly to non-english modders is why i think its a bug somewhere, but i just dont know where

rancid temple
#

Might have to just bring it up with Pathos when he's back in town

vernal crest
#

Translation via i18n is SMAPI, isn't it? Not game?

uncut viper
#

it is indeed

vernal crest
#

I think having a default at all is not very helpful

rancid temple
#

It's done through SMAPI but I thought it was something that already existed outside the sphere of SMAPI

devout otter
vernal crest
#

A default.json that is.

velvet narwhal
#

well i think that's done because of the base game

uncut viper
#

the Translator class constructor sets it to EN... im not actually sure where it checks for a default.json

drowsy pewter
#

ive seen other mods have default as another language

vernal crest
#

Yeah it was working in Korean with Korean as the default.json

rancid temple
#

But do en.json translations work in those mods?

vernal crest
#

But the English wasn't working

#

As en.json

drowsy pewter
#

i've seen them use en.json in addition to a nonenglish default.json

#

but i cannot profess to have playtested these mods

vernal crest
#

It was still using the Korean translation (but unsuccessfully because the game wasn't using the Korean alphabet)

uncut viper
#

do you happen to know one of those mods off the top of your head?

vernal crest
#

I wonder if the ones that use the same alphabet as English do work

rancid temple
#

Christmas debugging ⛄

vernal crest
#

No that doesn't make sense Aba

uncut viper
#

i dont think it was a font/alphabet thing though, bc i changed the first line of the event in default.json (when it was in korean) to english text

#

the english text did show, but it wasnt the text that was in en.json

velvet narwhal
#

cracks open the naver guess i'll go diggin

covert laurel
#

default.json is typically where english would have to go - i havent personally seen en.json used for english translations yet

vernal crest
#

But Pathos said that it doesn't actually need to be English in default.json and that you can have an en.json

#

And the first part of that is certainly true, but the second part doesn't seem to be

brittle ledge
#

yeah, I thought default was just the fallback if you didn't have a language specific json

uncut viper
#

(it wouldnt be feasibly possible for the game to know what language you actually wrote in default.json anyway)

covert laurel
vernal crest
#

No, but if en.json doesn't work then any mod that wants to have English available will have to have it as default.json even if it's not the default for the mod-maker.

uncut viper
#

i put en.jsons in my mods

#

theyve always been dupes of default.jkson though

vernal crest
#

Without default.json?

#

Oh

uncut viper
#

but i think buttons extra books does actually use it specifically

devout otter
#

Yar, tested en.json on my mod and it doesn't work.

uncut viper
#

since it loads it directly from the file and bypasses the i18n system

#

for some things

#

(i pass the CP i18n to my C# component that way but havent noticed any discrepencies. this isnt me pointing out anything useful just responding to cider having never seen it used)

brisk rover
covert laurel
#

unless the english tag is something else but im not sure what else it would be

uncut viper
#

the modder guide for translations doesnt actually include the bit about default.json being english

#

it doesnt include EN as a language, but EN is a valid LocaleEnum code

vernal crest
#

The other translations wiki page does though

rancid temple
#

meow_bongoderp I didn't know we had two different pages

uncut viper
#

pathos wrote both of em

vernal crest
#

Yup it is confusing to have two

uncut viper
#

or at least, the part about default.json being english was there from the start when he made the page, and so is the lack of mentioning default.json being english at the start of the other page

vernal crest
#

And then also a custom languages page

uncut viper
#

it makes sense to have a custom languages page at least since thats a lot different and more involved to add in

vernal crest
#

Oh yeah it does make sense

#

But I did get mixed up between mod translations and the game languages when I first started looking for info about game languages on the wiki

#

Likely PEBCAK though haha

uncut viper
#

i think trying to look into SMAPI's code here to see why en.json does not work is. far beyond my ability though

#

far beyond my understanding of SMAPI's codebase anyway

#

i just keep goin in circles

#

and i would rather not ping pathos on christmas night when hes visiting family lol

velvet narwhal
#

what's a decent enough timeframe to care

#

a week?

vernal crest
#

Yup my vote is we put this on hold for a while and then ask Pathos when he's available again

#

It's not like it's urgent

uncut viper
#

id rather not ping him on new years either!

velvet narwhal
#

oh true

#

a month then?

brisk rover
#

thank you everyone for your help

vernal crest
#

He will be gone for a few weeks he said

brisk rover
#

I wouldn't know what to do withouyt all of you :>

velvet narwhal
#

tbh i was gonna ask uber to make a reminder to me to then ask

vernal crest
#

No problem!

uncut viper
#

i still feel like in the back of my mind like im missing something obvious but i think i should probably just close ilspy before i lose too much sleep over it SDVpuffersquee

deep cypress
#

Hi loves! What's the C# equivalent of HasMod?

tiny zealot
#

Helper.ModRegistry.Get(modId) != null

deep cypress
#

Thx so much!!!!!!!!!

uncut viper
#

after 2 days of holiday celebrations, yeah

#

stuff's exhausting

fervent horizon
#

Odd that en.json doesn’t work, the translation helper even uses en.json in the comment about what it does

#

/// <summary>Provides translations stored in the mod's <c>i18n</c> folder, with one file per locale (like <c>en.json</c>) containing a flat key => value structure. Translations are fetched with locale fallback, so missing translations are filled in from broader locales (like <c>pt-BR.json</c> &lt; <c>pt.json</c> &lt; <c>default.json</c>).</summary>

uncut viper
#

incidentally thats already out of date anyway since we can use multiple files per locale now

fervent horizon
#

Yeah, seams like it is just going straight to default if the games locale is set to English.

#

Which would make more sense if en.json wasn’t a valid translation code

uncut viper
#

and the default one it sets to in the Translator constructor, at that

royal stump
uncut viper
#

what even is the purpose of using an empty string for that

royal stump
#

it's probably really old, but idk, it might be as easy to fix as setting that to "en" instead

uncut viper
#

i thought it checked LocaleEnum too but like i said, i kept goin in circles with all the functions using each other lol

royal stump
#

yeah, I just got sidetracked looking at the other Translation class, which sets a private Locale and then never reads it SDVpufferdizzy

velvet narwhal
#

"the inner workings of my mind, are an enigma" n all that

uncut viper
#

were you able to find where it actually chooses to load "default" instead of another string

fervent horizon
#

I don’t see where it would cascade down to default like it says it does

royal stump
#

I thought so, but now I'm lost again SDVkrobusgiggle

uncut viper
#

oh yeah, GetRelevantLocales

royal stump
#

there's the fallback down to default there, yeah, I just wasn't sure if it read default.json by getting the empty string there

uncut viper
#

why would it break if theres no dash

fervent horizon
#

Nevermind I think this is where default gets set ```/// <summary>Get the locales which can provide translations for the given locale, in precedence order.</summary>
/// <param name="locale">The locale for which to find valid locales.</param>
private IEnumerable<string> GetRelevantLocales(string locale)
{
// given locale
yield return locale;

    // broader locales (like pt-BR => pt)
    while (true)
    {
        int dashIndex = locale.LastIndexOf('-');
        if (dashIndex <= 0)
            break;

        locale = locale.Substring(0, dashIndex);
        yield return locale;
    }

    // default
    if (locale != "default")
        yield return "default";
}```
royal stump
#

guess it's more likely it falls through into that

fervent horizon
#

So if it is assuming en is empty, then it will always default

royal stump
#

so it yields the given locale first, which would be "" when it sets up in english, then breaks because there's no "-", then gets "default"

uncut viper
#

oh i missed the top yield return

#

it returns a list of those locales in order, then... so for french for example, it'd be [ fr, fr-FR, default ]?

fervent horizon
#

Swap the first two

#

Hyphen, no hyphen, default

uncut viper
#

i wonder if it would be as easy as just changing the single line in the Translator constructor then, since thats where the string.Empty happens

#

or at least thats a place it happens

fervent horizon
#

Could be

uncut viper
#

theres 6 things that i can see that call SetLocale and i dont feel like tracing all of them back however many steps

fervent horizon
#

What happens if you put the translation in like an en-EN.json file

royal stump
#

I tried en-us and en-uk earlier with no effect

fervent horizon
#

So, it is more likely just ignoring English as a locale

#

By assuming it is the default locale

#

But, where is it doing this

uncut viper
#

the game itself makes EN the default locale i believe

royal stump
#

digging around a little more, I think SMAPI itself is getting the more specific language codes from this SDV method in LocalizedContentManager

/// <summary>Get the language string which appears in localized asset names for a language (like <c>pt-BR</c>).</summary>
/// <param name="code">The language whose asset name code to get.</param>
/// <remarks>For the current language, see <see cref="P:StardewValley.LocalizedContentManager.CurrentLanguageString" /> instead.</remarks>
public static string LanguageCodeString(LanguageCode code)
{
    return code switch
    {
        LanguageCode.ja => "ja-JP", 
        LanguageCode.ru => "ru-RU", 
        LanguageCode.zh => "zh-CN", 
        LanguageCode.pt => "pt-BR", 
        LanguageCode.es => "es-ES", 
        LanguageCode.de => "de-DE", 
        LanguageCode.th => "th-TH", 
        LanguageCode.fr => "fr-FR", 
        LanguageCode.ko => "ko-KR", 
        LanguageCode.it => "it-IT", 
        LanguageCode.tr => "tr-TR", 
        LanguageCode.hu => "hu-HU", 
        LanguageCode.mod => (LocalizedContentManager._currentModLanguage ?? throw new InvalidOperationException("The game language is set to a custom one, but the language info is no longer available.")).LanguageCode, 
        _ => "", 
    };
}```
#

so it either uses its own default "" for english or pulls from that and gets "" anyway

#

(SDVpufferthinkblob also not sure why thai is in there when it's not an official translation, but w/e)

fervent horizon
#

Probably just an oversight when adding translations. Default is English so why would you need a specific en file.

royal stump
#

yeah, ultimately it's just that, the mechanical reason's just a little convoluted

fervent horizon
#

But with such a big kr scene, it is definitely something that should be reported as a bug/feature request

vernal crest
#

Remind me in 14 days to ask Pathos about the en.json thing

patent lanceBOT
#

For you? Of course, abagaianye (#6439652) (14d | <t:1736401433>)

uncut viper
#

well i can at least say its not as easy as changing the Translator constructor lol

#

it is also not enough to make LanguageCodeString return en-EN

#

unless SMAPI is getting that and caching it or something before my harmony patch can run, which i guess is actually not unlikely

#

okay, yeah, thats what was happening

#

changing StardewModdingAPI.Framework.ContentManagers.BaseContentManager.GetLocale(LanguageCode code) to return "en-EN" if it got an empty string from LocalizedContentManager makes it use en.json

#

i have absolutely no idea if anything else strictly relies on english being an empty string from that though

#

as far as i can tell at a very quick and cursory glance, my translations are not broken in my other mods

#

(i should specify i mean im not sure if anything in SMAPI uses it. i dont think it'd be as simple as changing the vanilla game's code bc it seems like the game might rely on the english string being an empty string when it comes to loading the correct localized asset in some cases. shrugs)

patent lanceBOT
#

@tardy adder: finish dealing with BHI (3d ago)

fallow musk
#

can i send multiple items through a mail or is it only one max

vernal crest
#

You can send multiple

velvet narwhal
#

it just doesn't get it's own funny little box and will give it to the player 1 at a time

fallow musk
#

thanks

brave fable
#

oh what a wonderful piece of junk mail we could make.
a hundred individual Wood that need to be claimed piece by piece

vernal crest
#

xD

brittle pasture
#

doesnt pressing esc just add all the item at once
(this is unsubstantiated, I'm on my bed and will fall asleep in 2 minutes, I will not check)

velvet narwhal
#

it does, so you'll just get a very loud popping noise of item collection

#

which is also

#

.q 6280

patent lanceBOT
#
#6280

Let's stop talking about making mods safer, why not make mods even more dangerous and user-harming

proud wyvern
#

we should wait for 200 more quotes to happen, then repeat this one, so the quote #6480 goes to @ 6480

velvet narwhal
#

that'd require me to pay attention to the quote numbers though

#

and there's probably much funnier 6480 quotes puffpensive

brave fable
#

you could do it nexus domain-squatter style and just quote that message another 199 times

velvet narwhal
brave fable
#

(it's always jamore in life, never j'adore SDVpufferpensive )

versed wyvern
#

I've been tinkering away at a Nexus mod page for a few days, does anyone know if that "original upload" date on the preview will update to the date when I actually publish this thing or not? ThinkO_O

brave fable
#

i wouldn't worry about that date, people only check for Last Updated dates

versed wyvern
#

It's one of those things that's gonna bother me even though it doesn't matter genshin_ehh

ocean sailBOT
#

@versed wyvern You leveled up to Cowpoke. You can now speak in our voice channels and share images in all channels!

brave fable
#

if it doesn't matter, it won't bother you SDVpufferthumbsup

distant radish
#

When it comes to code efficiency and performance, is it better to have a big json with 100000 lines or 10 jsons with 10000 lines each? Does it make a difference?

proud wyvern
#

readability > ultra tiny performance gains

distant radish
#

Got it, thank you ❤️

brittle ledge
#

(It's also easier for people to open if they need to see your code- my computer's decent and it struggled with SVE's content.json when it was still 30k+ lines)

light jasper
#

at least I saved that 200kb Smadge

#

something something the root of all evil

thick pelican
#

some people spend hours crafting their mods out of love

some spend 20 minutes making alex into troy bolton from hsm

everybody is valid

faint ingot
#

not just love though, all the emotions

#

I poured not only my love into my pierre jail mod, but also all my malice and hatred

finite sequoia
#

Omg just wanted to pop in and say I love L&O SDV

dim pebble
#

@tawny ore If you're around... I just tried out your Unlimited Storage mod, and I'm getting nowhere. It's not creating a config.json file in the mod folder, and it's not showing up options in GMCM.

tawny ore
#

It doesn't have any options at the moment. It just makes all storages able to hold unlimited items.

dim pebble
#

Yeah, it's not... doing that.

tawny ore
#

!log

ocean sailBOT
#

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:

  1. Open this page: smapi.io/log.
  2. Follow the instructions at the top of the page to upload the log file. (Don't copy & paste from the console window!)
  3. 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.

dim pebble
#

I'll keep messing with it.

ocean sailBOT
#

Log Info: SMAPI 4.1.10 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Pro, with 55 C# mods and 10 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

dim pebble
#

@tawny ore For that log file I disabled all my other chest QOL mods and was only running Unlimited Storage. But, on my existing save, it wouldn't allow me to overload an existing chest with more items.

tawny ore
#

And how are you testing it? You're opening a chest and adding items individually to it, or something else?

dim pebble
#

Trying again... maybe I missed something.

#

Never mind...

#

I blew it.

#

@tawny ore So where I blew it is that I was trying to use the Quick Stack button to quickly move items to the chest. It won't Quick Stack to a chest that is full, but you can continue manually adding items to a chest like that.

tawny ore
#

@dim pebble FYI Convenient Inventory implements stacking correctly in a way that is compatible with Unlimited Storage. Convenient Chests does not and hardcodes the chest capacity value rather than use the vanilla method for checking what a chest's capacity should be.

#

So this means in addition to not working with Unlimited Storage, I don't even think Convenient Chests would work with the vanilla large chests either.

cloud slate
#

what code do i need to change the price of the return scepter? I'm making a personal edit in a mod that affects krobus' shop

#

but i know nothing

rancid temple
#

For an existing entry in nested data, you'll need to use TargetField

uncut viper
#

if you're editing an existing mod, it probably already set up the TargetField for you

cloud slate
#

it does, i just need to add the scepter looks like

#

how do i find the sdcepter id?

uncut viper
#

theres a site for it, you can also unpack your files

rancid temple
#

!itemids

ocean sailBOT
uncut viper
#

its not 100% guaranteed that the shop entry id is the id for the scepter though (but it is most likely that)

rancid temple
#

!unpack is usually better since it's more accurate/up to date

ocean sailBOT
#

Follow this guide to unpack the game's content files in order to see and explore how the game data is structured.
It's helpful when making your own mods, or just to learn about how the game works!

dim pebble
teal bridge
#

@tawny ore what made you decide to give up on Better Chests? (Just out of curiosity)

cloud slate
#

does this look right?

uncut viper
#

no, that is incorrect (also please use the smapi.io/json uploader and send the link to that instead, it is easier for us to see and would tell you right away that you had json errors)

#

the string before the colon : after "Entries" needs to be the ID of the shop entry, which is probably the ID of the return scepter. i also dont know why your ID for it has brackets around it, but if thats how that ID website had it, then dont copy those

#

its just (T)ReturnScepter

calm nebula
#

I'd also doesn't matter

#

You need itemid

uncut viper
#

you also placed it inside the braces {} of the "Dwarf Scrolls" entry, which will break your json, as everything needs its own object, but you also need to remove all the "Dwarf Scrolls" stuff anyway

cloud slate
#

the dwarf scrool stuff is from the mod i'm updating

#

i didn't touch that

uncut viper
# calm nebula You need itemid

well, i was about to say next that they also want to change Entries to Fields, bc theyre editing an existing entry, so ID is ALL that matters SDVpuffersquee

#

yes i know, you need to remove it

#

or if you want it to be in the same mod, you need to rearrange your json

rancid temple
#

Seems like directly editing the existing mod and not creating a patch to it is what's happening here

cloud slate
#

yeah i just wanted a quick personal edit

uncut viper
#

then make a copy of this dwarf scrolls mod and rename it to something else

cloud slate
#

ah

uncut viper
#

because the dwarf scrolls mod needs to use Entries and you need to use Fields to just change the price and you cant do both in the same patch, so you're going to be rewriting a patch one way or another

cloud slate
#

okay made a new copy

uncut viper
#

change "Entries" to "Fields", change "Dwarf Scrolls" to "(T)ReturnScepter", and then remove all the stuff that isnt "Price" after that (but keep the braces)

#
"(T)ReturnScepter":
{
  "Price": 10000,
}

this is what it should look like (not the entire file obviously)

#

also, make sure in your copied folder that you change the details in the manifest.json too

cloud slate
#

is the logname okay?

uncut viper
#

only remove the stuff mentioned after "Dwarf Scrolls", dont worry about anything above there

#

besides the Entries -> Fields change

#

the logname doesnt affect anything but what you see in your console, so you CAN change it if you want, and you can remove it if you want, but it doesnt matter if you dont care and its just a personal edit

#

its just for logging purposes

cloud slate
#

gotcha

#

updating the manifest seems pretty straight forward. I assume i should delete the update key though

uncut viper
#

you can delete that and leave it as an empty [] yeah

cloud slate
#

thanks

ocean sailBOT
#

Log Info: SMAPI 4.1.10 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home, with 150 C# mods and 439 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

uncut viper
#

!json please send your json too

ocean sailBOT
#

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.

cloud slate
#

i assume both

uncut viper
#

you dont have to send the manifest

cloud slate
#

huh its the original hang on

#

nope i'm just silly

uncut viper
#
{
  "Format": "1.0.0",
  "Changes": [
    {
      "Logname": "Cheaper Return Scepter",
      "Action": "EditData",
      "Target": "Data/Shops",
      "TargetField": [ "ShadowShop", "Items" ],
      "Fields": {
        "(T)ReturnScepter": {
          "Price": 200000,      
        },
      }
    },
  ]
}
#

change it to this

#

it was bracket/brace misplacement errors and it was easier to just rearrange them and send than to explain how to fix them lol

cloud slate
#

haha thanks

uncut viper
#

oh, do change "1.0.0" at the top to "2.4.0" too

#

thats the content patcher format version, not the version of your mod

cloud slate
#

oooohhhhhhhhhhhhhh

uncut viper
#

that should generally always be kept up to date with the latest available format version (which i think is actually like 2.4.2 or something but im not sure the exact number, but 2.4.0 is fine)

cloud slate
#

yay no errors! thank you!

uncut viper
#

and the price correctly changed in game?

#

(always good to double check that too bc another mod you have might also change the scepter shop price and overwrite your change!)

rancid temple
#

Can't remember if using the Season token in a Load will make it Load every season

gaunt orbit
#

It will only load the current season, but it will reload when the season changes

#

Sorry I clarified bc I want sure which you were asking

rancid temple
#

Ah, well that should also be fine, thanks

heady relic
#

Simple question that's proved difficult to google: For crops that grow in the fall, should the json file use Fall or Autumn>

faint ingot
drowsy pewter
#

(you should also be looking at vanilla data)

heady relic
#

Thank you! Yeah, I had a sample, but it was just for an apricot tree which is spring.

drowsy pewter
#

Have you unpacked your files?

heady relic
#

Not on this PC. I'm working from my laptop at my folk's place for the holidays. If I were home then I'd have the files.

drowsy pewter
#

Ah got it

heady relic
#

Gotta say, adding a ton of spices and spice crops has taught me more than I ever thought I would know about the production methods and growth of various spices.

drowsy pewter
#

Lol yes

#

I know so much random plant stuff now

heady relic
#

I've been annoying my family for days now with random facts about spices.

opaque cobalt
brittle pasture
#

missing comma on end of line 13

tender bloom
#

Usually if it calls out line 14 for being unexpected, it means it didn’t realize line 13 is over

opaque cobalt
#

thank you

acoustic summit
#

Posting for input: Working on a daily missions mod, I've got some standard easy collection and slayer missions added and some unique ones (e.g: Catch a fish over a certain size, hoe artifacts in multiple locations) Anyone have ideas for unique missions you think would be fun to randomly get?

heady relic
#

cook food, gift (liked/loved) items to people, talk to x number of people

acoustic summit
knotty phoenix
#

wa ter your pet

opaque cobalt
#

Also, do config schema go under changes? Json vallidator was saying error with having no "changes" command in content json

velvet narwhal
#

Configschema is a top level like changes, dynamictokens

brittle pasture
fair crow
#

I apologize if this is not the correct place to ask this, but I am new to making mods for Stardew, and I have an idea of a mod that I want to make, but I'm not sure where to begin (I did look through the pinned posts). The mod I want to make is to add to the pool of items that can appear in regular and gold mystery boxes (and maybe even Skull Cavern chests too). Any help to figure out how to do this would be much appreciated! Mostly I want the seed pool to include mod-added seeds.

velvet narwhal
#

Uhhh boxes n all that stuff is... c# isn't it? I'm currently afk so I can't check if there's a json somewhere but it's most likely

tender bloom
#

No I’m p sure it was dehardcoded

#

Look at how VMV does geodes

light jasper
#

hardcoded

#

unless there's something I missed

brittle pasture
velvet narwhal
#

Yeah i vaguely remembered next.random ththonk

fair crow
#

I was wondering why there were no mods like this already...ok thank you for the info!

hallow prism
#

hmm

#

i am pretty sure it should be possible to add content to the existing geodes by targetting the right field

#

only part of their content is hardcoded

velvet narwhal
#

Maybe spacecore?

hallow prism
#

the geodes are patchables

#

the boxes may not be

#

making your own box (and then having a npc somewhere trading them for existing boxes) may be the simpler way

opaque cobalt
ocean sailBOT
#

Log Info: SMAPI 4.1.10 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home, with 35 C# mods and 46 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

brittle pasture
#

Yeah the 4 regular geodes use the CP fields, but the mystery boxes do their own thing in C#

fair crow
wanton pebble
#

grabbing example

#

ah, actually the brackets are correct

#

you just have no changes field

#

My bad on half of it

uncut viper
#

are you sure the json you've uploaded is the json in your mod folder?

proud wyvern
#

it looks like the log does not match what you sent in the validator

uncut viper
#

because your json in the uploader is valid json, but the log is indicating it cant even read it

proud wyvern
#

Path 'DynamicTokens', line 5, position 2

uncut viper
#

you'd get a different error for not having changes (which is a separate problem you'll need to fix too)

proud wyvern
#

this doesn't fit

#

something's up

#

if it said line 4, i'd understand

wanton pebble
#

Probably because it's running off the D drive

#

probs a c drive too

uncut viper
#

what?

wanton pebble
#

they're running it on D. My guess is they're editing a copy on C

#

And that's the discrepancy.

#

(Source: Done that a few too many times...)

velvet narwhal
#

All of my games live in D: but my builds go straight to C:

opaque cobalt
#

now I just need to figure out which file is missing the "changes" command or where that needst o be placed in the content json

lucid iron
uncut viper
#

except the config.json that gets generated

#

but otherwise if its a json you're using in content patcher, it needs a changes field

#

*exceptions for jsons you're Loading directly

#

you cant put dynamic tokens or configschema in their own json, either. those need to be in content.json

opaque cobalt
#

okay, so it would be changes at the top and dynamic tokens and configschema within the changes correct?

uncut viper
#

no. ConfigSchema and DynamicTokens are their own top-level fields. i would recommend looking at the content patcher documentation for them

wanton pebble
opaque cobalt
velvet narwhal
#

generally no, it's all going to be the same format, but would highly suggest being able to understand it on your own

uncut viper
#

i would also say generally no but it may depend on how custom their setup is and how strictly you copy it. but generally, there's only one or two ways to really do a lot of things, so a lot of CP mods that do the same thing are going to look near identical anyway

#

but like jamore says, its important that you understand what every line is actually doing in case you run into issues

opaque cobalt
#

Thanks. I like to try and learn as well but seeing the formatting and a larger example than I can usually see unless I miss something in the github wiki (I've never used github so may be missing thing)

velvet narwhal
#

uhhhhh there's probably airyn's wiki

uncut viper
#

(just ignore the bit about the TIME GSQ if you plan on having time-based outfits)

opaque cobalt
#

Can you give me a brief explanation on why some field need brackets vs fancy parenthesis or whatever their proper name is. I see that in wiki but never know why

uncut viper
#

{} = braces, or curly brackets

#

[] means its an array or more commonly called in here a list of things

#

{} is a single object

#

[1, 2, 3] is a list of numbers
{ "key": "value": } is a single object with some data in it

velvet narwhal
#

configschema being the odd one out suspicious

uncut viper
#

there is nothing different about configschema

#

ConfigSchema itself is an object (also commonly called a Dictionary) of string keys paired with config option object values

#

this is JSON syntax, not Content Patcher syntax

#

the difference between braces and brackets, i mean

velvet narwhal
#

i used to have a newtonsoft website that described all of it but it's gone to the wind now

#

and that also only correlates to cp, if you're using a framework that has it's own syntax you're on your own for that KEK

uncut viper
#

all .json files will follow these same syntax rules

#

a [] will always be a list and {} will always be an object

velvet narwhal
#

thinks about the list of lists

uncut viper
#

Content Patcher didn't create any of this JSON syntax

opaque cobalt
#

Thanks for the info.

uncut viper
#

(a list of lists is also valid JSON syntax and not unique to CP or any other mod)

lucid mulch
rancid temple
#

I made a dictionary of int, list dictionary string, list string dogekek

#

It took way too long and ended being way easier than I was making it at first

brave fable
#

at that point just setup a relational database

calm nebula
#

-> dict[str, dict[float, tuple[float, float, float, float]]]

velvet narwhal
#

someday... i'll finish reading about the tuple...

#

that day ain't today

rancid temple
#

I too need to play around with tuples

brave fable
#

tuple is wrapping your lunch in a handkerchief instead of a lunchbox

#

next

calm nebula
#

I love tuples

#

But they are less useful in c#

#

Please consider, instead, the humble record struct

#

Tbh half the time I do a tuple in c# I rip it put for a record struct

velvet narwhal
#

someday... i'll read the difference in structs between c++ and c#... but that ai-

uncut viper
#

every time I've thought about using tuples ive decided that I'd really only be doing it for the novelty and should realistically probably just stick with out variables or returning a class/struct

velvet narwhal
#

i have a long backlist to read, none of it is fun fiction, and yet i decided to spend 5 hours instead neck deep in next.js

lucid mulch
#

At a fundamental level, C++ struct and C# struct should be compatible, but the .NET runtime has added a bunch more sauce into them

acoustic summit
#

I think tuple is a list with indescrimate declared types and a declared length

lucid mulch
#

a thing to remember is the .NET Runtime can run C++ code in the virtual machine

acoustic summit
#

And in python its not mutable, not sure for c#

calm nebula
#

I think of tuples as wrapping my lunch in newspapers

#

Also python tuples are not mutable (ish)

#

I thought?

#

I mean the members may be but the tuple is immutable

#

C# actually has two things it calls "tuple" but when we say tuple we mean ValueTuple 99% of the time

lucid mulch
#

it should be possible to write a smapi mod in C++, but I don't like C++ enough to make that poc

calm nebula
#

Tuples are kinda like a hastily tossed together collection

velvet narwhal
#

i have yet to scrub it from my brain and it's the thing that's slowing me down in my own projects

lucid mulch
lavish terrace
#

question wrt Alternative Textures: do the three Strange Statues (Pinky Lemon/Foroguemon/HMTGF) count as Craftables? or Furniture? actually, same question for things that are doubled on the craftables tilesheet & the furniture sheet, like obsidian vase, chicken statue, singing stone, the big geode, etc.

young breach
#

Does anyone know of a way to get another mods ModEntry instance?

lucid mulch
#

Answer 1 would be don't

calm nebula
#

I mean, it's pretty easily doable but like. It's. Generally a bad sign.

uncut viper
lucid mulch
#

If you want something from the mod, that mod should expose it via a mod api.

Or be data driven from an asset

calm nebula
#

The strange statues are like, craftables

brittle pasture
#

the duplicate ones in the furniture sheets are unused

velvet narwhal
#

No button

calm nebula
#

Pretty sure the vase is a craftable, but it really depends, it's not consistent

brittle pasture
#

if you want to be sure look them up in Lookup Anything with data mining fields on. BC are big craftables, furnitures are F

velvet narwhal
#

.q 6279

patent lanceBOT
#
#6279

(One of the benefits of content packs is that they're generally stable and rarely break in game updates.
Button: "Let's fix that!")

lavish terrace
uncut viper
#

(you're not allowed to notice me while im lurking thats cheating)

young breach
#

I know what I'm trying to do is not a good practice but this is for a private project, I'm trying to patch a mod that has no public api and i need to get the ModEntry of said mod

uncut viper
#

if youre harmony patching, you dont need their instance

velvet narwhal
#

Ichor is the king of crimes

brittle pasture
#

with reflection you can get anything

lucid mulch
#

the ModRegistry class which is accessible via the helper has them, you would just reflection to grab it

#

but your mod will be fragile and break randomly and is not a good time

calm nebula
#

Anyways, you can get their modentry instance by grabbing their modinfo from the register

#

And then reflecting for this field

uncut viper
#

accesstools can just search for the method with a TypeName:MethodName formatted string

#

its one of the AccessTools.Method() overloads

slim gorge
#

Not done yet, by far, but the basics work. I haven't dug through the new game code enough yet to quite know how to fix things like scheduling and snow drawing, and some methods just don't exist at all anymore (like color swapping...?).

#

Though it's probably better to say that "the basics never stopped working, but everything else broke"

#

I'm unfamiliar with any such issue?

calm nebula
slim gorge
#

I can also glance at 'Clear Glasses', but I usually don't like merging forks back in unless there's a significant change.

#

Can you show me a bug report? I just don't have any details to go off of.

#

a full-screen overlay, off-the-top-of-my-head, shouldn't have broken anything in particular.

calm nebula
#

Full width was the issue iirc

calm nebula
slim gorge
#

I'm not sure what that means in this context - screen-width?

calm nebula
#

No, full width of the texture

slim gorge
#

Oh. It shoudl have handled that fine, it just sucked.

#

There was only one case I remember that did that, which was the starry sky screen, which sort of scrolled.

#

It certainly wasn't optimized for that case though.

calm nebula
#

No, the smapi asset edir code

slim gorge
#

I feel like I'm missing some core details :|

#

also, SM itself as you can see is (partially) running on 1.6 off the main source again, since I've had a bit of time to look at it today.

#

though I'm not sure how to approach or continue since a fork exists.

calm nebula
#

Also the game did optimize schedule

light jasper
#

the chicken is witness to my failure

calm nebula
#

Looks perfect

#

10/10 no notes

tender bloom
#

I see lettuce, ready to harvest, what more is there to want? SDVpuffersquee

light jasper
#

built different

#

never made a mistake

#

obv

calm nebula
light jasper
#

where tf is the background

calm nebula
#

would be funny if it was behind the floor

light jasper
#

I found it

patent lanceBOT
#

@calm nebula: do the thinf (31d ago)

uncut viper
#

classic off-by-one error

velvet narwhal
#

Tbh without the background if it had the dancing text I'd be none the wiser

teal bridge
uncut viper
#

i was referring to atra

#

and the reminder to do the thinf on christmas

slim gorge
slim gorge
#

I assume that I just didn't properly apply startRow as it never came up.

calm nebula
#

tbh spacecore now rocks a stripped down version of my scheduler, so you also probably don't need to do it anymore 😛

calm nebula
# slim gorge Ah.

it's not a common case. I just know about it because that got reported, repeatedly, as "More New Fish has invisible fish?" And because it was my PR, I spent forever looking into it

tawny ore
#

Does anyone know the easiest way to find all the warps in a location, and all the locations they warp to?

#

Not super familiar with location code so before I start scanning through all 18,000 lines of code. Hoping someone might point me in the right direction.

light jasper
#

15th try's the charm

#

or something like that

#

god I'm tired

#

I really never imagined that I'd ever have to say "I need flexbox in Stardew Valley"

#

but here we are lmao

#

maybe I don't tbh, maybe I just hate myself 😆

calm nebula
#

boots up the game once since, like, forever ago, with all but nine of my mods compiling

#

yup, that's exactly what I expected tbh

light jasper
#

so what devil did you make a deal with to get all this time, atra

calm nebula
#

christmas

light jasper
#

lmao

slim gorge
#

:|

#

or do I just need to replace two schedulers...

calm nebula
#

😛 you can find out for yourself XP

slim gorge
#

more importantly, does it return the exact same results as the default one?

calm nebula
#

no, it intentionally does not, because the default one is a weirdly botched dfs

teal bridge
slim gorge
#

So, mine does because otherwise, during multiplayer, if one person has SM and the other doesn't, it breaks badly

calm nebula
#

which causes npcs to wander maps out of the way if someone happens to insert a loop

calm nebula
#

which still would not produce the same order as the vanilla game

slim gorge
#

it's a variant of dijkstra's

#

meant specifically to put out the same thing that the game does

#

if it was purely dijkstra, it would not

calm nebula
#

I'm not sure how you would have gotten that, tbh

#

the game does dfs. We switched it over to bfs.

slim gorge
#

dijkstra is priority-first. Though usually it is effectively BFS. IIRC (it's been a while) the priorities are set up to act like DFS.

#

rather, Dijkstra is a BFS when the priority queue is a FIFO queue

#

I don't remember the details, but I do remember specifically being very frustrated by the game's implementation and having to make mine return the same results.

#

which causes npcs to wander maps out of the way if someone happens to insert a loop

This is a case where the SM one would differ, though... since the loop wouldn't loop.

I'm not sure if that's a bug in SM or not.

light jasper
teal bridge
#

I meant specifically what's the layout scenario that is flexbox-like.

slim gorge
#

I have a pre-prepatch planned that will rip that information before intervening functions already, so in that case it wouldn't. It'd break the present implementation though.

light jasper
teal bridge
#

I'm sure you don't want a framework dependency but nevertheless, there might be a solution in the code.

slim gorge
#

I was already aware of the potential issue, at least

#

some frameworks in the past have done similar things

teal bridge
light jasper
light jasper
teal bridge
#

Oh, well, your message gave me the impression you were having a hard time with it. No worries in any case!

light jasper
#

oh, no lol I'm just an idiot

light jasper
#

the last screenshot is everything working after I fixed my copy paste errors putting it halfway to narnia

teal bridge
#

Right, I gotcha

light jasper
# teal bridge Oh, well, your message gave me the impression you were having a hard time with i...

Actually there was one thing that gave me a bit of a headache, maybe you have some advice?
When a dynamically sized component changes, I wanted a way to know without having the parent foreach its children every frame. I ended up just passing the dirty flag up the call stack, which works pretty well but I wondered if you had a better way

/// <summary>
  ///   Marks the layout as dirty and notifies parent components.
  /// </summary>
  /// <param name="stackCall">Tracks recursive calls to prevent infinite loops.</param>
  protected virtual void SetLayoutDirty(int stackCall = 0)
  {
    if (IsLayoutDirty)
    {
      return; // Already dirty, no need to propagate again
    }

    IsLayoutDirty = true;
    NotifyParentDirty(stackCall);
  }

  /// <summary>
  ///   Notifies the parent component that the layout needs to be recalculated.
  /// </summary>
  /// <param name="stackCall">Counter to prevent infinite recursion in the layout update chain.</param>
  private void NotifyParentDirty(int stackCall = 0)
  {
    if (stackCall > MaxRecursiveLayoutCalls)
    {
      ModEntry.Instance.Monitor.LogOnce(
        $"A tooltip has exceeded {MaxRecursiveLayoutCalls} recursive layout calls.\n" +
        $"Component Type: {GetType().Name}\n" +
        $"Stack Trace:\n{Environment.StackTrace}"
      );
      return;
    }

    if (Parent == this)
    {
      // ???????????????
      ModEntry.Instance.Monitor.LogOnce(
        $"Tooltip parent refers to self\n" +
        $"Component Type: {GetType().Name}\n" +
        $"Stack Trace:\n{Environment.StackTrace}"
      );
      return;
    }

    Parent?.SetLayoutDirty(stackCall + 1);
  }
teal bridge
#

That's probably OK for relatively simple use cases, if you're willing to have a doubly-linked graph and don't need to deal with children being inserted or changed at arbitrary times.

#

In general, the recursive measure pass + layout pass is a pretty standard mechanism and very hard to optimize for arbitrary layouts.

#

Like, in your case you track IsLayoutDirty and don't notify the parent if it's true; if the parent can change then that implementation is potentially broken, or at least unsafe because its outcome depends on the order of hierarchy vs. property changes. But if you're not exposing this to the outside and you're always in full control of the order then you can kind of wave that away.

#

I think you'll find that dirty checks are very rarely worth optimizing anyway. The amount of time it takes to iterate children checking for the dirty flag is nothing compared to the amount of time to actually do layout.

#

One thing you may want to watch out for is whether or not the available size has changed, which supersedes any dirty checking. If you don't pay attention to that, then your views/widgets/whatevers can't adapt to changing viewports or changing containers.

light jasper
teal bridge
#

I understand why it's there, of course, just pointing out that it's a lot more work to maintain a notification-based dirty model than a state-based dirty model, for not that much of a performance improvement.

light jasper
light jasper
#

it's worked so far at least 😆

teal bridge
#

No problem in theory, just harder to enforce structure and easier to create leaks and other bugs when it's a two-way graph, and much harder to catch situations where something that is supposed to be updated does not get updated.

#

Not to say it can't be done. Just is more work (that is, more complexity/ongoing maintenance) to make it all correct.

#

Can your implementation do partial layout, or does a layout pass always mean performing layout on everything in the subtree?

#

For example, what happens when you attach a node that already has its own children or its own subtree? Or if you update a node in the middle of the graph? Does the parent know how to stop after that one dirty node and skip the rest of the layout? (Also, does it know enough to force layout on all the descendants of that newly-attached node, even though none of them were marked "dirty" explicitly?)

opaque cobalt
light jasper
teal bridge
#

Personally, I wanted to be able to simply use List<T> or equivalent for layout views and not impose a bunch of requirements downstream. If you need to propagate up the hierarchy, and therefore track whenever the hierarchy is changed, then essentially every child list needs to either be an immutable list (replacing children is all or nothing, callers have to transform the list based on current contents in order to "append" or "insert") or you need to use ObservableCollection everywhere so that you can watch for added elements.

Like I said, it's entirely doable, just a lot of work over the long haul for what I personally didn't consider to be important gains, and performance profiling proved that out pretty clearly; StardewUI has its own profiler and layout frames where nothing is dirty are virtually invisible even though they technically have to do a "recursive" check. If you think about it, the most complicated UI imaginable isn't going to have more than a few hundred elements to check. Equivalent performance to just iterating a list of 100 elements. Lots of mods do that every frame, like iterating the player's inventory.

Another reason I did it that way is because sometimes it's not clear whether a single property change should actually be considered dirty. Changing an image's sprite (texture + source rect) might need a new layout, but only if the image is set to be content-sized, otherwise it can ignore layout.

drowsy pewter
#

I was banging my head against the wall trying to figure out why the game wasn't taking my string for cooking recipes

#

the reason: I was patching them into data/objects

drowsy pewter
#

Okay, I need a hand with figuring out what I'm doing wrong here. Trying to load my cooking recipes for the first time and running into a error loop when I open the cooking menu (this only occurs when my mod is enabled)

An error occurred in the base update loop: ArgumentException: An item with the same key has already been added. Key: 1

https://smapi.io/log/570d9e422ca942e7a374096f00b21724
Loading recipes here: https://smapi.io/json/none/efe262bd2f774e75831ea48a72f444f4

I don't expect every recipe to match up with an existing item yet, since there are minor mismatches between our recipe and object files currently. I just want to figure out what causes the error so I can load a barebones version, even if there are visual/errored items in the menu

ocean sailBOT
#

Log Info: SMAPI 4.1.7 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Pro, with 30 C# mods and 37 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

uncut viper
#

i believe that hapens when theres an ingredient amount where an ingredient id should be

drowsy pewter
#

Ah okay

#

so I'll just skim over the recipes

uncut viper
#

unfortunately not an easy way to find which one i think without patching the function to log it

#

you could toggle each of those config options one by one to narrow it down

drowsy pewter
#

I think I'll try that

uncut viper
#

(im assuming the stuff like WorldTraveler_Essential is config and notr dynamic)

drowsy pewter
#

Actually it's all dynamic so nvm lol

uncut viper
#

well... you could make them always false one by one,

#

more annoying though

calm nebula
#

yeah, the easiest thing to do is to add a condition like

#
"When": {
  "Season|contains=Spring": true,
  "Season|contains=Summer": true
}```
drowsy pewter
#

found it

#

Just kidding. I found a different issue

#

Oh god there's so many typos in this file

uncut viper
#

oh no

calm nebula
#

pathos can debug dayupdate default to 1?

drowsy pewter
#

I found a total of six typos causing that error

#

But it works now!

#

Thank you so much button!

uncut viper
#

np! SDVpufferheart

drowsy pewter
calm nebula
#

I got annoyed at athing

#

(it's just repeatedly calling dayupdate and water, one second apart.)

opaque cobalt
ocean sailBOT
#

Log Info: SMAPI 4.1.10 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home, with 36 C# mods and 49 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

velvet narwhal
#

you're fighting with Seasonal cute, probably

devout otter
#

I can't currently check. What's the Precedence set by SSC for Penny?

velvet narwhal
#

i vaguely remember something like either -100, -120, or -150

#

i would:

  1. set a false dependency on seasonal cute
  2. set the precedence to something ridic like -500
  3. even then, i still get the random off beat that SCA overwrites me, so you'll have to tell people to turn off specific toggles on their end
hard fern
#

seasonal cute is set to the highest (or something) priority i think? , so yeah it will overwrite everything unless you just turn it off

devout otter
opaque cobalt
#

update key is empty as not uploaded anywhere yet

velvet narwhal
#

that's fine, and yeah that looks good

#

i don't remember exactly what happens based on load:high priority, so that might also be the thing

#

what happens if you toggle off penny for SCA?

opaque cobalt
uncut viper
#

load order priority should only affect the order in which patches are applied. it wont have any difference on Appearance precedence

#

so if ALL you have is those dependencies, thats likely not enough

#

unless you both happen to use the same ID for the appearance entry, which you shouldnt be

opaque cobalt
#

No, mine have a different naming scheme, they may have same condition set. Would setting all of mine to have a lower number in precedence fix this error? Thought mine loading after would avoid this problem

uncut viper
#

the patch load order is an entirely separate concept

#

its not something the game itself cares about

#

if you are both using different naming schemes, then it doesnt matter who goes first. both of your appearances will be added to the list of appearances

devout otter
uncut viper
#

the game does not care what mod added the appearances, it has no way of knowing. it just cares about the Precedence

devout otter
#

Now matter the load order, if your precedence is of higher number it would always be beaten with those that fulfill the conditions. (If the precedence is exactly the same it'd have a random chance of appearing.)

opaque cobalt
#

So, should I have the precedence be much lower on mine or have the names be the same and lower precedence? I could see this getting messy.

uncut viper
#

dont use the same names, just lower your precedence

#

has to be lower than whatever seasonal cute outfits put as their precedence

opaque cobalt
#

thank you. Will be funny as my Penny sprites are taller than seasonal cute so for any festival or event where they have outfits and I don't Penny will shrink 🙃

devout otter
#

If your entry has lower precedence than those festival entries, then it would replace them too, assuming the conditions are fulfilled.

opaque cobalt
#

Also, just to double check. For the two, condition sets below. Since they are different they would be able to have the same precedence but the rain one would take priority on any rainy day correct? Trying to see if I'm starting to understand

SEASON spring
SEASON spring, Weather Rain Snow Storm

uncut viper
#

they can have the same precedence even if they were the same

#

the one with the lower precedence has priority

#

if they are tied, its chosen at random

devout otter
#

If both have the same precedence and both fulfill their conditions, then both would have 50/50 chance of appearing.

opaque cobalt
#

err, I should rephrase then. trying to ascertain priority so I make sure stuff is maybe hopefully going to work

devout otter
#

If you want the rain one to always appear when it rains in spring, then you'd have to set its precedence lower.

opaque cobalt
#

thank you. So rain/storm outfits do need lower precedence, even with the stricter requirements as the regular Season spring one would still meet criteria?

uncut viper
#

the Conditions do not make a difference in priority whatsoever, the only thing they do is decide if theyre even in the list of appearances to choose from

devout otter
opaque cobalt
#

Where do I edit this image? World sprite, social tab image of her, and portraits all are correct except for that image in gift log

devout otter
#

I'm not actually sure, but maybe you can try do EditImage on her standard Characters\Penny?

opaque cobalt
#

thanks.

wide flint
#

I would like to extract a single sprite from a spritesheet available as Texture2D and replace an icon in an asset through asset editing. Usually you provide a string of the icon/texture path in your asset and while editing. Would that be possible in any way?

hard fern
ocean sailBOT
#

Making mods can be broadly divided into two categories:

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

velvet narwhal
#

they're working in c#

tight rivet
#

I have a gift:

rancid temple
#

It wasn't mine so I ended up taking the lazy route of getting the old file and putting it in the mods files to load it, but knowing the right way to fetch textures from a sheet is handy

gray bear
#

hey uhm i'd appreciate if a cool mod maker can check out #1321839537722232912 bc neither i or the author know why it's giving me errors and i for one am at a loss

rancid temple
#

FromFile token seems to be from their C# component and they don't have an open source link as far as I can tell

#

Unless I'm missing where it's declared

#

Hm, well, that's not right format for a C# created token

gray bear
#

i'm wondering if it's bc the {{spouse}} value they refrence is invalid?

#

like my current save has me not married to anyone

#

i think the from file is just uh, what's it called,

rancid temple
#

Oh, I see where FromFile is now, I've never used this, interesting

gray bear
#

internal asset?

rancid temple
#

It's a token that pulls the FromFile of the patch

#

Like a CP token, just never seen it before

gray bear
#

they specifically mention they aren't having this error and they are married, so idk

#

ah, interesting

rancid temple
#

And you're not?

gentle rose
#

I had a look at the CP docs when you first opened the ticket and the example in the docs matches their example nearly perfectly

gray bear
#

no spouse for me :(

rancid temple
#

Hm

#

Well I don't see them checking to make sure you're married for this, so unless they have some defaults in the files that could be a problem

gentle rose
#

I wonder what happens if you use FirstValidFile and none of the files are valid

gray bear
#

can't believe smapi is yelling at me for not being married

velvet narwhal
#

SMH no maidens

gentle rose
#

because using FirstValidFile AND HasFile in the same patch seems interesting

gray bear
#

i'm guessing first valid file just checks for either of the listings?

rancid temple
#

Whichever matches first

gray bear
#

does hasfile do the same here

#

oh i missed an update for the mod let me see if it fixes it

gentle rose
#

what if neither of them matches though. Does it return nothing?

gray bear
#

i think?

rancid temple
#

Possibly but it's weird that it's not complaining about the FromFile being wrong

gray bear
#

isn't it?

rancid temple
#

It's complaining about the HasFile, which is using a FromFile token

ocean sailBOT
#

Log Info: SMAPI 4.1.10 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home, with 67 C# mods and 139 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

gray bear
#

i think HasFile would just be returning "False" no?

rancid temple
#

I think the FromFile token is returning empty there

gentle rose
#

that's what I was thinking earlier

gray bear
#

Ah, I see

rancid temple
#

Because it thinks it's a HasFile that's checking for nothing

gray bear
#

anyone know if the mod author is in this discord by any chance...

rancid temple
#

No clue

gray bear
#

@vernal bone

#

they, are heh

rancid temple
#

Did you already update and try again?

gray bear
#

mhm, log I just sent is from the newest version

velvet narwhal
#

I assume slapping a when on married somewhere should be fine

gray bear
#

i can edit it myself and check, what would that look like?

rancid temple
#

Yeah, I wonder if When short circuits

gray bear
#

back to the cp docs i guess

gentle rose
#

like is it doing HasFile on an empty string

#

which is why it says it requires an input

gray bear
#

this would do yeah?

#

i'd imagine smapi is shitting itself because there's no spouse value and it breaks the tokens

gentle rose
#

would make the fix much easier because you just add that condition above hasfile

gray bear
#

lmao that's kinda funny since the specific Juliet and Sebastian Ginger files do check for spouse

#

stares this is correct rite

rancid temple
#

Well it's probably because it's using the FirstValidFile token and it's not matching anything because you're not married

gray bear
#

alas i am single

rancid temple
#

And they didn't set a default

gentle rose
#

I'd imagine it's possible to spawn in a kid without a spouse though? it would probably be more generally compatible with other mods for the mod author to just add a spouseless option to the FirstValidFile

rancid temple
#

They really should have set a default, I'm sure they haven't accounted for every single NPC that exists

gray bear
#

hopefully they see the ping.

gentle rose
#

I think they assumed that HasFile fixes that because it just won't patch anything in that case, but it clashes with FirstValidFile

#

they mentioned that that's why they put the HasFile there in the replies to Bea's post on nexus

rancid temple
#

Yeah if HasFile just silently failed if it was empty that would be fine, and realistically it's probably fine even with the red text

#

But red text == complaints

gray bear
#

Okay! after adding "HasValue:{{spouse}}": "true" there's no errors

gentle rose
#

probably best practice to always put some kind of default fallback that doesn't depend on any tokens in FirstValidFile just in case

rancid temple
#

Even yellow text will get complaints

gray bear
#

game is no longer mad at me for not marrying shane on day 3 of my save

gentle rose
gray bear
#

is that possible to do in vanilla?

#

what fallback would u add then?

gentle rose
#

sorry, I meant if someone has an incompatible spouse, I'm like only half awake lol

#

but all they have to do is add a generic kid option and add that to the FirstValidFile

rancid temple
#

The final option for FirstValidFile is the default

gray bear
#

ah you mean for modded npcs

rancid temple
#

But if the tokens on it don't match then it can't select anything

#

So the final option in it should just be whatever the default would be

#

So probably just the vanilla ugly kids dogekek

gray bear
#

they do mention they wanna add compatibility to those so i'd imagine this convo would help with that heh

#

not ugly, just creepy

rancid temple
#

Tomato potato

gray bear
#

they just kinda 🧍‍♂️

#

so adding a generic kid sprite to the FirstValidFile section would help with that no?

#

actually, no, since it will always exist

rancid temple
#

As the final option in the list

gray bear
rancid temple
#

So it will only choose it if no other match is found

gray bear
#

oooh

gentle rose
#

that's exactly what they should do

gray bear
#

i understand

rancid temple
#

Then it won't matter if you're married, it will just patch some stuff you won't see lol

#

And it would account for un-supported NPC's

gray bear
#

yeah and u can just tell people to edit the generic kid sprite to match their spouse

#

or, uh, deal with it™️

rancid temple
#

For un-supported NPC's you mean?

gray bear
#

yeah

rancid temple
#

I suppose, though probably the author will deal with them eventually

gray bear
#

there's already sprites for Jessie in the mod

velvet narwhal
#

I hate dealing with the child sprites so I Could Care Less SBVMischief

rancid temple
#

Assuming there's some level of demand and the author continues to support it

gray bear
#

wait would the first block apply anyway

#

so it would like edit the kid twice if the spouse is jessie

#

i suppose that doesn't matter

gray bear
rancid temple
#

Yeah it would just use the last one to edit it if it did

#

I have no clue who Jessie is

gray bear
#

probably a way to make it not do that with tokens

#

her

rancid temple
#

Also, I agreed to the kid prompt but honestly I'm considering a magic trick...

gray bear
#

oh no the children are rgb

rancid temple
#

All new Children by Corsair

gray bear
#

i was in fact wrong they have a whole lota sprites for a bunch of modded npcs

gentle rose
#

dammit you beat me to the joke rogukin z_goosebonk

gray bear
rancid temple
#

!twocakes

ocean sailBOT
#

If you discover that someone has made or is making a mod with a similar concept to yours, don't stress! Our community promotes the idea of "two cakes", where two versions of the same idea can peacefully co-exist. Your mod will have your own unique stamp on it that makes it special.

rancid temple
#

But for jokes

#

Corsair is a tech company that makes RGB peripherals

#

Keyboards, mice, etc

gentle rose
#

I was presumably going to go with razer for extra gamer cred

gray bear
#

ooh

rancid temple
#

Fucking, glowing mouse pads...

gray bear
#

wh-why

rancid temple
#

Exactly

gray bear
#

i get like keyboards and mice but the mouse pad??

gentle rose
#

I wanted one of those mouse pads so bad for a while as a teen DogeSmile

rancid temple
#

Just the rim around the edge

#

It's like the street car underglow

#

But for your desk

gentle rose
#

they look pretty sleek in pics, but it would probably be SO distracting and meh irl

gray bear
#

omg there's so many babies and they're all green

gentle rose
#

they also make RGB ram

rancid temple
#

It would either be annoying to look at or completely unnoticeable

#

Only green blankets

gray bear
rancid temple
#

And I guess onesies

gentle rose
#

prismatic baby mod when /lh

gray bear
#

let the babies be rainbow

rancid temple
#

I'd be more interested in them staying in my house if they were prismatic, NGL

gray bear
#

i'm sure it's doable, spacecore got animations

rancid temple
#

Yeah, but SpaceCore can't patch entire character sheets

#

You would have to patch each index individually

gray bear
#

ah

rancid temple
#

It's an issue

gray bear
#

nevermind. i mean yes for doable, but also yes for painful

rancid temple
#

Same for portraits

gray bear
#

can probably make the baby change the onesie color daily or something

#

depends how you'd define prismatic

rancid temple
#

The way I'd like to define it causes the game to lag dogekek

#

Supposedly anyways

gray bear
#

mmm yeah

rancid temple
#

I have a strong computer so never noticed an issue even when I had a screen full of prismatic fish ponds

gentle rose
#

prismatic babies are worth it for the pure deranged value they would add to a late game save

gray bear
#

imagine trying to sleep but if u can't bc ur child is fucking prismatic

hard fern
#

Prismatic baby ...

gentle rose
#

though it would definitely seal the deal on new parent sleep deprivation

wide flint
# rancid temple And sourceArea but hey, I wish I had seen this page when I was trying to fix a m...

I don't want to actually edit and use that image in the same place. I want to extract a part of the SpritSheet and use it somewhere else.
Example:

  • Take SpritSheet of FarmAnimalData.Texture
  • Extract parts of it
  • Use those parts as FarmAnimalData.ShopTexture but not in the same AssetRequested event

Texture and ShopTexture are both strings. How would I convert the extracted image to a string like that?

Just got into Asset Reading/Editing and I'm lost.

To read the image, I used Game1.content.Load<Texture2D>(farmAnimalData.Texture) but how do I convert that back?

rancid temple
#

It's something I still do by the seat of my pants every time. The specific mod I was thinking of the correct way to do it would have been to pull the appropriate textures from Cursors since that's where they are, the ones that were deleted weren't from before v1.0 and were super scaled up unused textures

#

If they're strings they're likely a reference to either a path or an asset they're looking for

#

I would have to check later to see what they actually want

wide flint
rancid temple
#

Unless someone who understands it better can correct me, I am pretty sure you would load your extracted images back into the content pipeline in order for them to be assets to make reference to

#

This is one of those things that I would probably just do in CP, whenever you start recreating CP functionality it becomes a question of if it's really worth it to be doing this in C#

#

If you needed to extract these images for making draw calls or something, that would be different

#

But extracting from an image to enter in the data assets, may as well be a CP mod

drowsy lake
#

Hello!
Sorry to bother-
i turned an .xnb mod to a CP mod for personal use (using https://xnb.pillow.rocks/ ), but it seems like the mod is not working
The mod changes the sprites of the bachelors, but there are more variants available so idk if i should choose just one to be picked, or if i can make the CP mod to be customizable.

I kinda wanted it to be customizable, but i don't know how to do it °O°
In the file i only have the content and manifest files- i presume that for make it customizable i need to have the config.json file but idk how to set it up ahah ;u;
this is the first time i'm approaching any coding for mods-

Can someone help me figuring out how to make the mod work? SDVpufferheart

hard fern
#

you can make a config

#

in the content.json

#

set up a configschema

#
"ConfigSchema": {
"YourConfig": {
"AllowValues": "option 1, option 2",
"Default": "option 1",
}
}
drowsy lake
#

ohhhh-
thank youu!

hard fern
#

and you have to make sure that your changes (aka the sprites) only change with the respective config options

#

so you need a

"When": {
"YourConfig": "option 1"
}
hard fern
#

(thanks, i misplaced that page 😭 )

velvet narwhal
#

i'm slowly getting my cache back in order KEK

ancient marten
#

i wonder if i should make this character ive made like a rivaling mayor candidate to lewis

slim oak
#

I bought stardew valley on Xbox. When I download SMAPI, the game doesn't measure my time, is there any way to solve it?

ancient marten
#

i dont know if this is also a bug but when i got smapi to help w my perfection late game brainrotting gameplay i didnt get the achievement for cooking everything

velvet narwhal
ocean sailBOT
#

For help with modding issues, please ask in #1272025932932055121! When asking for assistance there, sharing an error log will help others identify your issue (see https://smapi.io/log for instructions).

slim oak
tight rivet
#

As a side note: SVE gating Perfection beyond year 3 is incredingly annoying.

brittle ledge
tight rivet
#

the second

#

I'd argue that's deliberate though

#

timegating is bad design

teal bridge
#

I've always perceived not a lot of overlap between the SVE subset of players and the Perfection/minmax subset. I'm sure there must be some, but...

tight rivet
#

I mean, generally, I wouldn't be either, but it's one of the last two achievements I don't have. 😄

brittle ledge
#

use the 1.6 addition and ||buy perfection||?

#

but yeah I would exclude a Y3 character from perfection

#

(well. I wouldn't make a Y3 character in the first place because no one would ever see them SBVWahSob )

tight rivet
#

yeep

#

I feel vaguely having a ministry of magic in ferngill is very silly

#

but whatever man. c.c

#

Ithink the character is largely excluded, the problem is that the recipe isn't

acoustic summit
#

Do they have a unique friendship req / mailed recipe?

tight rivet
#

yeah, 3-hearts

teal bridge
#

Perfection waivers do help a lot with timegated stuff, but then I'll bet the average SVE player is even more allergic to anything Joja than they are to minmaxing.

tight rivet
#

probably, yeah

brittle ledge
#

"tia, why did you stop doing SVE compat?"

#

that cutscene WAS compatible with SVE but I guess he moved something in the map again

tight rivet
#

I know recent updates mentioned some map changes

brittle ledge
#

I told them to send me a log, if they do I'll probably look at it at least and see how annoying it would be to fix

brittle pasture
#

I didn't notice anything different, so I thought it was just the new trees. Wouldn't surprise me if it did stuff like "move Jodi's trash can two tiles to the left again"

brittle ledge
#

it wouldn't surprise me if it's a trash can move

#

I suspect it's something in the farmer's path but

#

it's doubly annoying because I built that code on SVE's vanilla tweak in the first place

brittle pasture
#

well on the bright side apparently that should be SVE's last major update, so hopefully (if you do choose to resolve it) you should not have compat issues pop up again

tight rivet
#

SVE is entering maintainace mode?

brittle ledge
#

He's said that before though SBVLmaoDog

rancid temple
#

Just like with SDV I'm sure there will be no take-backsies on that

uncut viper
#

(theres also no real indication that SVE is the actual problem from that one comment)

teal bridge
#

Was SDV supposed to be done with updates at some point?

brittle pasture
#

FS' recent blog post said that SVE is feature complete, and that the future 2.0 Castle Village update would instead be a new mod

rancid temple
#

I don't even think 1.6 was supposed to exist

brittle ledge
brittle pasture
#

and said mod can be used without SVE, so I imagine map changes made by that mod would be minimal

tight rivet
#

(well, "pushing the limits")

brittle ledge
#

if I was doing approximately ten thousand map patches I'd be pushing it too SBVLmaoDog

#

it's more accurate to say it's pushing the hardware performance limits

uncut viper
#

thats what the blog post says

brittle ledge
#

that he's doing ten thousand map edits? SDVkrobusgiggle

uncut viper
#

that its pushing the limits in terms of performance and hardware

brittle pasture
#

he clearly has not seen my new mod "map patches and foreachitem on updateticked for no reason"

tight rivet
uncut viper
#

"SVE 1.15 has already pushed the limits of what I think SMAPI can handle across a wide range of devices, both in terms of performance and hardware requirements."
this is the exact wording used

#

SVE does already come with an appreciable performance cost, so splitting castle village into its own mod makes sense for this

#

since you wont need SVE installed alongside it

#

so it doesnt matter if they both have performance costs if you're able to choose between them

tight rivet
#

true

uncut viper
#

i wish the people with 1000+ mods and every expansion mod under the sun installed luck when it comes to their loading times, though

tight rivet
#

yeah, I'm at 171 and that's.. well, enough. c.c

uncut viper
#

im sure "you dont need both installed" to them might as well say "you might as well install both"

tight rivet
#

... oh god. I mean, I can see it

#

people install RSV+SVE+Grampleton

velvet narwhal
#

my system at 220 or so mods (and my own wave of red text from my own unhinged expansion not having assets even though they're being called) takes roughly 5 minutes to go from pressing "ok" in a new game to actually being able to move

brittle ledge
#

yeah, SVE is just the most noticeable in terms of lag/improvement when it's gone

uncut viper
#

next playthrough i do i plan on installing all the expansions at least, but i probably wont come close to 1000

brittle ledge
#

honestly I might have tried castle village if I didn't have SVE-related mod author trauma SBVLmaoDog

#

inb4 "is it compatible with castle village"

calm nebula
#

At some point of time someone should take a hatchet to smapi asset loading and figure out where the time isssss

velvet narwhal
#

1000 is pretty much just aesthetic mods, which i can't justify because i enjoy vanilla enough

calm nebula
#

Tia, remember how I was trying to optimize appearances?

#

4ms!

#

Per npc!