#making-mods-general
1 messages · Page 309 of 1
Ahh ok, will mess around with it and see lol
hey guys I was just wondering if anyone had any information on making a content patcher thing that let me use pngs instead of xnbs (not for stardew valley)
not for Stardew Valley since it already has one but it seems like Stardew Valley is the only popular XNB modding community
we're already using pngs?
any help would be appreciated because what I can find online isnt helpful
Making mods can be broadly divided into two categories:
- Content packs are formatted text files, and don't need any programming knowledge. They can add/edit NPCs, maps, new items, shops, and more. To get started, see the list of framework mods, the wiki tutorial for Content Patcher, and there might be relevant guides on the tutorial wiki.
- C# mods use programming code to change fundamental game mechanics. See getting started with C# modding.
Usually it’s easier to start with making content packs, since you don't need to learn programming.
^
I know you use pngs im just asking how ya'll did that because I can't figure it out
like content patcher I imagine only works for stardew valley
check out the content patcher guide I linked. we don't really do XNB modding anymore
if you want to make your own modding framework for a completely different game that uses xnbs thats kind of out of this channel's (and discord) purview
but id look at the code for content patcher and the xnb unpacker
if it might help you
ooh I get the question
true, you could go there, though its less a questions and help channel
Look at how CP works. Look at how asset interception in smapi works
(you CAN ask questions and get help there, but its not the purpose of the channel like this one is)
someone already made this, it's called Content Patcher
(Hint: it replaces the localized content manager)
You'll probably spend more time than you want in the monogame xnb loafing code
alright thank you
They were asking how to make CP for another game, I believe
alas, i am trigger happy on the hot take cannon some days
ive probbaly already asked this but, how do I find/get a specific set of item IDs trough code?
like, id need a function that gets all crops
and than one that gets only the crops available that season (I guess it would just filter the function above with a gamestate query checking the season
idk ive found this https://stardewvalleywiki.com/Modding:Items#Categories and probably item categories would work here but im not sure how to use it
C# I presume? Object data (the seed item, the harvest item, etc.) is in Game1.objectData. Crops data (what seeds when planted gives what crops) is in Game1.cropData
they're described in https://stardewvalleywiki.com/Modding:Objects and https://stardewvalleywiki.com/Modding:Crop_data respectively
you can also use an item query
what is that?
ItemQueryContext IQContext = new();
ItemQueryResolver.TryResolve("ALL_ITEMS", IQContext, ItemQuerySearchMode.AllOfTypeItem, "ITEM_CATEGORY -75", avoidRepeat: true);
this is nice for broad searches, but looking at the data is better for crops specifically since theres no gsq to check for that
yeah, depends on how strict your definition for 'crops'. that item query will get every item with the category -75, regardless of whether they're from a crop
ppl made like, crops that grow cooper ore mods
or veg that is from a tree instead of a crop
im testing stuff, basically its for a quest that woul ask " harvest 100 X crop" and X crop would be a random crop available in the current season
yeah thats the reason I dont want to manually type all crop IDs
though some mod may add rare crops whose seeds cannot be bought in bulk, which may make the quest uncompleteable if that crop gets selected
dunno if that's prevalent enough to actually worry about though
I guess there's the vanilla rare seeds
another approach is to look at the stock of SeedShop
I guess I can add a config option to turn off mod seeds or something
alr, so this would return a dictionary containg all ctrop IDs?
{
var cropData = Game1.cropData;
return cropData;
}
seedshop? is it an object conatining all seeds?
keep in mind it wont be possible to turn off mod seeds unless you write out all the vanilla seed IDs anyway
in this case I need the crop itself and not the seed but I will likely need them somewhere else
theres no other way to tell what is modded and what is not
oh
once its in the content pipeline, its all the same. you could potentially look at the dictionary before and after any edits are applied, i suppose
not really worth doing in most cases
mhh cant I check if the item is from a mod and remove it from the array IF the setting is true?
oh alr
the game has no way of telling what is modded and what is not
seedshop is pierre's shop
ah lmao
content patcher knows, and if you get into the pipeline early enough you can know via dictionary diff checking, but normally, you cant know
ok, but I dunno why you're writing an entire function that's just literally calling Game1.cropData
can inspect whats in stock without limits
its part of the process😭
idk im learning both c# and smapi modding at the same time
oh so instead of checking the season I can check if its in stock
but than theres things like cofee that are not avalableù
no I will do it very soon to
Incredibly useful to do so
i would say borderline mandatory
It's basically how all modding works
alr ll do it now than
Frankly I've threatened to decompile the work of a library we use if they don't provide better documentation ||I kid I kid||
lmaoo
(I have decompiled my own work project once due to some former colleagues really loving partial classes, it was easier to read and understand the codebase in ILSpy compared to the real source code)
"Well I'm just trying to do Y but I'm getting segfaults?"
Is that why they are former colleagues
not exclusively the reason
But definitely part of it?
we still refer to that section of that codebase like 2-3 years later as [name] hell
it was a mess of abstraction, partial classes, empty interfaces that had extension methods
all for something that wasn't actually reused anyway
#making-mods-general message
I got correlation between patch in json and the runtime patch working, and so I can see local tokens
you target the patches by putting breakpoints on them as there are simply too many
New quote added by atravita as #6366 (https://discordapp.com/channels/137344473976799233/156109690059751424/1370593290868621344)
I've been doing background reading on lsp and dreading the work it'll take
but I think I can do some cool shit if it works by having a hybrid DAP/LSP
but getting the high precision of correlation between json and runtime state required for the LSP to work isn't going to be fun
- Content Patcher pack: enter
patch reload <your_mod_id>in the SMAPI console window. This will reload and reapply all your patches (but won't recalculate theConfigSchemaorDynamicTokensections if you use them). - Translation files: enter
reload_i18nin the SMAPI console window. If it's for a Content Patcher pack, also runpatch reloadafterwards. - C#: see the Visual Studio hot reload or Rider hot reload feature.
I'm tempted to just cheat and do non-standard extensions to DAP and do some of the lsp stuff entirely extension side instead
oh no i meant that afterdecompiling the game I can see everything
bruh theres literally the code I needed here
wow
i feel bad toh
idk what for
you could already run stardew through VS and have breakpoints etc just work
decompile wasn't actually needed for that
what are the consequences of me keeping around a Chest instance per screen purely to use chest.ShowMenu with a global inventory
why not just create an ItemGrabMenu with the global inventory
its long and annoying and maybe explodes on phone
do you want to colour code your global inventory
my opinion on phone is "if it explodes on phone, oh well"
just copy those methods yourself ezpz
that is true but long and annoying remains
cant believe it is a job for reverse transpiler again (no)
i mean in this case whats the harm in just copy pasting em
how badly do u care about special mod-patched-in behaviour for adding/removing items from chests for ur global inventory
reverse transpiler sounds fun here though i vote for that
i think they should patch who.addItemToInventory
but a second annoyance is like
item grab menu remakes itself whenever you exchange item
i mean it literally
it makes an ItemGrabMenu
grabItemFromInventory calls chest.ShowMenu
makes itself again just to update draw or smth idk
i should actually figure out if thats required or just a bit of quirky vanilla code 
beats me. i never noticed bc when i made my itemgrbamenu for my global inventory i just didnt use those functions so im no help here and even less help with splitscreen. godspeed
ik i copied these exactly for sprinkler attachments, bc i was a wee baby modder and didnt think to try anything different

can always just write ur own select and grab behaviours anyway for fun
hm yes i copied the code wrong enough to cause netcode problems and dupe items
😦
granted its not hard to dupe items anyway
plenty of places have items exposed without a mutex, or mods that ignore the mutex (I love you ChestsAnywhere but you are a duping/deleting magnet)
well i have copied this particular bit o code correctly before 
but doing it made stash btn not work so im actually thinking of changing that
ig i am indeed just keeping a Chest that never gets placed anywhere in the world 
Am I overcomplicating stuff or is this alr? (it shuld return available crops of the current season)
private static List<String> GetAvailableCrops()
{
var availableCrops = new List<string>();
foreach (var entry in Game1.cropData)
{
string cropID = entry.Key;
var data = entry.Value;
if (data.Seasons != null && data.Seasons.Contains(Game1.season))
{
availableCrops.Add(cropID);
}
}
return availableCrops;
}
Im trying to only base code on wiki/decompiled game without using ai lmao
it sort of is easier in a way
you can just try it
but as mentioned this will give u some rare crops (like rare seed)
oh right I completly forgot I can just print the result in a string lol
foreach (var entry in Game1.cropData)
{
string cropID = entry.Key;
var data = entry.Value;
can be replaced with this, but is mainly syntax sugar and isn't changing functionality
foreach ((var cropID, var data) in Game1.cropData)
{
yeah I will have to cover some edge cases but its alr
I intend the challenges to be very harsh
you dont have to ping me cus im still here lol
?
you can turn off the ping when replying
also cropData does have its PlantableLocationRules which is an optional list of GSQ to run based on the location to additionally deny for other reasons
oh yeah very cool I just checked
I could also get directly the product of each crop using HarvestItemId, super cool
can i add multiple recipes in the same mail 
actions yes but u dont get the text
I'll mention it in the body of the letter then
"Cornucopia.CookingRecipes_WillyOysterSauceCrab": "{{i18n:Mail_WillyOysterSauceCrab_body}}%item cookingRecipe Cornucopia_OysterSauceCrab%% %item cookingRecipe Cornucopia_OysterSauce%%[#]{{i18n:Mail_WillyOysterSauceCrab_title}}",

omg it works!
lol
Didnt know carrot seeds display as "CarrotSeeds" instead of an item ID.. is there a reason for this?
Excuse me, I need a little help. I'm making modifications in a map file on Tiled, but the main file have also a "Sandbox" map which seems identical with the exception of little differences. Can I edit the Map file freely without concerning about that other map or I need to be aware of something?
Ah, the chest mutex. What a wonderful, terrible thing. I spent so much time on that.
1.6 changed it so item ids could be strings instead of just numbers (better for mod compatibility) so the new items added take advantage of that
ohh makes sense, thats why he only used numbers in the past I guess
the numbers were previously the sprite index in the singular sprite sheet, and there wasn't an actual concept of an item id (which was why JsonAssets was effectively mandatory as it could maintain the concept of item ids and allocate sprite indexes dynamically).
1.6 both allows to decouple the id from the sprite index, and allow loading from multiple sprite sheets (which the 1.6 items do)
and as it was a texture being synchronized to the gpu, there were constraints on what the height of the spritesheet could be, so the hacks done in places like Events where you prefix your nexus id or whatever to the number wont work, as the spritesheet cant be that tall
@calm nebula: patch for extended hearts (14d ago)
Inside the farm, there is a warp from "142, 104" to "149, 148". But the content.json file has no contextual mention to this number or other close. How other else the author made this teleport?
can't understand that at all lol
nvm, found a way here
Is there any Stardew Valley title font generator but with correct colors? Because all the ones I found were black and white.
i don't think there is (i looked too) but with a little bit of work you can download a transparent one and then color it in
is the scroll generator not what you want
oh yeah there's the scroll generator, i assumed you were talking about the yellow wood board font
is this the proper way to format a question in dialogue?
"Thu4": "$q Uh, what?/Yes, actually... [give a lecture about 20th century naval battles] Thanks for your help with this assignment.$h#You don't know anything about 20th century naval battles, do you? I swear this class is going to kill me.",
perfect no notes
No, I want the title screen's font, which is different.
Oh you mean the logo?
Actually there is one note lmao, Clay should be 1, not 14. It accidentally took the amount from the thematic construction bundle instead of just taking one clay. I fixed it 🙂
Like these
Digus probably has a full set of em 
or these
But these r not really fonts per say
Oh gdi. The custom tv channel mod doesnt allow us to teach players new recipes yet
This is definitely something I should have looked into months ago
the TV is a Machine that produces Knowledge on day started
I know I just want something like them.
(doesnt seem like the modder is active either so probably not the best framework to add rn)
emc pls 
@ selph heyy
Just kidding I'll make our tv channels a newsletter instead. Clog that modded mailbox even more 😭
Hmm
6480 do u have either calcifer or spacecore rn
Nah both of them have furniture actions so just one is fine
Yeah something along those lines
mini queen of sauce tv
i think to emulate queen of sauce you can use the day of year as part of a i18n key
queen of sauce blog on your computer 
I think every day might be too much but we have content for two recipes each week for two years
If it's a "blog", then players can read the latest "blog post" and not worry about reading it on each specific day
Yep we'll do a book as well
That seems more complex for trigger action though i can sorta imagine how
Elaborate series of mailflags probably
well i can't just use the number in the i18n key because even though that cycles the i18n text just fine, the actual recipe learning command has to be written out for each recipe
no wait i guess it works
I just never used i18n for non-i18n things before
Yeah put it it like a separate do not translate i18n json
Yeah
default/
pls-translate.json
dont-translate.json
And then i come and make
zh/
pls-translate.json
i can still use queries to resolve day numbers into i18n strings and keep it all as one command lol
what about the vanilla string system, could that be used instead?
Do it before release cus default.json has priority over default/ folder
or would it not resolve
Wow, super interesting. I had read that 1.6 would have been very game changing for modders, but never dove into it
I dunno 
Actually hm i just remembered, the map letter view didn't parse actions
You probably have to go spacecore tile trigger action then
map letter view?
Map tile action Letter
Someone tried to use that with mail action and it didn't work
Yeah idk which vanilla map string thingy allowed side effects if any
ah ok idk what that is so it doesnt matter
u can do spacecore tile trigger -> add recipe + spacecore hud message
yup
If u add BETAS u get to use a dialogue box
For the King of Spice's beautiful portrait obviously
There's a thingy in mmap that spawns a question dialogue which would let people pick which recipe they want to learn that day 
I like the recipe blog because it makes sense that someone would be able to learn the same recipe for a few different days, but I think a little radio would fit as part of kitchen decor better... I just dont expect players to be able to remember to click on it on specific days each week
I forgor if spacecore anim let u do it conditionally tho
can also do spacecore hud message reminders
i guess not... nevermind
Well making it animated still helps mark it as a special thing
Does it work if u do it with cp conditions?
could you not also just put a When condition on the animation patch itself
I'm hoping it is respect invalidation
Will u draw 1 radio and then slip into kitchen clutter hyper fixation 
BETAS could also update the patch instantly if you did add it
let me see if I can utilize other BETAS features
I actually don't think it's an issue that it remains animated throughout the day cus you can rewatch queen of sauce as much as you want on the same day too
yeah
Hm so if it is just call trigger action then u won't need to i18n anything there
Just {{Random}} the trigger action id
That or a single trigger action with a bajilion If !PLAYER_HAS_MAIL
will BETAS SetNewDialogue refresh the npc's dialogue for the day unlike using a conversation topic? Or how is it different from a conversation topic?
if you append the dialogue then it works like a CT, if you don't append it will completely replace whatever dialogue they already had loaded
if you've already spoken to them that day it will let you speak to them again since they have new dialogue now
okay thanks
(which is also like a CT)
it also won't be tracked like a CT so unlike a CT you can see the dialogue as many times as you want. it's possible to do infinite dialogue in one day with it
Was it possible to add spouse-specific wedding ceremony content? I vaguely feel like I read something about that before but there doesn't seem to be much documentation about weddings
I wonder if theres some mailflag or stat system that I can use to keep track of incrementing items. My 12 quest items can be turned in in any order, so I cant tell if a player has turned in two of them or eleven, just all or none (or one specific one)
you can just use IncrementStat and the existing player stat system
if a stat doesn't already exist then IncrementStat will create it
oh interesting
It does seem like BETAS will be useful for a lot of our questline features so I'll grab it when I'm feeling less exhausted lol
yea u can add spouse specific wedding but its mainly via CP tokens (there's only 1 Data/Weddings entry)
if there's something it can't do that you need it to and you think it'd fit in BETAS feel free to let me know
update the animation patch instantly--do you mean the PatchUpdate trigger action? hopefully refreshing the entire mod to restart an animation doesnt do anything funny
im not sure if you have to edit on Relationship:Spouce engaged, or if DayEvent wedding is fine
yeah that's the one. It runs the content patcher console command
patch update
it doesn't do anything on it's own, it just exposes the console command that CP already has as a trigger action
mm
Hmm... so the spouse is still considered Engaged instead of Married on the day of the wedding prior to the cutscene?
Is there anyone who's worked with day/night tiles for custom maps before?
im not super sure when exactly wedding data get loaded
@whole raptor hey what is the cp patch u needed for ras wedding?
If they're still "engaged" I think my plans would work smoothly but if they're considered married already I can foresee that getting confused by multi-marriage mod(s) 
Oh, Rasmodia has an exclusive ceremony? I'll go poke around that for a bit then 
its a wip so i am ask directly
I haven't exactly tested how it works with wedding per se (I'm just testing it in game as a regular event for now), but from what I heard from Lemur you just need to add an entry to Data/Weddings with ID matching your NPC and it'll play that version of the wedding
Sword and Sorcery has custom ceremonies for their NPCs if you want to take a look
Oh that's nice im glad there's just unique key 
Yep, nice and simple
Ooh, if that's all I have to do then this ought to be easy, thanks 
Nope. The example on the dialogue page shows how to format it though. Also I might have an explanation of how a single question works in my tutorial, I'll go look.
Ok if you ignore the Q2 stuff this might be helpful: https://stardewmodding.wiki.gg/wiki/Tutorial:_Nested_Dialogue_Questions
@willow shale if you need anything pass downloading the Nexus mod and moving them to stand alone let me know ok
kk. probably wouldnt be anything too fancy if im doing it, no events introducing the animals, but i imagine i could keep the existing new buildings and just change the required building materials without much issue
That would be fine prob make things easier for ppl too
question; does any part of how the new buildings work rely on clowncore or any of the external frameworks? or is that all with cp?
Well there are a few assets inside the maps that is from my tilesheets but you could easily replace them with the basic farm animal build interior
sad to see PC go FC but hope you're doin alright
I'm not going anywhere just not modding anymore
Going in a different creative site but still very much gonna help ppl here and play
i mean, all those are in the pbc folder, right? i could probably just keep the structure of those intact
Mostly of them
Sure if you like!
Only NPCs not given away is Lyell, Grady and Roswell
RIP Roswell
She'll be in a comic instead
ooh as in you're not giving those characters away
Hi! I don't know you, and I doubt you know me, but I just wanted to say that I hope you're doing alright
well wishes to you
Thank you sage that's very kind of you
I was gon say Lyell seemed very fleshed out and would be weird no one would take him
vibes are literally unmatched
Yeah those are following me into a new project
I'm still debating how I wanna write the story, but I'm thinking a chapter book first with occasional illustrations inside
i've grown to love fighting pop and boxy over who gets the trash can
Yeah I'm sorry, I feel better though already leaving it behind
No need to apologize, glad I had the time to use it
If you decide you don't want to do it in the end, please let me know and I'll do it if @golden basin allows it. I'd really hate for them to not exist anymore
lets race. whoever gets it done first gets publishing rights
I just want them to exist
same, the animals are so cool
but clearly the fruits and trees and crops and foods need to exist too no?
(I would totally do it is what i'm saying)
It would be really sad to see anything get lost honestly
Megan can do the fauna, i'll do the flora! (and food(a))
if i mean, it hasn't been claimed by someone already
the biggest question is, which category would Zuuie fall under?
heh
Clown might want to keep it though, not sure what she wants to keep besides the NPCs she mentioned
If you want to you can I'm okay with it
Hi! I'm trying to create an Event for a custom NPC mod. I want to make an item with attributes similar to Robin's Lost Axe to trigger events. The item will be sent to the user by mail, allowing the user to take it to a specific location to trigger the Event. The only problem is that I'm worried the item might be lost and unable to be recovered. I hope to set it up so that if the user accidentally loses it (sells it or whatever), it can ultimately be recovered through the lost&found box. Does anyone know how to write this code?
How attached are you to the lost and found box in particular
Because, frankly, the sequence you describe isn't possible in json- only mods
You might be able to finagle it into the ||crow shop||, which is very similar and does have a data asset
If you were doing c# it's trivial enough to just make the item a quest item (so not lose-able or sell-able)
You can also make it an actual LostItemQuest and launch an event with the reception dialogue (with spacecore iirc)
O
I actually just need to make a failsafe mechanism, because my partner told me I have to do so, to prevent important quest items that cannot be obtained or crafted again from being lost by other users.
So. Which of these three options do you want
(An actual lost item quest generates a quest item which cannot be lost.)
I think I might use C# to handle this, because my script framework is already done, which is ideal for the visual presentation.
O god idk how to write this

"Oh cool C#
" turned into "on no... C#
" quickly there
For some reason Shane's vanilla 2 heart is now suddenly triggering, and then my event directly follows and then seems to softlock any of my following events :\ The only way I can seem to get the next event (dancing on the beach) to go off is debug mode
TRUE
"oh no C#" you mean the logical default
Does your event share very similar/the same preconditions as the vanilla Shane 2 heart one?
Similar yes, but not exactly. You have to have seen 3 other events first, have at least 2 hearts and enter the forest after 7pm.
Should I maybe change the heart level or time? It's supposed to be a rewrite of his 2 heart event which is why it's similar but not exact
Shouldn't you be removing his vanilla 2 heart one if yours is meant to replace it then?
Oh... I hadn't thought of that since so far the other event had never triggered.
Unless you want people to go through the game seeing all of his vanilla events and also yours, you will need to null out the vanilla ones.
ohhhhh okay. I definitely do not hahaha I'll search around for how to do that on the wiki 🙂
is that something I set in the content.json?
It's the same as making an event, except you make the event key the exact same as the vanilla one and then put null as the value instead of an event script.
can someone tell me the proper forrmat for the "SalableItem", I'm having an error there.
https://smapi.io/json/content-patcher/b508dc8d34e84e378f7a1c087cd99a70
do I just throw that in the same json as my regular events?
You can put it anywhere you want. Put it wherever it makes most sense to you.
Okie dokies, doing that now.
Take out the curly braces on lines 33 and 37.
Unrelated to the SalableItemTags, but you've also misspelled Dialogues and Dialogue in the Owners field so those won't work.
thanks, didn't see that, how do i add how much would the sell tho?
That's controlled by the price field in the data/objects entry, I think.
okay thanks, ill look into that
can i still make a shop like the "Joja Blackmarket"?
because im having this error https://smapi.io/log/33217615d81c409cb2b472c0871d469c
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home Single Language, with 13 C# mods and 1 content packs.
Your Target for your shop vendor portrait Load is "Target": "Shops/{{ModId}}_IDKYet", but the game is looking for Portraits\AkiAkumu.WallBasketDealer_BugEye. Change the Load target to Portraits/{{ModId}}_BugEye.
it's failing to spawn the npc, should i remake the tunnel map since that is where the shop will be?
like a new .tmx for the shop but containing my npc?
since that's what CopperSun did
No you only need to do small a map patch
how?
what do i put in the target? "Data/Maps"??
Everything you need to do is in the tutorial. There is no Data/Maps.
the map patch is there, but can't access the shop lol
So I'm assuming it's generally considered uncouth to ping a mod author about something simple like compatibility between two of their own mods? Probably should make a post on nexus or raise an issue on github?
I tend to ping on discord first if I know they're active on a server I'm on
Well then here goes nothing I suppose
@brittle pasture Any chance we could get compatibility between MPS and Additional Tree Equipments for giant crop tapping? The tapping works great up until I provide an MUS upgrade to the tapper, then it produces nothing (even when removed or mod-moved off and back onto the giant crop)
I poked around a bit in the code and while I'm not entirely unfamiliar with how something like this works I don't know a thing about Stardew modding to be able to even tell if this is a reasonable request or project to tackle myself. Maybe ChatGPT could help me get started but figured I'd hit you up first
Oh wait I'm tripping on something here, you aren't behind MPS. My bad
MPS is Nach, I think
Aye, I don't know how I got that mixed up
(Also, I am just chiming in to really strongly advise against using ChatGPT. It will give you complete rubbish.)
Oh, I hate ChatGPT. But it's something when you know nothing except enough to know when things are foolish
It's less than nothing, actually, because it actively points people in the wrong direction. So they waste time and effort on stuff that could never work instead of just finding things that could.
Anyway, MUS is by neither Selph nor Nach lol
So you've got three whole authors in that message there
But Additional Tree Equipments is
Somewhere in my sleep deprived brain I managed to really fudge it up though didn't I lol
Lol just a bit xD
I can add MPS compat on my end, though it's usually Nach who handles compat on his end right
If you're asking about MUS upgrades though that's Wren with Machine Upgrade System, not Nach with Machine Progression System.
Well, MUS upgrades upgrade MPS machines
So the MPS machines would need to compat I believe
yeah reach out to him as well to see if he's interested
the MPS tappers indeed need their own giant crop tapping rules
Apologies for the confusion from my end, thanks Selph
I can't be bothered scrolling back enough in that thread to learn what MES stands for
Machine Evolution System
Oh Nach's other mod lol
Machine Progression System
MUS, MPS, MES. That's not confusing at all xD
I don't blame you for getting mixed up lol
Well thanks for that haha makes me feel a bit better
Oh I think I got tripped up because I'm also using + testing Selph's Aquaponics mod
Which works beautifully with several other mods btw
Aquaponics + Legendary Fish Ponds + Fish Hatchery + Automate + MPS
is the current tree
Does anyone know if there are any water tiles that are walkable in vanilla? I don't think there are but I haven't been to Ginger Island so I don't know what's going on there
I'm thinking of making a buildable paddy field mod but if there's a splashy sound water tile I'd prefer that over making trenches
can someone tell as to why the shop is not accesible, the map patch is working, I just can't open the shop - https://smapi.io/json/none/d51e225798584e239a9f3c646a5f2280
I installed this mod, followed the instructions (renaming the image file), and it doesn’t work. If I wanted to make my own mod that replaces the sprite for the Triple Shot Espresso, how should I do it? I want to see if I can get it working, and if I do, I’d like to send the corrected file to the modder.
I can also share the content.json file with you — it’s small — in case there’s an error in the code.
The error I’m getting is:
[Content Patcher] Can't apply image patch "(CP) Triple Shot Espresso To-Go > EditImage Maps/springobjects" to Maps/springobjects: the FromFile file 'assets\triple.png' doesn't exist.
[Content Patcher] Can't apply image patch "(CP) Triple Shot Espresso To-Go > EditImage Maps/springobjects" to Maps/springobjects: the FromFile file 'assets\triple.png' doesn't exist.
But the image does exist.
https://www.nexusmods.com/stardewvalley/mods/33159?tab=description
Technically all the water tiles in the game are walkable except for the few that have the Passable property set. However, none of them make splashing noises. There's a mod that makes the tidepools walkable and splashy - not sure if it's better water or dynamic reflections or maybe even something else - but it will definitely be C# doing it.
Does your map patch include the Action OpenShop tile object property?
noooooooooooo, it needs that huh, brb
Darn, I was afraid of that
Can you show a screenshot of what the image looks like in the folder now that you've renamed it? Make sure the screenshot shows the file path please.
ok
Are you sure it's a png file? Can you turn on file extensions to check? It should be an option in your file browser up the top somewhere. Usually in View.
Did you rename it before launching the game?
wtf is faststone
An image viewer apparently
The default app I use as an image viewer.
Yes
Hmm I don't know then. It should be working. Instead of renaming the file you could try extracting the original mod again and editing the json so the FromFile matches the unedited file name instead. See if it works that way.
It's a pity the mod author didn't know about configs because this is something that would be extremely easy to change in game without needing a mod user to edit any files at all.
I did something similar — I edited the file name in the content.json so it would match, but it still didn’t work. I’ll try doing it the way you’re suggesting
It's not that hard to edit a file name either — I've done it in other mods and in my own, and it's never given me any trouble. I have no idea why it's failing now though, haha
No it's not, but many people do struggle with it and I don't think it's great to get users to mess around with mod files if it can be relatively easily avoided. Plus if it was a config players could change it in game immediately.
Not that the mod author is doing anything wrong, especially given that it's their first mod.
even with the Action, still can't open the shop lol
I just might suggest configs to them.
It worked without editing the image name but by editing the content.json. Don't ask me why, haha
Did you read everything about the tile object property and shops very carefully? They can be kind of complex and require things to be exactly correct to work.
The only thing I can think of is that you maybe had a space at the end of "triple" or your keyboard produced a character that was in some way slightly different to what was expected, but those are my only guesses lol
If I want to create the config.json file for the GMCM, how should I do it? That way I can pass it to the modder to integrate it into their mod, and at the same time, I'll learn how to do it for mine as well.
Maybe, but I thought of that possibility and deleted all the text, then typed it manually, yet it still failed, haha. At least we’ve solved it now, but I’m still interested in the idea of doing it with a config file for the PNG selection.
For example, you've put in your json that an NPC called "Bug Eye" has to be present for your shop to be open but there's no Data/Characters entry in your json. I haven't seen your Action OpenShop string but that would also need to have an owner tile area specified for the shop to work.
it works now i just change the value of the "Name" to None instead of the name of the NPC
This page explains how to add a ConfigSchema where you set up the possible options a player can choose from and then use the name of the config as a token to include in the FromFile: https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide/config.md
Yes that's the best option when you don't have an actual NPC for the shop.
Thanks = )
I'm going to bed now but if you run into issues and can't get help from anyone who's coming online soon (which is pretty unlikely, lots of knowledgeable people going to be around shortly) I'm happy for you to ping me and I'll look once I'm up in the morning.
lol, imma publish this now, it's fine right even if it's a small mod
Thank you very much, have a good rest and good night!
Mmm custom starting friendship would need C# wouldn't it
Not really

Is this one of the things I want to make that i won't have to wait until I learn C# to do.. truly
Hello there, I'm having some trouble editing custom FF content files with CP: I get a CP Warn that says that "the field 'Included' doesn't match an existing target". Here is the custom content file I want to patch:
{
"$schema": "https://raw.githubusercontent.com/Leroymilo/FurnitureFramework/main/doc/schemas/content.json",
"Format": 3,
"Furniture": {
// Unimportant stuff, removed for clarity
},
"Included": {
// Nothing, stuff is supposed to be added by CP patches
}
}
Here is the patch:
{
// Adding an Included pack to directly load a local file
"Action": "EditData",
"LogName": "Adding this Pack to Default Pack's Included",
"Target": "FF/{{DefModID}}/content.json",
"TargetField": [ "Included" ],
"Entries": {
"{{ModID}}.content": {
"Path": "{{ModID}}/content.json",// The asset asked by FF will be "FF/{{DefModID}}/{{ModID}}/content.json"
"Description": "A Furniture Pack made entirely with CP"
}
}
}
I am 100% sure that the Target is correct because the warning shows up exactly when this asset is loaded.
The goal is to add a new entry in the "Included" dictionary in the custom FF content data.
idea....different npcs are more or less 'grateful'. you give a gift to somebody like Penny and they are really grateful every time. If you give a gift to somebody like Shane then he would be a slightly above average gift gratefulness but would perhaps gain a bonus if you kept on giving gifts to them (filling their weekly limit)
i am probably not explaining the idea well..
ohhh this makes more sense now, thank you! i didn’t know that you had to define them all in separate keys 
No this makes sense.. I like this
I tried multiple variations of "Fields" and "Entries", with and without "TargetField", but it's either "field doesn't match existing target" or "Entries can't add a new value in an Object" (which is a weird limitation imo but eh, it's probably possible with "Fields")
That's kinda the idea I had for the custom starting friendship too, npcs like Elliott who claim they were eager to have friends feel like they would start higher on the friendship meter (or npcs that are friendlier) whereas someone like shane... well .. Shane lmao
it would be like the first time you give them a gift then they would think 'why is the farmer suddenly giving me gifts? it's not my birthday'.
yee!
Hello, I'm new to this server and I have a few questions. I know that the portrait size is supposed to be 64x64 but can I just scale it down without it being too blurry/compressed? If so, how do I do that?
I think you have to check the Portraiture mod, at least that's the answer I often see in here
It hasn't been updated since March 4 2024, is it still fine to use?
Sounds good to me, it's after the release of 1.6. Don't know for sure though, I'm not a portrait person.
Ah cool, thanks anyways
1.6 was on march 19th but as far as i know portraiture still works. i believe spacecore also has stuff for larger portraits now? idk
I'm going to bed, if anyone can help me with that, ping me so that I'll see the messages tomorrow
if you just scale a high-res portrait down to 64x64, it will almost certainly not look good.
as mentioned, Portraiture (which still works) is the standard approach these days if you want high-res portraits
Cool beans, thank you
How do I make a custom map for my expansion area?
VMV has a file with it but i didn't do it (pathos did it to test the 1.6 feature) so i can't really help more than the link and suggesting to look at VMV/Sunberry/another recent CP mod to see how they do it
I noticed that it might not be clear from your update that the command line tool is a good alternative for Mac users. It doesn’t seem like people actually get AvaloniaILSpy to work judging from this server questions. What do you think?
Thanks Lumina c:
Hi, does anyone know how to get mod-added maps to ignore outdoor lighting (so ambient lighting can be used)?
Hm so i believe avalonia ilspy does work on linux, however it's stuck in ilspy 7 for the backend and the ui doesn't scale very well
I thought that was too much detail for the wiki instructions 
Quite possible, I didn’t check on Linux, only on Mac
And idk what the mac status is
So you can either make your map indoors (fine if it's just an event map) or use this mod framework feature https://github.com/Mushymato/MiscMapActionsProperties?tab=readme-ov-file#mushymatommap_woodslighting-tcolor
Seems there are some workarounds for Mac in this issue thread but I don’t expect many users to find them
You might have better luck with the vscode ilspy extension
At any rate feel free to edit it more 
like chu said, ilspy does work on linux but it's stuck on 7 and it's unpleasant in multiple ways (source: i use it when necessary)
Thanks very much
MMAP can do this
Huh... I'm curious what is showFrame 101 in the wedding script 
Oh, that's good to know
I wonder how I did the farmer kissing scene for my resort event ages ago then... best not to think about it since it works 
I'm trying to compile Lookup Anything on my own machine and i'm getitng this "collection expressions feature not available" message. From my quick google search, C# 12 is available with .net 8. If sdv mods are supposed to target .net 6, how can I make this work?
I don't currently have anything past C# 11 on my machine
oh i see
you can use newer languages while simultaneously targeting an old one
<LangVersion>default</LangVersion>
do i need to update C# itself or update .net
ok i shall install net 8
i am behind the times 😔
i suppose i have like 3 different java installations i don't see why i thought I couldn't do that for C# too
It's not %spouse for when we want to use spouse name in dialogue/event? 
Is that a custom wedding ceremony? 👀
should be according to wiki, for dialogue
Yep
events should accept it too, since there's
hmm
maybe it's too soon
spouse may not be set yet
normal wedding ceremony is using a string instead of that, or something?
Normal uses @... %spouse... #$b# As the mayor of Pelican Town... from strings
hmm, then weird
Unless it's the i18n messing up... although it shouldn't 
unless you test the event without being married, of course
(i remember getting some strange issues when i did that)
Ah...
i don't remember i18n impacting this kind of token
ok then it may just be that spouse isn't set yet 🙂
frankly i can't remember if i tested the event while already married
Yep, that was the issue 😅
Just like that time I was trying to figure out a proposal didn't work for like an hour... before I realized I didn't have the house upgraded 
Also ngl, I was very pleasantly surprised Linus had a perfect sprite frame for officiating a wedding 
ok, i think i'm going to venture into hell to try and update this mod i used a long time ago because jahangmar is just. Gone. there IS a tutorial for "updating" a c# mod to 1.6, yeah?
migration page, yeah
Wouldn't call it a tutorial tho 😅
But smapi is very good at yelling what exactly is broken
true. ill try running a test save with this and see what it screams at
concerned ape... concerned ape why is this one tile all the way over to the left on the tilesheet... im going to go insane
when I did an update, I just loaded the C# mod into visual studio and looked for the red squigglies
oh true
and then I just guesstimated what the 1.6 feature was
i could probably do a better job now that i'm more familiar with the code lol
Half the time it was just me needed to capitalize something
aside from the migration stuff theres not really a way to make a "tutorial" for updating a mod as it can be very dependent and unique to each mod in question
i meant the migration guide, sorry, not tutorial hehe
(For example, i search the entire codebase for reference to "ParentSheetIndex" which is likely wrong)
alright, gonna see whats going on w InteractionTweaks by jahangmar
What's the mod?
(message above urs, chu)
this one
was my absolute goat in 1.5
the eating until full and the buying missing resources from robin... amazing amazing amazing
*peeks at Interaction Tweaks*
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>

Oh wow, it actually has a single unit test in there!
private class ModAutoGrabberObject : Object
{
private readonly Object obj;
public const string internalName = "Auto-Grabber";
public ModAutoGrabberObject(Object obj) : base(Vector2.Zero, 165, false)
{
The amount of digging through ooolllld game data for this would be tedious as hell. 
Some of the tweaks got eaten by game
I nerdsnipe you, DH
Smart Building should totally have this feature trust
Gotta account for y2 price up tho
is there a way to add flooring/wallpaper to calcifer catalogues? it has such little documentation so i cant find anything on it
What's funny is that two full years ago someone in my Nexus comments asked me if I would consider reduxing that mod
And I said "sure after I did my own updates"
And then my own updates did not happen because I'm a fool
Calcifer catalogues are really just shops with specific stock that can be opened with furniture actions
You can add more to the items entry and it should work 
Hmm.. im not sure how id add my specific wallpaper then, since when you add them they dont really have ids?
honestly i just want the robin features and the sell swords and the sell old fishing rods and the eat til full
the rest can vanish
Lani I'm retired
no i know, im just saying what im cutting out of it aloud
On the plus side, it looks like it's been made stuipdly easy to just rip out features.
updating said features... hahaha.... going to be a bitch and a half
no i meant like.. mine dont have a specific ID? if that makes sense - i cant find the data for how the junimo catalogue works though.
know a lot of the items have a context tag, but adding context tags doesnt work for the wallpapers .. unless im doing the context tags wrong/they are supposed to be done differently for those
Yeah hm i don't see how u would exclude it from random sale
Will have to text operation the peritemcondition

@ pathos plz
Joy
Tbh i wouldn't worry about it lily cus you are going to make this nice and exclusive catalog and then im gonna spawn it in cus i need the ?
You should just include the wallpaper in ur thing for Theme and dw about exclude
if i include alll the wall papers
it will be alll the wallpapers
oh i figured it out.. I just need to add 16 entries for each wallpaper and floor is all :')
Where may I find the logic that triggers green rain in the decompiled code?
it is done
Hmm
I think you can use peritemconditon item id prefix actually
Tho ik u already did it and it's the same thing 
It would cover both wallpaper and furniture in 1 item tho
pathos is ok with pings to discuss potential PRs, right?
iirc pathos doesn't mind pings
(I'll double confirm that!)
Hello is anybody willing to make a custom mod for me that adds 4 new npc( i will pay )
@ivory plume How would you feel about a Lookup Anything PR that allows for lookups on the rewards in the prize ticket machine? The menu doesn't have actual components for the rewards since they're not clickable; it may be a bit more brittle than other menu lookups if there's an update to the menu due to relying on pixel coordinates.
!commissions
If you're looking for people who do mod commissions (either art or code), here's a wiki page with a non-comprehensive list of people who do them: https://stardewmodding.wiki.gg/wiki/Stardew_Mod_Commissions
What if u just list the next 3 rewards
Then u can also have it happen on looking up the tile
list them on tile lookup only or in the menu lookup?
I'd rather not have a lookup that depends on hardcoded pixel coordinates. But I'd be fine with a menu lookup which lists the next X rewards as clickable links or something.
(I just finished the multilingual event changes for SDV 1.6.16, so I'll be preparing the next mod update wave soonish.)
To clarify, do you mean:
(1) A lookup menu opening when looking up the tile the prize machine is on
(2) A lookup menu opening when hitting the lookup key with the cursor anywhere in the open PrizeTicketMenu
Probably (2), but I'd be fine with both.
(The target/subject separation means you can just reuse the same lookup subject for both cases.)
Alright, thank you. I honestly doubt I'll have a PR up before your next update wave due to the vast backlog of modding and life stuff I have, but I hope to submit something when I have more time
ok i think atra was right this has to be rewritten from scratch mostly
im reading some of this and im like. man what the helly
half the commands dont exist anymore 
is there even an AssetNameEquals when using IAssetInfo
i know theres IsEquivalentTo in IAssetName but prrbt not what i need
if it's just a content pipeline edit, that's actually probably waht you want
Perhaps u can just start with the getting started button press mod
And then come back n ask about how to implement the features u cared the most about
oh i did that already HAHAHAHA it worked fine
last time i did c# was in 1.5 though so pepesad
Step 2 then what's the feature u want the most out of that tweaks mod
-# wasn't me
1 step at a time
carpenter menu to be able to buy missing materials
(See also the SMAPI 4.0 migration guide.)
or have a button to buy them
omg pathos pressing enter too early… i saws it…
(oh)
I would load the shop tbh
Mumble
Magic give me two free hours and I'll have a poc
So I nerdsnipe you chue
yeah load the menu, add the button, do math to calc how much you have missing and add the price on top of the base price
Ok so to add the button you would need to check for the menu becoming active, or directly harmony patch carpenter menu
mmhm
I would nit hardcode a price but load the shop data for the carpentry shop
I say do option 1 cus easier to reason about, for this you need the menuchanged event
Get this button drawn first and then do what atra says 
checking if the menu is active is how it was done prior so ill do it that way 🤣
omg wait i just realized. i can add a monitor log to print when the menu is active to see if im targeting the right thing… amazing
yeah
ill do that. thank u friends
Unfortunately controller support sux
There haven't been any recent changes to SMAPI or Content Patcher that prevents using \" to escape a quote mark in dialogue, right? I'm getting reports that my scheduleDialogue include is complaining about finding the \ as an unexpected character, but the code doesn't look wrong to me, and I haven't been able to replicate it: https://smapi.io/json/content-patcher/3c905e426d954d048fa3d0903a116866
i do tend to think too big on c# stuff and try to do it all at once, so breaking it down and saying “go away” is good lol
thanks chu 🫡
If u want u can just be lazy and make it a keybind first lol
And do the functionality through that
me when i press Y
SMAPI log that the user submitted complained about line 13
not sure why there are ending / in the target actually, but that's not the line in the actual log, it refers to Satoru_Room_002
Would the / inStringsFromMaps/ have any relevance whatsoever?
I wonder if the trailing slash is problematic
It's curious that I can't replicate the error even with the same code, but I can at least remove it to test
Nope, same OS, both on Steam versions, both on latest mod and Content Patcher versions.
Very baffling
neither SMAPI nor CP would be able to change how escaping characters works as that is a json thing handled by Newtonsoft, and since their log complains about position 194 which is beyond the length of the line anyway, i would not be surprised if they tried to do some kind of personal edit and messed it up
(the discrepency in saying line 13 but talking about the entry is because the actual file included in the mod itself is formatted differently, the smapi.io validator reformats it which affected the line numbers)
(yeah, line 13 is the Satoru_Room_002 line in the base code when opened in Visual Studio)
which still doesn't have 194 characters, LOL
i would tell them to reinstall the mod and id assume it will be magically fixed once they do
also, unrelated, but I'm noticing that the aliases for some of the preconditions are missing on the event data page, are they no longer working, or just got erased somehow?
Specifically the F and d from World/Context
which were is not Festival Day and is not day, I think?
Looking at another report of an event not firing, and it used both F and d Mon Tue Wed Sat Sun in the preconditions.
Which should have meant not a festival day and only happening on Thursday IIRC
those are in the Deprecated dropdown, no?
(This is for the Satoru Gojo NPC mod that I updated to 1.6)
okay, so they need to be rewritten and weren't migrated if old?
I wasn't sure, since the event pre-dated the update and so did the CP format
Also I completely missed the expand button on the deprecation list, so thank you for pointing that out ❤️
someone else more versed in events may correct me if im wrong, i didnt much pay attention t o them post 1.6.9
Yeah, I've not posted anything new to this mod post-1.6.9, so if it's broken, I might as well fix it all now
Little C.Patcher coding help, please: I want to edit the outdoor fence inside the farm but it affects the rest of the world map, too. can it be restricted to the Farm only? And if so, do I need to put separate code for each farm type?
So there's 2 options, OnLocationChange when locationname farm, or just make your own tilesheet
If it's a custom farm I'd definitely do new tilesheet
it's just for the vanilla farms, just want to do a simple "overlay" recolor, won't even touch shadows, so hopefully the first option works fine, I don't mind having multiple paragraphs as long as it works. Thanks much!
for personal use you can do a location change, the main reason "not" to is that for some people it makes game laggy
(when they have a lot of them)
so for publishing this is a thing to keep in mind (especially since the farm is a location you enter/exit a lot).
Unfortunately if I remove location chance then it colors the world map fences too, (or it simply doesn't work at all) if it's there then the change happens only inside the farm map. what a weird thing. I'll look for a workaround, otherwise I'll just put it aside, don't want to make people game's laggy.
that sounds intended to me what's weird about it
remember, they're using the same sheets
the workaround as mentioned earlier is to roll your own sheets for the farm
I think location change not that bad in this case but i am always for ✨ scope creep ✨ and u should totally do custom farm \j
random question but when i jsut wanna change to a normal different map in an envent do i still sue the changeToTemporaryMap thing? cuz i cant find anything else on the wiki page but i might be blind
yes you need the update rate "OnLocationChange" because otherwise the game will only check the location on day start and keep the value all day, so if you don't start on farm (which you don't, usually) you'll have no change, and if you do start on farm you have change everywhere. Hence the need of it paired with the location check
i also mention it because it can be a factor on stuff, but it's not THAT big a deal especially if you make it a config option
Yes, of course it's a config, you can turn it off. I guess I can warn people it may lag their game. (for Selph) and I didn't mean "weird" as in "what a terrible code" but as in "as a non-coder I find it funny how coding work". English is hard. Need to use more emotes.
Heyo, does anyone know why my dialogue command is not triggering properly? #$action AddMail Host {{ModId}}_CabinRepair Received?
I keep running into dead ends
that is not a dialogue command i dont think
there are event ones and dialogue ones
and i dont rembr which goes where. check the Modding:Dialogue and specifically search for addmail
or mail
The full quest?
no the full line
Yup
"{{ModId}}_WillyQ7": "ItemDelivery/{{i18n:WillyQ7_title}}/{{i18n:WillyQ7_details}}/{{i18n:WillyQ7_hint}}/Willy 709 150/-1/100/Gold/true/{{i18n:WillyQ7_reaction}} #$action AddMail Host {{ModId}}_CabinRepair Received"
the quest works as normal but the flag isn't given and removing the i18n token the flag still isnt given
yeah that does not look correct at first glance
See idk what doesn't look correct X| I am starring at the wiki and back at my json and cannot figure it out
just the flag piece. the $action bit
and the … # before it
its just that part that looks weird to me
but im not at home so i cant check for sure
If I remove the # before the $ it shows the action in the dialogue
i thought in dialogue you did the %addMailFlag or something?
and not $action
bc thats for events
Swap the two?
Put the $action first and tbe dialogue second
It's fragile iirc
OHHhHhHh if thats it I will cry lol XD I have been looking at this for 2 days
you didnt specify when the mail would be received
like you didnt put a Now
or a whatever at the end
but thats optional. i just like adding it anyways
also is the player Current or Host? i never know
Host, has to be for this quest as it triggers a map patch
i shee
Ok I am trying this rn
good luck
Yea still isn't working X|
Yep!
Are you testing on the host
yea
Do you expect the map to change immediately or after sleeping a day
should be day after problem is if I check the gamequery to see if I have the flag that is given via the quest completion I don't have it so the completion mail and map patch never happen
add Now at the end and the mailflag will get added that instant
😔
Received is correct here
I mean you could try Now and have a real mail for it to see if it is at least working there
Anyways
I need to drive home
Ill try it but I believe in the beginning I was testing with Now, let me try that and then maybe switching the player
I'm so exhausted today haha
Thanks for the help
Hmm, Host should work
How are you checking the gsq?
debug gamequery
Like, what gsq are you using precisely
Because there is some funky with managed names
PLAYER_HAS_MAIL Host {{ModId}}_CabinRepair Received
Ooop
Because the console doesn't know what ModId is
You have to spell the whole word out
The actual modid
I knew thattttt I swear X|
One sec
ok so the mail shows up as being received but then no mail opens
Yes it is a letter
Yes letter is there and a trigger for it should be the last quests mail flag being received
which wshould add that mail to the mailbox tomorrow
let me double but I don't think so
i always come back…..
Nothing in the log at all
I actually made a small python tool that validates all tokens/keys and makes sure there is not orphaned or missing
thats how I realized
I usually only use it for checking before I post an update to double check I did all the i18n keys
I coulda saved myself so much time LOL
Thanks for helping as well oml

so... there is no way to add an optional parameter to an API method that already has optional parameters and maintain backwards compatibility, right? Because Pintail doesn't handle optional parameters specially so it needs the argument number to match (I think?), but adding another signature with the new optional parameter will make the c# compiler complain that all of the existing call sites are ambiguous.
nope I don't think
optional parameters are syntactic sugar, the underlying method will have that argument and the compiler will just pass in the default value automatically if not provided
yes, but... it can't be just syntactic sugar because default values show up in decompiles, so they must be stored somewhere in the binary. Doesn't really matter, though, if Pintail doesn't take special steps specifically to try to proxy to methods with different argument count.
Yeah, overloads is your best bet
void A() => A("foo");
void A(string foo) => //etc;
I suspect it's possible
I can't figure out where, in the code, does the stats stepsTaken get incremented. Anyone knows?
Stats.takeStep()
oh my god it was right there
I was doing Find Usages on it and then text search in all the files that seemed reasonable
thank you a lot lol
if you already have an existing signature with multiple optional parameters..... I think it's impossible to convert into something that will proxy in the general case and still maintain backwards compatibility. If it were just a matter of expanding a signature with n optional arguments into n additional signatures (with no optional arguments) that would be tedious but possible. The problem is that you can''t get rid of the original signature or make its parameters non-optional because call sites can aribitrarily skip any optional parameter (implicitly using its default) by using the named argument syntax in the call. Turning the expansion into the power set of the optional arguments is possible, but highly likely to produce something that has multiple signatures that differ only in an argument name, which, of course, won't work.
(if smapi didn't have an allow-list on what assembly references to fix, it could maintain backwards compatibility)
if stardew adds an optional parameter it wont break smapi mods (unless used in the middle of a transpiler or other generated IL) as smapi will just rewrite your mod to populate hte optional parameter with the null/default value
Wouldn't work for pintail though
Pintail would have to intentionally allow that
Which
Honestly
I think the data exists for the IL
Yes, I'm more concerned with mod-provided APIs. I don't think anyone is too surprised if a game update requires rebuilding mods.
Can anyone help me? I've drawn a custom map for my location and it's all working accordingly. Only thing is: it's not working great with the NPCMapLocations mod. For example, one of my NPC's is in the trees to the left of the map, not quite at their home :c
did you populate the WorldPositions section of the map area to set the correct scaling?
Oh, no I didn't
I forget if pintail even looks at argument position
afaik NPCMapLocations is using the vanilla map logic now, so if a player was there it would do the same, and vanilla renders the player icons
I will look into doing that now, thanks!
Just for shits and giggles, can you try inserting the argument just before the optional ones
as a non-optional argument in the same signature?
that seems to work
(of course, nothing is using the new argument)
But I'm glad it works?
(I would rather optional parameter worked. I suspect it is possible and the data exists in the IL. I do not have the time to play with it myself)
Yeah, this isn't proper overload resolution
I think I'd need to write the "other side" both with and without the new parameter before I'll be able to convince myself that it really works. And I think it wouldn't work at all if the new parameter's type was the same as the first optional parameter.
(which it's not, for the specific thing I'm looking at right now... but...)
Ah. You're right
Hmm.
It can't use parameter names iirc
Or was it local names
I don't recall
Been too long
Yeah I'm wrong, sorry!!!
This is already more effort than I wanted to spend to avoid telling someone trying to be helpful that their PR would break things and I'm not going to require downstream users to copy in a new API and rebuild their mods just to add this small feature. Seems stupid to have to add a method with a new name, but that's probably easiest for everyone.
At least it's an interesting problem!
@polar escarp Hello brother, i have question for mod Fashion Sense
how can i fix this bug?, where i can disable this by code
in this is pc version,
It's also a different colour to the rest o.O
No that's what I meant, i forgot to retexture it because its not in the same place as the other kitchen tilesheets 
Kitchen tiles*
Oh haha that's ok then. I thought you had been struggling to find it to place it on the map and that it was just a random vanilla one that was a different colour for some reason to the other vanilla ones.
i swear to god ginger island is gonna be the death of me
i'm trying to update my mod to make it functional on ginger island but for some reason nothing I do can replace these bushes here
i assume it's some part my fault on the code, I just don't know what I've done wrong
"Action": "EditImage",
"PatchMode": "Replace",
"Target": "Maps/{{season}}_outdoorsTilesheet",
"FromFile": "assets/{{recolor}}/{{SeasonStage}}/StaticTreesBush/{{season}}_island_tilesheet_1.png",
"FromArea": {"X":208, "Y":0, "Width":49, "Height":49},
"ToArea": {"X":208, "Y":0, "Width":49, "Height":49},
"When": {
"StaticFoliage": "True",
}
},
{
"Action": "EditImage",
"PatchMode": "Replace",
"Target": "Maps/{{season}}_outdoorsTilesheet",
"FromFile": "assets/{{recolor}}/{{SeasonStage}}/StaticTreesBush/{{season}}outdoors_tilesheet_1.png",
"FromArea": {"X":208, "Y":48, "Width":49, "Height":49},
"ToArea": {"X":208, "Y":48, "Width":49, "Height":49},
"When": {
"StaticFoliage": "True",
}
}, ```
it's under "plants and bushes" this one in particular unless something else in the code is screwing it up. I'm not getting any errors in smapi regarding it either. bushes are applied everywhere else in the game just not ginger island
the bush on the bottom right should look like the one on the top left, but it doesnt and i dont know why @~@
i figure he made all the kitchens in a day, then a week later he made his morning coffee and had an absolute eureka moment
put the COFFEE. on the KITCHEN TILES
Try Tilesheets/bushes (iirc)
No, that big bush at least is from summer_outdoorsTileSheet
Do you happen to be testing this while it is spring on the mainland? I wonder if your Target is set as spring_outdoorsTilesheet while the island only ever uses summer.
peacefulend has been inactive, but I think that code is in here: https://github.com/Floogen/FashionSense/blob/development/FashionSense/Framework/UI/Components/SimpleSlider.cs#L34
I think you need to modify that code to properly hide the background behind the number on mobile
ah, thanks, i will check it
it's actually fall, and i tried specifically targeting summer_outdoorstilesheet and it didnt work
I'm having an issue with Content Patcher, specifically adding an emote. The custom emote gets added to the tilesheet correctly, but in game, the animation plays, then switches to red static instead of looping. I have triple checked that the size and position of the sprite is correct. What else could be causing the issue?
Hm, I don't see why it wouldn't work when setting the Target to summer_outdoorsTileSheet specifically. I'll try making a quick mod to test it and see if I can get it working.
I didn't know you could make custom emotes 
Oh… that might be the issue 😅
I just treated it as if it was a custom portrait, and it… mostly worked
I have 2 questions! 1: How can you make it so that custom companions don't show on the map using NPCMapLocations? 2: I have assigned all of the WorldPositions but when walking around Lilybrook, I am located on the map as being in the trees on the left. How do I omit the tree space on either side of the map from people walking there?
Huh wait parameter names ARE in the metadata
Gah
Been toooooo long
if I need to I can send you the entire mod
I'll just quickly test an incredibly basic edit first and if that works I'll grab your mod from you ^_^
thank you i appreciate it
Beautiful bush: ✅
10/10
Perfect. 10/10. No notes
Graphic design is my passion
This is the code for that
{
"LogName": "Recolour the bush",
"Action": "EditImage",
"Target": "Maps/summer_outdoorsTileSheet",
"FromFile": "assets/aba_bush.png",
"ToArea": {
"X": 208,
"Y": 0,
"Width": 48,
"Height": 48
}
}
Isn't that what ToArea is for?
does not work TToTT
What if you try removing all of your tokens and just hardcoding all the paths? Just for testing. Also, try commenting out the second patch. Just to really simplify it.
Oh right so you can get my beautiful bushes just by putting numbers into the json?
i dont know what any of those words mean ahaha i'm not great at coding just drawing....
Bump c:
Ignore what Atra and I are talking about, they're just having unrelated ideas lol
Well, slightly related ideas
imagine punching some desaturation values into a content.json and getting Nightshade At Home
If you send me what you've got, I'll get it working I think
Yeahhhh
Okay
ReShade At Home At Home, even
I go back to the IL mines
yo do you want to play stardew valley with me and @feral hill ?
so i hardcoded it, and one bush works now, but i'm also getting an error that the sizing is wrong (even though it isn't.. i don't think)
I will dm it
Not the place, my friend. Go to #1139016532966506576 if you want to find people to play with.
sorry ;3 we are new and we are l;ookuing for friends ._.
That's okay, just try to read channel descriptions in future. They're quite descriptive in this server. Hopefully you will find some people to play with in the channel that I linked :)
who are u bro
bro what r u pinging me for
stop followiung me aroun
creep
yo
SQUIDDIUM
Guys, this is not the place. Please take it to #town-square
this is not the channel y'all
This isn’t the right channel for this
my fualt
Is there a way to exclude an area of a world map and mark it as not walkable?
There are trees on the edges and I want them to not be “part” of the map
I’m probably not making sense 🫠
My character is appearing on the X, and I am actually standing on the O
Yep; see Modding:World map#Real-time positioning for more info on matching the world map and in-game positions.
Thank you! What does ExtendedTileData do?
There's a description of each field further down the page, but essentially it lets you snap the player's position to an inner border when they go past it.
In this case you probably just want to set the TileArea and MapPixelArea to the walkable area.
Thanks, will mess around with that now c:
hey eveyrone im here with my daily dumb newby question
public Trial? GetRandomTrial()
{
if (_trialsByCondition == null || _trialsByCondition.Count == 0)
this.Monitor.Log("No trials loaded", LogLevel.Error);
return null;
...}
I really dont understand the whole this.Monitor thing
why does it work in ModEntry, but it doesnt in other scripts?
TrialManager' does not contain a definition for 'Monitor' and no accessible extension method 'Monitor' accepting a first argument of type 'TrialManager' could be found (are you missing a using directive or an assembly reference?)
By reading the error I tought I had to define what Monitor is, but in ModEntry (wich is the example on the wiki) I dont have any definition of it so I dont understand
this.Monitor is just a reference to a property named Monitor on the current class. You don't need to define it in ModEntry because it extends the Mod class (the class ModEntry : Mod bit), and the Mod class defines it.
Oh alr, but than why cant I use it from other scripts? do I have to add custom funcs for each error in modentry and call those funcs from other scripts?
I assume you mean from another class. You'll need to define the property on that class and pass it in. For example:
public class TrialProvider
{
private readonly IMonitor Monitor;
public TrialProvider(IMonitor monitor)
{
this.Monitor = monitor;
}
public Trial? GetRandomTrial()
{
if (_trialsByCondition == null || _trialsByCondition.Count == 0)
this.Monitor.Log("No trials loaded", LogLevel.Error);
return null;
}
}
And then in your ModEntry class, you'd do something like this:
private TrialProvider TrialProvider = null!; // set in Entry
public override void Entry(IModHelper helper)
{
this.TrialProvider = new TrialProvider(this.Monitor);
...
// call methods on this.TrialProvider
}
Sorry to be a pain, but my player still isn't appearing in the correct place on the map. Here is the entry I've done: { "Id": "8BitAlien.Lilybrook_TopLeft", "LocationName": "8BitAlien.Lilybrook_Lilybrook", "TileArea": { "X": 6, "Y": 13, "Width": 33, "Height": 12 }, "MapPixelArea": { "X": 27, "Y": 23, "Width": 51, "Height": 39 } },
wow, thank you for the detailed explanation. Im still learnign c# and im not used to classes (at least the way they're used here), like in my TrialsManager script I have 1 single class TrialsManager wich contains all the functions it uses. Do you suggest splitting it in different classes?
Based on the _TopLeft in the ID, are you defining multiple areas for the location? That's not recommended if so, unless you have a significant mismatch between the shape on the world map vs in-game. You should have a single TileArea which covers the entire walkable location, and a MapPixelArea which matches the equivalent area on the world map. The game will automatically map positions between the two areas based on the ratio (e.g. if you're in the middle of the TileArea, you're in the middle of the MapPixelArea).
I haven't yet defined multiple areas, but that was my plan. I will do the entire TileArea entry now and see if that works!
It depends how complex your code logic is. You can certainly have everything in one class (and many simpler mods do), but splitting the code into multiple classes can make it more modular and easier to isolate. There isn't really a single answer, so you can start with whatever is easiest and refactor it later as you gain more experience with managing the project structure.
-# (some even do cursed behaviour like splitting the one class into multiple files with partial classes, please don't use partial classes for human authored code)
-# got it, using the file scope for everything
most of my mods never actually grow out of a single file, though mosst of these would have a second static class in the file for harmony patches
-# got it, put every individual method in its own file using a partial class
if i'm making a void room for an NPC to be in when not in a useful location, do i need to create an empty map for it? or is there a way to not load a map or load a null one or something?
That is somewhat a description of what FTM was at one point, was easier to view in ILSpy than github
(are we inventing JDSL from first principles in here? /lh)
I have actually done this for something.
erm I already have 11 files 😩
In Cloudy Skies, all my various trigger actions I register are in a Triggers class, but split into separate files, one per command.
and theres more to come as I only started working on trials
I must be doing something wrong, it's still not working 😦
Hence, instead of Triggers.cs file I have
Personally, I find this better to work with.
(This is veering a bit into #programmers-off-topic.)
definetly looks more readable/accessible/organized
Does my entry look okay for WorldPositions? { "Id": "Lilybrook", "LocationName": "8BitAlien.Lilybrook_Lilybrook", "TileArea": { "X": 6, "Y": 7, "Width": 107, "Height": 93 }, "MapPixelArea": { "X": 28, "Y": 13, "Width": 88, "Height": 105 } },
The format seems fine. What does it actually do in-game? Do you see the player marker moving around correctly on the world map, or does it stay in a specific spot? If you run debug worldMapPosition while on the farm, what does it show?
That's good to know. The player is moving a fair bit ahead in game and dragging behind on the map.
From left to right
It says this: The player is currently at 8BitAlien.Lilybrook_Lilybrook (15, 17).
This matches region '8BitAlien.Lilybrook', area 'Lilybrook', and map position '8BitAlien.Lilybrook_Lilybrook'.
The position's pixel area is {X:0 Y:0 Width:532 Height:472}, with the player at position {X:66.5 Y:80.24} (position ratio: {X:0.125 Y:0.17}).
Scroll text: Lilybrook.
So most of it seems to be working fine. The problematic bit is probably "position's pixel area is {X:0 Y:0 Width:532 Height:472}", which sounds like the whole map. Did you set the PixelArea field on the MapAreas entry?
It's currently in WorldPositions
Try setting PixelArea on the MapAreas entry, and removing MapPixelArea from the position (it defaults to the area's value).
So should I remove the entry entirely from WorldPositions and add it to map areas instead?
Do you mean remove the MapPixelArea field? If so, yep.
And now this is under MapAreas. Does it look correct? { "Id": "Lilybrook", "PixelArea": { "X": 28, "Y": 13, "Width": 88, "Height": 105 } },
You'd still need the WorldPositions field for that map area, but the PixelArea seems correct.
This is under WorldPositionsnow { "Id": "Lilybrook", "LocationName": "8BitAlien.Lilybrook_Lilybrook", "TileArea": { "X": 6, "Y": 7, "Width": 107, "Height": 93 }, },




