#making-mods-general
1 messages · Page 346 of 1
/changeLocation JoshHouse/warp farmer 16 16/faceDirection farmer 2/fade unfade viewport 64 15/ But I always ended up with black screen
You are missing a forward slash after the fade unfade command before the viewport command so the viewport command is probably not being parsed.
Thanks! It worked but farmer didn't warp to the place I want her to be for some reason. T.T
followed all tutorials down to a T...What went wrong here? https://smapi.io/log/a32e0ae4699f46269dc55867c19a4855
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home, with 4 C# mods and 6 content packs.
Tilesheet climbing
Your tilesheets have to be in the same folder as your map while you're editing the map in Tiled
We have a command about it but I can never remember it
!tilesheetclimbing
When creating or editing maps in Tiled, one common error is tilesheet climbing, marked by red text containing "invalid tilesheet path '../../..'. This is caused by SMAPI not being able to find the tilesheets needed by the map file. To prevent this error, make sure that you have a copy of all necessary tilesheets in the folder containing your WIP tmx file. Copies of vanilla tilesheets can later be deleted, but must be present while working on your map.
If you get this error with a completed map, an easy way to fix it is to open your tmx file in VS Code or a similar text editor, find all of the places with <image source=, and remove the filepaths to so that only the tilesheet names remain. For example, if the code says <image source="Content (unpacked)/Maps/townInterior_2" width="512" height="64"/>, change it to just <image source="townInterior_2" width="512" height="64"/>.
ITS WORKS AGAIN THANKS TO LILY <3......i actually broke it myself with a tiledata on the map...(which i forgot i did )
Q.Q
Can you recommend me some tool that checks the tiles of the game? Before, I'm using debug mode but it seems that it's not accurate anymore
lookup anything on tile lookup mode can do that
Debug Mode is affected by zoom, iirc
You can also always open the map and check in Tiled
There's a sort of unofficial fix for that until the PR gets merged!
Edit: Attachment coming again. Forgot something important.
quick question, why are you adding PetBowlLocation via CP? (that is why the latter format is correct, because you are trying to, i assume, adding that map property via Action EditMap, and that format is the correct format for a nested key/value i.e. using curly brackets. the [] brackets are for arrays)
you can just put PetBowlLocation as a map property in the .tmx file like so. the wiki format listed is for this method, you only type the numbers without the brackets.
then again even in CP it should still be
"MapProperties": {
"PetBowlLocation": "60 14"
)```
somehow Im still getting SMAPI blocked asset replacement for 'Maps/Anteiku': the 'TESTING ANTEIKU MAPS' content pack incorrectly set asset to a null value.
Hmm I think that happened the other day and the issue was that the person had accidentally deleted the width and height values for a tilesheet when editing the tmx to fix the tilesheet climbing problem. Did you edit your tmx in a text editor to fix your tilesheet climbing?
Yeah I did
Then I suspect you also deleted a height and/or width somewhere.
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home, with 4 C# mods and 6 content packs.
ty!!! Super appreciate you and Button
not sure if she's okay with getting @'d so
(Please don't use that word, it's a slur)
OH im so sorry i didn't know
It says there's a tilesheet called Walls.png used in the map but it can't find it. Is that a custom tilesheet of yours?
It WAS but that entire tilesheet was replaced
Oh, you actually have three different errors for three different maps here.
Oh no, two.
I suggest you set one aside and just try to fix one at a time.
It looks like your Custom_Hallway.tmx still has the Walls.png tilesheet in it.
Thats so odd, let me see if i can fix those then lol
Is it possible to add more actors in cutscene instead of 2 characters? in events?
Yup you can have as many characters as you want. Just add them in the third event command the same way you add the first two.
Is it possible to make an item in a shop a once-per-save purchase? I'm looking through the modding shops page on the wiki, but all I can find is the AvailableStock value which it says is per day.
Yup you can use the ActionsOnPurchase field to set a mail flag on purchase and the Condition field to make it available in the shop only if someone doesn't have that mail flag.
I would be careful with once per save purchases
If thr player could possibly lose the itdm
lost item shop 
That's where you put the console command to cheat for it in your mod page and then ignore everyone forever
yea use some kinda mailflag is the rec
Thanks, i'll try that
what is the item tho?
One thing I want to do with it is make the Joja vending machine buyable on the CC route, but only once
Oh that's fine. I was more thinking quest items
hm i have idea what if u just conditionally edit the entry for (BC)117
in Data/LostItemsShop.json
just changing RequireEventSeen from 502261 to 191393 should let you buy soda machine from crow as if u did joja route?
That could work too, thanks
Hello, can someone post my mod on #mod-showcase ?
yea sure, give mod link + blurb
While i'm here I also want to ask, can a shop item have multiple conditions or is it just one? I'd been meaning to test that myself but I think asking here would be quicker.
thank you 🙏
Have you ever regretted using the wrong item on a machine?
This mod allows you to cancel a machine's production and retrieve the item you put inside. (By right clicking, or breaking it)
Works with any vanilla or modded machine.
Optionally, you can choose when you should be able to get the items back, only before 30 or 50% of the production is done
https://www.nexusmods.com/stardewvalley/mods/35013
Multiple, but in the one field. Comma separated for AND, using ANY for OR.
Alright, thanks again
AUGH FINALLY I MGOT IT THANK YOU ABAGAIANYE the only issue im having now is trying to get the tiles to work with recolors
By that do you mean that you're using vanilla tilesheets but they're not recolouring? Or that you have made custom tilesheets and you have to recolour them?
OMG!!! LIFE SAVER! THANKS IT WORKED A CHARM! George appeared at last!
I am using vanilla but they aren't recoloring properly
Are you leaving the vanilla tilesheets in the folder with the tmx when testing in game?
Yes
That's why they aren't recolouring. Tilesheets in the map folder get used first and only if they can't be found does SMAPI go looking in the game's contents for them. Remove them.
(Alternatively, you can keep the tilesheets in the folder in a way that they work for Tiled and for the game if you put a dot in front of their names and then add them to the .tmx. SMAPI will ignore the tilesheets in the folder and use the ones in the game contents instead.)
You're welcome!
iM SO SORRY i am clueless but the other issue aND THANKFULLY LAST is that in every interior it is dark. Did I need to set the map properties for Indoors T on the,?
Them*
No, maps are treated as indoors by default I'm pretty sure. I think vanilla interior maps just use a truckload of light map properties and/or light tiles on the Paths layer. Sometimes I use the AmbientLight map property to adjust the lighting too.
Is textAboveHead is only available for NPC?
Probably, yeah. I can double check the code but I assume that you've just used it and found it didn't work. If that's the case, then yeah it's only for NPCs.
Yeah, I actually tried it doing it for my Farmer but [game] Event '777714' has command 'textAboveHead farmer It's okay' which couldn't be parsed: no NPC found with name 'farmer'.
Yeah im pretty sure the farmer isnt allowed to talk
yeah, textAboveHead as a mechanic is implemented on NPC, which Farmer isn't (and which is also what the event command looks for, so it won't grab the farmer)
Huhu too bad! anyways. Thanks! It's been a while since I've messed with content patcher
If you really want to use textAboveHead on farmer, you can have an invisible temporaryActor on the same tile as farmer and use textAboveHead on it instead.
Since the actor is invisible, it'd look like the farmer are actually speaking that text.
ohhh I see.. Thanks. There's a lot of new Alias I just noticed
The dating is now D instead of o am I right?
Nope
Use the full words now
Shortform aliases are deprecated and should be avoided
Ohhh Wait... where do I need to add them? Like smoonlightJellies/7 9/farmer 64 15 2 Sebastian 64 14 0/Dating Sebastian Or "77777/f Sebastian 2250/w Sunny/e 77771/Dating Sebastian/t 600 1000"
In the preconditions - and fix all of them and the event IDs (if they're entirely your events rather than you editing existing events from vanilla or another mod). It should be:
"{{ModID}}_GiveThisEventAProperStringID/Friendship Sebastian 2250/Weather Sunny/SawEvent {{ModID}}_TheEventBeforeThisOne/Dating Sebastian/Time 600 1000"
Ohhh so they are all full instead of just 1 letter?
Yes. You should not be using any of the single letter ones anymore.
(And change your event IDs! Please!)
I'm making a custom floor type, but when I remove the mod, any save that had used this floor crashes back to the title screen. However, I’ve tried other people's custom floor mods and their floors can be safely removed without breaking the save. Does anyone know what might be causing this?
Is your custom floor done exactly the same way as the other ones that aren't crashing?
I actually followed their structure when writing mine, but I’m not sure which part specifically prevents the crash. I might be missing something subtle.
do you have a log for the crash?
oh im pretty sure that is just how custom floors be like
if they are entirely new floors
u will have to add mod back and then remove all placed floor then u can safely uninstall
oh I see
its unfortunate really, i hope to bring it up for 1.6.16 eventually
thats a pain
Thanks for the explanation! That's really helpful—though yeah, it's definitely not very convenient.
hrm i wonder if i can at least fix crash
Shouldn't the other ones be crashing if they're also adding new floors?
if they r AT then its fine i think 
or if they r just never placed
i dont have full knowledge to say
But they said they're copying the other mods.
iirc the problem specifically arise when you have placed floors
That's why I didn't say it was the floors crash thing that you mentioned in your channel in SMC.
I assumed they were placing the floors from the other mods as part of their comparison, but I may be assuming incorrectly.
but yea i know for sure that Flooring.GetTexture is not very safe here
so perhaps ill just patch that until 1.6.16 
If I wanted to add a single shirt item to my mod, what's the best way to go about that? I keep seeing people changing the sprite sheet but that doesn't seem great for mod compatibility.
u can add new shirts now psure
this one's cp but u can do same thing in c# if you want
o great thanks ill take a look
(Not saying you are wrong, just confused about how it could affect one mod but not another without there being differences between the two mods. Which leads me to think that there may be differences and that perhaps monday could use that to find a workaround for their mod before 1.6.16 arrives.)
well im skeptical of the premise that "it didn't happen with other mods"
(And that difference may be that they didn't test them the same way lol)
but shrug its a fairly easy to repro thing 
configFilePath = Path.Combine(folderPath, "Mods", "RangedTools", "config.json");
jsonString = File.ReadAllText(configFilePath);
using JsonDocument doc = JsonDocument.Parse(jsonString);
JsonElement root = doc.RootElement;
if (root.TryGetProperty("AxeRange", out JsonElement toolRangeElement))
{
toolRange = toolRangeElement.GetInt32();
}
is there a better way to get another mod's config? this way if someone rename the folder, it wont work
That makes sense. I tested both mods myself, but it’s possible I accidentally placed one of my floors and forgot about it.
By the way, by custom floor do you mean like in the farmhouse or paths?
you can reflect into their mod, but besides that not really
I mean placeable paths like the craftable ones. I'm following how this mod does it: https://www.nexusmods.com/stardewvalley/mods/21577
Okay that's the type that chu says explodes upon removal
And which my game decidedly did NOT just explode upon removing
Thanks! For custom chests, one option could be:
- In SMAPI's
helper.Content.AssetRequestedevent, have Automate add a context tag likeautomate_storageto the vanilla items listed in the PR. - In
GenericModConfigMenuIntegrationForAutomate.cs, list every item which has that context tag. - In the automation factory for chests, check for the context tag.
That way mods which add a custom chest can just add the context tag, and it'll work with Automate.
Now I will try with this Moar Paths mod
oh yay is it fixed at some point
oh hm
aba can u go into my mod and then try deleting the Load for all the textures
so that the path itself is a valid item, but the texture of the path is invalid
Sure
(This Moar Paths one has number IDs
)
(chu why is your content.json just an include of floor.json???)
Oh nooooo it exploded my whole computer and I hadn't saved my aseprite session!!!
That might be the reason? I only followed the ObjectsData structure in my content.json.
oh thats not good i thought it would only explode game...
I'm gonna be like one of the kids and send a photo of my computer screen because computer ded.
look i had ambitions of other kinds of floor ok
There is no ObjectsData asset 
@ivory plume hi pathos can we get handling for bad textures on an already placed Flooring whose data otherwise exist
False alarm, ctrl+alt+del and then task manager actually worked for once
(possibly referring to just ObjectData which is the C# class name for the Data/Objects model)
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 10 Home, with 31 C# mods and 5 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
can we see your log plz
Sure, I'll add a note to look into that for 1.6.16.
So does that mean that アデリー is probably doing some funky texture thing for theirs to be crashing, since just removing chu's path didn't cause crashing?
i guess so, perhaps their texture field is incorrect
Or conditional in some way that goes funky, for it to be able to be placed originally but then to explode after removal?
How can a mod save its own state? Like say I want to added a new field to an object or just have some piece of information for later use
there's a few ways but for adding new field to object modData is best
Ok I confirm that Moar Paths didn't explode upon removal either
so like obj.modData["cat.ExquisiteMod/SpecialField"] = "1"
yeah, most in-game instances have a modData string-string dictionary that's synchronized in multiplayer, with changes saved automatically
(though other data-saving methods for mods are listed here)
https://www.stardewvalleywiki.com/Modding:Modder_Guide/APIs/Data
It took me a bit to recover the deleted save.
Here’s the SMAPI log :https://smapi.io/log/4604a032dd114fff978406de790ede44
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 10 家庭中文版, with 95 C# mods and 23 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
synced when the farmhand actually sees the real version of the thing, anyway. important distinction
did you apply AT on the deleted flooring somehow?
That’s weird, I gave it a new item ID and didn’t use anything related to AT at all.
Could it be related to the "Category" field? I was following the Adventurous Paths mod, which used "Category": -8, but I’m not sure what that means.
Now I noticed that Moar Paths changed it to -24. Could that be affecting compatibility?
i dont think that part matters
-24 what wood path used so i also just copied that lol
since you have no AT packs anyways, try disabling it?
Have you been referring to the wiki? The floors and paths page and the Objects page?
Yes, I followed the wiki when writing the properties for each new floor.
Hi again...does you guys know the max # of values Merge can take? I tried putting in more than 4 and the syntax highlighting immediately turned off🫠 the examples in the doc only have 2 or 3 at most
there's around roughly 8 different outfits I would need to merge
(does query have a max...?)
Syntax highlighting in your text editor is not an indicator of whether it'd be acceptable to CP or in game, it's just whether your text editor is able to understand what part of json you're writing.
But even then, as long as you're keeping the syntax correct I don't know why your text editor would have an issue with it.
Or even how syntax highlighting can spontaneously turn off 
if ur using linkoid's stardew syntax, it could be that the rule didn't account for too many merge
oof okay, I'm just using notepad++ because I don't have vscode on this computer rn
If the syntax highlighting changed at a certain point, double check that you didn't accidentally do something incorrect at that point. Otherwise...well...as I suggested before you should be checking this with patch parse in game before writing it in your json anyway so you should already know it works xD
yeah, I was kind of like ? when this happened lol and just wanted to make sure
I'll be sure to check with patch parse
Ty~
One more thing! Is it possible to add ConditionalDoor or LockedDoorWarp to a tile that..really has no door. Say a tile that the player isnt allowed to passs until set times
Yup. LockedDoorWarp will warp you rather than just letting you pass and uses the door sound though so it will be odd without a door. It also has to be on a Buildings tile which would be impassable anyway (unless you set it to be passable, in which case the player could just walk through it even if they couldn't use it to warp).
anecdotally, ive also noticed my N++ syntax highlighting just breaks with event preconditions that are too long, so... i think it just breaks with extra long json keys
¯_(ツ)_/¯
Yeah, there's an optional CollisionMask parameter that you can use to adjust what gets checked
it looks like your editor just thinks that this text is too long to be a key, so it just changes the color.
oh yeah, I just forgot about these, I copied them from the vanilla methods and didn't touch them to avoid breaking stuff.
FF lets you have furniture with multiple item placement slots, right? How does that work?
Everything is put into a Chest into Furniture.heldItem. Where stuff in slot is drawn is entirely computed from the slot data in the FF Furniture definition (and the Furniture instance position). Placing/removing and interacting with stuff in slots is handled by configurable keybinds, which makes the whole custom slot system separate from the Furniture.checkAction method (where the heldItem stuff is handled in vanilla)
Awesome, I already am handling chest dumping I think
nice
Hello I'm actually having this [game] WARNING: Mismatched UI Mode Push/Pop counts. Correcting. This error...
!log
Important note: Your computer username may appear in the log. If your username is your full name, please be aware of this before uploading it.
Please share your SMAPI log file. To do so:
- Open this page: smapi.io/log.
- Follow the instructions at the top of the page to upload the log file. (Don't copy & paste from the console window!)
- After uploading, it will show a green box with a URL to share. Post that URL here.
Please do it even if you don't see any errors. This has useful info like what mods and versions you have, what the mods are doing, etc. If the issue didn’t occur in your last session, please load the game to the point where the issue occurs, then upload the log.
Is it your C# mod
Nope in my Content.json...
That's unlikely, but perhaps you put in some data that's invalid
Send log and also your json pls
!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.
There is no log appearing. I think there is a problem on fork Coz When I click the answer I want... I'm getting that Error
Important note: Your computer username may appear in the log. If your username is your full name, please be aware of this before uploading it.
Please share your SMAPI log file. To do so:
- Open this page: smapi.io/log.
- Follow the instructions at the top of the page to upload the log file. (Don't copy & paste from the console window!)
- After uploading, it will show a green box with a URL to share. Post that URL here.
Please do it even if you don't see any errors. This has useful info like what mods and versions you have, what the mods are doing, etc. If the issue didn’t occur in your last session, please load the game to the point where the issue occurs, then upload the log.
This is your content.json yes, but you should also send log which shows the error
hello!
Can anyone spot any error which might explain why my mod item-icon does not work in game?
change the Target in the Load to Mods/{{ModId}}/Objects
Target is not automatically namespacewd to anything
the Mods/{{ModId}} convention is entirely made up and your Target can be whatever you want it to be
Hi! Does anyone have any experience with converting hairstyles to fashion sense? I have something that should be dyeable but isn’t showing up that way unless I edit every single hair json file. Which I can do, but if there’s an easier way I’d love to know.
it's determined in the json, how many hairs are we talking
132
wowie
You see my problem
You could write a script to batch edit all the JSON files
When you say "converting", do you mean they already exist with another framework?
If so, there is a list of converters that may help you
It’s just a hairstyle png. I’m using the fashion sense converter on github
im trying to patch all occurrences of
animal.friendshipTowardFarmer.Value = Math.Min(1000, animal.friendshipTowardFarmer.Value + n);
```and
```cs
animal.friendshipTowardFarmer.Set(Math.Min(1000, animal.friendshipTowardFarmer.Get() + n));
```to determine how much the friendship overflows (and i want it to work even if another mod adds code that does this)
the `friendshipTowardsFarmer` field is a `NetInt`, so i can put an event handler on it when it changes, but afaik that will fire even if the above code ran on someone else's computer, which isn't what i want
so my plan is:
- postfix `NetInt.Get` & `NetInt.Value get` to record the most recently accessed `NetInt` and clear all other state
- postfix `Math.Min(int, int)` to check when it's used with `1000` and record the other argument and the value it returned (only if we already recorded a most recently accessed netint)
- postfix `NetInt.Set` & `NetInt.Value set` to record the overflow value stored by our math.min patch, if the value being set is the result of the last math.min call and the current netint is the same one that was most recently accessed
this would *hopefully* prevent random math.min calls from triggering this system, because they'd only be counted if they happen between a get and set call on the same netint?
the only problem i can see is that (unlike with the netint events) there's no easy way to know which animal the netint is attached to!
the netint fields are readonly, so i could just have a dictionary from netints to animals, but i'd have to garbage-collect that somehow or it'd keep those animal objects in memory forever
so my question is basically: is there a better way to do this? if not, is there a best practice for keeping something like a static Dictionary<NetInt, FarmAnimal> without it being (technically or practically) a memory leak?
i'm thinking i should have some code that iterates over the dictionary at regular intervals and removes any animals that don't exist anymore?
You inspired me to google bulk json edits and I think I can just mass replace in notepad, so thanks!
is it possible to add many conditions to something? Like I want the crispy cookies to be sold wed, sat, sun :-))
Can I make a mod that like reskins the town, characters and buildings, and maybe changes dialogue? Not adding stuff, just changing it
Day_of_week Wednesday Saturday Sunday
Sure!
But....maybe make those three separate mods
Yeah definitely
pre-view :)))
Yo, how do y'all's npc mod folder look like?
https://github.com/DenisSilent/Eleanor/tree/main
Have a look.
Just want to make sure I didn't miss anything. I have manifest.json, content.json, assets= dialogue.json, marriage, portraits.png. sprites, schedule
This is an example, it 100% depends on you.
Should be good
Thank you, love
LMAO, I also have Six locations that add NPCs.
I like story.
I haven't started making my own NPC yet, but I’m curious is it okay to reference or include dialogue with characters from other mods? can I freely have my NPC talk to or about someone from another mod?
thats just random NPCs tho. in this chat we talk about mods you made
usually the npc mods mention something in their mod description. though either way i'd ask first before doing something deeper, but just some mentions should be fine either way
It's courtesy to ask the creator of the other npc
Especially if it's something involved like crossover event
yeah
A simple shout-out not that serious but I'm sure ppl want to hear about it anyways
Got it, that makes sense
The question was what my folder looked like. If I misunderstood what folder, I apologize
here's a list of conversation topics that some mods have added, along with a rating for "how okay is it for john Q NPC to comment on this" https://stardewmodding.wiki.gg/wiki/Conversation_Topics:_List_of_CTs
as in the npc folder of the npc you're making
so if you're looking for a particular shout-out, many of those are free to use
It's also fun to do completely off topic stuff for a CT
One of my pet peeves is CT oversaturation
Ie. Mod event X happens and then every npc you talk to is talking about it
You could try to remove entries for farm animals that no longer exist, but in practice, there are so few animals in the game that I don't think the dictionary could ever eat much memory.
That said, patching NetInt seems excessive, in that your code will run constantly on unrelated fields. I'd lean toward transpiling or postfixing the methods that edit friendship in FarmAnimal and tools, or maybe adding fieldChangeEvents for the specific NetInts. (Never tried using those events myself, but I've seen them recommended...)
unfortunately using events won't do what i'm looking for, since afaik they run when the field is changed from network sync stuff too
ConditionalWeakTable<FarmAnimal, NetInt> maybe
and transpiling the methods in question would be a huge maintainence burden and wouldn't work if another mod implements farm animal friendship changes
oooo i did not know that exists
Gotta be flipped cus FarmAnimal is the weak ref
yea
CWTs are the goat
(i still have no idea what a CWT is or how to use them)
Well u know what a WeakRef is right
I've yet to touch them, but I gather they're collections that discard anything that gets disposed of
it's like a dictionary but the keys are weak references, so they don't block garbage collection and are automatically removed when the key gets collected
adding an extra branch on a static variable to netint.get will probably not be a performance issue, right?
My guess is ..... yes
Esper did farm animals have an owner field
Tbh.
i mean that basically doubles the cost of every netint.get innit
Yeah can use net event but check that maybe? To only do anything if game1 player is owner
(Harmony patching can also add a lot of overhead.)
net value sets already take non-trivial time in bulk, so I've avoided patching them in the past
friendshipTowardFarmer doesnt care about any ownership
Hm is the friendship shared then
yeah its friendship towards all the farmers collectively
yes
same as with pets afaik?
also yes
Ah i see
wait no
yeah, pets share the same field, a single int w/o any farmer connections
I guess u can just only do anything on primary player 
am i misremembering
Context.IsMainPlayer or something like that
ok yeah im misremembering oops
unfortunately if i use the value changed event and don't patch the getter then the system could well fire randomly on garbage values from random calls to math.min
yeah, thought so, I saw Pet calling the .Set and such 
the overflow friendship is stored on the animal's moddata with no farmer key
i mean i still dont think transpiling methods that call friendshipTowardFarmer is bad
But that's netsync'd too by itself so it's fine right
I dunno im outside and vaguely recalling decompile over here
i want this system to work with mods that add friendship aswell
you can patch every mod in every loaded assembly automatically
yeah
itd be, yknow, costly, but itd be costly on startup
patching each base game method is still the only "clean" route I can think of, and monitoring friendship + math.min isn't guaranteed to catch all mod logic either, it's kind of inherently imperfect
but also i thought the implication was with a CWT you wouldnt need all this
(it's like 5 methods total for the base game stuff, and the same transpiler could be thrown on all of them, depending on detection logic)
i dunno if i could pull off the kind of transpiling necessary, i'd have to do weird stack stuff to track down when the value produced by math.min is stored in friendshiptowardsfarmer and to check for math.min being called with a 1000 constant, right?
the same transpiler can be thrown on all of them for sure if you just do instructions.MethodReplace or w/e it is to replace calls to the setter with your own
ideally it'd replace calls to math.min if the value produced is stored in friendshiptowardsfarmer and one of the arguments is 1000
or do the Manipulator extension instead to insert a call of your own right before or after the setter is called
It should just be a set property right
but idk how to track that stuff
im not sure why itd be ideally math.min instead of ideally the setter for the friendship value
Netint.set_Value or whatever
it would be yeah
Just find that n swap in ur own it's fine probably
otherwise i can't determine how much it overflowed by
unless i also patch math.min yk
Yeah then u need to match the whole thing including math.min
Swap out math Min instead?
idk how to make a transpiler that tracks values on the eval stack
Well u don't really care about that cus u r just make ur own specialmin(int, int) to replace math.min with
well thats just any transpiler
you dont have to replace math.min either
you can simply hijack its arguments and then put them back on the stack
Let original il give u whatever the stuff on top of stack is
however you know there is nothing stopping a mod from just, not Math.mining it right
well i only want to replace math.min if its result is stored in friendshiptowardfarmer
so how would i test my mod
Yeah that's the first part where u match for the right math.min by context
I feel it is fairly normal transpiler and there's several ways to achieve it
ofc, but then they're either doing it manually (weird) or producing incorrect behavior (their fault)
(don't think so, I've only ever tried the setter)
can i not patch NetFieldBase<int, object>.Get?
there's no NetInt.Get - it inherits NetFieldBase<T, TSelf>.Get
unless their mod is "increases max friendship for farm animals"
and you can't patch generics
then that is wholly correct behaviour
you can patch generics if the method uses the generic type in its signature and the generic type is instantiated as a struct, right?
That's just feature overlap right
they may even change the 1000 for a 2000
Gotta pick a cake
yeah
generic patching is not supported at all by Harmony/MonoMod
i didnt say unlimited friendship, just increased
you can try, but whether it will work? 50:50
are harmony docs lying to me. they say it will usually work if the type in question is a struct and its used in the function signature
one could Math.Min(1000, friendship + value) as easily as they could value = Math.min(1000, value), friendship = value or friendship = value, friendship = Math.min(1000, friendship)
i wouldnt say any of those is incorrect
maybe the third one depending on how syncing works
if you really want to go this way, i'd first double-check if patching that method actually works at all
its okay to have notes on coding right
i dont see why not
https://harmony.pardeike.net/articles/patching-edgecases.html#generics
If the generic includes a value type, such as
int, in most (but not all) cases, the method will not be shared. Patching a method which uses a value type parameter will patch only that specific method. Conversely, patching a generic with an object type will not patch the value type method, so both may have to be patched.
all of those would be caught by a system that detects "netint.get, math.min, netint.set"
Dup
Or maybe not lol since you need to duplicate 2
also for context
It might have once worked in framework
the harmony docs say this specific situation will usually work
and also also, the Get method is so small, it very likely gets inlined anyway
It's incredibly unlikely to work in Core
(was more warning against the discussion just prior about trying to match Math.min)
Anyways
Do what you want
The general consensus of this thread seems to be "oh god no"
i can see calls to either NetInt.Get or NetInt.Value get in my decompiled code, doesn't that mean its not inlined? or does jit inlining affect harmony too?
the latter
more like
when a method gets JIT compiled, and the compiler decides to inline a method call, it will take its current impl and insert that into the result
if you patch the method after that happens, the calling method still contains the old impl, not the patched one
Yeah. Inlining is done by the jit, not roslyn
honestly idk how else i could do this? i need to capture the value before it gets put through math.min, but only use it if it ends up getting stored in friendshipTowardFarmer
i mean my choice would be to not do it. id patch the base game methods manually with a reusable transpiler and handle mod compatibility as it crops up
so you're saying i can't patch netint.get before it gets inlined?
idk if you can
inlining is often proving to be the devil
i suggest you try patching it and see if it works
for both the generic and inlining reasons
yeah i will
and yeah, i'd probably go with Button's way instead
patch the relevant game code, worry about mod compat later / add some API
terrible idea but is there a way to check which method called the one you're patching
not without big performance hits (get the stack trace)
very unfortunate
and inlined calls would also screw it up
Man content.json is pretty confusing
i'd just be comparing the result between two calls so that wouldn't be a problem
getting a stack trace is expensive, and inlined method calls don't appear on the trace
and you'd have to parse the trace
very annoying
it's how Harmony's PatchAll() with no params works
and inlining was how it broke on Android back in 1.5 heh
maybe i could patch math.min to remember which method it was last called in (if one of the arguments is 1000) and then compare that against the next call to friendshiptowardfarmer's setter? that would avoid the problem of random calls to math.min triggering overflow stuff if they happen to line up with setting friendshiptowardfarmer
you're really trying too hard imo
😖
it's getting to the level of Slime Rancher modders patching Enum.GetValues to add their stuff
first mod is avocado mod does that sound simple
okay but that's slime rancher's fault
i didn't mod Slime Rancher, but i do think they could at least try doing something else
loll
patching system methods sounds scary
a subnautica mod i maintain patches array3<int> methods
to add support for negative indexing
bc otherwise the game gets confused if you expand the world bounds into negative batch indices
if you're hardcoding to look for an argument of 1000 anyway then you're already giving up some mod compat, so you might as well just worry about the vanilla game and take the easy way
i'll probably try and figure out how to detect math.min calls where the value is stored in friendshiptowardfarmer and make a transpiler that replaces those
well. ideally itd just look at the arguments, not replace the call. but there's two of them and that's a pain
unfortunately there isn't really another way to know which argument is the max value and which argument is the value being clamped, unless i were to patch it individually at each call site
this convo reminds me
is it better to transpiler all the spritebatch.draw from specific method
or conditionally skip prefix draw
I'm guessing a prefix on something called a million times per frame is bad, but you can always test performance 
I still prefix-false a few things just to make monsters run faster
well the prefix does very little work and is already prefixed by spacecore 
i wanna think im not adding that much overhead but idk how to profile this
it's probably fine if the check is simple, I've just never personally messed with something used that often
the actual thing is that
- i wanted to make building like draw layers work on furniture
- to slacc i used a furniture.draw prefix to set "now in furniture draw" and then prefixed spritebatch draw so that i can just record the layerDepth value
- do all the actual drawing work in furniture.draw finalizer
it turned into a skip prefix cus sometimes i dont want orig furniture
but yea doing this ofc adds overhead of harmony calling my prefix where i instantly return 99% of the time
i am consider switch to transpiler since i want to modify the layerdepth
I have made custom objects for my mod. Can i add them to universal dislikes? etc
Okay nice! Is there anywhere where I can find a example of how to build the code? ehehhe
if you're familiar with Content Patcher already, this text operation example is close to what you want:
https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide.md#text-operations
(if not, I think there's a bot command for CP tutorials, but I'm not sure what it is
)
Thank perfect! Thnx <33
what files do i put my mod in
Hello! I'm looking for a sound mod where I can easily toggle the sound on or off, specially during cutscenes !
coding is addicting
if you're looking for mod recommendations, I'd try #modded-stardew, but doesn't your keyboard have a mute button in some sense?
-# (forgot to reply
)
I'm watching youtube videos on the background !
ah, I see
you'll want system level application sound off
did so, couldn't find the channel
i'm on mac
sell it \j (seriously though this aint channel to ask for mod rec)
what exactly do you mean by this?
Where do I get help with making Stardew Valley mods?
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.
Is there any general rule of thumb for how big a UI should be in terms of pixels so it'll fit on smaller screens on PC? I'm using stardewUI if that's relevant
It's C#? Let's go!
the game's native resolution is 1280 720
since you are using stardewui u can do things to make the ui fit to size
how does one do this? I've only seen layout="some number px" so far
you can do 80% or 80vh
check the docs for syntax
my rec is that you should make the ui work in 1280 720, and make use of extra space from bigger screen when it makes sense
how do i make my npc mods (which has custom locations) compatible with the "npc icons on map" mod and also things like cjb hack which has warp locations? actually i just answered my own question its probably on some kind of docs
it just works
for custom locations what you need is not npc icon on map, but world map data
Data/WorldMap
by make use of extra space, do you mean like set the height/width to be x% and then put scrollable for stuff?
ohhh okay i meant more of like customizing the icon asset and stuff, i will look into it in the mod page
does the cjb cheats menu usually warp the player in front of the building or in it? (e.g. if you choose to warp to pierre's, do you get warped in front of pierre's or directly in the shop)
sorry i cant test it rn
cjb cheats has docs on how to add custom warps using content patcher
How do the last two temporaryanimatedsprite flags work? I want a sprite to fly like a rocket (shoots up at increasing speeds) but I can only get it to spawn at max speed no matter what.
yeah i was reading that, i was just wondering where the warps typically placed people
the tile you specify
I don't think it even works without specifying a tile
yeah, it doesn't, non-optional. I recommend reading the docs in full if you haven't yet because the author's guide explains this
What numbers are you using
I would try smth small
Yeah, I figured it out. Do not use motion and acceleration_change, and use acceleration with tiny increments like -0.2
However, I have another problem: How do I use the TAS command inside a quickQuestion? It keeps erroring in the texture name part, regardless if I use double backslashes or a single forward slash
Is there some special way to escape it?
Why is it so freaking so hard to mod stardew valley in my android phone😭
what are you putting for the texture name?
temporaryAnimatedSprite Mods\\Sunsketchx\\TASmushroom 0 0 16 32 50 3 1000000 3 6 false false 999 0 1 0 0 0 acceleration 0 -0.2
It works perfectly fine when used outside of the quickQuestion
hmm i wonder if it's parsing the \\ as separating commands and thus thinking the TAS argument is incomplete
just to test, what happens if you instead load the texture to Sunsketchx_TASMushroom, and use that as your texture?
That worked, thank you!
Another TAS question. Let's say I have a single loaded .png with separate sprites for a rocket and its smoke, can I call the TAS command once for the rocket and then call it again for the smoke or is that a no-no and I have to make them two different loaded files instead?
i don't see why not, as long as you define the texture properly!
Perfect, thank you again
if it doesn't work let me know
hii, ok if i were to need to change the coordinates of the stardew baby, does anyone know how I would go about doing that? if there's a page that will help or something that would be great too. in all honesty, I'm trying to solve a bug by myself and it feels like an easy fix if I can just do that.
is there a token or something that keeps track of the date you married an npc? like an {{Anniversary}} token?
or is that like Not a thing
well, the baby itself is displaced in game. It's like, y coordinate is different to the crib so its like on the floor somewhere haha.
the actual entity/ npc of the baby itself
The crib/baby position is fairly hardcoded you need some kinda mod to do it
I made a thing that let you move the crib, but I didn't decouple the baby from the crib in any way
mmm feared this lol
Depending on the ultimate goal you may want to just make your own C# mod?
i just dont know why my baby isnt in the crib fhuihfhf
Are you using any farmhouse mod?
yeah
Probably more of a mod help question then, if you aren't making your own farmhouse mod
!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).
You can ping me after making thread
ty 
is there an easy way to check if a given player is a splitscreen farmhand?
Context, thank you
I knew there was some utility class but couldn't remember what it was
bump
Hi, I created a farm map in tiled, placed the houses where I want them to appear, and placed the blocks on the Path, where they should be created, but for some reason the game is only creating the first 2 houses, the other houses are not being created when creating a new farm.
Does anyone know what could cause this problem of multiplayer houses not being created?
did you add the order property to them?
yes
do they have the correct numbers?
There are two blocks for each type of house
2 - Order 1 (One for a nearby house and one for a far house)
And there are 7 houses
14 tiles
MightyAmondee's Custom Tokens mod adds these
(anniversarySeason, AnniversaryDay)
thanks lemur!
hypothetical question: if i have 3 different versions of a dialogue line for different times of the day, and i want the character to like... queue up more dialogue after certain times, can that be done? like if i have morning, afternoon and night lines, and when u talk to her in the morning she says morning, talk to her again during the day she says the day one, etc etc
she does not move, its just based on the time change, and it'd most likely be in One Key. i don't think that's possible which is why i'm asking
oh thanks chu!
if she doesn't move, then maybe schedule location dialogue
just have her schedule move her to the same tile she's on but with different dialogue
hi ^_^ i have a StreamedVorbis question. the wiki recommends using it for things like background music & setting it to false for short sound effects, but all the mods I look through set it to true for short sounds like animal sfx, the horse flute song, etc. is there a good reason to do that?
You have to use a tiledata object with Order and a unique number 1-7 for each path cabin layout tile (near and separated), if you accidentally repeat even one, it blocks it and any after it from appearing
streamed vorbis = ogg files. more CPU work to play it, but smaller file size usually
iirc
Also less memory
that too
wav must be loaded into memory in entirety to play it but once it is it's smooth sailing
gotcha, thanks :)
hello lovely people, i have made a tool
https://stardew.button.gay/tools/mapfixer
drop one or more .tmx files into this thing, optionally select which fixes you wanna apply, hit "Fix" and it'll repair your .tmx if its broken in the most common ways we see (tilesheet climbing, invalid gids, unnamed tiledata, etc)
once it's done, any maps that needed fixing will be zipped up and downloaded for you. the zip will also include a folder of backups of said maps that are completely unmodified, just in case bc i know writing "make backups" wont make people do it
it'll log all the fixes it makes as well as any warnings or errors for things that you might need to note (like if its unable to fix something (.tsx's arent supported, for instance) or it detected an error that you said you didnt want fixed but you should be made aware of)
this isnt intended to be in like every mapmaker's standard toolbox to rely on or anything but more so just as a quick fix if you cant be bothered to do it yourself or, more commonly i expect, giving to newbie modders with a broken map who dont know how to do the fixes themselves
okay thanks back to my sdv modding break 
Upload .tmx files to fix common map errors.
I think the problem is in the position of the tile, it is difficult to get the direction right using the tiled block, I will try to do it using code
direction?
Same question
cabin tiles are not directional. they are just the upper-left tile of the cabin footprint, which is 5 x 3
Showcase?
I moved their position a little, and a house appeared, so I think it's the tiling that fails, if it's just a little bit out of place
is that something thats even allowed in the showcase
Yeah
It's like modding tools
Lina showcased the aseprite extension too so i think it's about the same
can the showcase do a video file attachment like that
Ik it can do gif
But y'know maybe i just @outer glacier so it can be deleted if it no work
well i dont see why not then i suppose if ya wanna do it for me
just maybe put < > around my website url to hide the embed for that just in case the showcase decides to use that embed instead of the video
which u will need to download from discord
Map modding tool by @uncut viper !
hello lovely people, i have made a tool
https://stardew.button.gay/tools/mapfixer
drop one or more .tmx files into this thing, optionally select which fixes you wanna apply, hit "Fix" and it'll repair your .tmx if its broken in the most common ways we see (tilesheet climbing, invalid gids, unnamed tiledata, etc)
once it's done, any maps that needed fixing will be zipped up and downloaded for you. the zip will also include a folder of backups of said maps that are completely unmodified, just in case bc i know writing "make backups" wont make people do it
it'll log all the fixes it makes as well as any warnings or errors for things that you might need to note (like if its unable to fix something (.tsx's arent supported, for instance) or it detected an error that you said you didnt want fixed but you should be made aware of)
this isnt intended to be in like every mapmaker's standard toolbox to rely on or anything but more so just as a quick fix if you cant be bothered to do it yourself or, more commonly i expect, giving to newbie modders with a broken map who dont know how to do the fixes themselves
okay thanks back to my sdv modding break 
nop didnt work

