#making-mods-general

1 messages ยท Page 481 of 1

merry river
#

okay so do I do the HasMod check for CMCT or for Free Love in the include?

#

wait my when syntax is off i think

vernal crest
#

Yes it is

#

The Include patch (so not this one) should have the HasMod for both mods if you're not doing a hard dependency on CMCT

merry river
#

Ahhh okay! thank you so much! SDVpufferheart

merry river
vernal crest
merry river
#

Okay, got it! Thanks a ton!!

vernal crest
#

You're welcome :)

spice inlet
#

@outer glacier ^

elfin kindle
#

Wh...why in the world has my mod decided that my "EditData" for "Data/Events/Farm" just... doesn't exist/work? When i try to debug the events there, it just says that the event doesn't even exist

vernal crest
#

Did you forget to save? Put it in an Include but then forget your Include patch?

elfin kindle
#

No, I've saved and its together in the same file as all the other events but those work???

vernal crest
#

What's your patch summary say?

elfin kindle
#

Lemme get a proper one but it just says that the event im calling on doesn't exist and that's it SDVitemblobfish

vernal crest
#

That's not what a patch summary does

#

Do you know what I mean by patch summary?

elfin kindle
#

Ah my bad, I googled but had too many thoughts going on cus the current patch was a desperate attempt one so i wanted fix that before I actually sent a proper one ^^ Gimme 2 sec

#

Yeah okay it seems to just totally be blind to the Farm events

#

Im not sure what the best way to show all this info is but like, all the other even changes are there but not the Farm one

vernal crest
#

Look at the actual line for the events to see if it's telling you that a condition hasn't been met or something

#

If there are no lines for the events whatsoever, then the problem is that Content Patcher itself is not even seeing the patch.

#

In which case you have accidentally commented it out, not saved as recently as you thought you did, or are accidentally editing the wrong file.

Or you have an error message telling you that the patch was ignored but missed seeing that.

elfin kindle
#

Aaah its my i18n issue again, that embarrassing SDVitemblobfish I had players say a certain event wouldn't load so I thought i'd look at it, but seems like i had made a new issue and wasn't actually looking at the players issue.

#

Whoops ๐Ÿ˜ญ i18n is difficult dude, i shouldn't have set it up when in the middle of the night-

#

Well it's not really difficult, but one tired mistake ended up creating many lolol

vernal crest
#

Ah yeah, attention to detail slips can be a problem

elfin kindle
#

Truly SDVpetcatsad Well time to actually fix the original problem my player was having lolol

vernal crest
#

Good luck!

elfin kindle
#

It was apparently that the event doesn't like the "Season Spring Summer Fall" precondition? It's working on another event in town, but it won't play on the Farm event??

vernal crest
#

How exactly have you written it?

elfin kindle
#

'/Season Spring Summer Fall"' , is that.. not how you write it? I couldn't find any example on the modding wiki so i've been just assuming

#

"{{ModId}}_MirrenHeartEvent14/t 610 2000/f {{Mirren}} 3500/SawEvent {{ModId}}_GettingHaleyToHelp/Weather rainy/Season Spring Summer Fall

vernal crest
#

Typo

#

Spring

elfin kindle
#

Ah it's not a type in the actual code, i just remade it in discord lolol

vernal crest
#

And it's definitely listed on the wiki, were you on the official one?

elfin kindle
#

Oh I've just been looking at the stardew valley wiki for this one, where it's pretty ambigious

vernal crest
#

The + sign indicates that you can list multiples, which is done how you have done it

#

But why are you rewriting it instead of copying and pasting it to show me? The real one might have a typo in it

#

Also, what's making you think it's specifically the season condition that is the problem?

elfin kindle
#

Yeah, it's how it's worked for all the other + ones. And it was just so i wouldn't backtrack the actual code, which is laziness I'll fully admit ๐Ÿ’€ I did copy and paste it from the working event and had checked for misspellings, as well as "spring" instead of "Spring", and i'm thinking it's that because it works when i take it out, and then stops working when i put it back in

#

Ah well putting !Season Winter made it work! And I was thinking it might not be a huge deal if it doesn't work as i don't think it can't rain without a rain naturally during winter and that's the more important part ^^"

vernal crest
#

Well, not winter is a more succinct way of putting it anyway so that works lol

elfin kindle
#

Yeah very much, i forogt you could do the whole "if not" way of doing it until just now lololol

tiny zealot
#

(github markdown woes) i am trying to put together a table of color swatches in github markdown and most/all of github's rendering strips CSS and won't accept an <img> with a base64 src. i'm unlikely to create 143 colored pngs for this (if that would even work; it might block all direct html images), so does anybody know a way to display a block of color? (css is ideal, since i already have the colors in a nice, css-friendly rgb(r,g,b) format)

#

i guess i could just bake an enormous image for it. that might have to do

gentle rose
#

svg?

tiny zealot
#

i don't speak svg SDVpuffersquee

#

