#making-mods-general

1 messages · Page 125 of 1

proven narwhal
#

huh anyways thanks for answering i just wanted to know like a weird quirk about the textures

hard fern
#

now look in cursors :3

proven narwhal
#

💀

royal remnant
#

I need some help im stuck on a coding error that i can not figure out

rancid temple
#

Actually, unless the patch that switches out the board removes those tiles from the whole map, it doesn't make sense that during spring a random broken board shows back up every year lmao

calm nebula
#

hmm

teal bridge
#

No, it's simply that the sprite doesn't need to be added to any other map because it can't show up in those other seasons. It doesn't magically reappear in spring 2.

calm nebula
#

where is the broken boards?

#

Town.makemapmodifactions

rancid temple
#

To the right of the bookseller

#

It's outside of the accessible area but it's just out there in the weeds

royal remnant
#

anyone available for possibly some help?

hard fern
#

huh

#

fascinating

calm nebula
#

wait

uncut viper
calm nebula
#

the special ordres board doesn't appear until fall

hard fern
#

yeah

#

i thought i was just misremembering

#

but i remember it showing up fall

royal remnant
#

ok let me see cause im not sure how to copy errors stuff entirely from the visual studio

calm nebula
#

then again, like

#

I just failed to count to 32 so

#

you might not trust me 😛

royal remnant
#

Argument 1: cannot convert from 'bool' to 'byte'
Argument 1: cannot convert from 'bool' to 'byte'
'new' expression can be simplified

calm nebula
#

we're going to have to see the code

#

like, seriously, take a screenshot

teal bridge
#

I wonder why smapi.io doesn't have a C# pasty thing.

rancid temple
#

So just during Summer the broken board disappears lmao

#

And the extra one near the bookseller just comes back every Spring

calm nebula
#

tbh coders can be trusted most of the time to know how to use pastbin or git

teal bridge
#

You say that, but...

calm nebula
#

tbh I never noticed

uncut viper
#

maybe they removed it to make room for the new one in the fall

rancid temple
#

Me either lmao

uncut viper
#

the lumber was on backorder

proven narwhal
#

😭 ngl i was just so confused since i noticed it

royal remnant
#

well i cant seem to get all the code into the screenshot hmm

uncut viper
#

just take a picture of the part thats giving the error and a handful of the surrounding lines

#

or just put it on pastebin and tell us what line is erroring

royal remnant
#

i beleive this is the culprit

uncut viper
#

those functions do not do what you think they do

#

they do not take bools as parameters

royal remnant
#

then byte?

calm nebula
#

that;s fucking amazing, CA

uncut viper
#

your IDE should tell you that they take bytes, or the decompile

calm nebula
#

anyways, like

hard fern
#

mystery of the special order board... solved?

uncut viper
#

for what purpose do you need to use these functions

calm nebula
#

apparently what you want is Game1.player.setMoving(64)

#

or something like that

#

(or more sanely, do Game1.player.Halt()) lol

#

that's amazing, CA

royal remnant
#

well the problem in fact is i have tried now both byte and bool with booltobyte

#

Im making an ai bot to play the game

uncut viper
#
if ((command & 0x40) == 64)
{
  this.Halt();
  this.running = false;
}
#

you want whatever makes this happen

#

i guess

teal bridge
#

booltobyte, what? Is that some AI-generated thing?

uncut viper
#

alternatively just call player.Halt

tiny zealot
tiny zealot
calm nebula
#

that's exactly how I program for work but in my defense I'm an EE so

tiny zealot
#

i've written protocol code that does stuff like this but not in this context

royal remnant
calm nebula
#

I mean, yes, and if I was Actually Doing This for some reason in C# I would use a bitflag enum to make it readable, lol

uncut viper
#

making a bot to play the game is going to be rather difficult

royal remnant
#

ive had it pretty much do everything i want it to except for the fact of the player floating off screen and then walking through the wall borders but now this stupid little issue wont let me build

indigo yoke
#

So I did not do custom skill buffs, but Dr birb did custom skill buffs.

You can check out YACS. I have custom skill buffs for food items for cross-mod stuff

uncut viper
#

well you just need to look at the decompile to see how the function you're trying to call works

indigo yoke
#

Like cheesey cauliflower buffing binning from YACS

uncut viper
#

and figure out what byte to send

royal remnant
#

ok let me see if i can find a syntax snippet and see what it says brb

#

not syntax grr been working on this for 12 hours plus lol

rancid temple
teal bridge
royal remnant
#

so i just asked chatgpt said this,

The errors you are seeing stem from the fact that setMoving() and setRunning() methods are expecting byte values, not bool. The other errors around ambiguity and the readonly field are secondary at this stage.

Goal:
We need to:

Fix the byte vs bool confusion.
Ensure that only one definition of methods and classes exists.
Resolve any remaining issues in order to have a working mod for testing the AI.

uncut viper
#

please do not ask chatgpt

royal remnant
#

is it not good one?

uncut viper
#

if you ever feel like you need to ask chatgpt anything abouit stardew, do literally anything else instead

teal bridge
#

about stardew

Or about anything else.

royal remnant
#

hmm could i infer with claude sonnet perhaps?

rancid temple
#

AI is just not good lmao

uncut viper
#

no

teal bridge
#

Yeah, you're really not hearing us here.

#

AI cannot write your code for you.

royal remnant
#

im just trying to keep anonimity because i want to get this done do a series on it then release it for everyone to enjoy im sorry i may be a bit stubborn but since i have no friends and such i just do this on my own just trying to find a fix

brittle pasture
#

!chatgptcode

ocean sailBOT
#

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.

royal remnant
#

I literally just asked gpt if it knew what was going on :/

calm nebula
#

(also, I strongly suspect you're trying to re-implement the PathFindController class in game)

#

except, well, very weirdly

uncut viper
#

you will not really get any support for using chatgpt here nor will you get help fixing chatgpt generated code

teal bridge
#

I don't think anyone has a problem with anonymity - none of us are using our real names. We do have a problem with LLM junk being posted here.

uncut viper
#

we are merely letting you know this so you don't waste your time

royal remnant
#

Ok. Anyways thanks for the help then i will see what other things i can use in the modding wiki

uncut viper
#

you will genuinely have much better results figuring out how to code it without chatgpt. and that is when taking into account any amount of knowledge you have of C# or sdv

#

!decompile

ocean sailBOT
uncut viper
#

i recommend following these instructions and taking a look at the games code to see how it works

royal remnant
#

OK sounds good! Thanks for not being to harsh on me!

hard fern
#

everyone's gotta start somewhere~

#

... SDVpufferflat as i fight with my events again

void obsidian
#

hey y'all, any chance someone could help me out with my modding attempt?

#

i'm trying to just reskin krobus as another character but i'm encountering a weirdly specific issue where concernedape uses krobus's sprite for the magnifying glass event

#

at a glance it seems like the only way to fix this is to edit the town.cs code but that would involve harmony i believe and... i truly have no idea how i would even begin to start such a small edit through harmony

hard fern
#

is that scene not using just the normal monster texture?

void obsidian
#

you would think so right

#

but no it uses krobus' sprites

hard fern
#

😔 i would think

void obsidian
#

haha

#

so if anyone knows how to just replace "Krobus" in this code with a new character i've added (that just has krobus' sprites) named "ShadowPerson" i would owe you my life

drowsy pewter
#

and why doesnt patching krobus's texture work?

#

Okay hold on. Are you changing how krobus looks with this reskin or are you adding a new NPC that looks like krobus called ShadowPerson?

void obsidian
#

initially the mod is just a fancy reskin of krobus, but i added an additional NPC to play the role of the magnifying glass thief

#

(which is just original krobus assets)

tiny zealot
#

changing krobus, but the problem is that the magnifying glass event is hardcoded to use krobus's sprite

void obsidian
#

^this

#

:'D

drowsy pewter
#

but why do you need to make ShadowPerson the NPC in the cutscene if they look the same?

tiny zealot
#

i think what you should do is edit Krobus's entry in Data/Characters to use a new TextureName

ornate locust
#

I think they want their NPC to be Not Krobus and Shadow Guy to be a shadow guy?

tiny zealot
#

then replace that one with your edit. then put your new thief guy graphics in Characters/Krobus

drowsy pewter
#

Yeah do that

drowsy pewter
void obsidian
#

i will try this, thank you ichortower!! 🙏

tiny zealot
#

good luck! i hope it works

dusky sigil
#

is there a transpiling for dummies somewhere because i have no idea what i'm doing

tiny zealot
#

with transpilers, it's helpful to remember that it's a totally different kind of code writing than prefix/postfix

#

instead of writing C# code as it will run alongside the patched functions, you are writing a function that takes a list of CIL instructions (the original method) and returns a new list (the method as you want it to be)

#

(please forgive me using function and method interchangeably, for i am an old)

dusky sigil
#

thank you! i will look into it

shadow pagoda
#

