#making-mods-general
1 messages · Page 219 of 1
https://staticdelivery.nexusmods.com/mods/1303/images/17875/17875-1737588395-149474747.png
https://staticdelivery.nexusmods.com/mods/1303/images/9347/9347-1629588783-235534910.png
https://staticdelivery.nexusmods.com/mods/1303/images/8844/8844-1622499254-1530982901.png
https://staticdelivery.nexusmods.com/mods/1303/images/9139/9139-1626746494-436696014.png
https://staticdelivery.nexusmods.com/mods/1303/images/18317/18317-1739239499-844713544.jpeg
Is kind of my standard size for my farms 
just stick some iridescent blocks along the borders, ez 
Woah, those are pretty amazing. They could fit modded towns for sure
im currently staring down my asset png in dismay
Oh, i need to get back to making my custom assets. I need to finish the house interior I’m working on
.choose i18n, config, docs
Choose result: i18n
Is it possible to mod in hugging friends without a framework as a dependency?
in C# definitely
the i18nifier is actually really good it even splits out mail title/text
there's already a mod for that
Which one is that?
one sec
Cool! A separate mod is needed though to posses both a spouse and roommate right?
yes, one of the poly mods
endertedi's poly mod let you say "you can only poly this char with another char" which i think is very cool
you can use it to restrict ur spouse + roommate combo if desired
guys i finally switched to rider
i can't believe i've been using visual studio for so long
I'm about ready to switch the other way around 
oh naur why 😭
Rider is being annoying and it sounds like vs is a little bit better about some things (like shared projects)
always worth a shot to try a few ides to find what best works for u
Never too late to switch to emacs
why are fences literally so cursed lmao
Hi everyone c: I'm working on creating messages for my map with right clicking. I have the property on the buildings layer, and formatted like so< Message "SJ_EJHome1" > but I cant get it to show up clickable in game
is there a simple mistake i could be making?
quite a few of them!
- is your tile object on the 🟪 Buildings layer?
- does your tile object have the property
Name: TileData? - are the
X,Y,Width,Heightproperties on your tile object set to multiples of 16?
I didn't name it tiledata!!!! Wow thank you for that
truly was losing it a little haha! super appreciated friend ❤️
no problem, do ask again if there's still any issues 
will do c:
bless u that was absolutely the issue, everything is running with no issues now!!!
stupid fence lol if I move the right set of verticals over, to match the corners, then it no longer aligns if it's just verticals
please fencing why are you like this
That was my PR, I don't think Pathos has merged it yet.
Nope. Not merged.
(Though I did see movement on the Data Layers API, so hooray for that!)
when its 1 pixel short of what i need it to bespace wise 😭
Does anyone know why the message "the legend would not be happy here" is popping up? Fish pond is cleared and I can't find an answer on google. Trying to make sure it's not a bug.
isn't there something about actually resetting the pond, not just fishing out all the fish?
Yes a button
I am about to try building a new pond, cause if it works with the new pond it is defenitely a bug, but I don't think that is the issue
can you put other types of fish in the pond?
Yea no problems there X|
did you build the pond in 1.5 or 1.6?
1.6
(i think it should work either way i'm just curious what hte root cause is)
Newly built pond didnt work either
do u have mods that change how this stuff works
is this on 1.6.15 with no other mods installed
1.6.15 with mods
the only way that text can pop up is if the fish is not a legal fish pond fish
check its context tags
kk
also is this for your own mod
Yea, I wanted to add some possible drops for the pond and I cant even get the fish in XD but my mod is not present as I thought it was the problem at first
I have a question.
I saw a mod earlier in Nexus called "They Stay with You", which is kind of like PurrplingCat's NPC Adventures.
I checked the mods out and found that the attack animation doesn't show the npcs swinging their weapons when attacking (melee attack).
Do you guys happen to know how I can add that in the mod so it would look more realistic when they attack?
Also is there anything specific for tags I should be looking for? They all look normal
yea you need to add a ProcAnimClip
Walk of life that happens
fish_pond_ignore
otherwise patch export your fish pond data
you can just make your own npc trinket mod though, the framework is for everyone 
otherwise editdata the appropriate ability
It was present but not anymore let me try a new test save
You need a skill in walk of life to put legendary fish in ponds.
This is not present in the tags btw
and ok it may be that my new test save is loading so about to find out
I'm surprised removing the mod wouldn't fix that tho
I dont know if that is your issue, but I had that problem with walk of life that's why I know you need a skill. I was very frustrated for a bit, till I figured it out.
Yea I would've lost my mind XD
Ok it is working on the new save, so Ill need to add the drops without walk of life and test with it afterwards, I think they have a compat for cjb cheats menu right?
Thank you!!!
I really appreciate this.
It does! Love when authors go the extra mile XD
oh yea you may find TextureExtra helpful
https://mushymato.github.io/TrinketTinker/guide/2-Variant.html
this basically let you append a extra spritesheet just for anim clips, so you don't have to touch the default one in Texture
wonderful ❤️
Thank you so much! I really appreciate your help.
I. I dont get fences
I just spent the last hour doing the same thing and suddenly
it works? it all lines up? after an hour of doing the same repetitive nudges????
At least it worked.
and now Ive found a new problem I cant solution my way out of because I cant nudge the sprite any further
HA got u
are you like
exploding then fences whenever you change things
this kind of terrain net object may have state saved to existing ones in the world
no, but I have to change between options in GMCM for it to take effect
like, typing it in the console? nah faster for me to open GMCM
shrug do what you want
my love/hate relationship with console commands bc i will manage to misspell the same word in 45 different ways untili get it right
I play on dual monitor with the game in windowed borderless so I'd either have to win tab out or go all the way over to the other taskbar to get the smapi console -- just faster for me to gmcm. plus I'm copy-pasting in SAI a lot right now so I'd keep losing the command
and also same
(you can up arrow key in the console to immediately re-type the last command you sent)
aaa i keep forgetting that
Now if you can only do that the chat window
is there a C# collection more suitable for caching stuff than dictionary
depends on your use case
i would like to keep strong refs to things in this case
I dont even know how to open the chat window lmao
but have ability to look things up by a key
in theory yes, but a lot of stuff internally will just have the dict anyway
its pretty much the most basic data structure you will use if you have key value data
look at the beauty, all lined up. only issue is vertical gates blend in heavily with the vertical pickets but eh, w/e
tries darkening outline pixels
i wonder if ppl r like, generally interested in a mod that gives you faster look ups for ALL_ITEMS with per item ITEM_CONTEXT_TAG
do people notice lag on big mod lists when opening shop
;l......................................................................................................................................................................................."
?
shrimp words
easy to measure
wise
Shrimply Feline
New quote added by chu2.718281828459045235360287471 as #6320 (https://discordapp.com/channels/137344473976799233/156109690059751424/1341591417746755616)
I instantly knew this was a cat or pet, because I have 6 of these menaces that do it
ive been quoted
...ofc there isn't one method still that does shop code
ah but the core of it is ShopMenu's cctr
the context for this special case is that i have mod that does item query ALL_ITEMS with per item ITEM_CONTEXT_TAG many many times to build the valid inputs to machines, so a while back i did the ez optimization of building a lookup between tags and items at data invalidate
but i didnt do this cache at item query level
I did start work on a dedicated performance optimization mod
currently it only fixes Data/AudioChanges being bad
the rest of my fixes are in smapi and cp itself
it mainly help mod lists with 9001 modded items
I like it, but if there is a vertical gate I don't see it... so yup, it blends in.
I defined it a little bit more, but that seems to be how it'll be for verticals because pickets
You could maybe add a latch that sticks out or something. Not that latch would be super visible. Also most people will probably remember where they put gates.
super quick question? any idea if outside of the ones i found thus far there's templates?? do most framework mods offer templates to set it up right?? im asking for not only art but also setting up the json files correctly. the only ones i found thus far that should be compatible with 1.6 is:
- FS HD Clothes Template by mio25683 on nexus mods
2.Seasonal outfit Template by AirynS on Nexus mods - Farm Type Template by OMEGAling on nexus mods
im wondering since i feel templates would streamline making mods for stardew valley and tbh? we need more stardew mods :3
maybe the crop creator for json and blank json asset template is compatible but im unsure
usually i offer examples instead of templates
Find a mod that does kind of what you want. Download it, and use it for reference. That's what I did when I started. Still do sometimes if I get lost or stuck.
ahhh
i get that i was just askin since, at least in my experience, things can be lost in translation and, again in my experience, i kinda learn alot quicker from visuals and being taught than trial by fire ;w;
but json is a text format
from my pov as someone who makes framework type mods
i rather you just make a mod using my framework lol
I really don't know what "visual" means when you're referring to something that's all text. /gen
than to make template
You would have to fill out a templet anyway, and replacing lines is not much different then replacing place holder text.
ahh mean a template can get the basis down
true true maybe it's just me still learning
But the CP does have examples in it's documentation. They are usually specific to what is being shown.
There are definitely some templates for certain modding bits on the modding wiki that people do find helpful, like for dialogue for NPCs and stuff. So if you made some (as a modding wiki page, not a Nexus download) I'm sure there would be people who found it helpful. The problem with making a template into a Nexus mod is that it makes it more difficult for it to be a community-maintained thing.
ohhh
Granted, sometimes they don't have examples when you really want one. But it does have alot.
true true it just takes at least a few reads to get it
the art part is alot easier than the coding part that's for sure
I found it the other way around, but I am not an artist. I actually have a bunch of mods I would make if I could do art. It is my biggest limiter at the moment.
Yeah I find the art to be way more difficult than the json, which for the most part is very straightforward for my brain.
ahh understandable
speakin of... thank god i caught it before it launched ;w; i accidentally made the required mod content patcher.... when it was meant for alternative textures ;w;
i mostly been drawing since i was a kid and while digital art is alot harder for me than pixel art im getting better by the day
tho is from me who learned how to draw singlehandedly cause the hype fixation was strong in me ;w;
sonic do be powerful yall
Making progress in design is weird, I look back at some maps I've made in the past and was so proud of, and look at them and go, "eh, they're okay." By my current standards.
true but still modding isn't easy and getting it to work? it feels amazing
it's not impossible but it's a learning curve
and everyone is at different skill levels with different things :3
Ye, there are times where I'm like, I don't know if there is more up to go, and then I go up lol
true true
Then again there are many aspects of modding I'm terrible at even still.
Actually I wouldn't say I'm terrible at them anymore, just not amazing, but not bad, 
Or just avoided them because it's annoying like events and dialogue
Can't really say I'm terrible at pixelart or content patcher anymore.
yeah i am still learning pixel art but it's to the point now i can look at my work but content patcher? it still confuses me and it seems i make alot of mistakes with it. thankfully the mods i got up seem to work?
i get no one starts knowing but lowkey? i feel dumb not catching it earlier ;w;
anyone ever felt like that?
Yup, I am feeling it right now with C#. It's not clicking for me so I am building knowledge in it way more slowly than pretty much anyone else in here who knows C# did and it's making me feel pretty stupid. I'm persevering because I know that anyone can learn anything given the time, resources, and determination. But it's definitely having an impact on my morale xD
true ;w; it really does
honestly if i didn't get the encouragement here? i would've given up by now
everyone starts at different spot 
Ye, cp structure always confused me for a long time, it felt like I was learning a new language and everytime I had to ask "how do I say x?"
Keep at it luv! It took me years to get anywhere with C#.... (Also, I still have my struggles with it at times). Just take it step by step, and make sure to make it fun! If there's no fun in it, your spirit might die. U got this!
Chu, I was paid to do programming before I had to quit due to disability xD
(Keep in mind a lot of us who do c# have been programming for literally decades)
I just really clicked with statistical programming and have really not clicked with program dev thus far. But I will!!!!
Kids, off my lawn. Please
wait, was i supposed to come into modding with decades of experience? did i accidentally lie on my modding resume
But yeah even with CP at first it was a lot of
for me but being in here and having the funky stuff explained has really smoothed that out.
yea you need 20+ years of SMAPI experiance
ah shit
its ok button just get a time traveler cert
And man it's fun learning all this new stuff 
You need to have at least two decades of c# experience
Please, let me know how collections were different in c#1
guess im quitting modding. its ok ill just have atra take over my mods
too late
Nooooooo
you fire me, you become the replacement
Atra I want BETAS to have 42 new GSQs by tomorrow plz
so true! i started learning c# but man is it hard
it's fun but it's hard
i'm something of a full stack developer. I work on png, json, and bbcode
dont you mean bbmarkdown
your jokes hit a little close to reality
Alternative joke: I'm a full stack developer (screenshot of a days worth of meetings)
(You're not actually retiring, right, Button?)
quick question? idk if this is a mod general or art.... but imma ask any idea if it's even possible to update this mod?
https://www.nexusmods.com/stardewvalley/mods/4688
any mod is updateable if someone wants to put in the work
i checked what version it was on based the last updated date and oh boy... that was in version 1.4
Modification permission ✅ but new tiles in 1.6 so
well it looks to be purely png files and a content pack
gotta fix all that
true but i gotta read through all the changes ;w;
all you need is to add the new files really
just open up some vanilla maps and see what tiles r not covered
Hi guys, I'm trying to change the AbigailGame class, using harmony in the SetupBinds function. But I'm having some problems, because the _binds variable is a private variable. Do you know how I can correctly set its value using Reflector? I couldn't do it.
Originally it is defined like this inside the function
_binds = new Dictionary<GameKeys, List<Keys>>();
_binds[GameKeys.MoveUp] = new List<Keys>(new Keys[1] { Keys.W });
_binds[GameKeys.MoveDown] = new List<Keys>(new Keys[1] { Keys.S });
_binds[GameKeys.MoveLeft] = new List<Keys>(new Keys[1] { Keys.A });
_binds[GameKeys.MoveRight] = new List<Keys>(new Keys[1] { Keys.D });
_binds[GameKeys.ShootUp] = new List<Keys>(new Keys[1] { Keys.Up });
_binds[GameKeys.ShootDown] = new List<Keys>(new Keys[1] { Keys.Down });
_binds[GameKeys.ShootLeft] = new List<Keys>(new Keys[1] { Keys.Left });
_binds[GameKeys.ShootRight] = new List<Keys>(new Keys[1] { Keys.Right });
_binds[GameKeys.UsePowerup] = new List<Keys>(new Keys[2]
{
Keys.Enter,
Keys.Space
});
_binds[GameKeys.Exit] = new List<Keys>(new Keys[1] { Keys.Escape });
dang meanwhile i've just been using AccessTools
it's what i get for not reading docs i suppose
I read it, but I didn't understand what to do, is there no example there?
you pass in ____binds the same way you pass in __instance
this is basically harmony doing reflection for you right
yeah (not that i actually know what it does under the hood but surely it uses reflection if it's private... right)
__instance.____binds
?
you pass ref ____binds as an argument to your harmony patch
have you used __instance or like __result before?
Yesish
(genuine question not snarky, just so i know what needs explaining)
But since they can emit for it it is faster
You guys are smarter than me, I didn't even understand the question. 😇
yeah harmony is a lot of IL emitting
private static bool SetupBinds_Prefix(AbigailGame __instance, ref ____binds) ?
it needs a type
(wrap code in ` brackets to make them show properly)
private static bool SetupBinds_Prefix(AbigailGame __instance, ref TYPE IDK ____binds) i believe
`like so`
ref Dictionary<GameKeys, List<Keys>> ____binds
The type or namespace name "____binds" cannot be found (are you missing a using clause or an assembly reference?)
you havent put a type
same way you'd write int 5 or string? whatever in your signature
thanks
four underscores is the new standard for variable naming 😤
But why so many?
harmony is set up such that injecting a private field into a harmony patch means the field must be prefixed with three underscores (see the docs button linked above). Since your field is named _binds, it means you end up with four
At least now we can do that, before it was just reflectors?
you can still use reflection, there's just no need to since harmony provides a shortcut
power of software libraries
i think its also years old
about 5
granted SMAPI didnt always use Harmony 2.x but its been a while
I'm trying to locate the sprite file, which shows the controls for the King of the Prairie game, but I can't find it, does anyone know?
pretty sure everything Prairie King related is in cursors
Make Prarie King even more difficult, make the player sprites and their bullets invisible
I dont play it as is? Why would you even suggest that? You are sick. 😂
because people complain that its hard, so we make it harder.
I'm just changing his controls, because someone on another server has no arrow keys on his keyboard, so I'm making a mod so he can play using other keys.
this is old and I don't know if you're still wanting this, but latest version of Extra Animal Config supports this!
OMG seriously!

Selph, you are amazing!
I'm definitely going to take advantage of it for Eggies
Hi trying to use solid foundations mod for item conversion but having issues with the minutes per conversion, it should take 40 mins in game to produce the item but after the first batch is produced it only takes 10 mins. Any help would be great!! Here is the code:
"ItemConversions":
[
{
"RequiredTags":
[
"id_(o)KatyDTK.CP.BreadLovers_BagelDough"
],
"RequiredCount": 1,
"MaxDailyConversions": 12,
"MinutesPerConversion": 40,
"TakeOnlyRequiredFromStack": true,
"RefreshMaxDailyConversions": true,
"SourceChest": "Input",
"DestinationChest": "Output",
"ProducedItems":
[
{
"ItemID": "(O)KatyDTK.CP.BreadLovers_Bagel",
"MinCount": 1,
"MaxCount":1,
"Chance": 1.0,
"Condition": null
}
]
},
]
!embedcode
You can embed code in Discord using a series of three ` :
```
Your code can go here
Even if not a haiku
Just an example
```
For syntax highlighting, add the language code on the same line as the first
``` (with no space, like ```json).
The usual codes are cs (C#) and json.
oh thanks
Like this?
I've never used Solid Foundations, but looking at the documentation, it appears as though you've done it correctly?
thats what i thought too, but it only works for the first batch, and then everything else after would just be done within 10 minutes not matter the stack
That might be a bug worth reporting to Peace.
oh how would i do that actually
Have you tried removing the "MaxDailyConversion" and seeing if it works at 40 min intervals?
And you could probably report an issue on the GitHub itself
hmm i havent taken out the max daily conversion lemme try that
The way I'm reading the docs, it sounds like it might convert up to 12 times every 40 in-game minutes, since you've set the max
Definitely worth playing around with some of the parameters to see
HHmm
And you don't have any other mods installed that could play a factor?
nothing related to new buildings or creafting mods , just visual and SVE
I would advise testing different settings, and if it still doesn't work as expected, report an issue on the repo
yeah removing the mac daily conversion doesnt change anything for the batches after the first one, it just spits it out in 10 mins
thanks 😄 i'll try and if nothign works i'll report the bug

Can anyone tell me what this SDV Expanded error means? https://smapi.io/log/9c1c0fdb749a492ea67da7e3c15bf85b
Log Info: SMAPI 4.1.10 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home, with 12 C# mods and 56 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
this looks like a C# error from SVE's C# portion
StardewValleyExpanded.FireflySpawner
report it to SVE server maybe?
So it's nothing I've caused? Will it affect my game negatively?
I didn’t know where else to put this
!mh
For help with modding issues, please ask in #1272025932932055121! When asking for assistance there, sharing an error log will help others identify your issue (see https://smapi.io/log for instructions).
in there
Thank you
hey? anyone mind reviewing my Alternative textures json in my thread?
it wouldn't really show for me at all and tbh i don't know alternative textures.
https://discord.com/channels/137344473976799233/1338626203552186460 in case anyone wanna pop in
I'm working on a building that has item conversions (a distillery), and because the items I want converted are part of different mods I'm trying to patch in item conversions for the custom building from each mod that contains those items. One of them, which is the mod that adds the distillery, is working, though it's worth mentioning that the building is added in one entry while it's a completely separate entry that then edits the item conversion field of the building; the other mod, which also edits the item conversion field of that same building, keeps giving the error that it "Can't apply data patch (...) to Data/Buildings: the field "Distillery" doesn't match an existing target".
Any idea what's wrong? If a mod adds a building to Data/Buildings, other mods should also be able to edit it in Data/Buildings, correct?
are you not doing all of your distillery stuff within the same mod?
oh, i missed the "the other mod" part
in that case, are the dependencies correct?
In the manifest?
yes
Well.
That solved that issue but has created a new one; the conversions from the second mod work, but the conversions from the first don't
i assume the error is different, but if it is, i dont know building stuff. but if you post your log and json(s) here someone else might be able to chime in
hi is Updating a mod to a new version of SDV complicated ?
1.6 seems to break my Favorite mod so i wanted to Update the mod hmmm...
what mod
Machine Augmentors
well, the source code is available. so you can fix it yourself with its open perms. might be difficult if you dont know C# at all
it adds Update cards that rarly drops from Monsters or can be buyed from Traveling merchant
i would try it but if i dont know where to start its a bit hard
dont even know wehre to look
!yellowbook
A good book for learning c# is https://www.robmiles.com/c-yellow-book
this will help teach C#. thats really just kinda what you have to do if you want to work with C# modsd
is learn C#
thx i think it would be a lot of affort to learn C# just to Update one Mod but im interested in modding so maybe i look on that later THX for the help
Figured it out, both mods were trying to patch in the whole "ItemConversions" list, rather than entries into the list; added "ItemConversions" to the TargetField and it works now.
Thank you for pointing out the Dependencies thing, that was a separate issue that also was breaking things.
Rainbow....a bow that once shot causes the rain weather effect.
Rolls away, giggling at pun.
is anything actually broken in this mod? the files tab on nexus says there's a 1.6 update with the latest version
theres 2 people in the comments saying it broke after 1.6.9 dropped
ah i see
yeah sadly it dont work SMAPI just say its need an Update
petition for there to be a vent channel here (i need to cry about how hard managing warps is)
Hi all! I'm trying to make an edit to a mod on Nexus, simply replacing 1 tile in Tiled, but I ran into an issue - the tile I placed down (from the same tilesheet) is not transparent? Any ideas on how to make it so? Using the crystal from spring_outdoorTileSheet
For transparency, I am editing https://www.nexusmods.com/stardewvalley/mods/21905
Specifically this tile
I tried looking up online for some tutorials or tips, but no luck with specifics to Stardew
- Did you place the crystal on a layer that isn't
Back? else, - If you made the edit in a different .tmx file, did you set the patch mode to
Overlay?
- I think I placed it on
Buildings? - I don't know what that means :D
i can't help further if you dont show the .tmx file. You can see clearer what items are on which individual layer by pressing H
I can show whatevers needed, I can share the tmx files themselves as well, just don't know what you need
yeah and as i said i can't help you if you don't show me the tmx files, so show either a picture of your tiled window or put the .tmx file here 
Oh, you're Kisaa, I love your mods btw :D
Appears it only adds a singlular tile to the Bus Stop
Right now the only image is on the Buildings layer
(as it was before, but it was a solid tile)
so the item is on Buildings then. and you are applying the edit via content patcher?
If so please upload your content.json here and follow the instructions listed
Im super new to this and kinda learning while fixing something that bugged me, I just copied the entire mod and tweaked it, idk how to send an edit strictly for this part
I see
The content.json?
Shows an errror for AddTile, but it does add it so that works?
Should I be displaying the art in Front?
Wait, sorry. Are you planning to upload this?
Depends if I am allowed
I am editing this for me, but others may want it so idk what to do tbh, I moreso want help to fix for myself, only intended to share for others if that was okay
Its uploaded right now just so I could understand how to get it packaged and delivered/working - Im managing the modpack im using through nexus so this seemed easier :p
no, it should stay in the Buildings layer because you dont want the player to be able to walk over the crystal. According to the CP docs map patches are by default have the PatchMode ReplaceByLayer, which means the layers in patch map you made are applied to the same layers in the original map.
Because your patch map's Back layer is empty, the ground in the original map is also empty. So depending on the structure of the original map's layers, you need to either:
- Add a
"PatchMode": "Overlay"line to yourEditMapaction block or - Fill in the
Backlayer in the patch map you made (Porta.tmx).
Nexus kept revreing my changes to the OG mod
So the back layer would be the grass its sitting on in Bus Stop?
eyup
also, the permissions of the mod you are editing don't allow you to upload your edit unless you ask permission first.
Wow, thank you for that
it's best practice to read the permissions section of mods you use or make personal edits to.
It wasn't my intention to redistribute without permission, I just wanted to get it working and unsderstand the process - thanks so much for your help I will be delisting the mod now and messaging the author
Is this sufficient?
actually, i believe you should take it down entirely instead of just hiding it.
"ask first" does not equal "if permission (still) isnt given for whatever reason, i can upload/ keep the mod page up anyways"
If I to add one thing: even if you did get permission, please make it a patch just for the assets you edited, and don't reupload the entire mod.
if you need to figure out how nexus works, there's no need to publish the mod page, you can keep it as a draft anyways
Yeah, you could keep it up but hidden like it is now, but it might be a little redundant if permission never comes?
That would be ideal, I am just now dipping my toe into Stardew modding
this is a little pedantic, but what dolphin said is not 'ideal', it's what you should do 95% of the time (exceptions depending on if a mod and its assets are open source).
the mod assets we are talking about here is the original map files.
and the content files too
I sent the author a DM
if you do get permission you can upload the patch map you made and the EditMap action, but not everything else in the original mod
They commented on their mod just the other day so hopeful
I'll cross the bridge when I come to it now
This has inspired me to maybe pursue making my own mod now :D
Now that you should definitely do!
Reading the wiki or event preconditions, you can do /w rainy/, right? Does that mean it encompasses both rain and storm?
Oui
Would that work for GSQ or When field, too?
Not sure
During the alpha it very much didnt
I can't remember if it ended up changing or not, but I think GSQ is very specific still
While the precondition is more along the lines of sunny or not sunny (misleadingly called rainy)
I see I see. Thank you!
Hi it me again. [I may be overthinking my plan here so please tell me if there is something easier to handle this]
If i were to write a function which is supposed to fire after a NPC received a gift (i found the receivedGift Method) to work with the reactions of the NPC (i.e they liked the gift and friendship changed and so on), do i write a Harmony Postfix for the receiveGift Method?
hi everyone! some may know me some others may not know me. before I came asking for help to do with the heart event code that I was doing before. I found someone to helped me with the code and got the event working for me! but then I saw the event. it looks great but....I felt I was imposing on the farmers house. I think because I played stardew valley a lot as a farmer you get used to the farmhouse being yours. so I went back and got up my old map of an outside house I did. I changed it to the house that I want. and now I am working to get the house up and trying to test it to get it right. thats what I am doing now. some of you guys were right about getting my house done. I thought to let the guys that sort of know me to know about the new updates. XD
If you want it to be every gift then yea that's the place, can perhaps do a prefix + postfix with state to track how much friendship is changed
This is also a trigger in BETAS if u wanna use that
hello! I know my content.json is a lot, but I can't for the life of me figure out what I'm missing on line 218, here's the link if anyone can look at it, thank you!! https://smapi.io/json/content-patcher/94c5da499bf246b68e3a6116c4f14ab9
You're technically not missing anything! Get rid of the } on line 218, and you'll be good to go.
Oh, nope, also one on line 411 and 412.
!json
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.
?
Use one of the text editors with json support
These will give you squiggles at where you actually need to fix
thank you!!
Hey everyone, i need help for the translation of my mod, i create a mod that add a new object, and for the DisplayName and the Description of the object i use this.Helper.Translation.Get("Name") (and "Description" for description), i have also a folder named i18n with a default.json et a fr.json containing for both the same content (but translate) :
{
"Name": "Boombox",
"Description": "A boombox to play custom music"
}
When my game is in french, its displaying the english text i dont understand
The name is captured when the object is created. You need to use a String Token for the translation to change for existing objects.
The only way for an object to get an updated name is for you to delete it and make a new one.
If you have unpacked the game data, look at Strings/Objects.json that's where the name should go
And then for Data/Objects the name is "[LocalizedText Strings\\Objects:YourObject_Name]"
So i should update the objects.json and the Objects.fr-FR.json in my code and use localized text ?
You put the name/description into Strings/Objects and use the token in Data/Objects
For example:
Data/Objects
"213": {
"Name": "Fish Taco",
"DisplayName": "[LocalizedText Strings\\Objects:FishTaco_Name]",
"Description": "[LocalizedText Strings\\Objects:FishTaco_Description]",
And:
Strings/Objects
"FishTaco_Name": "Fish Taco",
"FishTaco_Description": "It smells delicious.",
Strings/Objects can use your this.Helper.Translation.Get(...)
I have my OnAssetRequested function here :
private void OnAssetRequested(object? sender, AssetRequestedEventArgs e)
{
if (e.NameWithoutLocale.IsEquivalentTo("Data/Objects"))
{
e.Edit(asset =>
{
var data = asset.AsDictionary<string, ObjectData>().Data;
data["1234"] = new ObjectData
{
Name = "Boombox",
DisplayName = this.Helper.Translation.Get("Name"),
Description = this.Helper.Translation.Get("Description"),
Type = "Basic",
Category = -99,
Texture = "Mods/Flamy.Boombox/Boombox",
SpriteIndex = 0,
Edibility = -300,
CanBeGivenAsGift = false,
CanBeTrashed = false,
ExcludeFromRandomSale = true
};
}, AssetEditPriority.Default);
}
if (c
{
e.LoadFromModFile<Texture2D>("assets/Boombox.png", AssetLoadPriority.Medium);
}
}
So i should put a if (e.NameWithoutLocale.IsEquivalentTo("String/Objects"))
And the edit the dictionnary to add the string i want ? With this method i should also add a if for each language ? Or am i missing something ?
Yeah so DisplayName = this.Helper.Translation.Get("Name") isn't right
It should be DisplayName = "[LocalizedText Strings\\Objects:Boombox_Name]"
And then you also need to edit if(e.NameWithoutLocale.IsEquivalentto("Strings/Objects") to add the name there
Here are the wiki docs about it, there's not much written, but tokens are how the game looks up the translated text:
https://stardewvalleywiki.com/Modding:Tokenizable_strings
https://stardewvalleywiki.com/Modding:Common_data_field_types#Translation_keys
How are you changing the language
In the main menu
But i need to have a if for each language ? like :
if(e.NameWithoutLocale.IsEquivalentto("Strings/Objects")
if(e.NameWithoutLocale.IsEquivalentto("Strings/Objects.fr-FR")
Etc...
Well you wouldnt get fr-FR with NameWithoutLocale, since that's the locale
Not for each language, SMAPI can just target Strings/Objects and use Helper.TranslationGet to affect all of them
What's the difference with and without locale ?
NameWithoutLocale means that as soon as the language changes, you'll be updating that regardless of the language chosen
So SMAPI translation takes over
Haaaaa okok thanks
I've never compiled a mod for this game before and I'm not familiar with C#, but I would like to learn. Mostly because there is a mod that I'm hoping to fix.
PelicanTTS, I found a 1.6 version but there is a bug that makes it stop working when the Lookup Anything mod is installed.
https://smapi.io/log/b5ec25719f8b43a99edb00fb2bed762f?Sections=ModsList
so if someone could help me that would be great.
Log Info: SMAPI 4.1.10 with SDV 1.6.15 build 24356 on Microsoft Windows 10 Pro, with 2 C# mods and 0 content packs.
It looks like this mod patches lookup anything, and whatever it patched had changed signature
ok. I'm not sure what that means.
Harmony is a framework for patching .NET code, allowing you to take any portion of the game's logic and insert or substitute your own. This gives you more flexibility and control than SMAPI helpers and events, at the cost of being typically more complex and difficult to use safely and correctly, and more likely to break with a future update of the game and/or SMAPI.
If you are trying to do something that isn't possible or practical with SMAPI alone, then Harmony is usually the solution.
For more information, refer to the following:
- Harmony Modder Guide - Intro, Use Cases, Initial Setup
- Tutorial: Harmony Patching - Types of patches and code examples
- Decompiling Stardew Valley - For finding methods to patch
so this is a fix for it? so I just need to learn how to compile it. can you help me?
You will need to rewrite the patch code 
I can't help you because I don't knw what the mod does or what the patch code looks like
PelicanTTS is just a Text-To-Speech Mod
Depending on what you want the mod for, you could see if stardew access works for you?
Need screen reader setup tho
As for updating pelicantts, you really do have to show the part of code that's trying to patch lookup anything for us to give any useful help
its not that I cant read or something I just really enjoy having PelicanTTS in my game because it gives each character their own voice. It's just more fun that way. More immersive.
by chance is the person who posted this in here?
This is where pelican tts is patching lookup anything, it's iterating all the methods of drawtexthelper
You need to handle InitIfNeeded(), which should probably not be patched at all
!startmodding
Making mods can be broadly divided into two categories:
- Content packs are formatted text files, and don't need any programming knowledge. They can add/edit NPCs, maps, new items, shops, and more. To get started, see the list of framework mods, the wiki tutorial for Content Patcher, and there might be relevant guides on the tutorial wiki.
- C# mods use programming code to change fundamental game mechanics. See getting started with C# modding.
Usually it’s easier to start with making content packs, since you don't need to learn programming.
Refer to the C# guide for setting up stuff to build C# mods
To be clear, updating PelicanTTS is not just about learning how to hit the Compile button, but understanding the fundamentals of C# programming, and the intricacies of both Stardew Valley and SMAPI.
sometimes something breaks because how the code works changed
I haven't seen anyone like that around here
yea that's why i came here to learn
On the offchance they have the modder role, try cross-referencing with [[Modding:Community]]?
(Is this how the farm computer works?
)
thank you.. they have a SDV custom avi.. so trying here was an attempt to get a hold of them
that's from the farmer portrait creator website
i would love to.. but there is a possibility their Discord and Nexus names will not match
i know 
But this page will have both on it, so if they linked their Nexus, it should have their Discord right there too.
No results for "hats" anyway though, so probably not...
yeah.. not a part of this community.. mmkay.. just have to wait for them to notice
Can someone explain to me what the price variable means in the ObjectData class? The comment says "The price when sold by the player. This is not the price when bought from a shop." I got the object data for a parsnip which has a price of 10 when printed in the console. But when I actually sold the crop, it was 35. This is on a new save file. Is there an more accurate way of getting the selling price of any item. Ik there's a lot of factors that go into the selling price, but I would prefer if this part of my mod wasn't hard coded for the countless items in the game
did you spawn new parsnips to test
just tried that. it's still 10. I also grew them from their seeds, and seem to be getting the same results
What about the quality of the parsnip?
There is probably a multiplier for silver/gold/iridium
I just realized, I was accidnelty looking at the seed object rather than the crop. My bad. Follow up question: Is there a way to force to game to load the object data? I currently have this check to avoid a null reference exception. Is there a way to guarantee the ObjectData object is not null, regardless of the item I am looking up?
ObjectData parsnipData;
Game1.objectData.TryGetValue(parsnipId, out parsnipData);
if (parsnipData == null)
{
actions.Add(new Action("parsnipData is null"));
}
else
{
actions.Add(new Action($"parsnipData price: {parsnipData.Price}"));
}
are you doing this before the save is loaded
no
What all changes have you made to the object data (if any) or are you just loading the data?
I believe there were other times during single player when the object was null. But the only time I can reproduce null is when I was in multiplayer as a guest. Haven't tested it when I was the host
No changes. I'm just looking at the data
That really shouldn't be null anytime after GameLaunched assuming your parsnipId is set and correct
Did you try ItemRegistry.GetData
that also reads from Game1.objectData under the hood
I concur with matt that that shouldnt ever be null if your item id is correct
Ok, I'll try to write down the steps if that does happen to me. Thanks.
Am I just dumb for not being able to understand Object Oriented programing?
I think you picked a fairly sophisticated mod to try learning C# in, if you're trying to update PelicanTTS
programing and hell even frameworks like content patcher aren't easy to learn
It's a skill to learn, step at a time
There are a lot easier ways to get started, you're kind of jumping right into the fire
but i do admire they're tryin to update pelican tts
Platonymous mods are some of the more complicated ones that have been made for SDV
i assume it's to add a text to speach mod to make stardew accessible to those who are blind/vision impaired?
i honestly found that mod to be interesting
I was under impression that it mostly works though
Just has a harmony issue with lookup anything
Still, patching in general especially other mods is a higher learning curve than just learning C# which is where they are at as far as what's been indicated
I feel like I could easily Make a mod like PelicanTTS if I could write it in a functional language like Python.
So it's not that you're not learning OOP, but you're also trying to learn some more advanced concepts
Like OOP alone isn't too difficult, but modding, harmony patches, etc. can get tricky
What I mean is you shouldn't be too discouraged by it because even intermediate modders might struggle to do what you're attempting to do
so far OOP is the hardest part.
just want to make sure I'm understanding this. In ShopLocation, is itemsFromPlayerToSell a list of items the shop keeper is selling to the player, or is that the list of items that the keeper will buy from the player? I looked at that for SeedShop and FishShop, but they both seem to be empty lists even when I'm in the store. I'm trying to get a list of all the items the keeper is currently selling to the player
iirc that's for when you sell for example a parsnip and then the next day Pierre has that parsnip for sale
So how would I get items like the parsnip, potato, and green bean seeds for sale from both the pierre's shop and any other shop that has those items for sale?
you can just load Data/Shops
im sure the game caches that somewhere too but I don't know where. but i know just loading the content will work
Is there a program to edit a .dll mod? I want to change one number in the mod and not sure how?
sorry, where is this? I'm doing this all through C#. I'm looking through Game1 and can't find anything called shopData or anything like that
you load it through the content pipeline
I don't know what that means
There's a few ways
- Find the source code, compile it with your change
- Decompile the dll, fix it up so it compiles, do your change
- Harmony the other mod
(note that number 2 is not as easy as it sounds, especially as a mod gets bigger and bigger)
As for the program to edit you probably want to use an IDE for C#
Visual studio and rider r the main ones
for the record that content pipeline stuff I linked on that wiki page is really how you should be looking at everything unless you are only doing reads. Absolutely never, never never write to or change anything directly in Game1.objectData or any other cache
There's a whole lot of people playing the android mobile version on PC emulators... And consequentually piles of report logs. Why would someone play hte game on an android emulator on a pc?
How could you tell it's an emulator
On the positive side, i got my first Harmony Prefix and Postfix to work, so yay. On the negative, the feature i was working on is apparently already in vanilla stardew... My 20hrs over idk 5 years or more are showing 
The logs show the path to a android emulator filepath.
Source code is not listed. It is the "stay up late" mod. I want to increase stamina I lose each time it ticks. What would be the easiest?
Easiest is find alternative mod of similar concept tbh
if there is no source listed then the question becomes "how well do you understand C#?"
2 + dnSpy has worked really well for me, it handles the decompile + edit + compile all together
if you mean it says /storage/emulated/0, that's normal
I guess I would personally decompile mod regardless just to see what is needed to change
I wish there was a nice easy way to play Stardew with mods in an android emulator. I imagine it'd make mod testing a lot less annoying.
Then decide if i want to just harmony the thing or actually make new dll, it sounds like the mod not too big at least
does just installing smapi not work?
Every emulator I tried was throwing exceptions when I tried using the SMAPI for Android app to actually start the game, I gave up after a couple
public override void performTenMinuteUpdate(int timeOfDay)
{
base.performTenMinuteUpdate(timeOfDay);
if (Game1.currentLocation is AspenMountainTop)
Game1.changeMusicTrack("sadpiano", track_interruptable: false);
if (Game1.currentLocation is AspenMountainTop)
{
int oxytankint = 11;// ExternalAPIs.JA.GetObjectId("OxyTank");
string oxytank = Convert.ToString(oxytankint);
if (!Game1.player.Items.ContainsId(oxytank, 1))
Game1.player.takeDamage(30, false, null);
}
}```
Use the SMAPI ten minute update event to do this (this is from one of my mods).
It'd be nice if we have android decompile at least, to see what is up
Android is such a minor niche and even if I did get it running, the lack of being able to debug things would make development so annoying. I'll let someone else break that particular ground
But i have -2 idea how to decompile libaot stuff into something readable
No, it has something about android, and they all end up using some Mobile Spacecore to fix half their problems.
There is an unofficial port of SMAPI for Stardew 1.6 to Android. Please see the wiki instructions for more information.
IMPORTANT: This is a highly experimental build and may be prone to glitches, bugs, or incompatibilities. We are not able to provide support if you run into trouble or compatibility issues; please use the discord linked on the Android SMAPI github.
Do not harass mod authors to make Android specific compatibility patches.
so how do you know it's emulated from the log
Spacecore as it is does not run on android so android smapi include some patch fix for it
/storage/emulated/0/Android/data/abc.smapi.gameloader/files Here is there path. Yes, the vanilla spacecore breaks, throwing an error in my mod, then, they install some SpacecoreMobile thing that is branched on Github, and it works...
yeah that's how android works
that's the normal path for android, on real hardware and emulated
Yeah, the /storage/emulated bit has nothing to do with android running in an emulator. Android uses an emulated/proxy filesystem for user storage.
Basically, I am asking because I don't know why someone would use android on a PC, when they could just use regular PC version. Unless, the Android emuated version is the most stable pirate version. I'm just trying to not abet mass piracy.
we're telling you they are not using android on a pc
No shot it's the most stable pirate version when the PC version has no drm
Ok! are they using Android on a phone and sending me the log somehow?
I see! Somehow, in my mind, sending a log on the phone was not possible...
Thanks loves! I feel better about helping these errors now!
yep, I'm not modifying any of the content. So I figured looking through cahced data would be the best for now. But if that's not an option, I'll use the content. Though I'm not sure how I'm supposed to do this as I'm unsure what the returned value of the objects. This code got me this error.
helper.ModContent.Load<ShopLocation>("Data/Shops"); //'Failed loading asset 'Data/Shops' from SMAPI\hawker.perfectionistinteractiveguide: the specified path doesn't exist.'
Also is there any documentation on where I can find specific information about the game. Ik I will want to look at various things through the game, such as animals, npcs, weapons etc. I saw that there are cached data for that, but I want to try and be a bit more independent and not try and spam this channel whenever I have a question.
- have you unpacked your files? there is no documentation for the game outside the wiki bc its a game and was not made with documentation of its internals in mind
- you're not using the right content loader. ModContent loads a file from your mod folder.
- Data/Shops is a Dictionary<string, ShopData>
(you may sometimes find xmldoc comments in the decompile, but theres no like, one big API reference for all the vanilla game stuff)
(DataLoader.Shops)
Robin's got a follower from a tree she cut down
[Test Example for a Follower framework]
- idk what that means (im guessing decompilation), so probably not
- This may be true. When you said helper, I thought meant
IModHelperthat is parametrized in theEntrymethod. I'm unsure if there's another I should be using - I assume #2 is the issue as I just tired changing the T value to the dictionary and still getting the exception
!unpack this will at least help you know what to expect for a lot of the content types
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!
Just to bring more attention to this, never load any asset from Data/ without using the DataLoader class's static methods. Just don't do it. That way leads madness and incorrect types breaking everything
for 2, i did mean IModHelper. theres one for GameContent, not just ModContent
So don't do cs helper.ModContent.Load<ShopLocation>("Data/Shops") instead, do: cs DataLoader.Shops(Game1.content)
well ModContent.Load wouldnt work as m entioned anyway, but ive never had an issue just doing Game1.content.Load when ive needed vanilla content
im not saying the dataloader isnt useful, just that i forget its there a lot but never run into issue without it
Say 1.7 comes out and the content type of something changes.
-
You're using
content.Load<Dictionary<string, SomeType>>("Data/BlahBlah")and oops, your type is broken. But you need to go find where it's broken. It might not necessarily break compilation. It might be a runtime problem. -
You're using
DataLoader.BlahBlah(Game1.content)and the type is just updated. You have a compilation error showing you exactly what to fix right away.
Just use DataLoader for new stuff, lol
Koala 
What is the scope of this particular framework? Do you want to do custom companion like things?
that doesnt seem like a particularly important hypothetical situation to worry about if you ask me, but as always someone else values may differ from mine
or rather it doesnt seem important enough to warrant a "Never do this," unlike say "Never write to Game1.objectData"
I think it's good practice to use DataLoader for base game stuff probably, if you don't want to do what no more lag did
But it won't explode if u r give it right type
(Did No More Lag actually make things explode for any users or was that just a hypothetical thing with their dumb "let's load this as an object" code?)
good practice, sure, but "Never do it, madness and incorrect types breaking everything"?
im pretty sure No More Lag did actually break a lot of shit
It explodes content patcher specifically
By loading with object
It was a 1 in 3 thing, depending on whether cp got to load first
Anyways, I think saying "never do this" is fine. There are strongly typed helper methods that were added to the game for the specific purpose of being a better alternative to people using content.Load<T>(path) incorrectly. Because people have done that and it has caused issues.
It is the Best Practice to use that, and there is no benefit to not using them.
Right now my scope is to have things follow NPCs / the farmer, and maybe other characters. As for the specifics / what those things might do I'm not sure! Will likely just add more as ideas come
It's not wrong to not use it, but it's not not wrong to not not use it /lh
pathos even reached out in the comments section
Wait, I might have miscounted my negatives...
A shortcut I did for trinket companions is to save the position of the companion to a queue, to repeat later for effect of having "multiple" companions.
I think it can work pretty well NPC following entities too, so that they don't need their own path finder
Something else to be aware of is the whole farmhand ghost location business
(I can confirm I’ve seen stable PC pirated versions, unfortunately. Also stable android pirated versions for that matter)
That quirk is probably why custom companions dont let their entities path out of location
I'm doing something very similar actually 😮 Taking belated "owner" positions and stuff
Yeah i just wasn't sure bc koala didn't follow grid exactly 
Whats the farmhand ghost location? 
when you are farm hand the current location is fake
farmhands do not know about all the maps or other NPCs
unless they are in an actively loaded location
Oh that should be okay, though I'll keep it in mind for when I get to MP
if an NPC is in the Mountain and the farmhand is on the beach, from the farmhands game perspective, the NPC might still actually be in their house in town
if you ask the farmhand for the NPCs coordinates or where their follower is, it will tell you "in their house, ofc"
I think if u r just doing this as visual thing it might be ok that the follower cease to exist when u r not in same map 
So they r just fancy critters in the end
The only downside of that would be that if you went into a new map the followers wouldn't "know" where should be, like if I went into robins at 10 on a wednesday right now the koala will appear a tile top left above her, because she moved from that direction.
how would i make a config schema? i wanna know for future reference
I think in the end they'll feel like critters, maybe with some sounds and such. I don't know what else they would do at this time
You should give the an interact action imo
cool cool! thank you!
e.g. When player press button while their bounding box overlaps with the follower, run the content pack supplied trigger and/or trigger action
and this goes in the content json right?
yes
I have detailed thoughts about this bc i coincidentally did this exact feature 2 weeks ago
just wonderin! thank you!
If you wanted to make it I don't mind
If you didn't and wanted to spill some of those detailed thoughts I also wouldn't mind 
Hm not really, i think trinkets code is kind of hard tied to the owner being a player
And it has to remain that way for the whole ability system to function
Certainly the companion control stuff is reusable but hey it's MIT
I'm trying to patch FarmAnimal data after SVE in order to change its Camel, Goose and Bear entries, but for some reason when my AssetEditor is called, the SVE animals are not in the asset data, even though I've set priority to late.
I can't seem to figure out why my patch is running before SVE..
(this is in C# btw)
Did you try having optional dependency
I did, yea
And they r still missing?
When does SVE set their patch priority?
I don't think they do set a priority
And you are 100% certain you are selecting the right target names?
SVE does weird naming sometimes
this.Edit("Data/FarmAnimals", new AssetEditor(EditFarmAnimalsData, AssetEditPriority.Late));
(this.Edit is part of my asset editing framework, but it's just piping to SMAPI's asset API underneath)
private static void EditFarmAnimalsData(IAssetData asset)
{
asset.AsDictionary<string, FarmAnimalData>().Data.ForEach(pair =>
{
pair.Value.ProfessionForHappinessBoost = Profession.Rancher;
pair.Value.ProfessionForFasterProduce = Profession.Producer;
pair.Value.ProfessionForQualityBoost = -1;
});
}
( does patch export work for including C# edits or just CP?)
I do patch invalidate in-game and break into the asset edit method and see this
14 entries, which are all the vanilla animals
i'll try patch export
yep, SVE's animals do appear in patch export
is there something wrong with the way I'm editing the data?
I don't think so, assuming your asset editing stuff is fine
ok guys, false alarm
i was building as release and debugging the wrong file
(Apparently it managed to (rarely) actually load an asset and blow shit up(
Something something additional farms
I beg to differ. It's very possible to generate a ton of lag in the attempt to do something and still ultimately fail to do that thing.
Me swimming
And that's why it's important to do testing and not just assume a certain approach is going to be faster.
didnt know atra swimming lags physics irl
that explains why my keys phased through the ground last week
I was thinking of making my own custom NPC pack and I was just curious which is easiest to use for that purpose: Content Patcher or Spacecore? I have no coding experience if that's relevant
Content Patcher is what you use to add your NPC into the game in the first place
SpaceCore is a framework that adds extra features in case your NPC needs them
I wasn't aware SpaceCore had anything to do with NPCs, other than maybe fixing some bugs or enabling certain behaviors you might add with a custom NPC.
Thank you!
well it has a bunch of misc stuff. misc pathfinding fixes, unique slingshot item reactions, question framework
!npc
Keep in mind that making NPCs is a complex process that requires learning many different aspects of Stardew modding.
Here are a few links that can help get you started on all that you need to know:
-
Tiakall has a great tutorial on making a custom NPC for 1.6.
-
NPCs no longer use dispositions, check the wiki page for the new NPC data.
-
Aviroen has put together a template that will allow you to easily create a romanceable NPC.
-
Feel free to jump into the https://discord.com/channels/137344473976799233/1277457201077813280 thread for more interactive feedback and help!
-
Fireredlily has a WIP NPC Builder Please do report any errors you get with it into the NPC thread!
If you want a basic NPC to learn with, I suggest a nonsocial NPC first
And then you can add the extra moving parts that make up a social NPC
Oh okay thank you so much!
Are you talking about using the spacecore content engine?
I believe it is released and you can do the usual content load edit stuff but you will not have as many examples (it's very new)
SpaceCore has become the everything mod
Is the condition in GenericSpawnItemDataWithCondition considered a query or a content patcher condition? And is there an already built-in system within SMAPI to get the boolean value of that string? Currently, I'm just using to verify when certain items are available in a shop, which I don't think would be difficult to implement on my own, but I may want something more complicated and I don't want to do work that's already done.
It's a GSQ
But the entire model is actually an item query
IList<ItemQueryResult> itemQueryResults = ItemQueryResolver.TryResolve(args, context, SearchMode);
foreach (ItemQueryResult res in itemQueryResults)
{
if (res.Item is Item item)
...
Since u r shop u probably need to handle case of not Item too hm, but this is how it goes in general
args is the genericsspawnitemdatawithcondition
I don't follow the first line. I'm not sure what context is. This is what I have so far. I would like to add to the condition after I verify the item I'm looking for. In this case being a parsnip seed
//figure out if a shop sells the parnsip seeds and for how much
Dictionary<string, ShopData> shops = DataLoader.Shops(Game1.content);
List<string> applicableShopNames = new List<string>();
foreach (KeyValuePair<string, ShopData> kv in shops)
{
if (kv.Value.Items.Any(item => item.Id == parsnipSeedId))
{
applicableShopNames.Add(kv.Key);
}
}
Context is an ItemQueryContext
It's got the current player location and Random
There's a different overload you can use if you just want game to pass in a context for you
hey, I tried updating my C# mod (last I had it working was on 1.6.8) since SMAPI yells it's incomaptible, but when I updated pathos package I now get The "ContentPacks" parameter is not supported by the "DeployModTask" task loaded from assembly: SMAPI.ModBuildConfig, Version=4.1.1.0 - anyone knows what's up?
maybe. Sorry, this is a lot for me, and I'm not fully understanding
The shop code also uses item query resolve to get the list of things to sell
I think if you just take a look at decompile it will make sense
and that's different from unpacking?
!decompile
If you want to make SMAPI mods with C#, one important resource is decompiling the game to read the game code. Here's how to do it: https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#How_do_I_decompile_the_game_code.3F
(have you been coding without decompiling the game's DLL?)
Update to modbuildconfig 4.3.2
Or whatever the latest version was
ContentPacks is added in 4.3+
yeah. I've been going off instincts and some people's code
going through the game's code (not all of it, but just looking at what you're working in) is very helpful and saves you lots of time having to ask us questions
what even is this modbuildconfig thing? all my solution contains is pathos nuget package and manifest.json which has "MinimumApiVersion": "4.0.0"
It's a nuget that set up the common build target stuff for a sdv mod
To be honest im not sure how you ended up with a ContentPacks thing if thats all you got
I have updated to that, that's when the error started showing up
Can you show us your csproj
You may need to do the close vs open vs dance
Mystery, it is probably nuget cache things yea
... it worked
k, I'm done for today, thanks for the help, I'm off to bed
For a while VS would reliably crash every time I tried to delete a file
I joked it was VS telling me I really should retire from modding
And the rest is history
me geniunly tweaking when i cant manage 18 pairs of numbers
only 18? 
im not that smart ok
LOL
What do u mean by this
dont worry governor we will save you
bouncer has been unbonched.
-
-
- SongBirdAJ is typing...
-
Hey everyone! I have a mod idea, and I have no idea how easy or hard it could be. I'm new to modding and coding, but I'd love to learn more, and figured this would be a good place to start. My idea is when I push a predetermined key, the whole house rotates. The tiles that have objects on them would be rotated on the tile/tiles they are at, creating a 3D space effect, specifically for the farmhouse. If I have the maps built on Tiled, would this be insanely easy or insanely hard to code?
Do you plan to draw 4 version of the map
Yep!
That would require c# to update the maps in realtime, no?
Also furniture/farmhouse map compatibility will probably be A Lot
updating the maps wouldn't require it but moving any user placed objects would
Oof, you'd probably have to interfere with AT for compat too
you'd need c# anyway for the hotkeys though
I think one issue you will have is some furniture doesn't have all 4 rotates
Especially wall items
I don't know how you want to deal with it
Either way this is gonna be a C# mod
!startmodding
Making mods can be broadly divided into two categories:
- Content packs are formatted text files, and don't need any programming knowledge. They can add/edit NPCs, maps, new items, shops, and more. To get started, see the list of framework mods, the wiki tutorial for Content Patcher, and there might be relevant guides on the tutorial wiki.
- C# mods use programming code to change fundamental game mechanics. See getting started with C# modding.
Usually it’s easier to start with making content packs, since you don't need to learn programming.
That's something I figured I could add in a content pack, but I could do that only for the times I knew of (vanilla)
I was familiar with the content pack type stuff, but not c#
Now I have a rabbit hole to read about! Thanks everybody 🙂
No as in, the vanilla furniture system literally does not support all 4 rotations in some cases
it will be a challenge if you are starting from no c# knowledge
And placable things like big craftables don't have rotations at all but at least they only occupy 1 tile
Yeah like the kitchen items and chests. I guess I wouldn't know how that works, can you attach different perspectives in a content pack? or are those items hard to interact with in general
most stuff you would need here would need entirely custom, purpose built and probably complex C# code
Totally doable ofc, you can do just about anything in C#, just effort™️
well i finally got half the warps done, now for the other half
Sounds like I'll have to try my hand at C# then! I will see if its within my hyperfocus limits, haha. Thanks for the info! If I do end up trying it, I'll be back 🙂
....
I SWEAR TO BONCHER I AM NOT FIXING THAT, I AM JUST GOING TO HAVE TO PRAY THAT PEOPLE DONT ZOOM OUT
i just got done with all the warps as well
:SDVbouncerstare:
I think I would see that while still at 100% zoom
no that is at max zoom out, you cant see it at 100% zoom
swear to boncher...
dont risk it.. boncher is always watching
I would almost certainly see that at 100% zoom on a 4k screen!
oh right, i forgot about moniter size
I'm looking for the code that uses ItemQueryResult. I have some experience with ILSpy, but I still feel like I'm looking for a needle in a haystack. When I search for ItemQueryResult at the top, I only get the constructor and class definition. I was hoping that I would find where it's used throughout the code, and then use that to find the shop code
you can. right click > analyze
Oh right, i came here to ask for help
oh that's useful. thanks
So I have a touchaction setup on a tile property to prompt to go to sleep but when I click yes the screen goes dark but nothing happens unless I go outside, then when I go outside it takes me back to the farm house
so how do i make it so I go to sleep and wake up on the same tile
maybe if i set it to F outdoors-
hold on
i think i got a hole in my tent-
for completionist sake
wtf how big is your moniter
that is what 4k stardew looks like
oh
well i will see if there is a way to lock the camera inside a certian area on a map
found it
That's the tent map at that resolution for what it might help!
And at 75% zoom.
I wonder how annoying it would be to give map tiles conditional rendering
what is that
I appreciate people who test their maps at 4k
ive never heard of that
That's because there's nothing that provide such a feature afaik
oh
?
one more map isn't that laggy especially if small?
I have 8 tents, that means 8 separate maps, each map is 3x3
But the idea would be, some parts of map is invisible unless your character is inside it
Almost sounds like...
And the reverse, some parts are visible when your character is outside of it
Dont dynamic map tile me
I think the tiles should remain exist tho, merely invisible
they look more like, 4*5?
Anyway, i still don't think this will be a bigger problem than having one map of whatever you need to not see the other tents
alright i will do seperate maps
Here it is! Took a while to find.
Don't think it ever got finished, but it was a cool concept.
Wow, blast from the past
If the tents are identical, you don't even need separate map files. Just Load the same map as different locations.
Whoah, cool concept
should really get finished because it would be awesome
Vaguely related in concept: #making-mods-general message
Yeah, I learned about that after I started experimenting with that. I think it was broken even back then.
It's ok the bridges on ginger island isn't any better 
I remember a talk about z level impl months ago
I don't think anyone in the convo did anything for reals 
never able to figure out how to handle teleportation
The "tile action increment decrement your z index" would have been extremely fragile if the map gets patched
tbh I think multiple 3x3 maps would be better performance than one map with huge gaps to join them together
though maybe not as the one map would share tilesheets
What if it's just 1 map asset
What about the warps?
I need them to come out of the same tent they went into
I still think it's nicer if they r buildings tho
that is the nice characteristic of buildings, building interiors fix the warp to go to the correct place outside
well i did mention BETAS + spacecore can do it with just one map/location but you did say the way you were doing it worked fine, so
I always wondered about that. I made a greenhouse map, and have a mod that let's you build multiple greenhouses. Always wondered how greenhouses that use the same base map can have exits to different greenhouses. My map only has the one warp
buildings are so nice
doesnt it take the "exit warp" and spit you out one tile above?
or like... lowermost warp
because Buildings do not have Locations
Buildings have interiors specific to them that they take you to
unlesss you specify they should go somewhere global
it is important to remember that a Map is not a Location
I will just accept it works without my understanding for now.
Building warps r special and based on human door on the outside
Based on 1 tile above first warp on inside
Replying to this for context. I'm looking at ShopBuilder's GetShopStock method as that seems to have the code I was looking for. But I noticed that is does use ItemQueryContext on top of CheckItemCondition with the latter being the one I want to verify it's in the shop. If that's the case, what is the purpose of the former?
Actually, I just realized I can just use GetShopStock for what I need in general. But I still want to ask just in case I need it for the future.
ALL_ITEMS is an item query. that is not a Condition
so its something you'd need to account for, too
you would need both item queries and GSQ conditions to fully understand a shops stock
That's confusing. But that's mostly bc I'm just learning about it. I assume I'll get it with practice. Though my brain rn is hoping that I don't need it any time soon.
You might actually be able to get away with just one map. If all the tents look the same inside. Like the barns and coop. They only have one map and just reuse it for each building.
Buildings do have locations.
For some buildings like Greenhouse and farmhouse, the first instance gets the canonical name, with extras getting instanced versions.
all other buildings get the instanced versions, where its BuildingName<guid>.
you can debug warp directly into the third barn if you knew the start of its guid
they do not have Data/Locations
Correct, but neither do cabins which aren't buildings
i didnt say buildings were unique in this regard
How would he apply that to themap with 8 tents is the question?. As they want each tent to exit to the entrance used to enter the tent.
That seems to be the issue they are having.
if they were buildings then its a non issue
Wait cabins aren't buildings?
they do exist in Data/Buildings but i thought they had Extra logic applied to them
The idea was to make a tent building (that's not constructable) and then spawn the tents on the custom location
With buildings included
Is there any attempt to path npcs into these maps
There is a little extra logic for cabins but I don't think that makes it particularly unusual for a building.
hi! Is there any reason a mod would need to use load instead of edit image (for portraits), and is it possible to make a compatability patch that makes another mod use editimage instead of load?
So how do I setup a warp if there is no data/locations?
replying to this btw srry
if you are making a entirely new custom npc, you need to Load any assets that don't exist
ok, but if you are just modding vanilla npcs there's no reason for load?
Oh, hmm. Presumably you can do location-conditional AddWarps?
not really, better to EditImage if you can, however people do it because it works
Addwarps has the same format as Warp,
Value Value Location Value Value
some edge case include like, scale up 2?
if theyre buildings you dont set up the warps, the warps just are. you use the building door
If the new portrait is of different dimension, you'd need load.
(Assuming a HD portrait mod.)
this is a custom map where it doesnt have a door so i need a touch action
and wdym the warps just are
the suggestion was to use buildings.
the new portraits add some emotes but they are just regular size, not HD
which do not use touch actions
i think if you want to use maps, you can still load from 1 tmx
to N different targets
if you absolutely require touch actions, you do not use buildings and the suggestion is disregarded
then do editmap on all of each of em
I require tents which means I require touch actions
no, it doesnt mean that at all
if the tents are buildings then you dont
thats what the suggestion was
make them buildings and not built into the map
you can still have TouchActions inside the map (tmx) if you want, it just won't be for the warps
So I map edit in the tents?
If you did want to take the approach of "I want to load one map as different locations and have separate warps " you can do what I did for the Pelican Valley Loft NPC Apartment floors
buildings are not map edits
you can extend down with editimage, but not extend any other direction
this is bc of sprite index
there was a different framework suggested at one point originally that lets you just spawn buildings somewhere
so cool, if i wanted to make a compatability patch would it be possible to make the other mod use editaction instead of load (like, patch the content file I guess?) or would it actually require the original mod to change
i dont recall its name
What I did for the apartment floors was setting the separate outbound warps in Content Patcher for each floor rather than Tiled.
Alright, it would be helpful then if you can explain what exactly you want to do, and why you'd need to make a compatibility patch for it.
not possible to edit another mod from within your own like that
1.6 made them behave much better and are closer to sane buildings (along with the retrofit to make the farmhouse itself a building)
it took some work to convince Cabins to not be a building in my SinZational Shared Spaces mod
okay... hmm thinking
i also dont know why you would want to change another mod instead of just editing the image from your own after
so like Dolphin suggests, more context would be helpful
Or, I could just have 1 accessible tent and the rest are all "occupied" or "locked"
(Because why would you need more than 1 tent in the first place)
Just have nonsense messages like "there's so much debris inside that you can't find a way in." Or "The zipper seems to be stuck " 
Ooo good idea lol
Hello, can anyone help me? I have programmed things in HTML, CSS, PHP, ASP, SQL and JS (I have only programmed with websites) but never C# with Stardew Valley mods. I downloaded the programs they ask for but I can't make the .dll. How can I convert my C# code into .dll?
Please be patient with my English because I am Brazilian, but I understand more basic words.
It occupied
ahh ok here's the situation. I have one mod that loads custom portraits, but only for portraits that need changing from vanilla (so, only some NPCs, only regular and winter portraits, not beach ones, only if certain conditions are met). I want to use anime portraits with this mod, so I'm making anime versions of the specific portraits in the mod, which i can replace in the mod's portraits folder. But I want to also change the other portraits and NPCs that are not touched by the mod, for a consistent look, but if I use the anime portraits, which are editimage, they will edit the portraits loaded by the other mod.
!gettingstarted
If you would like a guide to setting up mods for Stardew Valley, check out the getting started guide! https://stardewvalleywiki.com/Modding:Player_Guide
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.
!startmodding ses the c# guide
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.
(wrong command sorry lol) look at the second bullet point
Basically I want the regular anime portraits to load (or edit) first, then the changes from the mod that currently uses load to apply second
The gist is you need to build with dotnet, and target net 6.0
There is a nuget package that setup sdv mod build
that is not what Load and Edit are for. if you dont want to overwrite a portrait, simply dont apply the EditImage patch
Okay, so you would need to work the opposite way: set a when condition for the portrait targets you don't want changed, that detects when that mod is present
Load always happens before EditData/EditImage/etc. always.
So when the mod exists, your EditImage does not run for those portraits
Just note that you won't be able to publish whatever you do afterwards
ok.... yeah I was just hoping i'd be able to make something that would work for others too
This is for your use only
Yep
if neither of them are your mod then you do not have permission to redistribute their assets unless they specifically say you do
For others you could recommend what you did to the author perhaps, as a suggestion
Yeah, that's a no-no without permission from the authors to edit their mod and republish
no I know that 🙂
Need content patcher patcher
compatibility like that is not possible for anyone other than one or both of the mod authors then
I will see if I can suggest that to the mod author.... changing load to editimage should be the first step for compatability though right?
I am not super familiar with Portraiture, but I think you can use that to cycle through different portrait mods and lock one style per character?
Which would be a no code solution
i would not suggest them specific ways to do compatibility but rather just ask them for compatibility and let them figure out the best way to reach it with their vision for their mod
lol noted
there is no one answer for "what to change"
well thanks guys, at least now I know i'm looking at personal edits for the time being and compatability is out of my hands ^.^
Okay, if I get this correctly, then nothing from the original mod's portrait asset would be used anyway because you'd want to change them all to anime style, right? Why not just make a patch for the anime portrait mod?
@dusk mulch i noticed you edited the wiki anyway despite getting no response, and broke the table somewhat by adding a random third column for that line only. there is no reason to recommend against the property as there is no reason it cant still be used with i18n in Content Patcher and there is no reason it has to be used with things that need translation at all. there is no one recommending against its use
oop- srry
I am currently trying to figure out when a specific shop is open. Preferably to know the hours it will be open that day, if at all. I tried looking through the decompiled code, and haven't found anything yet. Though I figure I missed something as I assume the game does some sort of check to let you in. As of right now, the only way I have thought of is to use the schedule data for all shop keepers to see when they're open. But that seems very jank and not intuitive at all. Is there something I'm missing?
data/shops will tell you the owner conditions
Hmmm, I didn't really think of that, I'll see how that might work.
As far as the map warps, those are locked door warps in the maps themselves
It won't necessarily be in the code as it is inside the tbin file
ok I gtg! thanks !!!
GameLocation.cs
look at performAction for tile actions like "AnimalShop"
many game default shops are hardcoded like this so their conditions are a little silly
for modded shops it's not as bad, check for OpenShop tile action on maps
i know you are trying to enforce the wiki but the way you said that was a bit harsh and couldve been worded a bit better as i think it was worded a bit more seriously than needed /srs
I don't see anything that's harsh in Button's response
if anything, i think accidentally breaking the wiki is a problem 😓
You might be taking the criticism too personally/feeling rejected because you made a mistake 
i think i am, i need to work on stuff like that
it was not my intention to sound harsh (like tiakall implies it wasnt meant as a personal criticism or anything, just a correction) but i will still make note for in the future to try and make sure i come across as not-harsh as i intend
and this is why im too scared to edit my own section on the wiki
Button, just throw on some 
yeah, so instead of feeling like Button was mean to you, I'd take the time to analyze what you did wrong and take steps to not do it in the future 
i do not have nitro
Nobody can be offended if you add extra emotes
and never will
convince the unicode consortium to support 🐶😆
use 

can’t lag if you can’t load