submit official complaint to aquova i guess
it might be good to include this in !tilesheetclimbing
idk how to edit commands tho
i can't edit em 
button dodging all responsibility with this one (1) neat trick
but you still have perms to submit PRs to Leah 
ah yes i gotta remember to impose responsibility
see if you can include a video in an embed
@ivory plume hello pathos it is I once again.
A while ago I asked if smapi can eat Arbitrary Tilesheet Access for loading tilesheets from outside of Maps/* by using Content/ as prefix. At the time the response was "todo.txt". If button or someone else were to PR smapi for this, how would you like it to be done?
@gaunt orbit It really was the tiled position, using code it worked
It's mainly stuck in TODO.txt purgatory because I'd need to figure out how to make it work safely and deterministically. PRs are welcome, but figuring that out would unfortunately be part of it in this case. Feel free to discuss ideas on how to approach it here if you want!
hm so i do want the actual path still resemble a file path, for tiled reasons
ATA's setup means i'd just make a Content folder next to my tmx and put say Buildings/Barn.png in there for usage
semi inspired by this, but is there a way to alias an asset / load an asset to another asset in content patcher right now
Target is the part I want to keep, it's FromFile that's the issue 
oh right I see what you mean, but what if it isn't my asset?
you're a chad for buying stardew.button.gay
I'll take that as a no
it would be a simple ish way for map makers to get around tilesheet access if it can be implemented with minimal overhead (so probably more like a symlink between two assets than copying the asset into another asset?)
i think u would have to get 2 copies of the asset
and also its time for Graph Theory
gotta cycle check
why would you have to have two copies of the asset
what if i copy A to B and then editimage B
and preventing cycles is easyish because patches are applied synchronously and you simply don't allow aliasing to an existing name (maybe?)
Is the author of Livestock Bazaar here?
that would be chu
hi yes what ailes thee
symlink would mean either you can't or that it just edits A
I'm in favour of you can't because that's not the point of aliases
that creates a new class of asset targets then
So several people have asked for Lilybrook to be compatible with Livestock Bazaar and I'm not quite sure what this yellow smapi text means. "[Livestock Bazaar] Invalid Texture field on farm animal '8BitAlien.Lilybrook_MiniaturePony', this is a problem with one of your farm animal adding mods and should report to that mod's page."
it means your horse is broken
this message is for you, the mod author who added the farm animal
check the Texture field and see if you have a matching Load
Yep I know that but I can't see anything wrong with my json
!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.
you loaded your texture to Animals/MiniaturePony1
field says Mods\8BitAlien.Lilybrook\Assets\Items\MiniaturePony1
i recommend loading your animals to Animals/8BitAlien.Lilybrook/<animal name> btw, so that you dont become incompatible with another miniature pony mod
Ahh ok I see. I will change that now!

yeah but 
as for further compat, u can make a shop to sell animals in lilybrook if you like
it'd be optional cus people will be able to buy from marnie unless you specifically go through livestock bazaar to ban the animal
button if you prove that my idea won't work I'm blocking you I swear /j
maybe im just being dumb rn and itd click what you meant later, but can i ask what exactly you mean by determinstically here, or how a static image source in a .tmx is less determinstic than the current option, which is a static image source but limited to one directory?
im not sure i understand what your idea is so ur safe(?)
I just mean that a given tilesheet path must always be resolved the same way, regardless of the current player's folder structure or which files exist in their Content folder (i.e. the behaviour can't change from one player to another).
(That avoids hard-to-troubleshoot bugs where it works on the mod author's computer, but fails for some players or accesses an unintended asset.)
I've sorted it and sadly it's still erroring
ahh. in ATA's case though it just checks whether the image source in question matches an asset name and doesnt actually look in any folders, just the content pipeline, to assign as the asset, which should count, id think
is it still talking about same animal?
Yep, but i think the problem is coming from the fact that the pony has skins
i suppose technically the behaviour would be different if two players had different mod lists but it would be the same kind of different if someone didnt install i.e. daisyniko's tilesheets for a mod that required em
Ideally it should be deterministic with different mod lists too.
this particular check is only for the base texture iirc, but you should fix any erroring skins too
The skins work fine with the base game I was just struggling to get compat with Livestock Bazaar
in an ideal world the asset would always exist! but i dont see how thats different from your mod relying on another mod loading their assets to the Maps/ folder first, with you setting them as a dependency
livestock bazaar has support for skins
what this warning actually does is prevent people from crashing my menu with invalid animal texture
it doesn't crash vanilla menu because livestock bazaar displays the actual animal for aesthetics
For example, a deterministic approach would be to support paths like ../LooseSprites/furniture relative to the Maps folder. That always resolves to the same asset name (i.e. LooseSprites/furniture) regardless of which assets exist or which mods are installed. The target asset may not exist, but the resolution will be the same regardless.
Is the idea of allowing tilesheet climbing as long as its at most 1 layer (i.e. never escapes Content) deterministic enough
Yep, that's the tentative approach I have TODO'd.
incidentally i just noticed that the skins menu dont have a equiv check so i gotta fix that next version 
So basically, I want to have Marnie selling the pony as usual but add Livestock Bazaar compat. I'm a little confused on how to do this. I've looked at the authors guide but a lot of that seems to be for custom shops
you do absolutely nothing if you just want marnie to sell the animal
in your theoretical implementation where ../LooseSprites/Furniture resolves to LooseSprites/furniture, would that also mean that something like ../../../LooseSprites/Furniture would resolve as well i.e. fixing tilesheet climbing at runtime?
or just allowing one .. max?
im checking to prevent mods with invalid data from exploding my menu, not for any compat purposes
../../../ would be referring to the LooseSprites/Furniture file in another steam game if the filepath concept is respected
You wouldn't be allowed to climb out of the Content folder, so that wouldn't work (unless the map was deeply nested like Maps/mine/moreMines/mines.tmx).
anyhow if u wanna get a log and open a thread i can help u in more detail there
or just someone has their sheets in a different location thanb usual
tilesheet paths always assume the current location is (Content)/Maps/ right?
LB compat
i see though, i understand, so you want to actually follow the content folder's filepath and actually treat it like a filepath, not as a single asset name
that wouldnt work to allow people to use any modded image like ATA does currently then, i take it?
ATA for example would allow Mods/UniqueID/ImageName as a tilesheet source
Yep. I think the base game / xTile does technically support ../, there's just no validation on it; so we probably just need to adjust SMAPI's validation from "no directory climbing at all" to "no directory climing out of the Content folder".
the entire asset pipeline can be projected as being a logical location in the content folder
If Mods/UniqueId/ImageName is loaded into the logical Content folder, it would work fine. You'd just need to do ../Mods/UniqueId/ImageName (i.e. relative to the maps folder).
I didn't know and did not understand the tutorial correctly. Thanks for explaining it.
would it be easier to simply remove SMAPI auto-applying the "Maps/" prefix unless the image source has no directory at all (except Mines)?
(/gen bc im sure theres something about that that ruins backwards compat that im not thinking of)
(Applying the Maps/ prefix is base-game logic, not SMAPI.)
its what ModContentManager.GetContentKeyForTilesheetImageSource() does
if the top folder is not Maps it prepends Maps to it
Ah I see what you mean by deterministic now.
if the path in the tmx is Mods/UniqueId/ImageName do you interpret it as forward directory climbing, or as an absolute path in the asset pipeline.
I'm in agreement something needs to be in the path to tell it to not do forward climbing, either relative path ../ or explicitly absolute / at the front
the vanilla game may also prepend Maps to it, but SMAPI doesnt strictly have to follow suit in its own implementation
What’s the order of operations for creating a mod? I have ideas, I know theres a how to make a mod rhing on the wiki, but like what else do I need to have in mind or need to look into to learn how to do it. I have no clue
(for ATA instead of just an absolute / at the front, i just decided it must start with Content/ itself, but same concept, basically)
unless you actually did want forward climbing to a folder called Content
that is true and i did consider that when i made it need "Content" instead of ATA's uniqueid but considered it a worthwhile trade-off for convenience
for a mod i think thats acceptable, though i'd agree less so for SMAPI itself
though I'd imagine tiled wouldn't be a big fan of /Mods/UniqueID/ImageName and might interpret that as C:\Mods\UniqueId\ImageName or something
yeah i just tested it and it wants to check my C: drive directly
making it easy for Tiled to understand without you needing to open up the .tmx itself at all was somethin i considered important for it
(which tbh is also why somethin abou the ../ requirement seems a bit less than ideal to me, since you'd have to have your working files outside of your mod folder (or outside of the folder with the tmx at least) for them to work)
(or if you are someone who makes your maps from inside your unpacked folder then you gotta keep stuff in your unpacked folder, though if youre doing that you're already used to that anyway so thats no biggie)
I love silly bugs
Ah I think I see how vanilla/xTile/xna would causeMaps/ to be prefixed now
for SMAPI loaded content though its just the ModContentManager class that does it, since thats all i needed to skip prefix to get it to work
during the xnb reading it would use TideReader to interpret the file, which will read the tbin from the memory stream, and then set assetPath to the asset name in the pipeline, and then call map.FlattenTileSheetPaths which iterates over the tilesheet references replacing \ with the system directory seperator char, and then setting the imagesource to be combined path of the assetPath (minus filename) and the path referenced in the file directly, and the MapDisplayDevice that is used to actually convert ImageSource to a file just passes it straight into the content manager
which would result in the map Maps/BathHouse_Entry having the tilesheet reference of bathhouse_tiles to use Maps/bathhouse_tiles
Chair economy in shambles
the TMXLoader path (or even the direct tbin path) doesn't appear to call FlattenTileSheetPaths, so SMAPI's FixTilesheetPaths is needed
which as far as i could tell doesnt have much reason to imitate the same auto-Maps prefixing in all cases aside from "thats what vanilla does"
other than being able to take an unpacked version of the vanilla maps, use them and still work
Did I do it correctly this time?
thats why i said "in all cases" theres no exceptions to it, nothing is done before first tacking on the Maps/ part
you could always do that after doing some other checks
though the vanilla logic technically isn't prefix everything Maps/ but prefix with the assets location, which by convention was the Maps/ folder anyway
but theres also backwards compatibility for all the maps made in the last however many years built with the understanding that tilesheets are relative to the Maps folder, and changing it is a breaking change
(semi-relatedly, i probably shoulda given FixTilesheetPaths a glance when working on my map fixer, theres more stuff i could warn about...)
only thing not breaking is allowing directory climbing as it was always previously forbidden
if you checked "is [image source] an asset name" first before you checked "what about Maps/[image source]" that would still be backwards compatible i think. emphasis on "i think"
i know just using it as a straight up asset name wasnt the desired implementation, but just as an example
then you get the deterministic errors where on one persons modlist it got interpreted as a direct asset name, and on someone elses modlist it was a Maps/[image source]
what about checking Maps/[image source] first and using it if found, and then checking the asset name if not?
ive been saying "before checking Maps/" but what i shouldve been saying is "before permanently attaching Maps/ to whatever the image source is"
🤔 i have a weird npc question... How hard would it be for me to get 2 NPCs to both walk and hold hands? I feel like one will always end up behind the other somehow and it won't work
thatd stop working as soon as they needed to turn a corner
even if you could get them lined up to start
😔 yeah i figured corners would absolutely destroy my plans
just gotta fiddle with schedule until they sync
it is fairly straight forward to have em hold hands in a schedule anim tho
it would also stop working if there's like a slight delay, like if a player stands in front. but u shouldnt worry too much about the player intercepting though
also omg chu your mod is going to be a lifesaver 
if demetrius dancing alone at the saloon on friday because robin is building is good enough for vanilla, you can have a little "holding hands with no one" as a treat in case of player interference
*mod tool
yeah lol i think the player would understand at that point
oops sorry for the ping
Ah, thats the other danger of allowing directory climbing.
before doing the Maps/ prefix and asking the asset pipeline for the asset, it does check first whether the file exists in the mod manager, which I think could directory climb to escape the mods folder and read a different mods folder directly
TryGetTilesheetAssetName's call for GetModFile yeah
it was such a tiny function name i glossed right over it
i was expecting something more descriptive/longer
too used to CA's wordy function names
its button's mod tool!
hi, I prepared an event for the NPC I created, but it does not trigger in the game and does not give an error in the smapi log..
and I looked at previous messages and it was said that the z command was used for all seasons except that season, but in the wiki it is the opposite??
also i suggest using a unique id instead of a number id
like {{ModId}}_eventname
the z command is part of the deprecated preconditions in the wiki
the new syntax i believe is !winter, for "not winter"
(you should definitely switch to the newer, human-readable preconditions and not use z et al)
to match just winter, use Season Winter. to match anything except winter, use !Season Winter
yeah sorry it's not !winter it's !Season winter like ichor said
and just give two seasons to match those two, e.g. Season Summer Fall
assuming im reading and following the code correctly and am correctly identifying what all these variables and args would be, i think it should work out fine if, during FixTilesheetPaths, where it currently checks for PathUtilities.GetSegments(imageSource).Contains("..") to detect climbing in the first place, use that moment to check if its valid climbing and if so, modify what relativeMapFolder is, which is what gets passed into TryGetTilesheetAssetName
oh okayy
thank you ill try them now
hope it helps!
i realized 15min later that this is also technically breaking if a mod was relying on forward pathing with a folder structure in their own mod that matched the games content folder
f
If I have MyMap.tmx next to the manifest.json and have a tilesheet reference that is ../Stardew Valley Expanded/[CP] Stardew Valley Expanded/assets/Tilesheets/EnchantedGrove/Shadows
am I escaping my mod to access SVE's files directly (which should be forbidden), or wanting to do an asset pipeline asset
asset pipeline asset, assuming my understanding of what pathos said he'd want for implementation
where its assumed you start in Maps/ and its all relative from there
assuming my understanding is correct*
(which it may not be)
yeah just means extra logic needs to surround the GetModFile path to only attempt local files while still inside the mod's folder
as local files within the mod folder are stable, as it doesn't matter where the mod is installed or what other mods are (or aren't) loaded
i might be missing something again but it seems like you should just be able to skip that GetModFile if-statement entirely if the modRelativeMapFolder contains "../"
with the previous function, FixTilesheetPaths, replacing its check for "../" with a check for an invalid amount or invalid placement of the "../"
then you navigate up the content folder after the GetModFile stuff
that is one solution, if you climb a directory you lose access to local files and become asset pipeline only files
right now, you arent allowed to climb a directory anyway
so no mod would be relying on that
yup
and then you can replace the "../" with just "Content" after that, though im not sure what you'd do in GetContentKeyForTilesheetImageSource
dont know what to do about the current auto-prefixing of Maps/
since you cant just detect if the source starts with "Content" bc then we're just back to what ATA does, which isnt acceptable
maybe wait until you're in that function to replace the "../"?
if it starts with ../ then you just don't prefix Maps/
sometimes ya just gotta type out loud enough until you see the "oh, duh" answer 
rubber duck debugging except im talking to air
rubber duck debugging is a -
its a very legitimate debugging tool
I prefer talking to the dog. Thanks
What does nexus mod endorsement mean
thumbs up
i have been endorsed by vegetarian alex. and the person who made the mod tutorial!!
"bangin' mod my man"

I understood this reference.gif
what is the reference
(deltarune)
ohhh
uhhh something papyrus spagheti (under tale)
sans under tale
I am so gamer
He a little confused but he got the spirit
Create a mod folder, pop a manifest.json and a content.json file in there (content.json if you're making a CP mod, other frameworks will have their own required files), populate manifest.json with the appropriate information (look at the "For a content pack" table), and start writing patches in the content.json.
I think I did almost everything necessary... How do warps work exactly? I did everything for going back to the farm, but how do warps work for going outside the farm?
Open a vanilla map and check the map properties to see how to do warps off the farm
As in, you couldn't find it before but you did just now?
No I can't still...
What vanilla map do you have open?
still doesnt trigger
So you want your event to trigger if you have 1250 friendship points with an NPC whose internal name is NPCAtsushi, NPCAtsushi is on the map, it's not winter, it's raining, and it's between 8:30pm and 11pm?
Standard Farm.
no actually its winter i changed it like Season Winter
Did you open the map properties?
Ok and have you confirmed your event works if you use debug ebi deadxl.atsushi_GraveVisit to trigger it?
oh no never heard it
The one on the top was it? I might have messed up and clicked on the wrong properties.
it says [game] Event 'deadxl.atsushi_GraveVisit' not found.
could be my modid wrong or eventname idk
Thank you again. I think I found it but I can't really read it...
There are so many numbers all over the place
Then yeah the issue is that your event is not actually present in the game. Your patch to add it hasn't worked. Are you adding it to a location that already has events in it?
Use the maps wiki page to understand how to read it.
Modding:maps?
Yes
I uh... I don't really understand what it's telling me.
Am I looking at the right thing?
Warps & map positions?
um i actually adding it to town
I think so. It's this one.
Ok, that's fine then. Can you do a patch summary to check that your patch did get applied? It would be patch summary deadxl.atsushi and then share the link to the log here.
It's confusing because...
"80 15 BusStop 11 23 80 18 BusStop 11 24 80 16 BusStop 11 23 80 17 BusStop"
The standard farm has so many for just Busstop
bc the path to the right of the farm is not a 1 tile tall hallway
its a wide path you can take, so every tile you could possibly cross the barrier with must be a warp
Oh! So you can't make it a straight line?
each warp is a single, individual tile
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home Single Language, with 12 C# mods and 8 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
Oh dear, don't Load your event. By doing that, you're deleting every other event in Town including all the vanilla ones. You want an EditData. Try switching to EditData and then try debug ebi again.
Oh no. I think I have always used the wrong coordinations...
I used the ones on the right...
Those are not tile coordinates
Can you go up to the Map menu and then click "Resize map" and then send a screenshot of the box that pops up?
I used the Standard farm as an example of my mistake.
The custom map has them like this
the coordinates in the parenthesis are pixels and not tiles
I am not smart...
Ok see how that is 64x44 tiles? That means a tile coordinate can't be any number bigger than that. Same for any other map. If it's a number over a hundred, it's probably wrong.
what about the X and Y for tile properties? Those can be very big
Those are also pixels
Oh...
A tile is a 16x16 pixel square, if that helps!
Either always divide them by 16 or just pretend they don't exist.
(some notable maps actually are quite large/over a hundred. Town is!)
Pixel coordinates and tile coordinates are different, if you look at the wiki, it will generally tell you which one you need to be using.
(Yes, but even the bigger maps are not much over 100.)
I misunderstood that bit as well then.
(Certainly nowhere near 1,000)
This is so frustrating. Urgh...
Okay uh... I will try and understand the difference...
"BusStopEntry [<int x> <int y>]" "PetBowlLocation <x> <y>" "EntryLocation <tile X> <tile Y>" i found these three different ones. Busstop entry uses "X int and Y int" which I don't know about, Pet Bowl uses just "XY" and EntryLocation uses "tile X and tile Y"
They are all the same thing, said three different ways
X = the tile position on the X axis, which is an integer
So they all use the left numbers?
Yep
Okay. time to fix this mess... Thanks for explaining it.
(is there anything that uses pixels for maps Aba? /gen)
The fact that I think the answer is no means it's almost certainly yes xD
Wait so the warps are put out of bounds? I always thought it was the tile before oob.
Seriously, I can't think of any. I know there are event commands that use pixels for the map (like viewport or positionOffset) but nothing for map-making.
I guess... it would explain why it takes so long to use the glitch...
time for chu to add pixel based map proprties
I'm so frustrated at myself for not understanding it...
learning to mod is a skill no one starts off with
And we all have bits that we struggle more than others to understand
and sdv modding especially has like, a lot of different bifs of info to know
bits, even
(Like me and Fields vs Entries
)
Well, I did mod Hat in time in the past which used the lines for warps and such.
You'll get there eventually, it takes so much time
okay, and? 1.6 changed a lot, and everybody messes up sometimss
i would probably suck at AHIT modding and would need you to help me!
i've questioned why things aren't working before then realizsd i forgot to load the file
Okay.
i switched and gave me the same error https://smapi.io/log/402e31ddc91e42c68b683cb3b363bd3e
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home Single Language, with 12 C# mods and 8 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
thats my content https://smapi.io/json/none/95d9f7700ca54cd69d228655240b274f
Your event id is deadxl.atsushi_Town but your command is trying to run deadxl.atsushi_GraveVisit
oopsie i didnt notice that..
Do I use the Left numbers for the entries or do I use the XY from tile properties?
Never use the XY from tile properties
okay now it worked when i tried debug ebi but my farmer doesnt follow the coordinates
Unless you find something explicitly saying it needs pixels rather than tile coordinates, never use the XY from the tile properties because those are in pixels.
Okay thank you.
Your first move command is telling the farmer to move 54 tiles to the right and 96 tiles down. That is wrong on two counts: one, that's way too many tiles than you actually want them to move and two, you can only move them in one direction at a time. Move them along the X axis OR the Y axis, not both.
I think you've interpreted the move command as needing to put which tile coordinates the farmer should end up on, but that's not how the move command works.
aaaah- i thought when i give these coordinates it will just go there!!
Your first move command should be move farmer 0 -1 0 rather than move farmer 54 96 0.
i understand now.. thank u
Do I need to do something for the Mailbox as well? or will it automatically spawn next to the House?
I don't know where the mailbox will spawn if you don't set its location so you probably should.
I tried reading this but it just confused me because of the second sentence...
Mailbox part of the building now
MailboxLocation is not required if using a default sized farmhouse
(New in the upcoming Stardew Valley 1.6.16:
- new
Data/Enchantmentsasset to de-hardcode enchantments; - and context tags for tools & weapons, including new vanilla tags.)
So I'm okay?
dehardcoded enchantments 👀 👀 👀
i think i might scrap my mystery bag idea, im struggling way to much to figure things out
૮꒰◞ ˕ ◟ ྀི꒱ა
Oo i can yeet the sc serializer from scythe mod finally
(why does the ClassName have to be in the SDV namespace tho
)
(Because if you specify a custom mod type, removing the mod later will brick the save file. Generally you shouldn't use a custom enchantment class, you should let it default to Enchantment and have mod logic that checks its ID if you need custom behavior for it.)
Can it work like trinket effects u think
fair enough
Type never serialized as the type, instead just the string
Reflection to construct on load
Hmm, possibly the instance could be recreated when the save is loaded based on the data, so all enchantments are just Enchantment.
Is it possible to dynamically generate mail? Like I want to send a mail that randomly gives the player a seed, but it could be any seed from any mod? The docs I'm looking at for mod data only have examples where you know the item id
I don't think there's any way to do it with just a content pack. You could do it with a C# mod though.
i'm trying to make a content pack for fashion sense (just for personal use converting some stuff from bb's shirts mod, it won't ever be published without the og mod author's permission), but i don't understand how to use the color masks. i understand you set the values based off RGB, but do they sort automatically (ex. the first color applies to the darkest value, then the second to the second darkest, so on until the lightest color), or is there some other way you have to specify where the colors apply?
iirc theres only one color you dye clothing with and the game automatically calculated the colors based on the values, you dont get to customize each color... i think. i havent done dyeable clothing yet so im not 100% sure
i'm not sure that makes sense, since the listed example of using color masks has an item where only the outline is colored, not the rest of the item based off that color
but i also might just be misunderstanding
when you make clothing, there's two big columns of the tilesheet; the left is the nondyeable masks and the right is the dyeable masks. so in the example it mightve been that the outline was in the dyeable part
im a bit sleepy rn tho i might be wrong
Are you talking about Fashion Sense clothing sugar or regular clothing? Because they work differently
@ivory plume Hey Pathos, since .16 focus on event update, can we have the event command emote use name instead of IDs, like emote happy instead of emote 4? I find it hard to remember the emotes ids.
(Just a suggestion, can we add our own custom emotes?)
oh okay. yeah ik they use diff systems, and my question is specifically abt how fashion sense does it
i just read through the fashion sense wiki article about colormasks, and since it was a quick skim, just take it with a grain of salt. but i think since you name the color masks, the player gets to set the color for each section?
Ok I had a look at the documentation and I think the Values are the colours that you use to paint your sprite with to tell Fashion Sense they are areas that can be coloured separately from other areas. I'm guessing that when the player adjusts the colour in game, the first slider affects the first colour that you've defined in the json and so on.
so do i have to define the colors first, and then set the values that i want that color/area on the sprite to be? i have colored pngs to start with, but i'm assuming that unless i say otherwise, FS will set the sprites to grayscale
Hi! Emote aliases would be fairly low on the priority list, but you could create dynamic tokens to do things like /emote {{happy}} instead of remembering the IDs.
Custom emotes might a bit too specialized to support in the base game, unless it's something many mod authors would use. Unfortunately there's a performance/memory impact to data assets, and it might not be worth the cost for emotes.
wait how do i use the when conditions? like i'm currently re-coding my Decoratable Cabin mod, but i have 3 maps 2 of which i want to use as overlay to be used when the building is not yet upgraded, once it is upgraded once it will remove 1 overlay and last upgrade will all the overlay, im using the oasis greenhouse mod as a basis
main map(as you can see has the ladder and stair visible) basically when it is fully upgraded -> overlay 1 with no upgrade -> overlay 2 upgraded 1 time
mhm, nexus is giving out free backslashes for every apostroph 
No, you don't use the json to change the colours. You make the png the colour you want it to be and then use the json to tell fashion sense which colours can be independently recoloured by the user. Fashion Sense will not make your image grayscale.
ohhhhh okay! so should i still use the color masks to make sure the shirts have sleeves?
does anyone know which xnb file contains dialogues and strings for interactibles in desert club?
Maybe Strings/Location.xnb is the one you're searching for?
I am not sure which channel to ask this in
thank you, it seems to have what im looking for
Is this mod save to use? https://www.nexusmods.com/stardewvalley/mods/34856
so, i'll have a question dialogue in my event but when i response i dont know how to write my npc's reactions to them. i looked at dialogue guide so am i gonna just write like as it is?
Looks like it should be - https://www.virustotal.com/gui/file/d88eba16a3346af23d067a2cabbb8086d2b013a2c78366cfdc9e3bde9c12c1e8/detection/f-d88eba16a3346af23d067a2cabbb8086d2b013a2c78366cfdc9e3bde9c12c1e8-1750231091
VirusTotal
Depends on what question (through which command) are you writing it.
!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.
Okay thank you. I was unsure
I can have a look and try to help you
it's literally just a CP pack maker (and for fairly simple uses too, it's just editing weapon stats + shops), you have better luck learning to do it yourself than running a random executable
like i just wanna have 2 different reactions yk
True...
i looked at other npc's events but they just have questions
Hopefully should be, never used this format/way.
I recommend using debug ebi deadxl.atsushi_GraveVisit in-game to find out, and test both variants.
i tried that and gives me this https://smapi.io/log/4b71cd00ca0a4aaab20e809e4e0a2467
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home Single Language, with 12 C# mods and 8 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
Then something is wrong... Let me have a look once more...
Well, you use speak and then try to divide the event in that command. I don't think that is possible.
I'd try quickQuestion (https://stardewvalleywiki.com/Modding:Event_data#Basic_format)
like am i just gonna write speak NPC event_sorry?
Eh.. I'm pretty sure that won't work
I recommend - as I said - looking at the wiki link I sent you and reformate the
speak NPCAtsushi \"What the hell are you doing here?! Did you listen to me?!$8#$q 1001001/1001002 Mind your own business!$0#$r 1001001 0 event_sorry#I'm sorry..#$r 1001002 -10 event_yes#Um, yeah but.. who's grave are you talking to anyway?\"/
part to use quick question command instead.
I'm not sure how to answer that. Won't it have sleeves if you just...draw sleeves?
If you want to keep your dialogue question you can use the fork command to switch to an event fork based on the answer in your question. Alternatively you can change it to quickQuestion like Dennis suggested.
it's possible i misread smth as i have mild dyslexia, but i thought there was smth in the guide to making content packs for FS that said that without a color mask, shirts just don't have sleeves
I can see something about the player being sleeveless without the SleeveColors property but without experimenting with a pack myself or being given more information by you about what's happening I can't say I understand what it means.
okay, i almost certainly misread something then. i haven't done my first test run yet, i must have just switched two lines reading the guide
It just means you have to write it in both places
And it has to be identical across the two.
Do I need to change the MODId into moddername.HMGBAFARM?
That's currently what it looks in manifest
No, {{ModId}} is a token. Content Patcher will automatically fetch your mod's unique ID from the manifest and put it in there in place of {{ModId}} when you run the game.
So it will turn the ID of your farm into moddername.HMGBAFARM_HMGBAFarm
Why would you need to write something else?
Thought it might be bad because it says HMGBAFARM twice just one with less caps.
Nobody in game is going to see that part. It's just a descriptive identifier for your farm that ensures it's unique in game.
Okay.
My NPC's internal name is Abagaianye.HiriaNPC_Hiria, which looks silly because it has her name twice.
It's normal to have things like that happen. It's more important for it to be properly descriptive of what your mod is and what the item you're giving an ID to than that it doesn't repeat.
Oh yeah... Did I screw up the mod because I forgot to add the assets folder before making the mod?
Since it's a map
There was so much info I am confused
You don't have to have an assets folder. It's just convention. The mod will still work even if you have your map in the same folder as the content.json. People use folders like assets or data to keep their mod folders tidy.
No, that's meant to be two different images, not just the HMGBAIcon.png. The {{TargetWithoutPath}} token is not meant to be replaced with your own file name, it's there to tell Content Patcher to look for an image called Icon.png to load into Mods/moddername.HMGBAFARM/Icon and then after that look for an image called WorldMap.png to load into Mods/moddername.HMGBAFARM/WorldMap.
I'll be honest... I just copied that from the tutorial page...
I know you did and that's fine. The example is there for you to copy it. It's encouraged to do so :)
But you changed it. It was "FromFile": "assets/{{TargetWithoutPath}}.png". And as I said, that {{TargetWithoutPath}} bit is another token. It's not meant for you to replace with your own text, it's there to perform a function.
If you go to your mod folder and change the name of your HMGBAIcon.png file to just Icon.png and then make a new file for the WorldMap image called WorldMap.png you can use the {{TargetWithoutPath}} token to get Content Patcher to use them.
You'd need to change your FromFile to "FromFile": "{{TargetWithoutPath}}.png" as well.
how do i even fix this?
Okay I fixed the icon stuff. The example did not come with a worldmap line.
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home Single Language, with 4 C# mods and 1 content packs.
The example does come with a worldmap line. That one you posted is the worldmap line. It does both the icon and the worldmap in one go.
No you do. I just told you what you need to change your FromFile to.