I'm trying to understand how to get the amount of times something has been crafted by a certain player. I found the timesCrafted variable in the CraftingRecipe class. I'm currently just having issues getting the CraftingRecipe object I want to check. The code below shows the various booleans I'm checking. Is there a way to get the CraftingRecipe object based on the name, or do I need to load it through CraftingRecipes.xnb?

string craftName = "Chest";
CraftingRecipe chestRecipieObj = /*unsure what to put here*/;

//does the player know the chest recipipe
Log($"Player knows {craftName} recipe: {Game1.player.knowsRecipe(craftName)}");
            
//Has the player crafted the chest at least once
Log($"Player has crafted a {craftName} at least once: {chestRecipieObj.timesCrafted > 0}");

//Does player have the items to create the item in their inventory
Item wood = ItemLocator.GetItem("388");
Log($"Player has the items to create the {craftName} in their inventory: {ItemLocator.PlayerItemCount("388") >= 50}");
brave fable
#

i want to say that Game1.player.craftingRecipes is a dict<string, int> where the int value is the number of times crafted?

#

just going off memory though

shadow pagoda
#

it's a NetStringDictionary<int, NetInt>. I'm unsure exactly what the value data type is and how it's different from an int or Integer

brave fable
#

oh, that's all fluff to say it's a net-synced dict<string, int>

shadow pagoda
#

net-synced?

brave fable
#

you should be good to use Game1.player.craftingRecipes.TryGetValue(recipeName, out int timesCrafted), which will return false if the player doesn't know the recipe

#

net-synced data types will have their values updated for all players in multiplayer

#

which is to say when you learn or craft a recipe, the host and farmhands will all be given the same dict state as soon as possible

shadow pagoda
#

I'll try it. Though having the CraftingRecipe obj would've made the last two checks easier and less hardcoded

#

thanks

brave fable
#

you can quite easily get a list of all crafting recipes, i just don't remember exactly how. try DataLoader.CraftingRecipes or Game1.craftingRecipes or CraftingPage.craftingRecipes or something like that

hard fern
#

SDVpufferflat ...yaaa....i redrew all my portraits.

#

sigh

brave fable
#

addictive, isn't it 😌

#

the ever-repeating cycle of improvement and dissatisfaction

hard fern
#

hooray!

deep cypress
#

My "that's good enough, we can move on" has a one year max limit of working on things. Looking at my older work makes me sad...

hard fern
#

i also wonder if i have too many weird random configs but like XD

royal remnant
woeful lintel
#

don't know what type of AI you're making, but if it's a learning one, at least it learnt to moonwalk, which isn't nothing

#

also fazes through Furniture. Probably managed to slit between tiles somehow

hard fern
#

honestly for an ai, uhh it's a start XD i've seen them do weirder things

#

really wants to investigate that wall though

deep cypress
#

Hi loves! A question! I have made a farm, adding by CP. I was wanting to add a mermaid to it, much like the mermaid on the beach in the Island. I Figured to make a custom Location C# class. It is not applying to the location. I have a staunch feeling that C# editing a custom farm map rolls much differently than a typical location. So, if I might ask, has anyone done this before? Any reccomendations on how this would best be done, (so I don't flop about like a beached mermaid for a few hours confused as to how to do anything!)

royal remnant
#

Dude wants to phaze so bad but hes at least learning lol, anyways animation stuff will be worked out later after i get his head straight right now hes had a little to many bubbly hops

hard fern
#

ooh now he's dancing XD

royal remnant
#

Getting down XD

#

ill update in a little while after i throw some words at him again

faint ingot
#

Oh yeah, it's all coming together...

deep cypress
#

Hell yeah!!! I love this so much!!! I need to finish my repuation framework mod, this would go perfectly with it! (reputation affected by things u do or don

hard fern
#

😭 pierre is in jail

deep cypress
#

He deserves it. He definitely commits crimes. Boring crimes.

strong ice
#

Hi! How can I edit assets? When I do it a white background appears... What photo editor could I use? Thanks

hard fern
#

any phot editor that allows transparent pngs

#

!software

ocean sailBOT
smoky wraith
#

I’ve never quite understood the process of making custom npcs. If someone can give a basic rundown of it, i would appreciate it a lot. Thanks.

tender bloom
#

!npc

ocean sailBOT
#
Creating a Custom NPC

Keep in mind that making NPCs is a complex process that requires learning many different aspects of Stardew modding.
Here are a few links that can help get you started on all that you need to know:

smoky wraith
#

Thanks.

strong ice
deep cypress
#

Going to make some patches to GameLocation, based on if the patient's current location is the custom farm I am making.

if (Game1.GetFarmTypeID().Equals("ApryllForever.MermaidFarm"))
This is how I make sure it is that farm, right?

subtle saffron
#

Finally published the mod I've been working on... but finishing the night before vacation was maybe a tad too close for comfort, but we big chillin now

proven spindle
subtle saffron
#

And I don't really have anything to say :p

#

Maybe you could mention the original creators are Holychurros and Stanloona420, and that I'm just maintaining the mod

proven spindle
#

Posting on behalf of @subtle saffron, who has updated and is now maintaining this mod which was originally created by Holychurros and Stanloona420:

"Are you tired of the rude and often shady Pierre? Would you like someone who is kinder and more well rounded?! Well look no further! Piper is the replacement you are looking for!"

https://www.nexusmods.com/stardewvalley/mods/29834

Nexus Mods :: Stardew Valley

Are you tired of the rude and often shady Pierre? Would you like someone who is kinder and more well rounded?! Well look no further! Piper is the replacement you are looking for!

#

Posted to the showcase!

hard fern
#

:( aaaa i think im coming down with a cold 😔

#

events will have to wait...

proven spindle
#

And I'll work on compat for my mods adventurer abigail and morris redeemed (I think the former will be fine as is for now, but I'm planning to bring her parents in more for the next arc so I'll make sure its still compatible when I'm writing those events)

subtle saffron
#

I severely underestimated how much work would go into adding support/compat for other mods

#

😭

#

I was asked to add compat for the childhood sweetheart caroline mod, and that mod alone will take me sometime rewriting.. cause uh.... Piper and Caroline have a good relationship, so I think dynamic wise the best way to go about it would be a poly relationship, or else I gotta go kinda crazy with it and lean into some crazy drama that'd split the two up

blissful panther
#

It's definitely also okay to just not add compatibility if doing so would go against the narrative written into your mod to such a degree you need to change too much.

rancid temple
#

Normalize saying no SDVpufferheart

subtle saffron
#

Also very true

#

I'll see how I feel when I get back from my vacation

subtle saffron
#

💀

hard fern
#

😔

subtle saffron
#

yeah

tight rivet
#

To put on my judgemental hat..

#

CWC does a fw things that really should be the author's problem: it does narration to dictate the farmer's thoughts, ||Abigail is adopted but they think she's theirs via uh.. magical memory modification.||, and the author doesn't know how to handle marriage events + scheduling.

subtle saffron
#

o h

proven spindle
#

A couple of my mods have run into story compat issues with other mods that I just didn't have it in me to figure out, so I just mention the situation on the modpage and let the users decide what they want to do based on that. It's worked out pretty well :)

tight rivet
#

This is fine. But it's one of those where it's like "it should try to make itself compatible. with others."

hard fern
#

😔 im thinking about my mod that i have in the works thats probably gonna end up being incompatible with sve for like 20 reasons

proven spindle
#

(Or I make funny and slightly fourth-wall-breaking in-game references about the situation. See the morris redeemed + marry morris easter egg 🤣 )

subtle saffron
hard fern
#

with lore/worldbuilding being one of them...

tight rivet
#

yeah. I'd be willing to agree you should maybe do minor changes but I'd wait until CWC is actually feature complete with..

#

you know, a married schedule. c.c

hard fern
#

oof

tight rivet
#

(CWC also, tangentially, forces you to be the same age or within 3 as Caroline for half the dialogue to make sense.)

#

but taking off judgemental hat

#

I think that dialogues that change married couples should at some level be up to that author because well, a lot of assumptions on the part of other modders is that these mods aren't being used for.. well, a lot of reasons

#

That said, thanks for linking the Piper mod, I'll probably grab it for a fun run after I 100% this one

subtle saffron
#

I hope you enjoy it when you do have a chance to play!

hard fern
#

compatibility is hard...

subtle saffron
#

Rewriting dialogue can take a bit, and then comes the implementation of the dialogue, which is the most tedious process ever 😭

hard fern
#

sigh, and seasonal outfits too

subtle saffron
#

Oh yeah

#

😭

#

Buildings as well

#

got 32 different images for the general store

#

But speaking of seasonal outfits, I'm planning to create some outfits for modded events/new 1.6 events, surly it'll be a fun time that I won't burn myself out over

hard fern
#

SDVpufferwaaah i found one misplaced pixel in my npc portraits

brave fable
#

compatibility is easy. just ask the other sucker to do it SDVpufferchickpopcorn

hard fern
#

modmaking hard

