#making-mods-general
1 messages ยท Page 160 of 1
Make a copy of that file
oki doki
yes
So you have folder "Mods", correct?
yes
In that folder Mods, create a new one and name it however you want. It'S your mod, after all ๐
In that new folder, create a file named "manifest.json" (you can create a .txt file and then rewrite .txt to .json)
Oh, that is some setting in File Explorer
At least if you are using Windows.
!fileextensions
Windows and Mac hide most file extensions by default. If you are creating or updating mods, it's helpful to show file extensions so that you can be sure all mod files are named correctly.
To show file extensions on your computer:
On Windows 10, open File Explorer, click on the View tab, then check the File Name Extensions box.
On Windows 11, open File Explorer and click on View > Show > File Name Extensions.
On Mac, open Finder, and in the menu bar, click on Finder > Settings (or Preferences) > Advanced, then check the Show all filename extensions box.
Use that message from Abagaianye (thanks!)
it's a .json now
In that file, copy this:
"Name": "Your Mod Name",
"Author": "Your Name",
"Version": "1.0.0",
"Description": "One or two sentences about the mod.",
"UniqueID": "YourName.YourModName",
"UpdateKeys": [], // when you release the mod, see https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Update_checks
"ContentPackFor": {
"UniqueID": "Pathoschild.ContentPatcher"
}
}
(taken from https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide.md#create-the-content-pack)
should I fill it out?
What do you mean by "fill it out"?
someone please help me with something in Tiled. I am trying to add waterfalls to a map that already has a bunch of tilesheets. how do i add the waterfalls tilesheet
put in the things in quotes
like the mod name and stuff
Wait. Did you copy the thing I provided or did you write it by yourself?
I copied it
You can export an already-animated waterfalls tilesheet from another map that has it as a .tsx file, and then load it in the map you're currently editing, and then embed the .tsx in your map file
how do i do the embed?
Good. Change that "Your Mod Name" to the name of your mod, WITH quotes.
๐
however that's a bit of a hassle, so the best solution is just copying a .tmx that already has animated waterfall tilesheet and use it as a template
done
see i cannot do that because. i already have a fully made map
Mine from the mod I'm doing is:
"Name": "[CP] Eleanor",
Lower right of the window
TY!!!!
it's the greyed out icon
Do the same for "Your Name" in Author
I got all of it
Nice! Could you copy the code to https://smapi.io/json/manifest/ and then provide the link here so I could check if it is correct?
that was kind of offensively easy compared to the amount of time ive spent doing some cocomelon shit to those files
Great work!
Now we'll create "content.json" file.
This link should help you: https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide.md#create-the-content-pack
To make your life easier next time you make a map, I greatly suggest having a template map.
Mine is a blank .tmx that has all tilesheets i could possibly need embedded in the file (namely both vanilla outdoors tilesheets, town tilesheet, waterfalls, island tilesheet, and certain custom tilesheets like mine and sharogg's). When i make a map i copy that file, and then make the map and delete the tilesheets I don't use.
Streamlines the process a lot, without having to do the .tsx steps
Smart!
do I move the copied hats.png into the mod folder and set the "FromFile" to grab from the mod folder?
Copy the file indeed, I guess "FromFile" should be correct too.
Yeah, it is indeed correct.
ty, sounds like a good idea!
mine was fine until i needed to update for 1.6
.>
heh, back in my day I could make my own Minecraft texture pack
/j
this is child's play /stillj
you probably need to make a new copy of the rules instead of just adding them to your item, because right now itโs the same instance in both items, so when you modify it it will modify in both
Your content.json file should now look like this:
"Format": "2.4.0",
"Changes": [
{
"Action": "EditImage",
"Target": "Maps/springobjects",
"FromFile": "assets/fish-object.png",
"ToArea": { "X": 160, "Y": 80, "Width": 16, "Height": 16 }
}
]
}```
(https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide.md#actions)
I used the load action
"Format": "2.4.0",
"Changes": [
{
"Action": "Load",
"Target": "characters/farmer/hats",
"FromFile": "assets/hats"
}
]
}```
it's currently this
I made a folder in the mod folder called assets btw
edit is preferable
oki doki
also you need the file extension in fromfile
also, ideally you do not reload the whole image, you edit in a specific hat
to a specific area
and by ideally i mean basic compatibility etiquette
I'm sorry if I will say something incorrect, but I never changed images.
Change "Maps/springobjects" from my example to "Data/Hats". Keep edited "FromFile".
"Format": "2.4.0",
"Changes": [
{
"Action": "EditImage",
"Target": "Data/Hats",
"FromFile": "assets/hats.png",
"ToArea": { "X": 160, "Y": 80, "Width": 16, "Height": 16 }
}
]
}```
Your `content.json` file should now look like this.
what would be the ToArea for the Skeleton Mask near the top right?
that's probably not easy to find out from the Discord image
A second, please.
open it in an image editor
Exactly.
I'm using Microsoft Paint to edit it because it's my only pixel art thingy
any decent image editor will show you the coordinates of a specific pixel you're pointing at
microsoft paint supports transparency now?
found it
excellent
I'm on Windows 11 so this one does at least
noice
*loads up the game and finds a big white square behind the hat* /j
microsoft paint also has a coordinate thingy
If it is a .png, then it might not have white background...
I got the coords
is it possible to add weapons without unpacking xnb? 
i mean strictly speaking you never have to unpack xnb
In technicality, you could copy some other mod that added weapons
thats just for your own convenience and reference
Yeah, you can guess and throw stuff at the wall until it works
You could also patch export a bunch of files individual
Good. As I found out, each hat sprite is 20X20 px, so which coordinations do you have?
I hope it is 20X20px...
Gonna find one that does
Why are you doing this illulen?
ok I'm going to test my mod
So, if I think right, then as you have "ToArea": { "X": 160, "Y": 80, "Width": 16, "Height": 16 } in content.json file, we'll edit these values.
If I'm not, please, correct me.
also, what does your file look like? coz you might need FromArea too
the X and Y
or more reasonably just cut out the part thats yours and dont FromArea
it's "ToArea": { "X": 160, "Y": 80, "Width": 20, "Height": 80 }
(You can also add new hats if you like.)
Also, in your copied hats.png file, do you have all hats or only the one you want to edit?
all hats
Should be correct, I guess
it didn't work
is that right? Are you replcing the skeleton?
i love weapons
yes
isnt it in the top row?
No. Why arent you unpacking the game files
shouldnt it be Y 0?
Ouch. Git says that was two years ago
X 160 looks right to me
actually yeah I think so
Are we talking about the same thing? Do you know what unpacking an xnb means?
You have to unpack to see the game data
I just installed Tiled. I am going down a rabbit hole I hoped I would never had to...
2 variants:
1st - edit the .png file so it would have only the one you want; or
2nd - specific "FromArea" in your content.json file
Making a CP mod without unpacking is like drawing a painting without looking
I think not actually
!unpack
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!
thank you
unpacking the game contents is simple and very useful to check what you need to change
the easy way is to copy your "ToArea" as "FromArea" as they are obviously in the same location. The reasonable way is to crop your hats.png to just your hat
up to you
Exactly!
Any way to place stardrops on a table, or in a chest? I can spawn them with /debug createdebris 434 but as soon as I try holding them, they activate. (not sure if this is the right channel)
like, for decoration?
Make a fake stardrop
https://www.nexusmods.com/stardewvalley/mods/393
I found it here that the author said to unpack weapons.xnb and expand the height is what i mean
XNB mods often break the game and are not recommended. See Modding:Using XNB mods for more info (and a list of Content Patcher alternatives), and you can reset your content files to fix problems caused by XNB mods.
For mod creators, see Modding:Editing XNB mods for help unpacking & editing them (including for use with Content Patcher).
youโre missing a comma at the end of the toarea line
An actual stardrop the player could get, but I want to place it in in a chest or a table.
also comma after ToArea
space doesnโt matter in json
Your FromArea is unlikely to need the same X and Y values as your ToArea unless the entire thing is the exact same size as the vanilla hats file.
dies instantly
you missed this discussion
I think yes (without the space of course), but someone else should check it too.
!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 this for a mod? because you canโt really use the console commands as a built in part of a mod anyway
Could you give us your file to check, too? (https://smapi.io/json/content-patcher/)
the one I sent a ss of?
And log file could be helpful, too.
why are you looking for a .png file in data?
Ad comma after line 8
"Format": "2.4.0",
"Changes": [
{
"Action": "EditImage",
"Target": "Data/Hats",
"FromFile": "assets/hats.png",
"ToArea": { "X": 160, "Y": 0, "Width": 20, "Height": 80 },
"FromArea": { "X": 160, "Y": 0, "Width": 20, "Height": 80 }
}
]
}```
the Target? I was told to put Data as the first part
yeah im looking for where it is rn
it's in characters > farmer > hats.png
yeah that lmao
Hats? \Stardew Valley\Content\Characters\Farmer
im pretty sure this means your target is Characters/Farmer/Hats
ok
My bad! (I thought that if https://stardewvalleywiki.com/Modding:Items had "Data/Hats", then it should be it, not the path; sorry for troubles)
You already have edited hat? (if yes, then good)
Data/Hats is for the data for the hats rather than the texture file for the hats. Things like names, descriptions, whether it hides hair etc
like the governor command said, thatโs an xnb mod and we donโt recommend using those any more
well this sounds like an eminently fixable problem :3
Oh yeah, I saw that file when I was looking for correct file!
now that I see it in-game I can fix the art problem
Glad to hear that!
I'm running into a visual issue when receiving an item of Clint's upgrade service.
The mod adds a new instance of each tool to his shop for higher prices at a faster upgrade speed.
When receiving the tool, it displays correctly in inventory and identifies as the upgraded version, but shows a different upgrade level when being used/swung.
Example: Upgrade Steel Axe to Gold Axe, still shows a Steel Axe when swung but is being displayed as Gold Axe in inventory. It keeps showing as Steel Axe no matter how many upgrade levels are made. Clint does recognize it as Gold Axe and provides the next upgrade for it.
Is there anything I have to apply to the tool (afterwards) so it displays properly when being used?
All I do is:
Tool toolCopy = new Axe()
Copy over the Upgradelevel from the default shop entry:
toolCopy.UpgradeLevel = tool.UpgradeLevel;
Then clone the ItemStockInformation and do some description and prices changes.
After that I'm adding it to ShopMenu.forSale
yeah i noticed, thank you everyone!
this is a very old mod with very old implementation (xnb edit)
this one is from last year. it adds weapons
that can be a good reference
thank you ๐ will take a look now
WOOT MY THING WORKS
GONNA UPLOAD IT NOW
1.6 WATERFALLS FINALLY
I thought i'd tried that but i must not be creating a new copy of the rules correctly
does anyone know a mod that can hide your head while wearing a hat
So only your hat would be visible, no matter it's size?
yes
you're just adding them to the list right now
you need to create a new instance
Yeah, I have never seen mod like that. However, if your hat is bigger that player's head, then it shouldn't be any problem.
if I make it big enough for that then there isn't room for the horns
wait I'm stupid I can use the Hand Mirror
I have a mod adding horns
There might be some workaround to that, like invisibility of your head while wearing some type of hat, but I don't know if that is even possible.
Is this enough to create a new instance? List<MachineOutputRule> rulesCopy = caskVanilla.OutputRules.Select(el => new MachineOutputRule() { Id = el.Id, Triggers = el.Triggers, OutputItem = el.OutputItem }).ToList();
at a glance, I think it should be
This is one case where you might as well DeepCopy
Dunno if Pathos kept it but that was how I handled the legendary bait
(For Aquarium)
I'm always just scared of blindly doing deep copies without checking source carefully first just in case haha, but if it works then that is probably preferable
It's still altering the original data even with that
can you send the new version of the script? and preferably don't use "attach as message" this time
(I generally won't recommend it for anything that isn't a data model)
I literally would just do var rulesCopy = caskVanilla.OutputRules.DeepClone();
yes, it's slow, but asset edits themselves aren't a speed point
(sorry, DeepClone, not DeepCopy, DeepCopy is a python thing)
Hi,
while coding events for my NPC, I came for a problem - when using /quickQuestion, I can't trigger second answer properly (getting an error to SMAPI).
Event code:
"LogName": "Eleanor - event - 2hearts",
"Action": "EditData",
"Target": "Data/Events/Forest",
"Entries": {
"Eleanor_2hearts/e EleanorIntro/f Eleanor 500/t 600 1200": "none/21 27/farmer 21 20 2 Eleanor 16 30 1/skippable/pause 1111/Move farmer 0 10 2 true/pause 4500/textAboveHead Eleanor \"{{i18n:{{ModId}}_event_Eleanor_2h.0 |PlayerName={{PlayerName}}}}\"/pause 500/emote farmer 8/pause 500/faceDirection farmer 0 true/pause 500/faceDirection farmer 1 true/pause 500/faceDirection farmer 2 true/pause 500/faceDirection farmer 3 true/pause 500/faceDirection farmer 2 true/pause 1250/emote Eleanor 40/pause 500/speak Eleanor \"{{i18n:{{ModId}}_event_Eleanor_2h.1 |PlayerName={{PlayerName}}}}\"/pause 500/faceDirection farmer 3 true/pause 1111/emote farmer 16/pause 500/speak Eleanor \"{{i18n:{{ModId}}_event_Eleanor_2h.2 |PlayerName={{PlayerName}}}}\"/pause 750/emote farmer 60/pause 500/quickQuestion {{i18n:{{ModId}}_event_Eleanor_2h.3 |PlayerName={{PlayerName}}}}#{{i18n:{{ModId}}_event_Eleanor_2h.3_yes |PlayerName={{PlayerName}}}}#{{i18n:{{ModId}}_event_Eleanor_2h.3_no |PlayerName={{PlayerName}}}}(break)/pause 1/switchEvent Eleanor_2hearts_q1_yes/(break)/pause 1/switchEvent Eleanor_2hearts_q1_no",
"Eleanor_2hearts_q1_yes": "resetVariable/friendship Eleanor 200/speak Eleanor \"{{i18n:{{ModId}}_event_Eleanor_2h.4_yes |PlayerName={{PlayerName}}}}\"/pause 2500/speak Eleanor \"{{i18n:{{ModId}}_event_Eleanor_2h.5 |PlayerName={{PlayerName}}}}\"/end",
"Eleanor_2hearts_q1_no": "resetVariable/friendship Eleanor -350/speak Eleanor \"{{i18n:{{ModId}}_event_Eleanor_2h.4_no |PlayerName={{PlayerName}}}}\"/pause 2500/speak Eleanor \"{{i18n:{{ModId}}_event_Eleanor_2h.5 |PlayerName={{PlayerName}}}}\"/end"
}
},```
Log Info: SMAPI 4.1.10 with SDV 1.6.15 build 24356 on Microsoft Windows 10 Pro, with 65 C# mods and 48 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
I'm not sure that's how quickquestion works
I think you have to explicitly switchevent
What do you mean by that?
that works ๐
Full events file: https://smapi.io/json/content-patcher/d11f49c434514bfd9643ab4506de1770#L19 (lines 19-29)
I was experimenting with (break), / and many of their combinations, but sadly, I still can't figure out how it should be correct.
Also, I can't find out where did both of those event errors from shared log file come from, nor how to fix them.
someone revived my Critter Rings ๐
I thought no one cared to ๐
I have to create new instance for each machine otherwise which ever machines code is last replaces all of them right?
Alright, so coding while doing some things in the background. I'm actually getting off my butt and writing the datemissed dialogue stuff, but I'm running into a syntactical question that I had half answered previously - how do I check if the player has the moddata at all? I know I previously asked this, but the vanilla GSQ to check is PLAYER_MOD_DATA <player> <key> <value>, but I don't care what the value is at the check portion, just at the writing portion
tl:dr need to do like a wildcard for that portion
wdym you don't care what the value is at the check portion, just at the writing portion?
essentially, the value can be Abigail, Leah, Sophia, etc. I only care about the value when I'm writing the trigger action because I'd be setting the new dialogue only for the NPC in question
If it exists, then I write the dialogue and immediately blow up the moddata
although docs don't have a setnewdialogue trigger... hmmm
oh, right, it's in betas
regardless, already using betas for this so shrug
Hm. Okay. Secondary obstacle just because my brain isn't totally wrapping around it with atra's prior example. The goal is to have the following action:
"Spiderbuttons.BETAS_SetNewDialogue <NPC from ModData> \"{{i18n:Missed<DateType from other ModData>}}\"",
Atra's example specifies [ModData ModId/LastDate], which for my purposes is the value of the key "DateMissed". However, I'm not sure if that translates to [ModData {{ModId}}/DateMissed] given it is applied via BETAS, but more importantly, can i18n parse a moddata value? If not, I may have to set a CT instead rather than just dialogue on day start.
Desync isn't possible since it's a net-synced mutex. Whichever lock request is received first by the host is accepted, any others are rejected, and the lock winner is synchronized back to the other players so the winner proceeds with the locked action.
CP resolves tokens into real values at asset edit times, then BETAS reads them to do its token things, so I don't think you can get an i18n value with the modData token string.
(EMP has some modData CP tokens now, though, if the extra dependency is worth it)
what have I done that makes the seed thing crash the game..
Hm. that complicates things a tad. I'll look into the EMP tokenry to see if that's a bit more able to do it, but otherwise I now have to figure out how to obtain the moddata value, then patch it into just that character's dialogues
Rrgh. I think I'm going cross-eyed here. I think it's an either or thing unless I'm losing it -
- If I use
SetNewDialogueI can properly attribute it to the NPC, but I can't make the missed date lines unique to each generic date type - If I try and use a CT, I don't think the Characters/Dialogue can patch to the value of the moddata
- If I send a mailflag with the moddata, I can't then remove the mailflag since the value's no longer existing
(For other context, the goal is to only have the dialogue fire for one day on the specific spouse that missed. For monogamous couples, just {{Spouse}}. For polyamorous people, I can store the values using BETAS as previous. However, I need to either:
- Patch the dialogue just to the specific spouse and trigger a CT
- Set the new dialogue to the spouse for the specific missed date - I store the moddata of the date missed so I can retrieve that too, it's just the problem of actually patching it in)
@uncut viper I ask because of Lyoko's plan to use BETAS: is BETAS incompatible with the polyam mods for any setnewdialogue stuff at all or is it just with the npckissed trigger?
Seeing Lyoko mention it made me realise I didn't follow you and Avi talking about it well enough to know what it clashes with.
I think it's still compatible, I'm just trying to be too fancy
If I kept it as one dialogue usable for any date, then it would work
buuuuut I already (in the past) wrote the dialogues for missing specific generics/the four uniques
out of curiosity for those of you better versed with CP NPC mods - what would this do?
{
"LogName": "Delete Sebastian from Stardew Valley", // This may potentially cause errors
"When": {
"HasSeenEvent:hostPlayer |contains=SebastianLeaves": true,
"HasReadLetter |contains=SIG_SebastianLastLetter": false,
},
"Action": "EditData",
"Target": "Data/Characters",
"Entries": {
"Sebastian": null
}
}
What's not clear about it? It erases Sebastian's character entry on some event/mail flag.
And yeah, I'll bet it may potentially cause errors to replace a vanilla character data entry with null.
I was wondering how effective it would be tbh, not exactly what it aims to do
so i have a question about smapi
and yeah, we figured it wasn't a great idea (and so did the author, clearly), I just wanted to have a look at exactly what they were doing
does anyone know why smapi doesn't connect to my earbuds
when ever i play modded
smappi doesn;t go through my earbuds
!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).
(but also, haven't we heard a few people saying similar things now? I wonder what's going on)
I believe it would work (think of it like uninstalling the mod for a modded NPC, the data for that NPC is gone), however NPCs do persist in the save data (so if you add back said modded NPC, that NPC would come back with your hearts progress and such saved)
If you want Sebastian to be gone, you can also just teleport him to a void I think
I'm sure it would be effective at doing what it says on the tin, deleting Sebastian. It'd probably just break a bunch of things in the process, can't even imagine how many mods and possibly vanilla code snippets assume that Sebastian exists.
the question ig is what it would do to sebastian, who's a vanilla npc (not my mod btw)
but ty guys for confirming it does what it says on the tin
Well, keep in mind it deletes Sebastian's data, not necessarily his instance.
There's basically no difference to the game whether an NPC is vanilla or modded
the mod says he's meant to come back but they don't have an entry repopulating his data, either, which is strange
they do also teleport him to a void
If the literal NPC object still exists and is walking around then he probably becomes some sort of weird ghost with no instructions to follow.
And possibly crash, log errors, etc. Depending on how robust the game is. I don't know, try it and see.
There is. After the letter is read, then this patch wouldn't trigger anymore and the game would go back to using vanilla data.
they give him a new schedule that places him in a void but idk if that happens before or after the patch. I'm probably going to run the mod in a bit and see what happens
How can they give him a new schedule if his data is deleted?
would it go back to normal immediately after the patch stops applying then? I'm not super familiar with cp, sorry for the questions
In a C# mod you could do it, but I'm not sure how you can simultaneously delete the data and edit the schedule in a CP mod.
{
"LogName": "Sebastian moves to the Void",
"When": {
"HasSeenEvent:hostPlayer |contains=SebastianLeaves": true,
"HasReadLetter |contains=SIG_SebastianLastLetter": false,
},
"Action": "Load",
"Target": "Characters/schedules/Sebastian",
"FromFile": "assets/ScheduleVoid.json",
},
CP normally get applied on day start. So he'd go back the next day after you read the letter.
They didnt need to both delete his data and change his schedule at the same time
only the data deletion will work
yeah, that makes more sense
I assume the void schedule was an attempt before they deleted Sebastian's data and they just didn' bother to take it out.
They said that they tried using void schedule but had problem because Sebastian still appears in festivals.
(Theoretically they could also yeet Festival-Sebastian to the void, but that's more werk.)
there's a few other issues, now that I'm looking at the mod more closely
I'm mainly curious about what the C# component is for, because from the description, it feels like what the mod does can all be done with CP?
I decompiled it, it's pretty short and could almost definitely be done with CP
internal sealed class ModEntry : Mod
{
public override void Entry(IModHelper helper)
{
helper.Events.Display.MenuChanged += OnMenuChanged;
}
private void OnMenuChanged(object? sender, MenuChangedEventArgs e)
{
Farmer farmername = Game1.player;
if (!Game1.player.mailReceived.Contains("SebastianIsBoyfriend") && farmername.friendshipData.ContainsKey("Sebastian"))
{
Friendship SebastianFriendship = farmername.friendshipData["Sebastian"];
if (Game1.player.eventsSeen.Contains("SebastianComesBack") && !Game1.player.mailReceived.Contains("RejectSebastian") && !SebastianFriendship.IsDating() && !SebastianFriendship.IsDivorced() && !SebastianFriendship.IsEngaged() && !SebastianFriendship.IsMarried())
{
((Mod)this).Monitor.Log("Changing Sebastian Friendship Status: Dating", (LogLevel)0);
SebastianFriendship.Status = FriendshipStatus.Dating;
Game1.player.mailReceived.Add("SebastianIsBoyfriend");
}
}
}
}
there's some inconsistency with mail flags and conversation topics - for sebastian to come back, you need the conversation topic SebastianGone_memory_fourweeks, but it's never set anywhere
I have found a most effective way of just straight up disappearing npcs, and it's setting their home location to an invalid setting
I did this for a while, then at one point SpaceCore throws error at me because of it. I don't know if it's still doing that.
I could check but from what I remember the npc would still effectively exist, has all of its socials n stuff, but I don't remember if npc map locations caught where the npc is
still out of curiosity about CP modding, do any of you know why this might be split into two patches?
"SebastianIsComingBack": {
"Id": "SebastianIsComingBack",
"Trigger": "DayEnding",
"Condition": "PLAYER_HAS_CONVERSATION_TOPIC Current SebastianGone_memory_fourweeks",
"HostOnly": false,
"Actions": [
"AddMail Current SIG_SebastianLastLetter",
"RemoveConversationTopic SebastianGone"
],
"CustomFields": null,
"MarkActionApplied": true
},
"SebastianComesBackEventTrigger": {
"Id": "SebastianComesBackEventTrigger",
"Trigger": "DayEnding",
"Condition": "PLAYER_HAS_MAIL Current SIG_SebastianLastLetter Received",
"HostOnly": false,
"Action": "AddMail Current SebastianComesBackEventTrigger received",
"CustomFields": null,
"MarkActionApplied": true
},
Tbh I'd have to see what is all connected to what
isn't one just triggering the other though? neither one is connected to anything else
(and I mean anything else because SebastianGone_memory_fourweeks isn't mentioned anywhere else in the entire mod)
The only thing I see is the CT sebasiangone being able to be used in character/dialogue/npc
But if absolutely none of it is checking for those flags, effectively useless
would that not be possible to merge the two patches then in that case?
I have also just woken up so I have no context for what this mod does
it deletes sebastian then tries to bring him back (though I'm pretty sure it won't because some flags are set incorrectly)
making seb disappear/come back?
like basically I'm asking if the action from the second patch couldn't have just been added to the actions of the first patch
because presumably they trigger at the same time? unless there's a day between them because of DayEnding or something
okay i'm at my desk now lemme look
Yep, we said the same thing in #modded-stardew
For the festivals, make them on some part of the map out of the festival map because you can do that with NPCs
I'm assuming the mod author just doesn't know about the simpler way of doing things
okay so the condition PLAYER_HAS_CONVERSATION_TOPIC Current SebastianGone_memory_fourweeks so that means this requires the SebastianGone CT somewhere anywhere and four weeks from then, the coming back will trigger, the second one has the addmail which has a default tomorrow so that would trigger 2 days later
still, it might be a good idea for - when Pathos is back from vacation - maybe asking if SetNPCInvisible can optionally work at festivals too
considering how dumb it'd be to attempt a removedelimited on that nonsense, maybe
although i should check if invalid home effects festivals too
Remind me in an hour to check invalid home with spacecore, festivals, and anything else, really *i already know heart events will still trigger
alllllllllrighty then, aviroen (#6458805) (1h | <t:1736105717>)
ohh, so the _memory_fourweeks thing is dynamic? I see
So is there any change I should be aware about with PIF and the decoratable location type for the create on load mappath. Currently I have CreateOnLoad with MapPath, Type set to StardewValley.Locations.DecoratableLocation and always active set to true.
I couldn't find it in the documentation
while it's nice that this person is delving into the weirder aspects of modding, there's easier ways to do this 
don't be me, crazy levels of separation georg
i'm pretty sure lyoko takes the spot for trigger actions georg though
thanks for putting up with my content patcher questions btw!
i might not know machine data but the web of bs that can be accomplished through cp alone is probably the thing that i think about the most
Quick questions... does FishAreaId no work as a whole or is it formatted differently or something now?
hmmmmm
I dont feel like its just for crab pots, let me check the fish data in locations.json in unpacked
It's still in use
i assume you just want the area of actual fish, not the crab pot fish?
i tend to use the location bobber thing
one second
these ones i've ripped straight from all of the farm variants 
@wanton pebble BETAS is compatible with polyamoury mods and you can mess with their dialogue all you want as long as you have some way to get their name into the trigger. the only thing thats not compatible is that all currently existing polyamoury mods use a skipping prefix on NPC.checkAction or whatever it is, which completely skips my code that raises the NpcKissed trigger. that is the only piece of BETAS that is currently incompatible with polyam mods
Isee, do you know where on the wiki its mentioned so I can take a look, I'm a tad unsure how the field of area is set for it
also thank you I was gonna be really bummed if I couldn't specify areas
uh iirc fishareaid is whatever the default is
i @'d you bc you answered below it too so i wanted to make sure you knew the specifics, too
which most likely isn't documented
it's kind of obscure
Ah. In that case I should just state I have no intention of using that portion XD
What I'm mainly trying to do is figure out how I can get a moddata value into the i18n key
which is fair! but now ya know ๐
Do you think it accepts a X and Y value like the fish area creation?
ah so this is for little patches of water in whatever place that you're doing, so you have to specify uhhh god is it a list? with an "X": "Y" pair?
a custom CP token would be the only way so thatd be esca's EMP
that said are you 100% sure you need an i18n token for it and not LocalizedText
ah, so I will need to do both. Got it, thank you!
i literally just woke up from a nap so my backreading wasnt very coherent
not necessarily a list jus a cove on my map so I need to set a area for fish that can only be caught in the cove
yep. Sadly, this dialogue is being patched in from DNR
ah okay you can straight up rip my location bobber thing then with the ID/ItemId
so LocalizedText won't help
don't worry though, knowing that EMP will allow it works for me
Dang X| lol
could you theoretically also just patch in all the possible dialogue into the content pipeline too just for using it with mod data
i will not worry then
but if you ever come across a situation that needs it, all the BETAS stuff can use stuff like [LocalizedText] in its triggers and actions
actually i might have a simpler one if you want very specific fish
https://github.com/Aviroen/Custom-NPC-Edelweiss/blob/6cc8c41df71acf95514379b7416f8f0889c92a4a/data/Locations.json#L19
also if it helps hopefully ill finish the new docs today and put out a new version so SetNewDialogue will be able to take a translation key too and not just i18n if that also makes it easier
(or not just the raw dialoguie string i mean)
What should I be looking at
I keep reading this as "fish are aid" and being confused
so the fish list lets you specify whatever fish will be found in your location
I have done that XD
but the areas are in the same location
Do you think it would be possible to add the fish to a map patch of just that area?
oh you want fish in specific ponds?
okay lemme dig into the wrinkle for a second
Thank youuu
Like in the locations.json in unpacked content, the FishAreaId is used like I have tried using it, but the fish I add using it do not show as spawnable
so I don't know if something has changed for formatting or FishAreas entry stuff
do you think anyone would be interested in a mod that converts various hardcoded loot tables into data assets?
(fishing treasure, mine crates, panning, etc)
YES
I WOULD
100%
Panning and Fishing Treasure, have been untouchable for me as I don't know C#
i could've sworn we could dig into fishing treasure but i also have chicken wire for brain
so it could edit the existing loot's spawn chance? ๐ ๐
I have looked and havent found anything, besides outdated frameworks
yeah and add new ones
PLEASE
In a lot of games, that can desync if not done right on the client-side, as the "losing" client has to roll-back behavior. Some games handle that surprisingly poorly.
A strategy I've seen (if the client knows that they're racing) is to bias the locking in favor of the client with the greater or lesser ID or such
I have wanted this for months and I know a bunch of other mods that would definitely utilize it!
nice 
(while i'm here, anyone know how to check for ginger in the ground? CheckForBuriedItem returns null
)
ginger is just treated as a crop I think, even naturally planted ginger
spring onions too
This sounds an awful lot like how Sauron described his rings... friendship rings...
That's why the client requests a lock and passes the success/fail logic in a callback. There's no rollback needed, since nothing happens until the lock is either approved or rejected by the host, at which point one of the callbacks gets called.
For example, if you request a mutex to open a chest:
- client requests a lock from the host;
- host approves the lock (which locks out any other client);
- client receives the lock approval;
- client opens the chest UI.
really? hoedirt.crop was giving me null on the hoedirt...i must've done it wrong then. i'll give another look, thanks!
lookup anything shows it as "unknown crop" so i had figured it was the case
That requires latency upon every action, though. That's why most games don't do it that way.
Yep, that's the tradeoff. It's generally fine for the way Stardew Valley uses it though.
It's certainly simpler and less error-prone, of course.
What you're saying is that I need to write NetcodeMaster...
(The net mutexes are only used for specific actions that need extra protection. There's a whole other interpolation/conflict-handling layer in the underlying net sync code.)
"X": 23,
"Y": 98,
"Width": 1,
"Height": 1
},``` this looks like the format for player/bobber position, so the x/y is the topleft most space in tiled where your pond/fishing spot starts, and the width/height is how ... far... down... the pond is...?  my brain is Not Brainingโข๏ธ so i will come back to this because i did not actually eat breakfast like i said i would 
https://github.com/rokugin/Collector/blob/main/Collector.cs#L774
This is where I'm doing collections on crops
(I really would rather not, netcode is not my forte)
Oh I see ok I will take a look and give it a shot, if it works I have no issues with how it is done
That's a tile rectangle area, specifically a 1x1 tile area starting from (23, 98).
For example, if you had "Width": 10, then any player position between (23, 98) and (33, 98) inclusively would match it.
(It's not my mod; I was just pleasantly surprised someone revived one of mine.)
Looks like the same thing as the FishAreas, so it shouldn't be too hard, I still find it weird that the fishareas and fishareaids just cancels the spawning of catchable fish using it when vanilla still appears to be using it as well
ah okay, so the position needs to be middle of the pond
Also, I tend to be wary of non-deterministic logic as I write a lot of simulations as a hobby - non-determinism breaks seed reproductibility. I often have to write subsystem specifically to detect when a pass isn't deterministic.
No its like a map per say you start from top left and define the width and height from that point on -Y and +X axis
(I design knitting patterns now. ๐ )
(i leave to eat breakfast
)
I hope its a good one XD
PlayerPosition is the tile on which the player is standing. I'm not sure what you're doing, but in most cases you should just omit that field; it's used in specific cases like Easter eggs, where the player's position matters (rather than or in addition to the position actually being fished).
Ok so using it too create a knock off fishing area would not work?
Sauron comes to the Valley seems like an interesting idea. Instead of Smรฉagol finding the ring... it was fished up by a random farmer in the Valley...
I may be on a LOTR kick.
Again. I design knitting patterns now ๐
Are they Sauron's patterns?
i assumed it'd have the same formatting for playerposition/bobberposition, iirc this playerposition that i have was, uh, maybe for a legendary fish
old code does not speak to me because i don't remember what i was doing
I want to see some atra knitting patterns 
You'd use BobberPosition for that, if the fish area system doesn't apply to what you're doing.
Essentially:
PlayerPosition= where the player is standing;BobberPosition= where the fishing bobber landed (i.e. where they're fishing in the water).
for some reason all I can think of when I think of you designing knitting patterns is the patterns from SkyKnit and HAT3000
Ok so Jamore you were on the money before! I will go ahead and use the BobberPosition, and I am also gonna give the PlayerPosition a test for making certain fish only catchable off the dock which seems intriguing
Someday... I will tackle machinedata... 
Item Extensions does fishing treasure
At least according to the docs!
How did I not see that
And panning?
Idk what Mine Treasure Framework does but also worth checking out
Note that I did not personally investigate at all, I just glanced over docs to make this
Ah yes the always sunny interconnection
Oh no VSCode is about to explode... what have I done
I might actually decipher it later and attempt an excel sheet just for my own clarity, but I depend on like, 5 frameworks max 
Charlie's wall of insanity is also representative of SM's data flow... am I Charlie?
I followed that and didn't end up where I should have.
I think that's just called spaghetti code.
Nah, the code isn't that spaghetti-ish itself, there are just a lot of cache layers and it's hard to reason about.
The red and black stuff is under each purple header
Also everyone needs to come up with shorter framework titles
I think I'm doing my part.
Betas is one of the longest lol
Lasagna code, then.
Part of merging CG with SM is that SM will technically become a framework, which I'd already been planning. Though I think in that realm there will be overlap with some other frameworks.
couldve been worse. couldve been more game accurate and called them Trigger Action Actions Stuff
"Trigger Actions Stuff" just confuse the ever loving shit out of people referencing Temporary Animated Sprite
It's a strange mix of lasagna, fettucini, and a little C++ and .NET assembly.
Oh, does this mean I could opportunistically block certain elements from upscaling? Because 99% of stuff looks good but some things occasionally just turn into slop.
It can already do that.
question: what would the CG+SM framework entail 
Let me clarify, opportunistically block as the author (not as the end user).
As in, I know something's going to scale very badly when it renders and don't want users of the mod to see it that way.
It has a blacklist that takes regex spritesheet name patterns and offset/extent pairs.
How did I make a lantern on the buildings layer behave like a person when being walked into......
I amaze myself at the issues I create by my own hand XD
person? did you use the front layer?
I haven't implemented that for... a few reasons.
- There are/have been a few well-known authors who would absolutely abuse it, making the user's experience - and my bug report list - worse.
- Usually, it ends up with a jarring effect for the user. I try to limit the blacklist as much as possible.
No and you have to walkinto it for a few seconds before passing through lmao
Can you give me an example of an effect/sprite where disabling it in a forced manner would be advantageous? Not trying to be antagonistic, just trying to contextualize it and to find a workable solution.
I just added tiledata to make it not passable
Absolutely can. It's one I'm working on now:
Usually, if something scales badly, it's something for me to mitigate rather than for it to be disabled.
@velvet narwhal: check invalid home with spacecore, festivals, and anything else, really *i already know heart events will still trigger (1h ago)
The text just becomes illegible with upscaling.
Well, I just have CG installed with "stock" settings, nothing customized, so I assume that's how most users would see it with CG installed.
In any case, when I heard "framework" I was hoping "ability to leave some hints to the system about how/whether to upscale".
I've only shallowly dug truth CG's changes, but SM defaults to xBRZ - it can choose to use EPX in some cases.
Can you send me the png/tga of that sprite?
What, I can also do is allow you to mark things as UI specifically
What is the history of who is maintain spritemaster/clear glasses 
Which will allow me to bias for legibility/accuracy rather than perceptual consistency.
I am the author of SM
The original is here: https://kenney.nl/assets/input-prompts-pixel-16
But I'm not using the entire thing, just a handful of the individual sprites copied into a mod-specific tilesheet.
CG is an SM fork, and is being partially merged upstream.
Marking things as UI is probably better than nothing, at least it would be right 80% of the time instead of 20%.
A few things are broken in CG (not their fault, what I wrote is very complex and is pretty-much only understood thoroughly by rendering engineers) and that might have an impact.
Can you send me the settings TOML you have?
Do u plan be the main maintainer of the merged afterwards
I want to validate that it's EPX
Yes, but that's not really a change
It's more that I've been absent.
I have Scaler = "xBRZ" in the config, but if there are other relevant lines then I can post the whole thing...
Actually, nothing is set to use EPX.
The issue is just that without any upscaling on some stuff, it's really jarring. There are things I can do to maintain accuracy when that's the goal.
Everything is xBRZ except ScalerGradient with is ScaleX.
That's odd - that picture is very much EPX to me
It is pixel subdivided with no gradients
The top-right corner, for example
I assume this is the relevant section you care about:
# Should the texture be scale-adjusted if its scaled dimensions are outside preferred dimensional limits?
Scale = true
# What scaling algorithm should be used by default?
# Legal Values: [
# xBRZ, Vanilla, EPX/ScaleX, EPXLegacy, xBREPX, None
# ]
Scaler = "xBRZ"
# What scaling algorithm should be used for portraits?
# Legal Values: [
# xBRZ, Vanilla, EPX/ScaleX, EPXLegacy, xBREPX, None
# ]
ScalerPortrait = "xBRZ"
# What scaling algorithm should be used for text?
# Legal Values: [
# xBRZ, Vanilla, EPX/ScaleX, EPXLegacy, xBREPX, None
# ]
ScalerText = "xBRZ"
# What scaling algorithm should be used for gradient sprites?
# Legal Values: [
# xBRZ, Vanilla, EPX/ScaleX, EPXLegacy, xBREPX, None
# ]
ScalerGradient = "ScaleX"
# Should dynamic scaling be used (scaling based upon apparent sprite size)
EnableDynamicScale = true
xBRZ turns that into a diagonal line.
I wonder if it's detecting it as a gradient sprite
SM heuristically analyzes the sprite based on a lot of things and guesses what it is. ScaleX is very similar to EPX, but more scalable.
xBRZ, notably, tends to posterize smooth gradients, so if it thinks it has smooth gradients, it defaults to ScaleX instead
I'll run it through the analyzer and see what it's doing
Well, if that is in fact the issue, then being able to hint the content type could help. "Contains text, not a gradient"
Off-hand, it shouldn't be a gradient. It is somewhat more smooth than some sprites, though, in transitions.
What's the spritesheet name it is going into?
Also, if you want to verify, change ScaleX under ScalerGradient to xBRZ in the settings TOML.
The file/asset name is "UI". Although I might later decide to move it into a "buttons" or "prompts" texture.
My heuristic for detecting gradients is a bit... crude, so it likely needs to be refined.
I've generally always wanted authors to not have to do anything, so this is a bug for me
I'm keeping this chart for reference now lol
It should "just work" <Todd Howard>
I definitely understand the perspective of wanting to make the tool/framework/etc. smarter rather than forever expanding the list of parameters and options for users to abuse and mess up.
That said, the "escape hatch" is generally a good thing to have.
Just have to balance the need for consistency and real design improvements (as opposed to piling up workarounds) against the fact that it's impossible to account for every possible configuration and use case.
The gradient test effectively basically checks each row and each column, checking if the max perceptual color change is higher than a set value.
Since that sprite is nearly-grayscale with very similar colors, it might be tripping that.
Since it's just a luminosity test then
Redmean is best as color differences, not luminosity differences
I actually do know what you're talking about, just not in enough depth to provide any meaningful comment.
My knowledge of rendering and low-level graphics is very JIT.
https://github.com/ameisen/SV-SpriteMaster/blob/master/SpriteMaster/Resample/Passes/Analysis.cs#L142-L183 this is where the analysis itself is done.
adjusting Config.Resample.Analysis.MaxGradientColorDifference to be more restricting might also work
which would be under... Resample.Analysis in the TOML file
making it into a larger value makes it less likely to determine that it's a gradient
I may need to add a specific luminosity test rather than just a difference test. It should already technically do that, but as said, redmean is less sensitive to that, since we're effectively operating with all channels being identical.
alternatively, it's possible that CG has broken something and it's just always defaulting to EPX. I haven't investigated CG deeply in that regard.
I think things like banner text would be pretty broken if it was always using EPX.
Not to mention the small font.
Aye. I just did notice some bugs when I was looking through the CLs, like always disabling bilinear filtering.
I'd hazard a guess that was done because of some edge-blurring bug. Drives me crazy in other engines like Bevy.
Is modded farmers the correct channel to post modshowcases in?
you can also do it here
i think it accepts only from modded, here and the making mods art channel
Thanks!
user-facing i always drop into modded-farmers, if it's author-facing i drop it here
"edge-blurring bug"?
So, SM does appear to be getting confused by the edges of the sprite since it's going right up to the edge, something to also look at. This is what it looks like as xBRZ x6:
the pixel pattern in the B is ambiguous to it
to be fair, it's also ambiguous to my eyes normally
I don't know what the technical term is, but sometimes when you use anything other than nearest-neighbor, you get garbage from neighboring tiles in the tilesheet for any given sprite because the edges are blended together with adjacent sprites.
The workaround typically being to put big gaps between tiles, which Stardew doesn't do.
Ok I posted my update in Showcase if anyone wants to check her out to see why I've been so busy lmao
Ah. That doesn't happen in SM. SM doesn't use atlases (it should, but that's a separate issue).
SM also only enables bilinear filtering for resampled sprites
Really? It creates a new texture for every upscaled tile?
yes
there's a few reasons for that, and they're hard to overcome in monogame
it was easier in SDV before 1.5, as D3D9 made asynchronous ops easier.
Maybe that's why nine-slices act a little strange sometimes. It's probably detecting different tiles as different content.
OpenGL is a pain with it.
SM doesn't break the tilesheets on the source-side
the resamples sprites are stored individually, so there's never any crosstalk
The reason is that the GPU's texture samplers have no idea that the sprites in an atlas are separate sprites unless you use the texGrad samplers in a very particular way
the proper approach is to use texture arrays instead, but people rarely seem to do so
I get the feeling that most of the frameworks weren't written by people very knowledgeable in it at that level, so they have just kept doing it the same way it's always been done. SDV and Monogame just inherit that.
As to why XNA initially didn't use them by default (as D3D9 supports them)... no clue.
MonoGame mostly inherited from XNA, and yeah, I've raised a few eyebrows here before with my speculations on the merits of whomever designed the XNA graphics APIs. I won't repeat them.
I'm not sure what you mean by 'nine-slices', though.
like, trees?
In that case, yes.
Though the proper solution is not to assume that they aren't tiles
Trees?
discrete objects made up of multiple tiles
Are you asking about what I mean by the literal phrase nine-slice, or how it relates to the context?
Yes it's an object made up of multiple tiles, where only the center tile on each side and the center-center tile are stretched.
correct. I'm unfamiliar with the terminology. 2d art isn't my forte, for me it's just an extension of general rendering.
looking it up, "9-slice scaling"
Hey y'all! Quick C# question. I was initially using OptionsElement for my UI, but wanted to swap over to ClickableTextureComponent to properly use a texture and allow me to use the "tryHover" method.
However, unlike OptionsElement, ClickableTextureComponent doesn't have a "receiveLeftClick" method to override, or anything similar. How does ClickableTextureComponent know when it receives a click?
typically the game menus will use the IClickableMenu function for receiving a left click and check if the ClickableTextureComponent contains the point the mouse clicked on
Yes, SM has issues with that for that reason. The solution is the same as the macro-objects and such - SM needs to detect which sprites are adjacent after the fact, and pass their edges to their adjacent tiles during the resampling phase.
It can do that, it's just hard to do, since SM doesn't know when passes begin or end.
How does ClickableTextureComponent know when it receives a click?
It doesn't. ClickableTextureComponent has no interaction whatsoever. It's just a silly name for a bag of data whose behavior has to be handled by the menu.
Aha. In that case, maybe shouldn't use it. How would I best implement a tooltip to an OptionsElement then :3
I think this another thing that hinting could help solve.
I've worked on a lot of codebases, and I've surprisingly never seen that called "9-slicing"
I think the older term used to be "nine-patch", I don't know when or why it got renamed to "nine-slice".
Well, SM cannot do it without a lot of context.
if you're making a menu then still using ClickableTextureComponents and checking in IClickableMenu's hover function instead
it knows where sprites are being drawn. It just doesn't know when, in terms of passes, so it doesn't know which are related.
I'll take a looksie
If it knew that, the resampler's overflow could overflow into adjacent tiles instead and make unique sprites instead of fixed ones.
Right. So again I turn to hinting. At least in the cases I'm thinking about, I can guarantee that literally every nine-slice carries some hint, because all nine-slices go through the same class.
well, I'm not sure how you'd hint that for it.
You could give very concrete hints, of course
but you'd have to do that for every single sprite
It could be done automatically for every sprite, though.
Correct; for something very specific that has a framework or a class behind it.
If you're getting into UI, I would highly recommend checking out https://discord.com/channels/137344473976799233/1293051032904925255
UI Code is a mess, and having a framework handle all the complexities for you using mostly a markup language is a godsend.
it can be done automatically in the general-case as well, it's just harder
though I should be doing it :|
it would make trees/grass/etc look better
I've been using CBJ cheat menu as a reference for my UI design
Hence why I started with OptionsElement, which is what almost every element in the cheat menu uses as a baseline
the thread they linked isnt for something to use as a reference, its a framework for making a UI
You're suggesting that the framework basically take input saying 'this tile is always adjacent to this other tile's X edge on it's Y edge, etc'?
Yeah, things like "When do ClickableTextureComponents get a click event" are expections that come from a proper UI Framework. As opposed to SDV's handling where everything is manual in every menu, every time.
It's the new framework they just recently designed. I think a few mods I've downloaded use it as a baseline
Okay so y'alls suggestion would be to move to the StardewUI api?
Being able to prototype a UI and refresh it live alone makes it completely worth it
Fun fact: I prototyped the color picker which is now part of the framework using the framework's own hot reload system.
i would very much suggest at least trying StardewUI first. if you dont like it, you can copy what vanilla does too (and probably find out that thats even worse and go back to StardewUI)
I doubt I'm in a place to make any specific suggestions like that, just saying that some kind of hint system could make it less difficult for you to anticipate every edge case, and that for a lot of the stuff I work on, a lot of the hinting from the user end could be automated.
To be clear this isn't my first foray into UI design. Made an entire mod (that I never shipped for reasons I cannot describe) that was a Twitch Integration thingy :3
But this definitely sounds extremely promising. If I have any further difficulties I'll look into using it
but regarding atlases, SM doesn't use them for two reasons:
- I haven't written it yet. Allocating non-uniform sprite sizes into an atlas is a difficult problem, and I've only done it professionally once in a 360/PS3 game where we were dynamically allocating textures into fixed buffers.
- It's very, very, very, very difficult to lock/copy/unlock into only part of an atlas (which is just a single texture) with OpenGL, without stalling the entire pipeline. We are tecnnically stalling it right now, but I want to fix that using PBOs. I cannot do that with atlases, since the API doesn't offer that level of granularity.
Tyvm!
It SHOULD because the lack of atlases causes a significant performance hit, especially on low-end or integrated hardware
I'd switch to texture arrays, but:
- The resultiing sprites are non-uniform in size.
- I'd have to overwrite much more of Monogame's renderer, which I'm fine with, but it would break other mods that rely on specifics.
You could probably mitigate #1 by only enabling it for uniform tilesheets. Most are uniform, only a handful aren't.
SM doesn't generate 1:1 results
it adds things like padding depending on analysis.
that can be disabled, but the results look worse because they become constrained.
I'd have to overwrite much more of Monogame's renderer, which I'm fine with, but it would break other mods that rely on specifics.
Probably me especially, haha.
so, two 16x16 textures may result in different dimensions (usually off by only a little bit, but anything other than exactly the same would be bad for texture arrays)
a solution would be to have the texture array size always be the max possible with padding, and just use the existing offset capabilities to draw a subimage.
Yeah, I see where you're going. So you don't know what fudge factor is necessary in advance, and the only workaround would be some gigantic fudge factor that leaves a lot of empty space.
that's wasteful on memory, and people have run into OOM issues before.
well, I know the max fudge. But everything is different, and texture arrays assume uniformity.
there is a pattern to it though, it just makes it more complex.
ideally, things from the same spritesheet end up in the same texture array, for performance reasons
If "max fudge" is like, a few pixels, then I'd say just make the atlas grid that many pixels larger. If it's up to 2x the original size or something, then yeah, not great.
as they're likely to be drawn at the same time
it depends on the scaling algorithm in the end, though it should always just be a few pixels.
SM trims pure transparent rows/columns, and it's just meant so that the algorithm can overdraw a little bit.
Adding padding on dynamically-generated upscales seems not all that different from the multitude of game assets having pre-padded tilesheets.
Yeah, it takes up some extra VRAM, but I'd expect it to only matter on severely-constrained hardware that perhaps shouldn't be running an upscaler in the first place... but that's your call, of course.
I'm here on my 16 GB soapbox so I ain't got much sympathy for the 1-2 GBers.
the bigger issue is that I do want to support asynchronous texture updates instead of requiring the synchronous pass I presently have. OpenGL already makes that very difficult due to its (lack of) support for concurrency (and its complete lack of multithreading support altogether), and when the object in question is a single texture object vs n objects, it's even harder.
easy to do with D3D9X/D3D11[X]/12/Vulkan, doable on D3D9 or 10. OpenGL is uniquely problematic.
SM actually did the updates asynchronously on SDV < 1.5 with D3D9.
MonoGame is so aggressively single-threaded anyway, I'm assuming all this is only possible with calling into native code.
SM already has plenty of htat
it replaces significant parts of the renderer as it is
I don't believe anybody ever touches those parts, and if they do, SM just doesn't patch them.
Isn't part of the point of texture atlasing because of all the overhead associated with texture uploads (and especially textures on a single thread)?
they're performance-related
No; it's to reduce the number of context rolls on the GPU.
otherwise you have to change the bound texture object a lot which requires the GPU to flush (sorta)
a texture atlas is a single bound texture object
Fair enough; though I'd still expect more overhead uploading 100 small textures than 1 large one.
4000 individual sprites are 4000 single bound texture objects.
there is, but SM doesn't resample a spritesheet at a time
nor does it have any knowledge of the structure of the spritesheet.
it can guess that it's probably a bunch of 16x16 sprites, but that's not always correct, so it uses the draw data.
spritesheet-at-a-time would also be rather bad for animated sprites
SM has the spritesheet texture data, but it makes no assumptions about its structure or usage (other than what's set in the settings)
and, as said, it doesn't do things atlas-at-a-time (and since it progressively works, would it be making a bunch of small atlases, or rebuilding atlases as it goes?)
It assumes that it's never done since things might change or a texture might be updated by something else, so it creates small texture objects that are immutable.
the issue is that you can sub-update arrays or atlases, it's just difficult (if not impossible) to do so without stalling the GPU with OpenGL since the API doesn't allow you to lock just a part without also implying a lock on the entire texture object, since it doesn't know that the shaders won't sample what you have locked.
Sounds like you're looking for a variation on chunking, where you periodically take groups of those individually-produced textures and group them into an atlas once there are enough loose ones.
Ideally, I don't do that since that manifests to the user as a delay
This is Stardew we're talking about, every asset load manifests as a delay.
I mean, a lot of SM's patches are directly intended to reduce that delay :)
Well, if you solve the async problem (I have no idea how) then it wouldn't manifest as a delay, since it'd be done in the background.
the async update could only happen once those textures are ready, at least. But it's a twofold problem on OpenGL, just a singlefold problem on other APIs
there's a reason I don't like using OpenGL
Write your own Vulkan bridge?
I'd rather have MonoGame use D3D11-on-Vk
:D
but as said, there's a lot of reasons why I don't want to outright replace the renderer - least of all because Pathos won't let me run SM before everything else to replace the assemblies.
(I can't imagine why he'd have a problem with that...)
I mean, SM is already pretty terrifying, but I wasn't the first to propose it.
it's a terrigood idea
You'll just have to go the SK route and write your own injector for the entire game.
that doesn't mean that SM cannot directly patch SMAPI's assembly DLLs to allow SM to do that, and then restart the game, but Pathos may not like me doing that.
I prefer to keep SM minmaximally intrusive
easy to install and use, as intrusive as I can get away with
a lot of the patches are only tangentially-related to resampling - you still get performance benefits overall even if resampling is off.
I'd found that things like alpha premultiplication in SMAPI were taking up relatively-large amounts of time in a profiler, so I replaced them.
Possibly. Too bad you haven't stumbled on a way to improve the horrid asset-loading latency.
I wrote a custom SSE2/AVX-based version.
I mean, it is slightly better with SM. It's just still really bad.
If SM's caches are warmed, SMAPI does all that a lot faster since it also patches GetData
there's no GPU turnaround in those cases
I think quite a lot of latency is just in the file access and format decode.
it's possible that that broke with CG/1.6 or such. No clue off-hand, it appears to be working in my current SM build.
prolly. I could patch more, but there's a limit to what I can do at that level.
Both things that totally do not need to be done on the main thread in theory, yet have to be because of, well, MonoGame.
I'd already fixed a lot of load time issues when I submitted my CL that replaced the on-demand-compiled regex patterns in SMAPI.
and XNA.
since XNA was also single-threaded
SM did have to patch XNA to allow D3D9 to be used on multiple threads.
but allowing the D3D9 library to handle that was 10x more efficient than doing it through XNA's threading system.
different levels of granularity.
I know that Pathos locks some things onto the main thread even as tasks for mod compatibilty reasons
there is/was a bit of code that would intercept the tasks.
I still think adding an async API for loading assets (without removing the synchronous one that everyone uses) would work, but doesn't seem to be in the cards.
Probably because 99% of modders should not be touching asynchronous or concurrent code.
yet that doesn't mean that they won't.
it's hard to test and get right
Perhaps. Most modders shouldn't be touching Harmony either, and yet...
Seasoned Windows veterans misuse the overlapped Windows APIs all the time (and cause fun crashes)
I see far fewer instances of C# devs misusing the async file I/O APIs. The raw Windows APIs are just easy to mess up, period.
Like, all of them, not just the file APIs and certainly not just the overlapped ones.
I see the async stuff misused a lot overall - a lot of programmers tend to just jam await everywhere and then seem to wonder why no parallelization is happening.
Well, yes, but at least they're not breaking anything by doing that.
And as the folks here are fond of reminding me, it's just mods... the stakes are not very high if something does get screwed up, unless it somehow becomes endemic to the whole ecosystem.
it hardly acts like a mod, and doesn't really use SMAPI for much other than, well, starting.
it interacts pretty much entirely via patches
I wasn't talking about CG/SM though, I'm talking about all the mods that could theoretically mess up async assets/async I/O.
right
what you're saying is that I need to make AsyncMaster, which patches SMAPI to allow for async IO, and then somehow patches all the mods to properly use said calls.
I'd settle for just part 1.
Most existing mods aren't going to be compatible with async anyway as they undoubtedly try to use a texture on the same frame it's loaded.
well, that part is actually pretty easy (harder on the mod dev side since you won't know said API exists until you're running - it won't be in the assembly DLL)
That, and if you have to call it with reflection, it kind of defeats the purpose of a performance boost...
Property with the name 'Action' already exists in the current JSON object. Path 'Changes[0].Action', line|
Huh?
Eh, you can use reflection to fetch a delegate.
You only have to reflect once.
the delegate itself can be generated MSIL
Startup time, though. With 1000 mods all doing that...
(And how many actually will compile to a delegate?)
I suppose we could harmony patch .NET's reflection library to shortcut that specific query.
that doesn't sound terrifying.
Amusing. I confess to some morbid curiosity over whether that would even be allowed.
In this case, it will because I would explicitly use expression lambdas.
I use those quite a bit
I mean "allowed", not in the sense of "not explicitly prohibited" but "won't completely blow up .NET and Harmony in the process".
the reflection would just be to fetch the delegate that's already been generated by that process
not creating a delegate from the getter
well, SM already... messes with the .NET VM a bit.
I can't remember if I removed that. Let me check.
I did not.
(This discussion might be better for #programmers-off-topic or a thread, so newer mod authors can still ask questions here.)
Have you ever changed the element type of an array in .NET so you didn't have to copy it to use it elsewhere as a byte array instead of a uint array?
Can you post the JSON file?
That is me, I am new mod author! And I do, in fact, have a question. I have two comma-separated ITEM_CONTEXT_TAG item queries in a "PerItemCondition", but they don't seem to work - it's like the game tries for the item to have both
"ItemId": "RANDOM_ITEMS (O)",
"PerItemCondition": "ITEM_CONTEXT_TAG Target book_copper_tier, ITEM_CONTEXT_TAG Target book_steel_tier, !ITEM_CONTEXT_TAG Target mysterious_bookshelf_banned",```
I have defined 1 item with book_copper_tier and 1 with book_steel_tier, but no items come up
You're missing a few {}[] characters; this version should fix that. I suggest indenting consistently to make that a bit easier to spot.
(You can also combine the EditData patches in this case.)
Yep, PerItemCondition will match if all of the given conditions match. If you want to have OR logic, you can use the ANY game state query like this:
"ItemId": "RANDOM_ITEMS (O)",
"PerItemCondition": "ANY \"ITEM_CONTEXT_TAG Target book_copper_tier\" \"ITEM_CONTEXT_TAG Target book_steel_tier\", !ITEM_CONTEXT_TAG Target mysterious_bookshelf_banned",
Which could be read as (book_copper_tier OR book_steel_tier) AND !mysterious_bookshelf_banned.
oh, I didn't know I could nest queries in PerItemCondition
Thank you โค๏ธ
Can you help with the same brackets? ๐
The easiest way to fix brackets is to use an editor like VS Code that recognizes the JSON syntax, and then indent consistently. Each time you open a [ or {, all the subsequent lines should have one extra indent; and then remove an indent after } or ].
Then you can just click one of the []{} characters to highlight the other one in the pair, and see if any aren't paired correctly.
(If you can't find the issue, feel free to post the indented file via smapi.io/json here.)
Also in vscode you can turn on rainbow brackets in settings, and it will colour match the open and closing brackets, and unmatched brackets will be red
Everything seems to work
I personally use Brackets for coding, but that's because I did a web dev class back in high school that used the program
https://smapi.io/json/content-patcher/65534277aa724030a32da77fa1a4df0c
Before that, everything was working, why is it not working now?
You're missing a comma at the end of line 3.
to make an item glow when held you use a context tag right?
torch_item I believe
ok cool let me give it a shot : ) thanks Selph
Oof, I tried out StardewUI and it almost immediately nullified weeks of work because it handles almost everything I was previously coding manually
While I'm glad it works so cleanly, a little irked I spent so much time on UI code for it to Not Matter
if you have more questions feel free to join the dedicated thread here: https://discord.com/channels/137344473976799233/1293051032904925255
Thus far any questions I have will probably be answered by me reading documentation (currently looking into how to create a submenu when you click on something in the main menu) but if I have any questions I'll defo pop in and ask!
One day it'll be as popular as SpaceCore and then we won't need to advertise.
now that's shooting for the moon
I've nullified no small amount of my own code too; at least one entire example that I originally did for the framework is now roughly equivalent to a 1-liner.
Gotta have big goals if you wanna accomplish big things, amirite?
Hello can someone help me with solid foundations?
what are you using SF for
shouldn't adding this to a new location be enough to add stuff to the artifact spots? with an editdata action and entries
there is a way to see how many tiles I have selected in Tiled?
[Content Patcher] Can't apply data patch "Fish of Stardew - AztecViper > Include assets/artifacts.json > EditData Data/Locations #2" to Data/Locations: the field 'FOS_Beach1' doesn't match an existing target
I keep getting this warning
which doesn't make sense to me as FOS_Beach1 is already an existing location and no other areas have issues like forage and fish
do you have code we can look at
The rectangle select tool will show you and if you can figure out how to use the wand select it should as well for stuff that isnt rectangular
Yea let me post my artifact and locations.json
https://smapi.io/json/content-patcher/f7284048a0fc4f31b283b7ddd9306220
locations above forage artifacts below
https://smapi.io/json/content-patcher/a54d69eccc304c5a94d07f616f231ce8
I am using the 'select the same block' and hoping for a tile count somewhere... even looking for more windows to add
it is in the [#] at the bottom when using the select same tile tool
Nvm that number isnt correlating one sec
that looks fine to me. maybe "Enable New Locations" is not enabled?
It is so I'm a bit perplexed XD
uhh check your file order?
Ok that may be it
Didn't think of considering so but I bet artifacts is loaded before the location is loaded
I created a building with solid foundations but I also added a animated open/door closing feature but I want a sound to play
I thought SF could add a playsound but I can't find it
I couldn't even find the [#] thing... maybe I am blind
I'm trying to work out the longest item name in the game for the purposes of a text field. I think it is the book, "Jack be Nimble, Jack be Thick" - can anyone recall a longer one?
oh wait does it go in the sequences portion
as far as I can tell this is not possible, you may be able to make a command to use but that requires knowledge outside my realm of capability, sorry
How to find out the ID of all locations for fishing?
!unpack
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!
Oh, thanks
the fishing zone data is in Data/Locations
'Natural Wonders: Exploring Our Vibrant World' beats that
and modded items can ofc be as long as you want
What.... is that? Is that in vanilla?
movie poster
Thanks a lot anyway. yet trying to get used to Tiled somehow
its a furniture item
it's the movie yeah
Oh, they are furniture. Ok, I don't think I need to worry about those. Thanks though.
(Furniture definitely has some ultra-long names but I don't expect anyone to be putting it in their quick-access menu)
maybe could look what the possible longer name in the game would be and use the value as needed. Not sure if C# limits the length of a string at all
Not sure how you came to the conclusion I was concerned about a limit on the string data type. It's a rendering issue, there is only so much physical space you can occupy on the screen before having to elide.
Anyway, it's all good, thanks.
I concluded it was the size of a quick-access search, like the Better Chests one, following the last message before mine. sorry
Clearly you should check out the French
i am summoned
Oh yeah, if you need to worry about the size of item names in other languages that could get wild lmao
also about the rendering, after seeing the bullhead be translated as 'peixe-gato-cabeรงudo' in pt and seeing this breaking the very day ending shipping items value report, I would care little to it
oh you meant the french translation
i don't touch those
alas, all the info I needed was in the wiki all this time and I feel like self-sabotaging myself
Either I'm blind or it's not there...
Rather 1 option
Not the German?
Perhaps the Welsh
Did someone ever put together a list of the 1.6 music tracks? Been looking at the soundbank google sheets and I don't think it's been updated
I haven't looked it up, but I'll bet "Friendship 101" translates to something like "Ein Einfรผhrungsbrief ins Freundschaftsbeziehungen"
An introductory brief in the relationships of friendship.
Could just go the other route and say something like "Freundschaftseinfรผhrungsbrief"
Good for testing line-breaking. But thankfully I already got that sorted out.
How difficult would it be to add an interactable furniture item that grants the player a buff? Maybe removing the buff if used twice? Been thinking I wanted to add an alternate source of glow/magnet to free the player from having to choose between the de facto QoL ring and more directly beneficial rings
I know there's a mod out there that adds a glow buff to the game for modders to use so that should be doable (at least, after it gets fixed to work with 1.6.9+) but I'm clueless on the interactable item part
Hm, not sure if any of the frameworks have toggleable buffs
SpaceCore you should be able to make a furniture you can get a buff from
But you'd have to re-up it every day
is it cool if I add you?
Yeah, but I think that's better than making a permanent effect because there are times we might not want magnetism
But, I think this might be a little out of my league at the moment, looking at the glow buff mod's documentation
(fyi glow buff broke in 1.6.9 and not fixed yet)
yes :) feel free to
Ye the author's reportedly working on it now so I'm holding out hope for that but also the documentation says it currently only works on consumables
...im actually kinda losing it, does anyone know why smapi is yelling at me saying "could not create location" ??
Do you have the error log? I have a feeling there's a problem with your TMX
i can get that in a second, i reloaded it trying to fix it ..
Everything in your .json looks correct my guess is tmx too
Here's my drawLayers functionality for the solid foundations framework I want a sound to play can anyone help? ```cs
"DrawLayers": [
{
"SourceRect": "0 0 48 68",
"DrawPosition": {
"X": 0,
"Y": 0
},
"HideBaseTexture": true,
"Sequences": [
{
"Frame": 3,
"Duration": 100
},
{
"Frame": 0,
"Duration": 100000,
},
{
"SpecialAction": {
"PlaySound": {
"Sound": "crystal",
},
},
},
],
"Condition": "dreamygloom.cellarbuilding_Cellar_Closeby dreamygloom.cellarbuilding.smallcellar 3"
}
],
here is my log https://smapi.io/log/37d02e0768184231a6ad257fd964b5ae
Log Info: SMAPI 4.1.9 with SDV 1.6.14 build 24317 on Microsoft Windows 11 Home, with 14 C# mods and 1 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
did you at some point save your map when the tilesheets werent present
System.Exception: Invalid tile gid: 2699```
so yep, that's absolutely the gid issue at work.
your brackets look wrong
I can't help with SF itself though, sorry
(should I ping chu to add conditional draw layers to MMAP
)
@lucid iron hey selph wants something
๐ญ
you cant
I thought that the case too, but no
and to think of it it'd probably be very annoying to implement mainly because of update rate
Fix doesn't seem too bad to do, at least: https://stardewvalleywiki.com/Modding:Maps#.22Invalid_tile_GID:_.3C.23.3E.22
a sound to play is also not in vanilla 
yeah it seems SF still has lots of niceties
it feels to me that u r in a situation where SF is the correct choice, assuming that thing works fine in 1.6.15
Pelican Valley Loft NPC Apartments has officially gotten it's update published for event support, NPC-only elevator warps, and world map positioning!
event support?
Mainly loading blank JSONs in Data/Events for each of my added locations so that mod authors can use EditData and not have to worry about overwriting each other or failing to find the Target.
Was a minor nitpick but did seem a bit safer for compatibility since my locations are all custom maps specific to my mod.
they shouldnt have had to worry about overwrites in the first place though
not that i think having the blanks already there isnt convenient though, im fond of it
Loading blanks for events for locations you aren't adding yourself should always be non-exclusive
I'm a big fan of promoting use of EditData where possible, and it wasn't that hard to add in the blank JSON.
This does help prevent user error though
i wasnt saying they wouldnt use editdata for the events i was just saying what roku said, they can load blanks but with a non-exclusive priority and it works fine
Assuming the mod author knows to do that, yes.
๐ my door is see through
But this mod is part of my initiative to encourage people to create more NPCs, so if I can make it easier without adding unnecessary burden on myself, I'll do so.
Did you add the Door map property?
Doors map property and Action Door both necessary for a door
^
Reminding me, I put together a sliding door sprite to try out the new EMA Custom Doors action with. I should do that today.
In my custom doors expedition, I learned that only the coordinates for Doors is actually used
(I know double doors aren't truly supported yet, so I want to see how close I can make it with two individual door actions)
that's the thing, this is just clint's room door. i just moved the map property a few tiles over to account for the new location
Did you move the TileData?
no, because i added more tiles to the left of the map, the coordinates changed
but i didnt actually move the door or anything itself
oof
So the door didn't move but you changed the map property?
Oh, I see what you mean now
You shifted the entire maps tile indexes by adding tiles lol
yeah
Adding extra tiles to the left and top of a map is usually avoided just because of stuff like this, LOL.
๐
I mean, double check the coordinates, make sure you entered them correctly in the map property is where I'd start
Can you take a screenshot of it?
so it wont work i read
Like EditMap patch
๐ค i used editmap
oof
(unrelated to your current issue, but have you already taken care of the coordinate changes you'll have to do for Clint's (and Lewis's) schedule and the warps leading into the Blacksmith to account for your map edit?)
(no, not quite, i was still fighting with just getting it to load into game properly)
And also, text operations don't handle these dumb map properties well, so you would have to just overwrite the Doors property on the Blacksmith map
i did notice clint spawned In The Middle of the floor
I suppose for my project I could add C# logic to work with the gamestatequery I created...
instead of behind the counter
If these map properties used real fucking delimiters instead of all spaces, it wouldn't be a problem
A thing I copied like a dipshit for my one map property and I seriously considered changing
whats wrong with textoperations here?
You can't match the specific group of fields you need if they're all delimited by spaces
I dream of one day getting an "AddDoor" CP function that works like "AddWarp" xD
if i set it to load, would it behave without needing to to something else?
If internally the groups are delimited by spaces and externally each group is delimited by spaces, there's no way to match a specific group
I mean, Loading is the way of madness and compat issues
You gotta make sure to copy all the vanilla stuff and anyone else making changes to those areas are gonna conflict
So SVE compat is gone
Thankfully, the default Blacksmith map only has one door, so overriding the Door map property completely is non-destructive with vanilla, at least.
(well, i dont even know how well this would work with sve in the first place)
Realistically though, if you wanna support SVE you'll need to have an edit that incorporates their changes anyways
Since you've changed all the positions
and my warps won't work ๐
It's too late at this point unless you absolutely want to redesign your map again, but in the future, this is why it's easier to add down and to the right on existing maps.
For now I would just overwrite the Doors map property and save all the other stuff for later
Make it work, make it right, make it tight
so how would i go about that? I'm unfamiliar with doors
in the editmap, the mapproperties as an entry, so you're effectively nuking it all
you might have to null first and then add them back in, but i'm unsure
EditMap -> MapProperties and the Doors key should be sufficient?
Question! If I want to ask about proper implementation for StardewUI, should I ask in here or the thread? I wasn't sure if the thread served a specific purpose
Threads will help your question and answers not get lost if the discussion on how to implement your request gets lengthy
We do tend to chatter on a variety of mod-making topics here, so things can get lost.
i imagine focus doesn't bother to backread unless specifically pinged, and i don't necessarily like pinging people
so it's nice that people have threads
I've not tried with Doors specifically, but for all the other properties I've used, it will completely replace it by default if the property already exists.
ah then the null shouldn't have to be necessary
"Action": "EditMap", "Target": "Maps/Blacksmith", "MapProperties": [ { "Doors": [ 14 9 1 120 ] } ],
(i have no idea how this works)
{
"Action": "EditMap",
"Target": "Maps/Blacksmith",
"MapProperties": {
"Doors": "14 9 1 120"
}
}
the property should just be a string
a