if you know a way to embed it directly as html without github stripping it (and if it's easy to generate on the fly from a known rgb value), i could try it, but i think i might be consigned to the big image at this point

#

(i don't fancy including 143 small images in the repo, but i can justify one big one)

lucid iron
#

Svg makes sense to me

tiny zealot
#

also, related but not related, TIL monogame has a color called MonoGameOrange (R:231,G:60,B:0,A:255)

digital herald
#

You can use a placeholder image https://anyplaceholder.com/placeholder?width=100&height=100&bg=09f&color=fff&text=%23fff&fontSize=20&radius=0&format=png
The text, size, and color can be customized. Created using this https://anyplaceholder.com

lucid iron
#

It can still be text form

tiny zealot
#

<svg> seems to be stripped out entirely (<img> gets gutted but a vestige remains)

lucid iron
#

It looks like you have to commit the svg separately (pain)

tiny zealot
#

okay, big image it is then ๐Ÿ˜”

lucid iron
#

But it is a text format s.t. versioning is slightly better thab bitmap i suppose

#

I do not think average modder person knows what an svg is

digital herald
#

if you have the colors in a neat format, I can help with generating the readme.

tiny zealot
#

respectfully, i think you have misunderstood my problem

digital herald
#

No problem, I thought you were having issues with displaying content using github markdown. Since github doesnt really support outside links. You can write HTML using github pages, and embed it using iframe. Or host the images on the repo.
I was suggesting automating this process of updating the colors on readme.

gentle rose
#

I don't think github markdown supports iframes either though

#

yeah it doesn't

digital herald
#

Sorry my bad, github readme.md doesnt allow iframe. It seems like the only way is to host the images on the repo.

austere spruce
#

Hey yalls, I came to ask some questions about making mods. How would you go about making a modded farmhouse interior layout? I've been trying to use google to find tutorials but I keep getting guides for installing mods lol

ocean sailBOT
#

If you want to make mods that add or edit maps:

  1. Use Tiled to edit .tmx or .tbin files.

  2. Refer to the Maps wiki page for details on how maps work in Stardew Valley.

  3. Content Patcher allows you to create custom locations through editing Data/Locations

  4. Vanilla Maps can be edited via Content Patcher as well: EditMap

hard fern
#

u need tiled

autumn tide
#

dammit

#

!unpack

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!

autumn tide
#

okay there we go

austere spruce
#

Great, thanks :)

austere spruce
#

Follow up question, how exactly do i import the tile set in tiled so it can auto fill the map files

hard fern
#

and this little button to embed them

lucid iron
#

When editing vanilla maps, you want to make sure to start with copy of the original

#

Once you unpacked you can copy the tmx + needed sheets to working dir for that

sage pollen
#

If I have a mod related gameplay question, is this the right chat to ask?

hard fern
#

this is for making mods yourself

oblique meadow
sage pollen
tiny zealot
#

i spent an inappropriate amount of time on this extremely minor feature so i hope someone appreciates it /lh

tiny zealot
#

simply do not look at github on your phone. skill issue /s

uncut viper
#

just make your own docs site. skill issue SDVpufferthumbsup

lucid iron
tight rivet
#

hm. I wonder how to use CP to update the machine rules generated by PFM..

autumn tide
#

okay i have an idea- would it be possible to enable other NPC shops to open geodes?? considering making it possible for dwarf to open geodes for ppl who hate clint (me)

tight rivet
#

:V

#

That's going to make this difficult then

brittle pasture
#

is this for compat with another mod

tight rivet
#

yes

brittle pasture
autumn tide
tight rivet
#

(more specifically, I'm adding stuff that patches furnaces to a mod that adds custom furnaces, or looking into feasibility of it.)

brittle pasture
uncut viper
autumn tide
#

why joke fuck clint

brittle pasture
autumn tide
#

would it be possible for an idiot like me who doesn't wanna do too much work but is open to looking at framework and dependencies to enable other NPC shops to open geodes?

uncut viper
#

if selph only considered adding it but did not actually then id say probably not

autumn tide
#

oof okay

tight rivet
#

glancing at it's code I'm hoping I do not have to learn PFM for it

brittle pasture
#

hmm yeah, I was asking because I vaguely heard of similar CP mods

#

no 100% replacement though it seems

autumn tide
#

hmmm okay

brittle pasture
#

and yeah, your best course of action to change PFM rules is ||file replacement||

tight rivet
gray bear
#

i saw there was a mod to make calico eggs and qi fruit not disappear from the inventory, but im assuming making them a wallet currency kind of deal like qi gems and golden walnuts is a c# thing

#

to mod ideas github i go

brittle pasture
#

unlockable bundles support that

gray bear
#

oh?

brittle pasture
#

custom currency i mean

tight rivet
#

I'm working on a calico eggs one now

#

speaking of that, I hsould test ifit worked

uncut viper
#

would double check if that actually lets them able to be used where the game normally expects them

autumn tide
#

was thinking of like maybe seeing if clint's shop is a map tile action thing and then adding that action to an anvil in dwarf's cave and then having a location change trigger action that changes clint's geode opening sprites to dwarf- as well as changing the geode opening bckg

gray bear
#

i mean if you add calico eggs as a custom currency will that just make em that forever

tight rivet
#

.. that one I can't doubletest as I'm well past the festival window, lol

gray bear
#

yeah can you still spend em? thonk

autumn tide
#

hmmm i think spacecore has some custom wallet item/currency stuffs?? not sure tho

uncut viper
autumn tide
#

okay gotcha

#

...i'm not going to do that then. (telling myself this bc omggg scope creep)

uncut viper
#

you cant do that without C# anyway

autumn tide
tight rivet
#

.. does anyone have a save at the desert festival I can borrow?

autumn tide
#

you can cheat the date using console!

tight rivet
#

well, that works, I guess.

lucid iron
#

If you just unlock bus then you can get desert fest on save y1

#

Normally I cjb unlock that

dusk terrace
#

Just make 40k in the first 2 weeks without cheating np

tight rivet
#

... okay

#

sometimes testing mods makes me worry

soft lance
tight rivet
#

the mod works but interacts oddly with the dropdown that's present in the festival (in that you'll see it drop down and rise up a few times)

hard fern
#

wow my favorite festival has always been [LocalizedText Strings\1_6_Strings:DesertFestival]

lucid iron
#

Is the tooltip your mod

tight rivet
#

no

#

my mod is making calico eggs a currency. ๐Ÿ˜„

soft lance
tight rivet
lucid iron
#

I guess u just need unlockable bundles for that right

tight rivet
#

yep

#

it's actually pretty simple

lucid iron
#

Wonder how it deals with egg gone tho

tight rivet
#

uh.. >_>

soft lance
#

can i fry the eggs.

tight rivet
#

i suspect that it wouldn't actually erase at the end of the festival like it should

lucid iron
#

Well the good thing is that it's ez to test and just a bug report if it no work SDVpuffersquee

uncut viper
#

would that even be considered a bug? i dont see much of a point to making it a currency if you didnt want to keep it permanently

lucid iron
#

Feature request to delixx then

#

The purpose of currency is just to not have inventory slot tho

#

There's other non persistent currency like star tokens

brittle pasture
#

star tokens is a secret hardcoded festival points thing right

uncut viper
#

yes, star tokens use a shared int across all festivals

tight rivet
#

i don't think you could use CP to remove them

uncut viper
#

not without a dependency framework

tight rivet
#

and tbh, personally, I'd rather just keep them in the wallet

#

.. lol, PFM machines don't have logic in the Data/Machine asset

#

welp I guess I'm learning PFM syntax

uncut viper
#

thats why selph said you cannot edit them

#

(with CP that is)

lucid iron
#

Could you just rewrite the mod in data/machines

brittle pasture
#

PFM rules still take precedence if the user has the original mod

tight rivet
#

I could, and I'll rpobably end up doing so for local use

#

.. but on the other hand

#

really not sure I could convert the PFM config to anything else, so

#

(I guess the main reason I wanted to do it in CP was for HasMod stuff. )

ornate locust
#

so it's not broken! It just doesn't know what a localized string is

tight rivet
#

ah

lucid iron
#

What is meant by pfm config

#

Is it different than the content pack itself

tight rivet
#

it controls the animation and stuff of the machine itself

lucid iron
#

Well I am fairly sure you can do all that in Data/Machines, questions is just permission and purpose of your mod

tight rivet
#

it's mostly to make three mods play nice together. If it's an issue with permissions I'd probably just not release it, lol

tight rivet
#

Congrats on your mod, Midnight!

autumn tide
#

okay i have a question- what on earth are blank.json files for???

obtuse wigeon
#

initialising, thats entirely it to my knowledge, EditData only works on assets that are already present, loading a blank.json makes said thing present

dusky sail
#

if you load something you cant use content patcher features such as tokens. but if you edit something you can. so you load the blank to create the asset and then edit it so you can have all the thingies

autumn tide
#

...i got no clue what that means but ty for responding LOL

uncut viper
#

its not just for tokens but both answers combined paint the whole picture

#

you cannot use tokens like {{ModId}} inside a .json file loaded with a Load action. they dont get parsed

uncut viper
#

unless you meant you dont know what Atlas meant?

autumn tide
#

uhh i didn't get either-

#

i have a irritating learning curve-

uncut viper
#

you can do EditData on something like Characters/Dialogue/Penny or whatever because that asset already exists, you can see it in your unpacked content folder. there's already stuff in there. It contains a bunch of strings for the dialogue, so you can edit that list of strings just fine

#

but for a custom NPC, Characters/Dialogue/MyNpcName doesnt exist. you cant edit its list of strings bc there is no list of strings

autumn tide
#

mhm

#

okay

uncut viper
#

a blank json file, just { } is an empty list of things for you to edit

#

(or an empty dictionary, but for the purpose of explaining that difference is semantics)

elfin kindle
#

I also wondered wtf blank.json was for and this is what Abagaianye said! ^^

uncut viper
#

so you use the blank.json file to give the empty list, the blank canvas, to Characters/Dialogue/MyNpcName

#

then you can edit that blank canvas

autumn tide
uncut viper
#

if you know you're not going to use any tokens at all inside your dialogue (or schedule, or event, or whatever) then you can just Load the json directly to the target in question

#

and not use an empty one

autumn tide
#

hmm, maybe someone should make that a command?

#

the 'what's the blank.json for' question answer thing

exotic token
#

mail flags can be used to load patches right?

#

can it be used to remove patches too?

lucid iron
#

Not really?

#

A mailflag is either true or false

exotic token
#

ugh i thought so

lucid iron
#

And a patch is either loaded or not loaded, possibly conditioned on mailflag

#

If you consider that removal then sure

exotic token
#

so it can make the patch unload

tiny zealot
lucid iron
#

I think unload is the wrong terminology here

exotic token
#

so lets say I have a patch that turns alex into a girl

lucid iron
#

If you had patch A B C and B got a When HasFlag

tiny zealot
#

down the line i might automate the color data file by dumping it from within the game somehow, but that's later. i'm mostly confident i didn't mistype any of them

lucid iron
#

When the flag is not set the patches that apply is A C

exotic token
#

and I want alex to be a boy again a few days later

#

is that possible

tiny zealot
#

yeah if you unset the flag that gates the patch, the patch will stop being applied when your context updates

lucid iron
#

In that case what you actually want is a trigger action that toggles the mailflag controlling the "alex is girl" patch, whatever that might be

#

Common ways to do few days count down is conversation topics and IncrementStat

drowsy pewter
#

alex is going through some things

exotic token
#

it was an example

lucid iron
#

the key thing is just that you do not control when content patcher rechecks patches, that is fixed by the updaterate (default daily)

#

you would make the condition true or false so that the next time content patcher rechecks, it will do something different

hard fern
#

Congrats on your transition Alex

exotic token
#

at least i dont have to make a second alex npc

lucid iron
#

Well ig it depends on what alex is girl should actually affect

exotic token
#

sprite, portrait, and dialogue

lucid iron
#

Cus if it's just sprites then using appearance system is better

exotic token
#

appearance system?

lucid iron
#

Yeah the Appearance field in character data

#

You can use that to change npc sprite and portrait conditionally

#

It's what seasonal outfit mods use

#

The reason why you should use that even if you have to do HasFlag elsewhere is cus you can give girl alex a very low precedence so that your appearance win

#

Otherwise you'd have to editimage all these other mods blobcatgooglyblep

nimble karma
#

Hi y'all, not quite sure where I would ask such a broad question but I figured I'd start here. I've been playing modded Stardew for quite a while now (like 600+ hours whoops!) and finally got the urge to create my own mod. Does anyone know where I'd find resources to build custom bundles in the community center? I was looking at basically building on Custom Community Center Bundles and expanding it to include a few other mods (Alchemistry, Grapes of Ferngill, Sunberry Village) alongside their optional Cornucopia, RSV, and SVE bundles.

#

I don't really have too much coding experience, but I've been editing JSON files to make mods interact with each other in a cleaner way so I know how to find basic stuff like itemID's and the like \

obtuse wigeon
#

Theres a framework that lets you make your own bundles called Unlockable Bundles and another called Custom Community Center Bundles, check out both of these and see if they fit your needs! I'm not sure how different they are so it's entirely which would fit your needs better

#

Oh wait it seems the Custom Community Center Bundles isn't a framework my bad!

nimble karma
#

I forgot about Unlockable Bundles, I'll have to check them out!

obtuse wigeon
#

I don't think the regular bundles in the game are hard coded either? but I'm not sure about that though if you just want to edit them

nimble karma
#

That's what I was thinking, the Custom Community Center pack I downloaded is shockingly simple

obtuse wigeon
nimble karma
#

Alright, I'm gonna study this and compare it with the Content.JSON in the CCCB pack I have and just strip it down to understand it

#

I'd love to work on restoring the old Love of Cooking Community Center bundle afterwards, but that'd probably be waaaaaay more work

#

One step at a time

#

And I'm not much of an artist so ๐Ÿ˜… if there's sprite editing involved, I'll probably leave that alone

tiny zealot
#

!anyonecancook everyone had to draw their first pixel art at one point

ocean sailBOT
#
stray hemlock
#

Pixel art is also different from "manual" art in that you don't have to learn the ergonomic "crafty" parts of painting and drawing. That's what helped me, as someone who still can't properly hold a pen due to developmental dexterity issues, I recently realized that with pixel art I don't have all these issues that made me hate art lessons in school. I'm still a beginner, but finally art is fun.

Just to clarify, I don't want to say that it's easier, just that it requires a different skill set which might make it easier for people who have difficulties with the skill set required for "manual" (is there a word for that?) art.

shut edge
#

Just edit vanilla stuff tbh, that'll get you farther than you might think

#

And you might pick up the basics from that

narrow owl
brave fable
#

you need to change "Name": "Irish Moss Pudding" to "Name": "{{ModId}}_IrishMossPudding" SDVpufferthumbsup and of course correct the other Name fields for each item

#

ideally you should also ModId prefix your buff Id fields

soft lance
brave fable
#

content patcher is case insensitive (*when reading tokens), you can use {{season}} or {{MODid}} if you like

soft lance
#

phew okay haha good to know, ty

autumn tide
#

god i love case-insensitivity

brave fable
#

it's all fun and games until you start using case insensitive file paths

autumn tide
#

idk if i spelled that right but

brave fable
#

and then it all falls to bits

autumn tide
#

shit

#

alr

brave fable
#

windows users occasionally create an Assets folder and use assets in their FromFile values, and then the changes are never applied for linux users

tiny zealot
#

there are also some gotchas sprinkled throughout stardew modding in general. lots of it is case-insensitive, until you hit something that isn't and oopsie doopsie

brave fable
#

the same applies to pretty much anywhere that would use file paths if you're inconsistent, not necessarily just CP fromfiles

#

ideally you should follow as it's presented in the documentation

brave fable
#

since of course programming is nothing if not inconsistent

tiny zealot
autumn tide
brave fable
#

and event commands..

#

the list goes on ๐Ÿ™‚โ€โ†•๏ธ

autumn tide
#

a tragedy

soft lance
#

its 10pm, i gotta sleep and wake up at 4 am

#

will i do that? no

#

will i sleep at 12 am? yes

autumn tide
autumn tide
soft lance
#

4 hours is enough for now

#

cause a flight

#

so i cant really sleep in much

hard fern
#

Just be me and dont sleep

autumn tide
soft lance
autumn tide
#

..which doesn't sound not entertaining.....

#

hmmmm

soft lance
#

in and out of sleep mid text

#

and my mind jumps from like

"yeah i love chocolate cause the trains in ohio went fast thats why we have space"

it starts to lose track on where its at ๐Ÿคฃ

autumn tide
#

hmmm yeah i can't fall alseep without meds so that's not really my issue

#

OH i thought you meant rapidly falling in out of sleep lol

soft lance
#

ohh

soft lance
#

mine is like 5 seconds asleep and i wake up and continue typing and then again

#

its like...power saving mode

autumn tide
#

๐Ÿ˜ญ

#

..okay bye actually going to bed now byeeeeeeeee

soft lance
#

byeeeeee

#

gnnn claude

pale river
#

๐Ÿ‘‹ hii I'm starting to make my first custom npc

urban patrol
#

i need to stop banging my head against the wall of TargetField and "a list of models", can someone please tell me how to format this?

    "LogName": "World Map - Base Texture",
    "Action": "EditData",
    "TargetField": [ "Valley", "BaseTexture" ],
    "Entries": {
        // docks
        "{{ModId}}_Docks": {
            "Id": "{{ModId}}_Docks",
            "Texture": "{{ModId}}_WorldMap/{{Recolor}}",
            "SourceRect": { "X": 239, "Y": 134, "Width": 41, "Height": 26 },
            "MapPixelArea": { "X": 239, "Y": 134, "Width": 41, "Height": 26 },
        },
                // ... etc
},```
#

(i had been doing EditImage on the world map before, but BaseTexture is supposed to be more performant and also won't get overwritten by recolors, for example)

vernal crest
#

Is that not working, nic? What error are you getting?

urban patrol
#

"must set the Target Field" (can send log if you need but that's it)

uncut viper
#

what asset are you editing?

urban patrol
#

ohh

vernal crest
#

Oh yeah haha you don't have a Target

uncut viper
#

bc it doesnt say so in your patch

urban patrol
#

๐Ÿคฆ

uncut viper
#

i can see why thatd be a confusing error to get if you arent sure you're using TargetField right

urban patrol
#

yeah after like 6 revisions i was like well clearly i don't understand TargetField

#

thank you for the second and third pair of eyes on that lol

lucid mulch
#

a load bearing space in that error message

vernal crest
#

I was no help lol

#

Except for making you feel better for missing it I guess because I did the same thing xD

fluid night
#

Help!

ocean sailBOT
#

Log Info: SMAPI 4.3.2 with SDV 1.6.15 build 24356 on Microsoft Windows NT 10.0.26200.0, with 62 C# mods and 143 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

lucid mulch
vernal crest
#

It would for me, yep

urban patrol
fluid night
#

but the errors in the code for the mod I made?

narrow owl
#

why do people stop using json assets?

vernal crest
vernal crest
fluid night
#

ohhhh okay I know the problem now

tiny zealot
vernal crest
#

ichor's explanation is better

narrow owl
#

what abt producer framework?

lucid mulch
#

iirc it has some niche usecases still but for 90% of things can be done directly in CP using vanilla machine rules

vernal crest
#

PFM is still maintained though

narrow owl
lucid mulch
#

no idea

narrow owl
#

k

urban patrol
ocean sailBOT
#

Log Info: SMAPI 4.3.2 with SDV 1.6.15 build 24356 on Microsoft Windows NT 10.0.22631.0, with 20 C# mods and 1 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

urban patrol
#

patch is being applied but

vernal crest
#

Did you do a patch export to make sure it's in the right place?

urban patrol
#

of Data/WorldMap or the map texture?

#

the answer is neither but which would you like

vernal crest
#

Data/worldmap

#

I do that when I am not sure why my change isn't applying

#

(Not specifically for world map, haven't done that before)

urban patrol
#

hmmm is this perhaps a case where i need to MoveEntries inside a list? they're in there, but the vanilla BaseTexture is above them

lucid iron
#

oh this aint the format i was meaning

urban patrol
#

๐Ÿ™ƒ

lucid iron
#

ill brb cus its annoying to explain in words anyways

urban patrol
#

okay np

lucid iron
#

@urban patrol this is the bit to put in a piece of tx

urban patrol
#

you beat me by literally 5 seconds

#

thank you so much though

#

now to test stupid recolors

lucid iron
#

i deliberately mismatched recolors Dokkan

#

the benefits now is that ppl can just editimage you to add compat

#

cus you are loading stuff to actual target that is not just worldmap

urban patrol
#

excellent!

#

although they'll see my messy half-recolored maps lmaoooo

lucid mulch
#

That might be the first time I've actually seen the texture field used for a map area outside of vanilla

urban patrol
#

i'm chu is a pioneer

lucid mulch
#

Last time I did a scan in mods I got zero results

lucid iron
#

i do think u should prob use season conditions but shrug doing a bunch of loads is also ok

#

does remapping use this?

urban patrol
#

i do at least tokenize it so hopefully it's better?

lucid iron
#

it seems like the kinda mod that would

#

tokenize it makes it worse :)

urban patrol
#

ah.

lucid iron
#

well, it's more like if the data is invariant

#

then game never has to invalidate it

#

or uh, content patcher never has to

lucid mulch
#

It would have been back in March or something I did the scan

lucid iron
#

if u put a token that is variable then it means at some point content patcher will have to invalidate the whole asset Bolb

#

but as content modder i wouldnt worry about this just do what feels nice

urban patrol
#

i think for the sake of my own sanity and not have 4x the amount of code, i shall live with poorer performance for now

lucid mulch
#

๐Ÿ™

urban patrol
#

if people complain that i get too bulky i'll revisit it

lucid iron
#

i was actually thinking you do a bunch of loads instead

urban patrol
#

hmm i guess that wouldn't be too much extra work

lucid iron
#
{
  "Action": "Load",
  "Target": "{{ModId}}/worldmap",
  "FromFile": "assets/maps/tilesheets/spring_worldmap.png",
  "Priority": "Low"
},
{
  "Action": "Load",
  "Target": "{{ModId}}/worldmap",
  "FromFile": "assets/maps/tilesheets/summer_worldmap.png",
  "Priority": "Low+1",
  "When": {"Season": "Summer"}
},
#

like this + fall and winter

urban patrol
#

+2 and +3?

lucid iron
#

well Low+1 is fine for not spring

#

spring is the base unconditional load

urban patrol
#

oh i see

#

how about for recolors? should i not tokenize that as well

lucid iron
#

sure u can do that, they r likely essentially invariant

#

go make a DT for worldmapflavor or something

urban patrol
#

that's what i already got :)

lucid iron
#

anyways the thing to avoid is just EditImage LooseSprites/map

#

once u get out of that its alright to play a little loose with your own assets Dokkan

#

if someone else wish to do compat with you they can do Default priority When loads Season to nic.dbd/worldmap

#

and they'd just win

urban patrol
#

and their loads are preferable to them EditImaging mine, for performance?

lucid iron
#

editimage cost more than load yes

lucid mulch
#

That reminds me, I should check to see how load priority works in cp and if it's smart enough to not bother invalidating if a higher priority patch was winning anyway

#

The key with loads is that only one load is actually going to win and touch the filesystem for the image

urban patrol
#

and so even seeing multiple loads and throwing the rest out is still better over edit+edit+edit+edit, makes sense

brave fable
lucid mulch
#

also need to check how asset propagation happens for worldmap and textures it tries loading

lucid iron
#

loads that dont activate never actually goes into the part where a Color[] is allocated for texture editing operations

#

that is why it's strictly better when 1. you can do it, no Exclusives flying around 2. no need to do any Edit

gray bear
#

color crimes?

lucid iron
#

i really wish Exclusive wasn't the default SDVpufferpensive

#

ik why but one can wish

lucid mulch
#

ok worldmap maparea textures are fine, vanilla keeps references to them all and renders them all, rather than compositing a new image

lucid iron
lucid mulch
#

game does plenty of map modifications on the fly which wont track the source changing (spouserooms/patios for example)

#

ah yes, the building paint mask does

brave fable
#

pretty sure farmer sprites are also constructed for skin colour and arms

lucid mulch
#

I should have gone to the smapi propagation code first

brave fable
#

not sure if it uses a new for that or just edits the loaded texture

lucid mulch
#

playersprites, the tool spritesheet and building masks

#

hmm tool spritesheet looks like kinda dead code, nothing seems to mutate it anymore but still has the plumbing to be in a different texture2d from the content pipeline

#

unless it was for old mod support?

lucid iron
#

oh yea building masks those r funny Dokkan

lucid mulch
gray bear
#

why did you add dynamic tokens for days of the week?

smoky sage
# gray bear

Well... I used the template I found on the Wiki, and since it didnโ€™t cause any issues before, I just left it as is.

gray bear
#

what are you using these tokens for?

#

can you share the scedules.json?

smoky sage
#

Actually, I donโ€™t know what to do with these tokens.

vernal crest
#

Have you changed his schedule recently?

smoky sage
#

yes, I adjusted his time.

vernal crest
#

Have you slept since doing that?

#

In game

smoky sage
#

Well... Not really...

#

I just logged out and logged back in.

vernal crest
#

You have to sleep in game after making schedules changes

#

So try that and see if it helps

smoky sage
#

ok! I'll go try it now!

vernal crest
#

And if it doesn't, please paste patch summary full LuoLi.Zayne into your SMAPI console while in your save and then get your log again

smoky sage
stray hemlock
#

Is there a debug command that opens the pause menu? I can't find it in the wiki, but maybe it's a combination of a few different commands.

fossil osprey
#

The pause menu?

#

Like, the pause mode where the whole game is paused outside of an inventory?

gentle rose
#

all menus pause in single player, none do in multiplayer

stray hemlock
stray hemlock
gentle rose
#

don't let button hear you say that SDVkrobusgiggle

stray hemlock
#

You need to have friends for multiplayer.

#

Also, multiplayer is much more stressful because nothing pauses. It feels like the days go by so fast.

neat vigil
#

Hello, I'm kind of a beginner in modding.
This is the first time I'm modding a game and I would like to know something.
So basically, Iโ€™d like to use Harmony to modify the power of my pickaxe, and I wanted to know if there is any documentation with Stardewโ€™s functions, like the Pickaxe Do function, etc.

#

Sorry to disturb you all ๐Ÿฅฒ

gentle rose
#

there is not, no. I'm guessing you have some programming experience from the sound of it?

#

the difficult thing with modding in general is that the source code isn't intended to be used as a library so it typically isn't super well documented, most of this part of figuring things out is done via decompiling

#

(or by asking here for help if you can't figure it out, of course)

neat vigil
#

Oh okay, thank you ๐Ÿซก
Yes, I have some programming experience, but it's only been about 2 years of making games in Unity, so I'm not a very advanced programmer.
But I am familiar with some design patterns and the basics

gentle rose
#

the most important skill in (non content pack) modding in my opinion is the ability to read code, and it's also a great way to develop that skill. I'd start with decompiling the game.

stray hemlock
#

I don't know if Harmony is the right tool for that. You generally don't want to override game methods. I know the power of the pickaxe is stored in variables (which I'm still kinda deciphering), so modifying these variables is the safer choice.

neat vigil
stray hemlock
neat vigil
#

Yes

#

I'm sorry if I seem clueless or if my questions sound stupid
I don't have a lot of time to create this mod, so it adds a bit of stress

gentle rose
#

what's the time pressure?

neat vigil
#

I only have 4 days before I show the mod to some of my friends and I have a lot of ideas I want to include in it so I am working on it 24/7

gentle rose
#

as far as I can tell, the only "variables" relating to the pickaxe are a state variable (changing it is pointless, it changes all the time) and some consts, so this would require harmony like you thought

stray hemlock
#

The pickaxe has a variable of type NetInt called additionalPower. Without testing I assume that this will be what you want to target.

gentle rose
#

I think

stray hemlock
#

int damage = Math.Max(1, (int)upgradeLevel + 1) + additionalPower.Value;

neat vigil
gentle rose
#

it will work on stones but not boulders

neat vigil
#

Maybe I am using it wrong

gentle rose
#

which don't use that netfield at all

#

(also, you still need a way of setting that variable, it isn't static so you can't just set it once)

heavy pewter
#
using StardewValley;
using StardewModdingAPI;
using StardewValley.Mobile;

namespace ifthisdoesntworkidk
{
    public class Test : Mod
    {
        public override void Entry(IModHelper helper)
        {
            var harmony = new Harmony(this.ModManifest.UniqueID);

            harmony.Patch(
               original: AccessTools.Method(typeof(VirtualJoypad), nameof(VirtualJoypad.CheckForTapJoystickAndButtons)),
               postfix: new HarmonyMethod(typeof(Test), nameof(Test.ButtonBPressed_Postfix))
            );
        }

        private static void ButtonBPressed_Postfix(VirtualJoypad __instance)
        {
            if (__instance.buttonBHeld)
            {
                Game1.currentLocation.tapToMove.mobileKeyStates.actionButtonPressed = true;
            }
        }
    }
}```

Finally, ended up learning Harmony just for this
gentle rose
#

well, every time a pickaxe is created it gets a new one, so you can't just set it once for all pickaxes

#

as for how often they're created, at the very least whenever you get a new one from clint, but I wouldn't be surprised if more often

stray hemlock
#

Fair.

gentle rose
neat vigil
#

Maybe I can just check the current tool of the player and upgraded it ?

gentle rose
#

you'd end up upgrading the pickaxe every time the player selects it. I think you were right that this will need harmony

stray hemlock
#

Yeah, sorry. I just really dislike the idea of modifying game methods, so I always try to search for alternatives.

gentle rose
#

a prefix with a power ref argument might work SDVpufferthinkblob

neat vigil
gentle rose
#

we've actually debated whether that warning is a bit too scary in the past ๐Ÿ˜… harmony can be absolutely fine and even a better way to do things sometimes

neat vigil
stray hemlock
lucid iron
gentle rose
#

wdym?

#

you still have to set it for every pickaxe SDVpufferthinkblob

lucid iron
#

Get pickaxe increase the power only if no modData

gentle rose
#

that would still require harmony, wouldn't it?

#

did you mean to reply to the message about setting it too many times

lucid iron
#

Nah inventory changed is sufficient

gentle rose
#

tbh I forgor about moddata

lucid iron
#

I think the main deal is actually making sure it's not slow as hell Dokkan

gentle rose
lucid iron
#

Besides that

#

You can just make an pickaxe upgrade

#

New item, higher power in data

neat vigil
#

How did you all learn about modding? Iโ€™m really fascinated by how well you understand what youโ€™re doing SDVpufferwaaah

lucid iron
#

It's a hobby

gentle rose
#

wait additionalpower isn't even applied to boulders SDVpuffersquee

#

boulders are hardcoded 4 'power's

stray hemlock
gentle rose
#

(so power == 4 => instant break)

neat vigil
stray hemlock
#

who.CurrentTool.DoFunction(who.currentLocation, (int)who.GetToolLocation().X, (int)who.GetToolLocation().Y, 1, who);

#

Oh, wait, no, it immediatly gets assigned a new value.

#

power = who.toolPower;

#
public override void DoFunction(GameLocation location, int x, int y, int power, Farmer who)
{
    base.DoFunction(location, x, y, power, who);
    power = who.toolPower;
gentle rose
#

yeah but we overrode that with their prefix

stray hemlock
#

I should probably stop using Nano to quickly look at the files.

vernal crest
neat vigil
#

Than you for your advices ๐Ÿ˜

hard fern
narrow owl
#

my first mod was cuz a wanted to build a fish pond army and there was no ez way so I got sent down the generational sidequest of a lifetime

hard fern
narrow owl
#

do u have the files still?

hard fern
narrow owl
nimble marlin
#

I thought my mod was causing compatibility issues with Fashion Sense, but then I ran the game with only FS installed and it still happened. does anyone know if this is a problem with FS, or if I'm doing something wrong?

obtuse wigeon
#

That's what usually happens, you have to also install a pack with shoes and arms that fit, FS has one available on the mod page I believe

nimble marlin
#

so weird... I'm patching FarmerRenderer so I thought this was the cause but it seems not

obtuse wigeon
#

Did you manually select the FS specific shoes in the shoe tab? They're not automatically added when choosing a different farmer height sprite, but this is normal FS behaviour regardless of whether you touch farmer renderer

nimble marlin
#

no... I didnt knew I had to do this, so if im changing player height I have to change other stuff too?

obtuse wigeon
#

Yep, all have to be done manually, a tad annoying but when you have many FS packs its rare the base sprites will be used anyway

nimble marlin
lucid iron
#

@nimble marlin while you are here I have compat ask for act of cooking

#

Do you think you could load your custom sprites to the content pipeline so that people can EditImage them?

narrow owl
#

how do you make a dependency required?

autumn tide
#
    {
      "UniqueID": "dependencymod",
      "IsRequired": true
    },

stray hemlock
#

I think IsRequired is true by default.

narrow owl
obtuse wigeon
#

Yep in the manifest, under the dependacy field

#

Either dependency or dependencies I don't remember off the top of my head

autumn tide
#

and i will replace the update key thing dw

narrow owl
autumn tide
#

NEVER

#

I SAW THT

#

I SAW THAT

#

YOU TRAITOR ๐Ÿ’”

narrow owl
#

must've been the wind

autumn tide
#

BOOOOO

narrow owl
#

lmao im js joking chill out

autumn tide
#

anyways i made new portraits for them it's fine ๐Ÿ’”

narrow owl
#

oopsie

autumn tide
narrow owl
#

my computer glitched

autumn tide
#

I THOU THEE THY TRAITOR

narrow owl
narrow owl
#

i thou thee thy traitor?

#

tf

autumn tide
narrow owl
autumn tide
hard fern
autumn tide
#

you're just uneducated

narrow owl
narrow owl
autumn tide
#

it makes sense in context okay ๐Ÿ˜ญ

hard fern
#

I you you the traitor?

narrow owl
narrow owl
autumn tide
#

using 'thou' as a pronoun could be considered offensive depending on the context- i was literally quoting something a judge said to someone accused of treason ๐Ÿ˜ญ

ornate trellis
#

since when

autumn tide
#

the elizabethan era

ornate trellis
#

anyway, reads more as a fee fi fo fum

autumn tide
autumn tide
narrow owl
ornate trellis
#

anyway, mods

autumn tide
#

oh yeah those are a thing

narrow owl
ornate trellis
#

they sure are

hard fern
#

nah. mods arent real.

autumn tide
autumn tide
worldly wadi
#

How do I make seasonal tilesheets?

brittle pasture
#

if this is for maps, then if you prefix the tilesheet name with spring_ then the game will automatically swap in the season name as appropriate

#

you do need a Load block to load the other variants

lucid iron
#

Also it's outside maps only

autumn tide
#

helloooo how can one only edit a small portion of a vanilla PNG?

lucid iron
#

EditImage has ToArea

worldly wadi
#

Do I need to create new saves to test if they're working?

autumn tide
worldly wadi
#

Bc I did all that, and is still stuck on spring, no matter the season

lucid iron
#

New tx that you are loading

#

that will break existing instances of the object though

autumn tide
#

gotchaaa

#

maybe edit the OG springobjects thing then, ty SDVpufferheart

brittle pasture
lucid iron
#

Yeah it's a tradeoff

#

A mod that edits everything might consider doing that though

lucid iron
#

One of the back of mind things is to ask tai about switching vanilla tweaks to that

#

Perf reasons

autumn tide
ornate trellis
#

i believe the tilesheets need to have the season at the start of the name or something?

brittle pasture
#

I did mention that
maybe some context (code, etc.) could help

versed moss
#

I am thinking of coming back to mod make. Has there been any development in the music adding side. Like adding a victory theme to floor 120 or making custom song appear in the skull caverns

autumn tide
#

heyy I'm back, is there a way to edit an entry from another mod without directly stealing the code of that entry?

royal stump
royal stump
royal stump
#

and possibly Fields to keep the stuff you don't want to edit intact

versed moss
lucid iron
#

I wonder if u can play music via map edits then

lucid iron
#

Since the map of f120 mines is an actual editable map asset

#

The location should be undegroundmine120 or something?

versed moss
#

Thanks

pale river
stray hemlock
#

The traitor was Paul.

autumn tide
pale river
gentle rose
autumn tide
autumn tide
pale river
autumn tide
autumn tide
gentle rose
pale river
gentle rose
stray hemlock
#

Here in Germany you'd always use "Mr." (or other gendered terms) and only append the professional title when you want to be really, really formal, as in a letter.

#

Like, "Mr. Dr."

heavy pewter
gentle rose
#

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

stray hemlock
#

Don't stress out about similar mods.

narrow owl
#

yes always upload if comfortable cuz you never know if someone will benefit

stray hemlock
#

I personally don't like using Nexus, but that's where the community is.

lucid iron
#

Nexus/no nexus is your choice

stray hemlock
#

If all else fails, convert the zip file to hex and post it here.

lilac scaffold
#

Does anyone have a solution to or know of a workaround for config files being reset / overwritten when updating a mod?

stray hemlock
#

That shouldn't happen if you don't ship your mod with config files.

brittle pasture
#

the config is saved in config.json file in the mod folder

#

dont ship it yeah

#

SMAPI will create one if it's not present

stray hemlock
#

The defaults will be taken from content.json, so no need to provide one.

lucid iron
#

If you are a C# mod you may choose to store your configs in other places

#

Global app data for example

lilac scaffold
lilac scaffold
uncut viper
#

if you're not shipping the config with your mod and not purposely overwriting them via C# then any config being overwritten is not you or your mods fault

urban patrol
#

stardrop warns you that updating mods using it will overwrite config settings yeah

#

usually i think the recommended course of action is to move the config file outside of the folder, update, then drop it back in

neat vigil
#

Hello again, I would like to change the gameโ€™s music but I canโ€™t manage to do itโ€ฆ. My mod doesnโ€™t show any errors, but when I launch the game, it still plays the same default music

If someone knows what the issue is, please tell me ๐Ÿ˜ญ

brittle pasture
#

post the code that you have?

lucid iron
#

Global app data is a different kind of mod data to store

neat vigil
#

I am using Content Patcher for the music

lucid iron
#

But nothing stops you from using that for configs

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

lucid iron
#

It will be next to the save files in sdv app data folder

lilac scaffold
neat vigil
# stray hemlock !json

{
"Format": "2.7.0",
"Changes": [
{ "Action": "Load", "Target": "Music/spring_day_music", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/spring_day_ambient", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/spring", "FromFile": "Music/Dayy.ogg" },

{ "Action": "Load", "Target": "Music/summer_day_music", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/summer_day_ambient", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/summer", "FromFile": "Music/Dayy.ogg" },

{ "Action": "Load", "Target": "Music/fall_day_music", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/fall_day_ambient", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/fall", "FromFile": "Music/Dayy.ogg" },

{ "Action": "Load", "Target": "Music/winter_day_music", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/winter_day_ambient", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/winter", "FromFile": "Music/Dayy.ogg" },

{ "Action": "Load", "Target": "Music/farm", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/town", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/forest", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/mountain", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/beach", "FromFile": "Music/Dayy.ogg" },
{ "Action": "Load", "Target": "Music/desert", "FromFile": "Music/Dayy.ogg" }

]
}

here it is

lucid iron
#

I personally don't do this because I treat configs as transient stuff

uncut viper
#

please use the json uploader in the governor command in the future, but that is not how you target audio

stray hemlock
brittle pasture
#

pls use the json site as requested, and that code is also not how you load/edit music with content patcher

lucid iron
#

Mod should have sensible defaults and config is for accomodations of ppl with different opinions than me

uncut viper
#

"Music/<whatever>" is not a thing

neat vigil
#

I am sorry

brittle pasture
#

[[Modding:Audio_changes]] for how to edit audio

#

fuk

neat vigil
#

thank you !

#

And sorry again

#

so the next time, if I want to upload my json, I have to hit !json ?

stray hemlock
lucid iron
#

Don't put words in my metaphorical mouth :)

uncut viper
stray hemlock
hard fern
#

What does fifty mean

lilac scaffold
uncut viper
#

fifty?

hard fern
#

Maybelline i

stray hemlock
uncut viper
#

oh, FTFY. fixed that for you

hard fern
#

Oh my god

#

My phone is against me

stray hemlock
lucid iron
lilac scaffold
lucid iron
#

I also have a few mods where my personal defaults is not what's in the code because I know I'm the weird one this time

stray hemlock
hard fern
#

See i hate discord light mode but prefer word and vscode in light mode

lucid iron
#

Previously I actually made it save specific so that people could have different concurrent saves with different mods n settings

#

So yeah it's ultimately your mod's data, store it however desired Dokkan

urban patrol
#

are locations created every time a save is loaded if the "CreateOnLoad" field is true? trying to figure out if i can spawn a hardwood log in my already-existing map for the next update

lucid iron
#

You should/could just use ftm/spacecore for that

#

The create on load stuff doesn't recreate location that exists in the save file psure

urban patrol
#

hmm darn yeah then i'll have to

lucid iron
#

If the log isn't vital then adding it is also fine

#

Ppl can rtf it right bolbthinking

urban patrol
#

just wanted to transform this from plain cliff to minecart but make it a lil difficult

lucid iron
#

I forget if betas had a regenerate terrain feature thing

urban patrol
#

oh yeah i can use BETAS trigger action

#

yep

uncut viper
#

(yes)

lucid iron
#

It definitely has a clear terrain

uncut viper
#

well

#

ish

#

RegeneratePathsLayer

lucid iron
#

Yeah that should work 4 this right

uncut viper
#

i dont know what all is on the paths layer i dont make maps

urban patrol
#

this log is paths yes

lucid iron
#

You will get debris back too then

#

And grass

uncut viper
#

i know theres a stumps map property so if it was that it wouldnt work

lucid iron
#

Trees

uncut viper
#

RegeneratePathsLayer takes a rectangle

#

so you can regenerate just the stump

#

it just calls the vanilla function GameLocation.loadPathsLayerObjectsInArea(int x, int y, int w, int h) lol

lucid iron
#

Hm how does this stuff work anyway

#

I know paths lights actually just secretly edit the lights map prop

urban patrol
#

are trigger actions having been run stored in the game save? i don't want the log to come back every time someone downloads the file again

uncut viper
#

a light isnt an Object is it

#

yes tractions are saved

exotic token
#

can you make an event thats just a text box on a black screen?

lucid iron
#

I don't know the answer

gentle rose
uncut viper
#

no all those get added to the maps objects or terrainFeatures lists

#

or largeTerrainFeatures

#

or resourceClumps.... i can never remmeber which is which

urban patrol
#

sidenote that viewport is weird and differs between indoors and outdoors

#

you may have to deal with clamp

uncut viper
#

(related to terrain features, id still love to know who is responsible for the method name GameLocation.checkForTerrainFeaturesAndObjectsButDestroyNonPlayerItems(int x, int y) because i still love it. so wordy)

urban patrol
#

is that what happens when an NPC paths through debris and stuff?

uncut viper
#

probably not, id imagine that would be GameLocation.characterDestroyObjectWithInrectangle() or GameLocation.characterTrampleTile()

#

as far as i can tell the one i mentioned is only used to make sure trout derby and squid derby temporary NPCs dont overwrite chests or other player-placed objects

urban patrol
#

these are so specific lol

uncut viper
#

i just like how overly descriptive and specific that one is and also because it holds the record for longest method name in the stardew codebase (last i checked anyway, which was sometime after 1.6.9)

gentle rose
uncut viper
#

they dont move, but they are actual NPCs

#

and not animated tiles

#

they just need to not destroy a chest if they happen to get placed on top of a chest

gentle rose
#

they got actual npc sprites before gil did SDVpufferpensive

uncut viper
#

which means if you know where theyre meant to spawn, you couldprevent them all from spawning

#

you know the little red or green rectangles that show up on the map when you're trying to move or place a building or something to tell you where you are and are not allowed to place it
does any C# modder here happen to know where the drawing of those things is actually handled

torn beacon
#

CarpenterMenu.draw handles the little red and green boxes, if I read things correctly

lucid iron
#

It's not rly unified

uncut viper
#

carpentermenu my nemesis

#

thank you two!

modest dagger
#

Is there a way I can make a machine recipe only work if a mod is installed

vernal crest
#

Put the patch for that recipe behind a hasmod condition

modest dagger
#

yea i figured it out (sort of)

#

thank ye

#

I should separate it from my main crops file right

vernal crest
#

Up to you. No change in behaviour as far as CP is concerned regardless of what file it's in.

modest dagger
#

ah so it's just for ease of access for me then

vernal crest
#

Yep. You only need to use includes if you want to local token them or if you're using something like CMCT with an optional dependency because you need to gate the cmct check behind a hasmod first so it doesn't try to find a token from a mod that isn't installed.

lucid iron
#

HasMod include json is nice for organization

modest dagger
#

Thanks Aba but ye lost me

lucid iron
#

But what is the detail of machine rules here

#

It might not actually matter?

ornate locust
#

If you don't use CMCT, it probably doesn't matter.

lucid iron
#

If you have a machine rule that requires a input item that doesn't exist

#

Then that rule is just inert cus it never activates

ornate locust
#

Hasmod includes are just nice with Cross-Mod Compatibility Tokens becuase it won't throw (probably harmless) errors

modest dagger
#

II'm trying now to make the item not appear if the mod isn't active even if it's part of my mod. I already have it so it won't drop and the recipe won't work

uncut viper
#

(theyre definitely not harmless)

lucid iron
#

Yeah in this scenario gating everything related to that item in 1 json included by hasmod is nice

#

But y'know it's ur mod ur organization

ornate locust
#

I stand corrected, didn't think they'd be harmful if you had the thing set not to activate without the mod anyway.

uncut viper
#

Content Patcher is the one that decided that a token failing is a warning and not an error

modest dagger
#

so wait I can set it up so everything I need for a compat is in it's own json and then i won't have to individually disable the things

lucid iron
#

HasMod is a special token that cp optimizes away after the first load

#

Cus it is invariant

uncut viper
#

until someone makes a load-mods-at-runtime mod SDVpufferowo

ornate locust
modest dagger
#

yea no i'm doing that it seems way easier

whole raptor
#

Having a mod compat folder is neat, just don't forget to make a correct include, so you won't catch yourself having something that never works in your mod for a year and a half without noticing (that definitely did not not happen to me SDVpufferpain )

ornate locust
#

LOL Oh no, I've done that

#

got it before release anyway...

#

always update your includes

#

I used to have it in allcaps on my Trello before I started just remembering to do it, UPDATE YOUR INCLUDES

uncut viper
#

probably not, it'd probably be pretty slow, performance-wise

vernal crest
#

Not so slow criminal scum

odd ginkgo
#

hey all, super niche question for events, and conditions to start events

#

I want an event to start in the desert if its raining in the valley. According to the modding wiki, the weather condition is for the players current location

#

is there anyway to add a condition for the weather is another location?

uncut viper
#

you can use the GameStateQuery precondition with the WEATHER GSQ that can take anyu location

odd ginkgo
#

time to learn haha

#

thank you!

uncut viper
#

GameStateQuery WEATHER Town Rain should be all it takes

#

maybe GameStateQuery WEATHER Town Rain Storm GreenRain if you want to cover all types of falling liquid water weathers

lucid mulch
uncut viper
#

i meant more like a user being able to just add a mod whenever they wanted

#

even in the middle of the day

modest dagger
#

first mod compat for ARC is done thanks y'all

uncut viper
#

otherwise SMAPI itself fits the bill of loading mods at runtime

lucid mulch
#

isn't too hard, but would require CP to do a full rebuild of its state model because hasmod being immutable means its decisions get baked into the runtime view of the json

#

and making hasmod not immutable would suuuck

uncut viper
#

the thing ive never cared to put too much thought about is what the potential consequences would be for running peoples GameLaunched events at far after the actual game launch

#

my hunch is "not much actually" but thats about as far as my thinking ever goes with it

#

can probably cause problems if a mod is relying on loading before another mod to do things first, but since you cant guarantee that afaik anyway tats probably very minor consideration

lucid mulch
#

or hitting apis that have assumpsions on timing (like registering cp tokens)

uncut viper
#

well if we're already gonna be forcing CP to redo some stuff for HasMod im sure we could knock down a few more reflective barriers to make it figure out tokens again

#

should be super easy trust

lucid mulch
#

I mean its the exact same problem

#

it needs tokens ahead of time for the same reason hasmod is immutable

odd ginkgo
uncut viper
#

in this hypothetical scenario where someone is making this mod and putting in the effort to make it work properly, i think "needs" would be a strong word to use

lucid iron
#

Yeah this hypothetical scenario is someone taking a jackhammer to content patcher and bonking it until it do what they need

soft lance
#

Hi

#
PLAYER_LOCATION_NAME Current BeachNightMarket

Is there a way that you can check if there is either BeachNightMarket or Beach instead of just one? I want both to be acceptable for my quest conditions


"Condition": "DATE_RANGE Winter 1 Winter 28, PLAYER_LOCATION_NAME Current BeachNightMarket, PLAYER_BASE_FISHING_LEVEL Current 4, PLAYER_HAS_CAUGHT_FISH (O){{ModID}}_Gingerfin, !PLAYER_HAS_MAIL Current {{ModID}}_QuestWillyGingerfinLetter",

royal stump
#

that query accepts multiple location names, so PLAYER_LOCATION_NAME Current Beach BeachNightMarket or some such

soft lance
royal stump
#

there's also the more generic "any" query, e.g. ANY \"query 1\" \"query 2\" if needed, but that's how the multiple names will work anyway

soft lance
#

Just curious since they have a custom map

#

if not totally fine

royal stump
urban patrol
soft lance
#

tyytyy

soft lance
#

just wondered if I had to do something special for custom mod maps

uncut viper
#

from the games pov, there is no difference between a custom map and a vanilla map

#

it doesnt know the difference

soft lance
#

awesome ty

soft lance
#

i did for instance DATE_RANGE Winter 1 Winter 28, it errors, so I did
Winter 1 1, Winter 28 1, and that works, but only for year one

#

How can I make it any year? I dont want a min or max year, just between x month and x day of said month(s)

uncut viper
#

things in < > are required, things in [ ] are optional. the first year is required, the second one is not

soft lance
#

ohhh

#

like

uncut viper
#

Winter 1 1, Winter 28

soft lance
#

DATE_RANGE Winter 1 1 Winter 28?

#

ohh yeah

#

tyty

soft lance
#

cause im worried if its gonna go from

#

Winter 1 year 1 to winter 28 year infinite

uncut viper
#

shrugs. i actually dont really understand how that query works exactly tbh after rereading it

royal stump
#

the comma will break that, but for "any day in winter of any year", just DATE_RANGE Winter 1 1 should do it

uncut viper
#

(oops, my bad. i didnt mean to put that comma)

soft lance
royal stump
#

if not included, it assumes the whole [] [] [] part is winter 28 999999 or some such

soft lance
#

or if its only one like here it encapsulates the whole month

vernal crest
#

I had DATE_RANGE Fall 22 1 Fall 28 in a mod of mine and it stayed true after Fall 22 year 1. It never went back to false.

#

I think it was checking between Fall 22 Y1 and Fall 28 Y99999

soft lance
royal stump
#

...ah, then it probably isn't designed for what I assumed at a glance, yeah

#

so it's a single timespan from one date to another

vernal crest
#

I ended up having to do SEASON_DAY fall 22 fall 23 fall 24 fall 25 fall 26 fall 27 fall 28 so it would check those days every year

soft lance
#

but probably for the best

royal stump
#

if the goal is just a query that's true on any day in winter, SEASON winter should cover it

hard fern
#

P

autumn tide
#

๐Ÿ‡ต

tight rivet
#

oh god that ai modder made a weather mod. angrish

autumn tide
tight rivet
#

note this mod was first released yesterday

autumn tide
#

wait like even the code??

tight rivet
#

yes

#

maximum vibe coding

autumn tide
#

god even the text read so AI

#

it's not A- it's B

tight rivet
#

(he "checks the AI output" but.)

autumn tide
#

hm.

tight rivet
#

"Stardew Valleyโ€™s built-in weather forecast is often:

easy to miss
vague
buried inside the TV
missing for modded weathers"
#

uh..

#

it's not vague, it's very easy to find, and most weather mods mod the ..

#

...

#

okay, sure, whatever.

#

(I rran across it checking for latest mods)

autumn tide
#

I don't wanna hate on anyone (...in this scenario ..yet /j), but i agree it's so frustrating when ppl use AI to make acutal ART like cmon

#

(art also applies to other creative shit like mods imo)

autumn fog
#

im troubleshooting a cp mod (my first mod!) and ran smapi without any other mods, including cp lmao

autumn tide
#

im just glad AI is banned here

autumn fog
#

ough i hate people using ai for mods

autumn tide
autumn tide
autumn fog
#

like mods are a community thing why would i use a mod someone couldnt even be bothered to make a thumnail for

#

let alone code

autumn fog
#

ok the same issue still happens without any other mods SDVpuffercry

#

i just followed this https://stardewmodding.wiki.gg/wiki/Tutorial:_Your_First_Content_Patcher_Pack but the item shows up as this thing??

Stardew Modding Wiki

Last edited by AtlasVBot on 2025-09-13 18:58:05
Welcome to creating your first Content Patcher Pack. I wanted a quick and easy way someone could copy, paste, and run their first content patch to prove to themselves everything's working as expected. I always find that creating my first, simple, working code gave me the confidence that I could tin...

uncut viper
#

this tutorial uses Entries when it should use Fields

autumn fog
#

oh ok

uncut viper
#

Entries practically speaking erases all the data about the item, and then fills in that newly erased item with the stuff you wrote (description and displayname in this case)

#

Fields will not erase anything and only change what you wrote it should change

autumn fog
#

ohh tysm!

uncut viper
#

the reason it turned into the green weeds is because since the data is erased its actually all being reset to default values, so its using the very first texture on the objects spritesheet

#

among other default values for things like edibility and type and whatnot

autumn fog
#

ah yea, i assumed it was something like a missing texture issue

lucid iron
#

Weedses

autumn fog
#

weedses

heavy pewter
#

Guys, when does our logic runs in the game? Does the game prioritize vanilla logics over our logic? Or Do they all run in the same tick?
I'm still trying to manipulate a certain vanilla logic(the one that stops button B from being fire continuously)

lucid iron
#

There's no 1 answer

lucid iron
inner harbor
brittle pasture
#

the lost arts of farhing

brave fable
#

mmm yes my favourite attributes. farhing. sunny. .

#

โŒ water

heavy pewter
# lucid iron For something like that you'd have to look into how and where this is being done
{
    buttonBHeld = true;
    Game1.currentLocation.tapToMove.mobileKeyStates.actionButtonPressed = true;
    return;
}
if (buttonBHeld)
{
    Game1.currentLocation.tapToMove.mobileKeyStates.actionButtonPressed = false;
}
if (!_touchingButtonB && buttonBHeld)
{
    buttonBHeld = false;
}```
This is the vanilla logic, and I'm trying to manipulate it with these

```if (pad.buttonBHeld && !state.actionButtonPressed)
            {
                state.actionButtonPressed = true;
            }```
tiny zealot
brave fable
#

Each weather type provides buffs and debuffs, with buffs always totaling +1 more for fair progression.
Buff totals always equal or exceed debuffs by exactly 1 point.
our results determined this to be a misleading answer

#

appreciate muddy rain for farming +2 mining +1 foraging -2 mining -1 just to make sure your mining is better and also worse

#

i wouldn't normally have anything bad to say about a mod page, but really the entire thing feels generated hahah

gentle rose
tight rivet
tiny zealot
brave fable
tender bloom
#

Headless bunny!

#

Got done losing feet

woeful lintel
#

in my perfect world this type of shit would be illegal

brittle pasture
# brave fable hmmmgggrrrhhhfsfs

ah yes, giant bunny head over a firestove(?), while crawling below the hanging diploma was the โ–“โ–“โ–“โ–“โ–“[CORRUPTED DATA DETECTED. UNIVERSE INTEGRITY BELOW CRITICAL LEVEL]

hexed siren
#

Does anyone know offhand if it's possible to call farmer's name in a message in events?
message "{{i18n: sam.event.movingforward.6}}"
I know @ gives you a left arrow, and I've tried {0} and some other numbers... pretty much everything I've seen used in code.

brittle pasture
#

if all else fails use the farmer name token

hexed siren
#

Oh, you mean create a token calling farmer's name?

brittle pasture
hexed siren
#

Ah ha... thanks!

drowsy pewter
#

..............

#

why can i not put recipes in the stardew fair shop

#

Bruh

#

Wait no

#

It's obviously because my test save has already learned every recipe in the game

#

.....

gray bear
#

it happens pat_froggy

#

i know ive been there

karmic gust
#

when you're adding an animation for a schedule do you use an NPCs internal ID for the key so it calls from their sprite sheet? like "{{ModId}}_Fable_sit"?

finite ginkgo
#

A Data/animationDescriptions entry only specifies which frames the animation uses, it does not affect spritesheets, the key/name is arbitrary, it will use whichever spritesheet your NPC currently is using

karmic gust
#

oh I see, so if I add fable_sit as the key and use that in her schedule it'll automatically pull from her sprites. do I have that right?

finite ginkgo
#

Yes

karmic gust
#

thank you!