rancid temple
#

Compat in two easy steps:

  1. Make mod open source
  2. Tell users they can do it themselves
brave fable
#

oh perfect, free open-source suckers

proven narwhal
#

hey can someone explain to me on how to add my new area to the world map?

inner harbor
#

I also really dont like it when mods add "farmer" dialogue via message. Give me options, or even just one basic option to click.

#

(My brain cant cope with it and it takes too long to figure out "im saying that? But i wouldn't say that!")

lucid mulch
#

just have every dialogue be a trolley problem instead

#

only bad options but you have to actively pick them

proven narwhal
slender badger
subtle saffron
#

(Sorry for the ping the first time )

proven narwhal
#

not even an error

#

so im not sure what im not getting at

drowsy pewter
#

I cant help with this area but if you share the code someone can

#

!json

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.

proven narwhal
#

it did everything else did properly

#

i think its just me being a little stupid since ive never done this before

fallow musk
#

Does anyone know an example of a mod which modifies the character creator screen?

#

i want to try my hand at adding a new <= option => kind of thing, but it seems very daunting, especially since im new to modding

tiny zealot
#

mods that add or change UI are notoriously difficult in this game because so much of the UI is directly in code and inconsistently implemented

#

i don't mean to discourage you, but it's a tough first mod to choose

fallow musk
#

ohhh

tiny zealot
#

what option were you thinking of adding? maybe there's a different way to accomplish the goal

fallow musk
#

i kind of wanted to add an 'origin' kind of stuff which would give buffs/nerfs/passives based on the job the player had at joja corp. Something like an accountant starting with extra 250g or a Warehouse manager starting with a chest in inventory etc

#

i assume i could ask this as a dialog on the morning of the first day

#

but itd been cooler if i couldve asked this in character creator

tiny zealot
#

ah yeah, i see what you mean

calm nebula
#

It's not impossible; it's a bit of a faff but like

tiny zealot
#

have you done programming before?

calm nebula
#

I would get it working first with dialogue options on day 1

#

Then retrofit to a box in character customization

#

Or maybe hijack into the intro cutscene

fallow musk
tiny zealot
fallow musk
#

ill try to implement the day 1 dialog option for now, will try more complex path once i get used to modding.

#

thanks for the help

cold summit
#

Hello! I am currently making my first mod, no coding background whatsoever, I am learning on the fly. I got my custom item into the game but it will not load the texture. SMAPI is saying the asset doesn't exist but the file is there, and it even displays the picture when I hover over it in the code. any ideas?

brittle pasture
#

!json post your code

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.

brittle pasture
#

!log and your 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.

cold summit
slender badger
#

What custom item are you trying to make? If it's something that fits into the base game categories, you can most likely create that with Content Patcher and have a much easier time of things

cold summit
#

It is a decore piece, and everything else works except for the texture, the description is there and everything

tiny zealot
#

i have a few questions, but the first one is did you copy this code from a tutorial or something?
(what on earth are you doing with a using directive for X509Certificates)

cold summit
#

yes everything is from tutorials, as I said I have no coding experience at all (only R lol)

tiny zealot
#

ok that content.json is for content patcher. so just throw out your C# code, you won't be using it

cold summit
#

oh! ok got it

tiny zealot
drowsy pewter
#

someone will tell you the texture issue but I recommend changing your item ID to StarJewMod_Khannukia as I dont know what will happen if you try to use the slash there in some sitations

tiny zealot
#

6480 is right, your problem is you are referencing your file assets/Khannukia.png but you need to reference an asset instead

#

the quickest fix is to use the InternalAssetKey token instead, which will do the work for you:
"Texture": "{{InternalAssetKey: assets/Khannukia.png}}",

cold summit
#

I will try this! thank you so much

calm nebula
#

I keep having to remove random unhelpful usings

tiny zealot
calm nebula
#

Nah, you'll just be typing

cold summit
#

omg it worked!!! thank you

finite ginkgo
#

Yeah I've definitely had VS just add that exact using before on a whim, what am I supposed to be using x509 certificates for VS

calm nebula
#

And VS will be like, hey, you want AbortedThreadException right?

tiny zealot
cold summit
#

yeah the dimentiones are off lol

#

one more question lol, can i change the dimentions?

tiny zealot
#

not without specific other mods that alter the game code to allow it. for objects you are stuck with 16x16 by default

cold summit
#

ok so i can just edit my image

tiny zealot
#

yup

cold summit
#

thank you so so much for the help ♥

fallow musk
#

What would be the approach to code a 'take 25% more damage from a specific kind of enemy' permanent hidden nerf?

#

i could not find any taking damage specific Event in SMAPIs Event lists

tiny zealot
#

my approach would probably be a harmony postfix on whichever take damage function is closest

#

spacecore might have an event for it (spacecore has a lot of jobs)

fallow musk
#

oh thanks. Ill check it out.

coral solstice
#

Hope it’s okay to ask in here -

I’ve made a basic recolour of Abigail’s hair, following a YouTube tutorial- I have manifest.json and content.json files, but SMAPI says that none of the files are manifest.json

I am very new to this and I’m just kinda practicing I guess - can anyone gimme a hand to figure out why it’s not reading properly??

timid ice
#

If so - can you take a screenshot of the folder structure/files for your mod real fast?

coral solstice
#

Gimme 2 seconds

timid ice
#

With file extensions, if possible.

coral solstice
#

Just gotta load discord up on my laptop lol

#

thats what the mod file looks ike

tiny zealot
#

just to be sure, do you have visible filename extensions turned on? (i forget the steps. View menu?)

#

your file might be named manifest.json.json if not

coral solstice
#

That may be possible

#

Yeah it is

#

Thank u, I am a dumbass

tiny zealot
#

no, you're not. windows's default setting is the problem

coral solstice
#

Thank u very much for letting me know that it’s even a thing to be seen!!

You’re very much appreciated 🫶🏼

timid ice
#

And for what it's worth - I didn't catch it right away - Was trying to think of ideas why it wouldn't be happy with what you posted, didn't occur to me that you had the extension doubled. So no calling yourself a dumbass over that one.

coral solstice
#

Thank u thank u! 🫶🏼

#

SMAPI is now telling me its dependencies have a circular reference 😭

Gosh I’m terrible at this. Only up from here though. Gotta remind myself that I’m just practicing and I’m not gonna be amazing at it straight away

timid ice
coral solstice
#

None at all

timid ice
#

Can you upload a log then?

coral solstice
#

Sure thing

#

I’ll pop it in support once it’s parsed

#

Unless it’s okay for me to drop it here - I don’t mind 🫶🏼

timid ice
#

Just toss it in here

coral solstice
#

Awesome will do

timid ice
#

It's related to making a mod (And we'd just bounce it back here anyways)

coral solstice
#

Just waiting for the full log to load up and then I’ll grab it - thanks for helping me btw, I really appreciate it SDVemoteheart

ocean sailBOT
#

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

timid ice
#

(Can't say I've ever seen a mod circular reference itself)

coral solstice
#

I've probably buggered up somethin in there

timid ice
#

The ContentPackFor should be pointing at Content Patcher

#

I believe

coral solstice
#

Ah that makes sense I shall move it and see what happens!

Thank u

timid ice
#
      "UniqueID": "Pathoschild.ContentPatcher"
   },```
#

Since you're telling SMAPI what mod to use to parse the Content Pack

coral solstice
#

That makes a lot of sense

#

It loaded!!

Thank you so much!

#

Time to see how bad my recolour job is 😂

dusty vortex
#

Anyone have experience creating mods for Custom Companions?
Can't seem to stop the error "Command Failed"

dusty vortex
#

I've been trying to get one of the example companions to work and every time I use "cc_spawn" to make it appear, it says "Command Failed" in the cmd window

#

I began with a custom sprite, but encountered the issue, so I went through the guide using the example companion instead and it was the same result

coral solstice
timid ice
tall shale
#

hello, guys! is there a chance to combine ContentPatcher with specific code in .dll files within 1 mod? if i relate to both .dll and ContentPatcher, the mod won't load because like the error says these 2 parameters exclude each others

coral solstice
gaunt orbit
#

I can help you with the second option if you like

tall shale
gaunt orbit
# tall shale would be awesome

So the heart of it would be using the Helper.Events.Content.AssetRequested event. You'd create an event handler for that event which checks the name of the asset being requested and either loads or edits the asset if needed.

What is your CP component doing?

tall shale
#

my CP component is creating a new item with unique id, loads my own assets into the general objects sheet and uses this sprite for my new object. + item's recipe object i can buy from the shop

gaunt orbit
#

okay, that's all pretty easy

#

do you want to write your object/shop entries in c#, or write them in json and just copy them in with c#?

#

both are pretty easy to do

coral solstice
#

I am peeing my pants

#

I love learning

tall shale
#

honestly, i'd like to see how both options would work, but don't want to waste too much of your time

gaunt orbit
tiny zealot
whole raptor
#

Anyone knows if this button from Spacecore is editable by CP? SDVpufferthinkblob I can't really find anything obvious in the log

tall shale
tiny zealot
fallow musk
#

does a postfix harmony patch need to have the same function arguments as the original function? even tho lets say the logic doesnt need any of those values

tiny zealot
tiny zealot
#

yup, there you go! "Target": "spacechase0.SpaceCore/ExtraEquipmentIcon"

latent mauve
#

And then you just need to make sure you're loading after Spacecore, yeah

whole raptor
#

Weird it didn't show up in the log like with GMCM, but at least it's doable

tiny zealot
latent mauve
#

I missed the Priority, my bad

#

Was just doing a quick glance while I try not to freeze over here, LOL

coral solstice
#

Ugh Abigail is still purple

gaunt orbit
# tall shale honestly, i'd like to see how both options would work, but don't want to waste t...

adding via c#:

private void HandleAssets(object sender, AssetRequestedEventArgs ev) {
  if (ev.NameWithoutLocale.IsEquivalentTo("Data/Shops"))
    ev.Edit(d => {
      if (d.Data is Dictionary<string, ShopData> shops && shops.TryGetValue("ShopToAddTo", out var shop))
        shop.Items.Add(new(){
          ... shop entry info goes here ...
        });
    }, AssetEditPriority.Normal);
}
``` adding from json:
```cs
private void HandleAssets(object sender, AssetRequestedEventArgs ev) {
  if (ev.NameWithoutLocale.IsEquivalentTo("Data/Shops"))
    ev.Edit(d => {
      if (d.Data is Dictionary<string, ShopData> shops && shops.TryGetValue("ShopToAddTo", out var shop))
        shop.Items.Add(Helper.ModContent.Load<ShopItemData>("assets/shopEntry.json"));
    }, AssetEditPriority.Normal);
}
whole raptor
#

Oh no... I lost all my modding snippets for VSC after reinstalling the OS SDVpufferwaaah

coral solstice
#

Really confused as to why Abigail’s hair is still purple when the assets in my file have been recoloured, and SMAPI & CP are reading it and loading it fine

I’ve only loaded up CP, my recolour, and CJB so there’s no other mods recolouring her 🤔🤔🤔

fallow musk
#

im getting AmbiguousMatchException trying to postfix patch a takeDamage method in StardewValley.Mosters/bug.cs

I checked some older messages with same error and the cause is overloaded original method

but when i look at Bug.cs in decompiled code, i only see one takeDamage method

gaunt orbit
tender bloom
#

Does base have multiple or something?

gaunt orbit
#

you can add the DeclaredOnly flag to filter those out

fallow musk
tender bloom
#

Monster.cs would probably be base

gaunt orbit
coral solstice
#

So CP has decided that two of my recoloured assets just don’t exist 😂

#

They definitely do exist, and they’re both written correctly in my content.json file so I am v confused

tiny zealot
#

maybe you can upload & link your content.json again and we can take a look?

tiny zealot
coral solstice
#

Yeah i figured that one out pretty quick

ocean sailBOT
#

Log Info: SMAPI 4.1.8 with SDV 1.6.14 build 24317 on Microsoft Windows 10 Home, with 4 C# mods and 1 content packs.

tiny zealot
#

hmm. as you say, nothing seems obviously wrong

#

i guess make sure the content.json and assets folder in your actual Mods folder are up to date? (if you are working on the files elsewhere, as is my practice)

coral solstice
#

they’re all in the actual mods folder - so they should be fine, not sure what’s happened at all

#

They should be up to date too

tiny zealot
#

CP's warning about missing assets usually matches exactly what is in the FromFile line, in my experience, so since it's missing the ".png" i have to wonder

tall shale
coral solstice
gaunt orbit
coral solstice
#

Wait it’s fixed itself?????

stable leaf
#

Hey, I'd like to make a custom garbage can-type object (without the "NPCs get grossed out" behavior) that spawns multiple debris items for the player to pick up. Is this possible to do with ContentPatcher or do I have to write C# code? Basically, it's a fixed object on the map that the player right-clicks and causes, say, multiple pieces of wood to fall out.

tiny zealot
coral solstice
#

I am bewildered, tired, my brain is burning, but it WORKS

coral solstice
gaunt orbit
#

you would need a custom tile action, which requires scripting

coral solstice
#

Thank you so much for all your help Ichor 🫶🏼

gaunt orbit
#

very easy

tall shale
gaunt orbit
#

IE. this part json { "Id": "(O)Arteesian.ExplosiveKegs_ExplosiveKeg (Recipe)", "ItemId": "(O)Arteesian.ExplosiveKegs_ExplosiveKeg", "IsRecipe": true, "Price": 5000 }

cold summit
#

hey if i added a piece of furniture how can I make it so players can get it without item spawner?

gaunt orbit
cold summit
#

I didn't see it in the catalogue :\

gaunt orbit
#

if you want to exclude if from both, you can use one of the optional furniture data fields to exclude it

gaunt orbit
#

also !log

#

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

cold summit
lucid iron
#

You can use cp's patch export Data/Shops to validate what you did

gaunt orbit
lucid iron
#

It'll get stuff added by C# too

tall shale
gaunt orbit
#

you need to edit Data/Furniture to add furniture, and the format is different

gaunt orbit
#

see "ShopToAddTo"

cold summit
gaunt orbit
#

bah I'll just link it myself, one sec

#

apparently doesn't have it's own page

gaunt orbit
uneven dagger
#

Hello gurus. I'm attempting to load NPC's birthdays and favorite gifts at the beginning of the day with a C# mod. So far I've had good success loading birthdays! The gifts are a bigger beast. I can get the gift IDs after some work. Now I'm trying to load object data for name lookups with issues. Skipping most of the cruft, this works:

// Load the NPC gift tastes using SMAPI's Content API
var giftTastes = this.Helper.GameContent.Load<Dictionary<string, string>>("Data/NPCGiftTastes");

This does not work:

// Load the "Data/Objects" asset as a dictionary
var objectInfo = this.Helper.GameContent.Load<Dictionary<string, string>>("Data/Objects");

SMAPI output:

[My Mod] Error loading Data/Objects: My Mod failed loading content asset 'Data/Objects' from the game content.

I see Objects.xnb in the Data folder. Is that not what I think I need?

🕰️ No urgency to respond. I realize I need to run an errand super fast. I'll be back in 30 minutes. Thanks for your awesome knowledge in advance! SDVemoteheart

gaunt orbit
blissful panther
#

You could also just use Game1.objectData. I'm 99% sure it should be automatically kept up to date with content changes? Might be more of a hassle to keep your cache up to date, though.

#

Though thinking about it...

#

It should be Dictionary<string, ObjectData>, yeah.

#

Not string, string.

gaunt orbit
#

good catch, I missed that

blissful panther
#

So did I until I looked at the type here! SDVkrobusgiggle

gaunt orbit
#

the 1.5 brainrot is forever isn't it 💀

lucid iron
#

Usually u only need to maintain ur custom assets

#

For vanilla stuff there's DataLoader

#

Tho ofc u should cache anything u want to access every tick

tall shale
# gaunt orbit no, that's in the c#

great, so it worked, tysm, but i need to create the recipe and item themselves somewhere. how do i define the recipe itself (what it contains of) and the item itself? i mean how do i do the stuff that was in the contex.json file

gaunt orbit
#

like have one for your object, and another for your recipe

#

for loading your custom sprite you can just do a ev.LoadFrom and point it at your image

cunning holly
#

Is it possible and how simple/difficult is it to use ContentPatcher to change NPC characters' names? And if not ContentPatcher, which mod is the best to do that?
Just pointing me in the right direction would be a big help. Thank you. 🙏

lucid iron
#

It's possible to use only content patcher, but difficult for compatibility

blissful panther
#

I you just mean their display name, that should be one of the simpler things to do, I think?

lucid iron
#

There is no magic global token to edit for all dialog

blissful panther
#

Ah!

#

Unless you care about in-dialogue, yeah. Then...

cunning holly
#

Yeah. I thought it might be difficult. Since you can't change the name in one place without affecting something else. x\

tiny zealot
#

mentions in dialogue etc. are the tricky part

lucid iron
#

New topical mod Dokkan

tiny zealot
lucid iron
#

I believe this one just brute force edit all mentions of pierre

#

And yea if you want something fancier u will need C#

blissful panther
tiny zealot
#

i aim to please

lucid iron
#

It is easier than pre 1.6 at least

#

Since npcs have proper internal names now

cunning holly
#

I see. Thanks everyone. I'll look more into it. x]

whole raptor
gaunt orbit
cold summit
#

I put in what was in the wiki (with my item's name and texture) and it just gave me a chair lol

latent mauve
#

Ignore the name there, it's primarily a Data/Furniture spreadsheet meant for use with CP

fervent horizon
#

I feel like I am going to facepalm when I see the solution, but I have tried many things and can't figure this out, as I am a C# newbie. I have a texture at

string iconRelativePath = $"assets/Generated/{farmName}_{horseName}.png";

That I want to set to horse.Sprite.textureName.Value

Everything I do, it sets it as an xnb, and i am honestly just stumped

gaunt orbit
gaunt orbit
#

assets don't have those

fervent horizon
#

ok, so it will match name first, and if it doesn't find it, it assumes xnb

latent mauve
#

only filepaths use extensions, right?

fervent horizon
#

so that is why I am getting the .png.xnb

latent mauve
#

Well, direct file paths

gaunt orbit
#

files use extensions, assets do not. asset paths look like filepaths but they aren't really

latent mauve
#

gotcha

gaunt orbit
#

it's more like a lookup key

latent mauve
#

I really only fiddle with CP, so I'm used to referring to asset paths as Targets

#

gotta assimilate the new vocab 🙂

iron ridge
latent mauve
#

Congrats! I just hit 6k this past weekend

gaunt orbit
#

wow nice!!

fervent horizon
#

So would I do something like this once I remove the png - horse.Sprite.textureName.Set(iconRelativePath);

dusty scarab
#

if I wanted to have my crop mod's carrots also be able to be fed to the horse to increase its movement speed (like vanilla carrots can), would that require C#, or can I do that in CP?

latent mauve
#

That makes me wonder if carrots have a native context tag or if that's hardcoded

fervent horizon
dusty scarab
cold summit
tiny zealot
#

frankly i would be shocked if feeding carrots to the horse were not hardcoded

rancid temple
#

Fairly hardcoded

latent mauve
#

Also the only context tags for carrot are: "color_orange", "dye_medium", "season_spring"

lucid iron
#

Well it's probably a ez transpiler

dusty scarab
#

awww, darn. that means it needs C#, doesn't it?

lucid iron
#

As long as you don't want some alt animation for it

rancid temple
gaunt orbit
fervent horizon
#

Thanks, I will try that

rancid temple
#

Seeing as how it doesn't appear that you're loading it into the content pipeline

rancid temple
#

I am flying by the seat of my pants when it comes to is and similar things lmao

#

His relative path was a string wasn't it?

#

Also it would need the .png if you use ModContent.Load

gaunt orbit
rancid temple
#

Oh, uhhh

latent mauve
# cold summit it works! but now it won't load the texture again :(((((((((

Are you sure you have the spriteindex exact?

Also I think Texture might prefer an asset path instead of an internal asset key, but I am not sure that having an internal asset key would prevent it from working. It's not very hard to load your furniture PNG as a Target path to use in the Texture field, if you need to.

rancid temple
#

I did this once but I switched to loading to content pipeline so I'm winging it lmao

latent mauve
#

I fought so hard with furniture sprite indexes.

dusty scarab
#

tlitookilakin, are you the same Wren that made the Wren's Greenhouse mod?

gaunt orbit
latent mauve
#

Yeah, I'm more thinking it's the spriteindex being a butt

dusty scarab
latent mauve
#

I don't see why InternalAsseyKey wouldn't work

rancid temple
#

Oh textureName is readonly anyways

cold summit
#

it worked before with the same index

dusty scarab
#

mind if I pm you a question about it?

gaunt orbit
cold summit
gaunt orbit
#

@fervent horizon so what you need to do is set textureName.value to a string that is an asset path, then you need to use AssetRequested to provide your local image for that asset path

#

assets and files are different things, and the game cannot directly read your mod files

fervent horizon
#

ok, I will try some things out

latent mauve
#

You shouldn't have to reverse the /'s if it's enclosed in the InternalAssetKey brackets, right?

#

I know for normal Textures you have to reverse and escape the / to become \\ for delimited lists

dusky sigil
#

so i'm trying to write code to make a monster move towards another monster and it's just... not working. i tried copying the structure of the code that makes monsters move towards the player but no dice

latent mauve
# cold summit computers hate me lol

NikiMouse, if you look at the link I sent before, there's a "Furniture Code Examples for CP" tab that includes what you'd need if you wanted to load the Texture directly rather than though the InternalAssetKey

gaunt orbit
latent mauve
#

Yep, just trying to spitball ideas as to why it's not working right for NikiMouse

cold summit
#

nope still not working with \ \ :((

latent mauve
#

are there any errors in your SMAPI log with the initial code tlitookilakin gave you?

cold summit
#

no it works perfectly and the item is in the catalogue and everything, just no texture

gaunt orbit
cold summit
gaunt orbit
#

does your log say anything?

cold summit
#

it said the asset didn't exist

gaunt orbit
cold summit
#

i chevked its properties and it says png

gaunt orbit
#

can you enable the file extensions anyways?

cold summit
#

and it worked before when it was just an object

latent mauve
#

And your content.json is directly in the folder above this?

cold summit
#

yes

gaunt orbit
#

well, you can always load it separately

latent mauve
#

Also I can't believe nobody fussed at me for having EditData instead of Load in the Code Example for Loading a Texture in that sheet. xD

#

It's fixed now.

#

I blame cold medicine brain

frosty hull
#

Hi, i have question about Facade
how can i write field from "private Item hoverItem" into public?

uneven dagger
gaunt orbit
#
"Changes": [
  {
    "LogName": "Add Furniture",
    "Target": "Data/Furniture",
    "Action": "EditData",
    "Entries": {
      "{{ModId}}_Khannukia": "{{ModId}}_Khannukia/decor/1 1/1 1/1/1000/2/Khannukia/0/Mods\\{{ModId}}\\Furniture"
    }
  },
  {
    "LogName": "Load furniture sprites",
    "Target": "Mods/{{ModId}}/Furniture",
    "Action": "Load",
    "FromFile": "assets/Kannukia.png"
  }
]
#

@cold summit try this

cold summit
#

will do

gaunt orbit
cold summit
latent mauve
#

yeah, change the typo in the PNG to remove the h

cold summit
#

you're my heros

fervent horizon
#

welp, removing the png didn't work, the game still assumed it was looking for an xnb file An error occurred in the base update loop: Microsoft.Xna.Framework.Content.ContentLoadException: The content file was not found. ---> FileNotFoundException: Content\assets/Generated/Pumpkin Acres_Daximus.xnb ---> DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley\Content\assets\Generated\Pumpkin Acres_Daximus.xnb'.

tender bloom
#

That’s the way the errors always look

#

The game always displays errors by XNB even when what it needs is png

rancid temple
#

You're still trying to feed a string into an asset spot

gaunt orbit
fervent horizon
#

I can throw it up real quick

gaunt orbit
# fervent horizon https://github.com/bsavage81/StardewMods

okay, yeah. so you're currently trying to use file paths as asset paths.
assets and files are two completely different things. The game can only "see" assets, not your files. You have to turn your files into assets to make them available to the game
you can do that using the AssetRequested content event

rancid temple
#

Why can't I just make a mod, why do I always have to have ideas

lucid iron
#

Are u scope creep agen

rancid temple
#

Yeeep

lucid iron
#

You can stop creep if release mod now then update later

rancid temple
#

Lol, delayed creep

lucid iron
#

Long Term Support

rancid temple
#

The problem is, I generate scope creep before I've even finished the base of the mod

brittle ledge
#

If it helps, when I've got a big project with lots of creep, I delineate between "needed for initial release" and "good in a future update". Like specifically ask yourself what is strictly desired for an initial release.

#

People love updates for more content!

tight rivet
teal bridge
#

Yes, learn to love the MVP.

tall shale
#

could you guys please tell where can i find so called "tall" sprites like casks, mayo and cheese machines, etc.?

brittle pasture
#

tilesheets/craftables

brave fable
#

fortunately, MVP can just as easily stand for Maximum Viable Product

#

which pairs well with my plans for Long-Term Suffering

#

boy i hope pathos appears by chance today so i can casually send a sly message about making EditData MoveEntries optionally not send a warning if the BeforeID/AfterID is not found in the list SDVdemetriums or like, have a fallback operation

rancid musk
#

I am good with Maximum Viable Products.

#

What's that? This feature is something like only 2 people ever would even use and definitely not worth delaying a release? But it sounds neat

calm nebula
#

We all know I only care about what user #1 wants

#

(User #1 wants gloves)

rancid musk
#

Knitting is just multithreading.

drowsy pewter
dusky sigil
#

just attempted to write baby's first harmony patch and my mod immediately crashed 🫠

rancid temple
#

Depending on what you tried to write, this is probably normal

#

I would say postfixing a monitor log would be the most "baby's first" you could do with the least likelihood of dying

dusky sigil
#

tried to use a prefix to prevent specific debuffs from applying

#

i have no idea what i've done wrong, just that it's clearly something

brittle pasture
#

you can always post your code if you're stuck

brave fable
#

we have no idea too 😌 a log could help that

dusky sigil
#

here's the relevant code, i'm sure i've made some kind of obvious mistake

brave fable
#

hint: log with $"Failed in buffing prefix:\n{e}" so you actually know why it failed

teal bridge
#

And what is monsterController, where is it populated?

dusky sigil
#

it's a custom class, it's populated in the mod entry

teal bridge
#

You also haven't matched the class to the method.

#

Game1.player.applyBuff is obviously a method on Farmer, not Game1.

dusky sigil
#

with that fixed it's finally giving me a useful error

#

System.Reflection.AmbiguousMatchException: Ambiguous match in Harmony patch for StardewValley.Farmer:applyBuff

brittle pasture
#

that means there are multiple applyBuff overloads on Farmer and the game doesnt know which one to patch

#

you need a 3rd parameter to AccessTools.Method that is an array of Types corresponding to the parameter type of the overload you want to patch

lucid iron
#

I thought you specifically wanted to ban the ghost from doing the debuff

#

Rather than prevent player from getting debuffed by nausea

dusky sigil
#

i want to specifically ban the ghost and the strong skeleton from doing debuffs

lucid iron
#

You need patch those subclasses of Monster

#

The nuance is just whether other sources like say modded monsters should be able to apply them

dusky sigil
#

right. doing it this way just seemed easier at the time but maybe i'm wrong

brave fable
#

yeah that happens a lot hahah

brittle pasture
#

yeah it is easier, patching the monsters need a transpiler

#

to switch out their debuffing projectiles

tender bloom
#

The monster classes are a bit monstrous sometimes

rancid temple
#

This way they'll still try to debuff won't they?

tender bloom
#

Don’t ask me how the serpents move

#

It’s black magic

rancid temple
#

The debuff just won't do anything when it hits the player

tender bloom
#

What about postfixing the methods and immediately removing the debuff?

brittle pasture
#

if you're going down the route of patching Farmer.applyBuff, perhaps patch BuffManager.Apply instead (which both applyBuff overloads are calling)

tender bloom
#

You could also do a prefix to record the farmer state before getting hit

#

This is less elegant but you’d avoid a transpiler

#

You can also add in conditions like the monster name matching what the vanilla monsters do if that helps any with modded monsters

#

RSV might be a good mod to test on, as they have tons of those nasty ghosts

#

You can either decide you do want to affect those monsters, or that you don’t, but I think they’re spawned via FTM like most mods adding monsters

dusky sigil
#

man i'll be honest, i'm pretty sure my mod is not at all compatible with modded monsters either way whoops

tender bloom
#

As long as it doesn’t crash the game, eh, sometimes that’s the way it goes. I know I personally don’t spend much time adding compat unless someone asks. And even then I sometimes put it off.

#

(And I doubt it would crash the game, Stardew modding is pretty chill)

dusky sigil
#

for me, compatibility is a "would be nice" kind of feature. not something for the minimum viable product

teal bridge
#

I have successfully crashed the game before. But it's not common.

brave fable
#

runtime engine execution error my beloved

#

fond memories of trying to harmony patch a specific switch statement function in communitycenter.cs that would crash the game only when debugging

tender bloom
#

I've crashed the game, but I was doing stupid stuff

brave fable
#

fond memories (i may have cried)

tender bloom
#

I had a brief time when I was causing AVEs using relatively normal harmony patches

#

I was mostly perplexed at how I managed it, iirc

teal bridge
#

Trying to use a struct like a class in IL is an almost guaranteed AVE.

#

Apparently it can also generate an execution engine error as happened to Pintail a couple weeks back.

tender bloom
#

I wasn't touching IL

#

That was the weird part

#

I forget what stupid mistake I was making, but I never do transpilers

teal bridge
#

Oh, I see, you meant postfixes etc.

tender bloom
#

So it was a prefix or a postfix

teal bridge
#

That does seem hard to do. Maybe marking (or forgetting to mark) some argument as ref, or using the wrong modifier? Or a version incompatibility, SMAPI's rewriter isn't perfect.

rough valve
#

Is there any way I could create a mod that changes the frog egg sprite to match its color? There is a framework mod called TrinketTinker so maybe I could use that.

lucid iron
#

There's always silly AVE stuff

lucid iron
drowsy pewter
#

Yes its dumb, and yes its easy

lucid iron
#

It has features for matching the icon to the variant (see the bat example) but it has no power over vanilla trinkets

brittle pasture
#

I guess it can be a standalone C# mod

#

just for the frog egg draw thing

lucid iron
#

Yeah Dokkan

brittle pasture
#

I assign you, get to work

calm nebula
#

Great! You're nominated to make it

#

Crap

lucid iron
#

I think u can also reproduce the particular impl for variant icons, but for the froge

#

Which works by changing the parentsheetindex

#

No harmony required

#

To summarize u would

  1. Change frog egg to different item icon texture, make colored variants on same sheet
  2. Make custom machine output method based on the anvil one, change parentsheetindex here
  3. Make a new machine rule on anvil that accept only frog egg and produces using the custom output method
dusky sigil
#

i fear i have done something else obviously wrong this time

System.Exception: Parameter "id" not found in method System.Void StardewValley.Buffs.BuffManager::Apply(StardewValley.Buff buff)

brittle pasture
#

that seems fine to me
did you save

dusky sigil
#

did i 🤔

#

if it didn't work because i forgot to build i'm going to flip a table

#

i can't believe it.... it's working

#

tested it and the patch actually works too, the debuffs aren't applying

ocean sailBOT
#

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

stable leaf
#

Hey, my google skills are kind of failing me: Is there a good tutorial for GenericModConfigMenu? Or maybe is there a simple mod that has a small example I can look at? My mod will literally have one boolean checkbox for "Enabled" for the mod I want to create. (I'm experienced at coding, new to SDV modding.)

brittle pasture
#

are you making a CP or C# mod

lucid iron
#

I don't think you need a config like that

#

If people don't want your mod to take effect it's simple to uninstall

rancid temple
#

I've put a enabled bool in for when I have a mod that you can disable to finish up a day without issues

teal bridge
brittle pasture
lucid iron
teal bridge
#

Betting it's one of those "unreleased" mods.

rancid temple
#

Nah, it's Custom Locks Updated, just in case there's some issue where my patches are making doors fully inoperable

#

Because I've had some conflict issues that literally cause that

teal bridge
#

....temporarily? That's bizarre.

rancid temple
#

And just disabling my mod makes them work properly and the issue can be reported to me

lucid iron
#

Oh the whole dtz business

rancid temple
#

It only happened during one of my updates so far, can't remember what I did wrong lmao

uncut viper
#

sounds similar in idea to my debug book that just removes all the book powers you got and refunds you, in case i fuck up again and cause issues from a broken power

#

doesnt hurt sometimes to have a "in case i fucked up, heres an easy out" button

lucid iron
#

Yeah ig these r more like "safely uninstall" buttons

rancid temple
#

I only add it in mods where it makes sense because I hate when I'm using a mod and a problem causes me to lose a whole day

stable leaf
#

Thanks. I'm doing it in C# since I have to have custom code anyway, and GMCM from CP seems easy enough to understand.

mighty quest
#

How the f** can this throw an NRE?

if (debris?.itemId is not null && debris.itemId.Value.StartsWith("(O)") &&
    Game1.random.NextBool())
rancid musk
#

debris.itemId.Value is null or Game1.random is null

mighty quest
#

itemId was null, so it shouldn't have gotten to Value

#

and Value shouldn't be null if itemId is not null, right?

#

Game1.random definitely is never null

brittle pasture
#

A non null netclass can hold a null value

mighty quest
#

is this better?

if (debris?.itemId?.Value is { } id && id.StartsWith("(O)") &&
    Game1.random.NextBool())
rancid musk
#

NetString, which I assume that is? Can absolutely hold a null value

mighty quest
#

yeah its NetString, but when VS broke it said itemId was null, so it should have stopped there

#

maybe it was refering to the Value

#

and I didn't pay attention

brittle ledge
#

Did STF get a 1.6.14 update?

calm nebula
#

It got a 1.6.9 update

#

Is it broken again

brittle ledge
#

Mmm let me see what version I have. I did all the updates I had in Stardrop.

calm nebula
#

I'll go grab the Nexus version when I get home at least

brittle ledge
#

Okay, I have ~20240227 while the newest is ~20241107 or so. I guess Stardrop didn't register it as an update because the difference is all after the alpha part.

uneven dagger
#

This evening's C# SMAPI mod puzzle: I know that a festival is today via Game1.isFestival. How would I go about getting today's festival name? Is there a good lookup chart for these variables? Maybe something to open up the .xnb files to take a look around?

... and now I need to run an errand. Ask and run! (back in 1 hour, no rush to respond and THANK YOU!)

rancid temple
#

Aren't festivals tracked by something dumb like checking the literal 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!

lucid iron
#

it seems like 184 is as big as i could go with only a Chest.GetActualCapacity postfix

#

i get index out of range if its bigger than that monS

calm nebula
#

Chue chest framework???

brittle pasture
#

ehh 184 is big enough, anything to remove Better Chest

#

(no offense to BC, it's just beeg fridge is literally its only feature that I use lol)

lucid iron
#

oh yea fridge needs a separate transpiler lol

lucid iron
#

but i do wonder why it caps out at 184 kasumidetect

#

i believe it's something to do with the gamepad neighbour id business

lucid iron
brittle pasture
#

(nice, thanks. I'll also probably just build that for myself lol, I don't feel like dealing with the possible torrent of reported compat issues from BC/other inventory mods)

lucid iron
#

indeed sleep

hard fern
#

😔 better chests necronomicon config...

gaunt orbit
#

my solution to "chest not big enough" was a custom slice-base IList implementation

fallow musk
#

How do I go about using Spacecore in a project. I have it imported and i want to try the spacechase0.SpaceCore_TriggerSpawnGroup spawnGroupId location includeRegions excludeRegion call

i couldnt find it in the Apis methods after initializing like this
SpaceCore.IApi SpaceCoreAPI = new Api();

gaunt orbit
#

InventoryMenu does just use IList<Item> for its inventory, and doesn't cache state, so you can just do a list that maps back to a specific slice of a larger list and it works great

uncut viper
#

that is also not the way you'd want to get an API from another mod anyway. theres a wiki page that explains how somewhere but i dont remember off the top of my head

#

but regardless you dont need it here anyway

fallow musk
#

scrajj im dumb, i think ill skip using frameworks till im more experienced
Assume my goal is to spawn a monster in the farm programmatically, what is the best way to do it?

lucid iron
#

im psure spacecore's spawning stuff is meant for usage with content editing, usually content patcher

lyric kestrel
#

Hmm, I'm trying to add a new piece of mail on winter day 14, that doesn't overwrite the travelling merchant mail, but using Id "winter_14" does. I'm just using ContentPatcher, if that helps.
I tried a When statement for Season winter day 14, but that didn't seem to work?

latent mauve
#

Keys have to be unique, you can control when a letter shows up with trigger actions.

lyric kestrel
#

Hm, okay, thanks I'll try that route.

light bramble
#

question, for gift tastes for npcs do you have to use the notation that says if it's an object, big craftible, clothing, etc?

brave fable
#

only objects can typically be gifted, so no

light bramble
#

ok

#

also, random question. the only "sushi" item in vanilla is sashimi...right?

brave fable
#

nope, there's Maki Roll too

light bramble
#

ok, wow XD

#

that's so little

brave fable
#

love of cooking adds Eel Sushi and Roe Roll SDVpufferfush

#

and Sushi mod adds like a billion soosh

lucid iron
#

there should be a mod that adds ceviche

light bramble
#

Well idk if I could allow for modded items in a modded npc's gift tastes...

brave fable
#

not sure how you draw ceviche in 16x16 without it looking like confetti

light bramble
#

Like wouldn't I need a conditional?

brave fable
#

it just compares names, you can add whatever items you like

#

it won't explode if it can't find Blueberry.EveryFlavourBeans.EggJam in the item registry, but if you give an npc that item and it's in their gift tastes, it'll use that taste

lucid iron
#

yea it doesnt care if it has a non existent id

#

u could use string operations to conditionally append if u want but not important

tiny zealot
#

you can also use context tags for gift tastes (context tags my beloved). for example, Maru likes edible_mushrooms

latent mauve
#

Bonus if you can use a standardized context tag for a taste, yep

light bramble
#

Is there a context tag for sushi? XD

brave fable
#

that's true, you can give them food_sushi for sushi items

light bramble
#

how do I find the context tags???

brave fable
#

they'll take anything from Maki Roll to Roe Roll to Snail Sashimi

#

use help ingame, there's a console command for it somewhere

latent mauve
#

It will be in the object/item data for them

light bramble
#

TIME TO SEARCH CONSOLE COMMANDS

brave fable
#

i believe you want list_contexttags

#

which is also a great way to increase your log by 5mb

#

but like, less 5mb

light bramble
#

LOL

brave fable
#

on a mission to draw the stupidest & floppiest cats for ur home

latent mauve
#

There is also debug iq ITEM_CONTEXT_TAG food_sushi probably if you just want to check if that one is a valid tag. It should open a shop menu with all those items that match in it

#

If I read the wiki right

tiny zealot
faint ingot
#

is jumping around days/seasons with world_setday something that can fairly easily mess up your save file? I've had a couple files now go south while testing my mod, while new ones seem to work fine. I'm hoping it's all the debug commands and not something I'm mis-coding.

light bramble
#

now I have all the items...and their context tags

brave fable
tender bloom
#

debug listtags

light bramble
#

that didn't work

brave fable
#

well it does work, it just only lists the tags for the held item

light bramble
#

[Console Commands] Sent debug command to the game, but there was no output.

#

Oh...I have to HOLD the item...

#

😐

tardy adder
#

Remind me in 10 hours to check charity box compat, ponder dewb multiplayer

patent lanceBOT
#

grumbles, mutters some vulgarities about humans...13midnight in particular... fiiiine. (#6396262) (10h | <t:1733234637>)

tardy adder
#

The latter is really big ponder... I don't know

brave fable
#

incredibly annoyed i didn't make a dewbug for my bug collection given how many times i've typed it in the console while trying to send commands

tardy adder
#

dewbug would be so cute

light bramble
#

what does the tag dye_strong mean???

next plaza
#

Brb adding a dobug command that introduces a bug to random mod on your machine, permanently

tender bloom
#

with the dye pots or sewing machine

light bramble
#

ah

faint ingot
#

question - I have a few assets from the base game "furniture.png" that I use in my custom location, and unlike some other base files the game will not find it automatically. Is it like a no-no to include the furniture.png in my location directory for it to use? Should I copy out the pieces I need onto my mod-specific sprite sheet?

drowsy pewter
lucid iron
faint ingot
#

blah of course the one sprite I want to use for Jodi isn't present on her winter outfit, now I have to make it and patch it in, in case my event happens in winter

#

I don't even know what the sprite is used for in vanilla?

teal bridge
#

I'm getting a curious warning that I've never seen before, does anyone know what it is?

0>CSC: Warning CS8785 : Generator 'JsonSourceGenerator' failed to generate source. It will not contribute to the output and compilation errors may occur as a result. Exception was of type 'InvalidOperationException' with message 'Unreachable'.

It seems to have something to do with the ModBuildConfig, but hell if I can figure out what.

subtle saffron
teal bridge
#

It doesn't really seem to be affecting the build, but I'm worried that something's not getting updated and maybe there's something stale in the zip.

#

(Actually, it could also be in the ModTranslationClassBuilder - but like the mod itself, it seems to be updating despite the warning)

latent mauve
light bramble
#

It seems that ITEM_CONTEXT_TAG just doesn't work

latent mauve
#

weird.

uncut viper
#

ITEM_CONTEXT_TAG isnt an item query is it? its just a GSQ

#

that can be put in the PerItemCondition field, but isnt an item query itself

light bramble
#

even tried with edible_mushroom

latent mauve
#

yeah, there's a different way to use that I think

#

ah, gotcha

light bramble
#

I just wanna find all the food_sushi items 😭

brittle pasture
#

doesn't seem like the debug command supports PerItemCondition unfortunately

#

you can patch export Data/Objects and get all items in-game, and search for food_sushi

light bramble
#

_< guess I'm back to doing that.

#

This is a wierd tag...fish_talk_demanding

rancid temple
#

Has to do with the way the fish pond item requests are worded

hard fern
brittle ledge
#

You could set the event to not fire in winter, if you want

#

Wow okay way to not pay attention to where the timeline ends, discord

faint ingot
#

I'll do that if my patch attempt doesn't go smoothly the first time

#

aaaannd it didn't work 😛 why am i so bad at this { "Action": "EditImage", "Target": "Characters/Jodi", "FromFile": "assets/NPCs/Sprites/Jodi_Winter_Kneel.png", "ToArea": { "X": 16, "Y": 192, "Width": 16, "Height": 32 }, },

hard fern
#

your full json?

#

!json

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.

hard fern
#

and, what exactly isn't working?

latent mauve
brittle ledge
#

(There's also the fact that sprite mods are not going to have your sprite and may not support it)

latent mauve
#

There is dialogue that mentions that she helps out sometimes and that would track for not being in use during winter.

#

Though I have never seen her actually help, she just says she does sometimes

ornate locust
#

that makes sense

faint ingot
#

and yeah it looks like gardening, i was using it to have her kneel by the mine ladder after Kent goes down to look for her son

#

that should do it, right? "239790008/t 1700 2400/f Shannon 2000/z winter":

#

or does winter need to be capitalized? the wiki doesn't say

hard fern
#

it doesnt

latent mauve
#

Is it necessary? Absolutely not. Does it save me reading through a text document? Yes.

brittle ledge
#

Yeah, the winter should be lowercase iirc

#

Are you updating an old mod btw?

faint ingot
#

no its mine, not published yet

#

but SOON [tm]

light bramble
latent mauve
#

Haha

brittle ledge
faint ingot
#

Yeah I saw someone mention that the other day, its too late now though if I changed it somewhere I'd miss a reference to it somewhere else

latent mauve
#

Remind me in 5 days and I can make a mini-mod specifically to add a shop entry that you can change the item queries on for what should probably be standard food tags.

patent lanceBOT
#

for a moment there I was gonna say no, absolutely not. but fireredlily? yeah, yeah i will. (#6396408) (5d | <t:1733636294>)

brittle ledge
#

I had the same issue because I started my current WIP NPC in 1.5, but with the number of events she has it's SO much easier keeping track

latent mauve
#

Lol Uber

brittle ledge
#

But the old events in Jorts and Jean stayed on numbers just in case there's a mod tied to them somewhere

light bramble
#

So, fun fact. Did you know that the sushi project mod has references to Jorts and Jean?

lucid iron
#

Hm is there legit no debug command for this

lucid iron
#

Ik there's debug iq but I forgor if it takes per item

light bramble
#

I'm just going through a list of items really

#

What does fish_upright do? XD

#

Also love that brown eggs still give white color

brittle pasture
hard fern
#

i mean if you grind up eggshells, they're all gonna look egg

brittle pasture
#

my brain is too mushed for math rn to really say what it does though, though you can reference the fish that has that tag and compare it against the fish that doesn't

#

correction: not fish tank, fish pond

tender bloom
#

potentially it's like squids?

light bramble
#

question. is there a limit to how many items can be in a loved gift pool for gift tastes?

brittle pasture
#

I don't think so

faint ingot
#

blah I'm getting my code I'll cleaned up to publish and now I see a note to myself to create a night market schedule for my NPCs. Do I care any more? hmmmmm

latent mauve
#

Honestly there is a good chance that I will end up making that mini mod tomorrow if I keep thinking about it

#

Only thing stopping me right now is that it's cold and I don't want to get out of bed when I need to go to sleep soon

brittle ledge
light bramble
#

Also, say I put food_seafood as a context tag for liked gifts, but have food_sushi in loved but have eel foods in hated...will the food_seafood have priority?

hard fern
#

I think there's something to check for priority on the wiki, but can't remember where it was....

#

Or what it was for.

#

Which i realize is unhelpful

light bramble
#

I just want to make sure that if I put spicy eel in hated gifts, it won't conflict with food_seafood in liked/loved gifts for gift tastes

hard fern
light bramble
#

that does not help me at all as I do not understand if it would work for personal gift tastes

#

Like it says it will override universal tastes

#

but idk if it will do for my specific problem

proud wyvern
#

What’s your specific problem? All I’m seeing is a theoretical question, and I’m not sure where it came from

light bramble
#

So I want to have a liked gift taste list that includes items with the context tag of food_seafood but any food made with or of eels needs to be in the hated gift taste list. If I put the context tag of food_seafood into liked, will that then override having spicy eel in the hated list?

proud wyvern
#

then the page above does list how that would conflict and what would happen then

#

in a pseudocode format though

light bramble
#

then I either don't see it, or don't understand where it is mentioning that

proud wyvern
#

it's just generally complicated

uncut viper
#

its the big block of pseudocode at the bottom of the page

#

under "How a gift taste is determined"

#

thats the order in which it figures out the final gift taste result

rancid temple
#

This method is long lmao, it checks each list so many times

hard fern
#

Yeaahhh it's long

proud wyvern
#

but generally it looks like loved items > hated items > liked items > disliked items > neutral items

#

universal tastes > personal tastes

#

so it first does the love>hate>like>dislike>neutral for universal tastes, then again for personal

#

stops on the first it finds

light bramble
#

so if food_seafood was put into loved items then the spicy eel would be considered as loved...

proud wyvern
#

pretty much

light bramble
#

😐

rancid temple
#

Universal doesn't seem to return first found, but personal does?

proud wyvern
#

wait no, it doesn't stop on universals

#

yeah

#

i just woke up, forgive me

rancid temple
#

So if you set personal preferences it should choose the individual item taste before context tag

light bramble
#

well....poop

rancid temple
#

But if you rely only on universal, it'll choose context tag because that's checked last

light bramble
#

This makes my gift tastes thing much more difficult to do.....

rancid temple
#

Probably a reason as to why vanilla gift tastes are so boring

light bramble
#

because I can't use the context tag if the person I am making this NPC for wants seafood in the loved category

#

so I will have to MANUALLY put each id in for the seafood that match the criteria that being no eel.

rancid temple
#

This definitely seems like a "gonna have to test" moment, but I'm pretty sure if you put the context tag and then a personal preference for the specific items you want to deviate then it should work

#

Though I guess that would require the context tag in the universal for everyone?

light bramble
#

I mean I'll try that first...still trying to get all the context tags.

rancid temple
#

Which would be a different problem lmao

#

Actually context tag in personal should still choose item first

#

Since it returns as soon as it matches and it checks each category for specific items before checking for context tags

light bramble
#

Love that the wiki says there's a context tag of category_gem but when I search it in Data/objects there's no item with that tag.

proud wyvern
#

could be implicit

rancid temple
#

Not all context tags are in Data/Objects

#

Many are added by the context tag adder script thing

#

Totally spaced the name of it lmao

light bramble
#

ah

#

still needing to get all the context tags for items....fun

proud wyvern
#

basically if the item has a category of -2, it gets the category_gem tag

light bramble
#

Yeah but I also need for some modded items, so I am still needing to go through the patch export of data/objects

proud wyvern
#

i'm just saying where the category_gem comes from

light bramble
#

oh...sorry. am the dumb

#

it's also like 11pm...and I work tomorrow...I should get sleep

pseudo roost
#

Hey you made the Shiko mod? Well I mtrying to activate her 6 heart event and it refuses to work.

rancid temple
#

That was in 2019, pretty sure nobody has been able to get ahold of Papaya in years

hard fern
#

Wow... 2019

#

Does shiko even work nowadays?

rancid temple
#

I imagine not very well, seen at least a couple people trying to update without permission so I had assumed not at all

fallow musk
#

is it possible to add a single extra inventory slot? or is it only possible in multiples of 12.
Will the UI handle such an odd number of slots

deep cypress
#

Any tricks to quickly making animations in Tiled? As in, any way to do it quicker than making a million clicks and praying to all the Goddesses that I don't get the count wrong and create a horrifying monster?

rancid temple
deep cypress
#

This is the horror of which I speak, and also, I have trouble making good gifs.

patent lanceBOT
#

@calm nebula: do a wiki edit (36h ago)

cold summit
#

hey! so I tried to add a recipe as well as an item of furniture and it wouldn't let me put both in the same "content" json file. what should i do?

hard fern
#

!json

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.

cold summit
#

it loads the furniture piece but not the recipe

deep cypress
#

Data/Recipes isn't where u want to load the png, methinks

#

I have done a recipe, but it has been a while, lemme look into the wiki...

#

U might want to review this. Are u in 1.6?

cold summit
#

yes\

unique sigil
hallow prism
#

There is a plugin for quick animation of several tiles

#

For aseprite

unique sigil
#

huh, TIL

#

i used to try and follow the "export animated tilesheet as .tsx" trick outlined in the wiki, but i keep running into issues that got tedious to fix, so i'm sticking to that template method

cold summit
#

so I changed it so it's seperate but now i'm getting an error notice

unique sigil
#

Your brackets are incorrect i think

unreal spoke
#

Missing a closing one for the first patch.

unique sigil
#

missing a closing bracket and the second patch has an extra bracket too

unreal spoke
#

Wait, no, the indentation is just very weird.

unique sigil
#

nah youre right, the EditData one is missing a closing bracket. and the Load action has an extra closing bracket after FromFile.

unreal spoke
#

Okay, first thought was right after all. I’ll leave this to your capable hands. SDVpuffersquee

deep cypress
cold summit
#

I don't see it 😦

unique sigil
#

use the json validator linked for you.

cold summit
#

no idea how to fix that

unique sigil
#

you are missing brackets, if you retype them in the program you use (what do you use?) to make the .json, there will usually be both brackets added automatically

hard fern
#

if you look at the thing the validator is yelling about, you can get an idea for what the issue is

unique sigil
#

if you want to add them manually, you need another closing bracket after the Entries in the Edit Recipe part

#

and an opening bracket before the "Load recipe sprites" part

devout otter
#

Watch out with how your opening brackets pair with your closing brackets.

cold summit
#

ok thank you lol

#

i think i got it!

#

the recipe is not showing up in the game 😦

#

do i also need to add it as an object?

hard fern
#

yes

#

well

#

you need to add the product of your recipe

#

to the game

cold summit
#

it works!!

proven narwhal
#

yeah i really cant figure out how to add a custom map overlay 😭

calm nebula
#

Remind me in 12 hours to edit the wiki

patent lanceBOT
#

I love meanies, so for you atravita? absolutely (#6396871) (12h | <t:1733271664>)