#making-mods-general
1 messages · Page 15 of 1
idk tbh, its been like this since day 1
we dont happen to have, like, a top 20 of most used npcs do we lol
Might be worth retrying the instructions here? https://floogen.gitbook.io/stardrop/guides/nexus-mods-integration/connecting-to-nexus-mods-api
I just chose the New Character category and then sorted by downloads to find the most popular NPCs
I just go based off who I like since I run a pretty heavy NPC load generally 
Void if you remind me in 4-5 hours, I have a list of every EN-lang NPC that has over 10k downloads (though those numbers are from early 1.6)
I started downloading a bunch, got exhausted, and gave up partway through
Festivals are stinky and I am not going to bother with them until later
You can also just rely on the scream test
Is that waiting for someone else to scream at me?
Yes

man
I really dislike those who dont have their whole mod ready in a folder when unpacking....
ok...I THINK i can finally test festivals now
what's mod compat, my expansion is gonna add an extra large area that isn't touching the main area because my ideamen wanna be in every vanilla festival
That's probably worse to do compat for tbh 
@deep cypress: figure out exactly where the crash is happening by spamming ten million break points. (8h ago)
[20:32:01 WARN game] NPC TheFishmonger can't load portraits from 'Portraits/TheFishmonger': Microsoft.Xna.Framework.Content.ContentLoadException: The content file was not found.
Huh
trying to set up my mail trigger for a map edit only to be applied when a specified mail has been read HasReadMail
question is, in multiplayer, who can read mail? is it only the host?
Ridgeside, Sunberry and ES all patch the festival maps, and that's not counting SVE which redoes them altogether
it was really a mistake to be like, "okay you get a max of two npcs" them: "i wanna be in all vanilla events"
i thing i did the new appearance system wrong
Plus I think there's one of the Reimagined map mods that changes them (though they aren't updated for 1.6. yet I don't think
casually eating in front of a library computer
yeah i'm gonna hate compat with all the other expansions, i contemplate breaking their lil hearts and being like, "nope we're not gonna deal with vanilla festivals"
wdym, show
smapi says no portraits, i somehow accidentally completely nuked Constance from the game lol
Link to json?
did you keep your flat loads?
Can you link the mod and what you want it to say?
i need a set of {} around the [] of appearance, dont i
why do you have an open appearance with no action 
Also tiaaaa say if I planned to make a dialogue mod for, say, June, where do I ask for permission 
https://www.nexusmods.com/stardewvalley/mods/27218?tab=posts&jump_to_comment=143384733. I wantit to say "This is quite possibly the greatest mod ever made for Stardew Valley. It changes the Pig Painting to the painting from the Brother, May I Have Some Oats meme"
Your larger appearance block isn't inside your EditData for Data/Characters
idk i copy pasted it from somewhere help
Appearance lists should not have {} around them
i saw it in a dispo and was like, hm i guess this is a thing i gotta do now
its a list of objects so the brackets are correct
braces would not be
i think the problem is that it's a floating appearance with no actions attached to it
Just copy and paste all the entries (start with the Usual Outfit) underneath the "Default" entry that is actually inside your Data/Characters edit block.
that is likely the problem yeah im just makin sure to say its definitely not the brackets too, dont change the brackets
(on the real appearance entry i mean)
your dispo's appearance is fine
it's line 84 that i'm staring at you with a pencil for
I didn't see you get a clear answer to this - not sure if I missed it - but sell prices are set on the Item itself, that is the "instance" or "stack" which carries over when the item is moved to a different slot, put in a chest, etc. If you want the price of an already-harvested item to change when the season changes, you would have to hook one of the time events like DayStarted, check for a season change, and iterate through all the items in inventory and storage and update their price.
(In other words, this requires code. Someone may correct me if I'm wrong but I suspect it's not possible in CP since it's not really the "content" that's changing, it's live data in the game.)
(Rokugin did say it would need C# but didn't reply to do it so it was pretty easy to miss.)
hold on i attempt to fix from this shoddy school computer
i need to stop going to mateo to look how things are done :I
what did i miss on line 90
i don't have an actual validator i have to do this from memory
the way you fixed it makes it more complicated than it needs to be bc they can just add the list directly into the Appearance field of their character
Yeah just move it up
the reason you're getting errors is bc you didnt give any of the entries any keys
done, slap that in
replace "{{ModId}}_Fish" with whatever you want, if you want to bother, i just named them 1 through 9 LMAO
oh, that's what you meant
(i would still not do it that way Avi since they are not editing an existing character)
shove it into the appearances rather than making a whole different entry
i didnt effin realize i already got it up there wahh
Yes you dork :P
that way would work tho Avi and is what they would need to do if the NPC wasnt theirs
but it can just go in the disposition itself yeah

i have the thai food-itis and i just sat through an hour and a half talking about c++ structs and everyone kept on repeating the same question
You've got it now, don't worry
oh i set my appearance to null for my custom npc that's why i had it differently
why for
i didn't want my long laundry list of appearance edits to be in the dispo 
I want to implement some code to fix the issue that occurs when a player is swimming state and then they are defeated. The player is warped to the hospital in swimming attire.
i mean, that sounds like what id expect to happen if someone found me passed out in swimming attire
hmm maybe I could just patch a map property to the hospital map... so the player will change out of the swimming attire...
is that problematic?
How would you manage to pass out while swimming? Bat attack?
Is there any unsafelocations with swimming??
oh, are they not actually swapping to swimsuit before they can get in the water then, and getting into the water fully clothed?
mix of swimming waterways and stone caverns
Swimsuit inflicts the slowed effect when it has that tile action iirc
the passout functions seem like they already should be changing you out of your swimsuit if you're wearing it
Yeah my mod is based off underwater caving
it doesn't. It's not hardcoded
is patching the hospital cause issues?
if ((bool)who.bathingClothes)
{
who.changeOutOfSwimSuit();
}
this is in passOutFromTired, and this is from performPassOut:
if (!base.swimming.Value && this.bathingClothes.Value)
{
this.bathingClothes.Value = false;
}
Shouldn't be, it's the pass-out context for the location
the monsters are ghosts and bats
though i did miss that ! at first glance
so they fly and attack the player when swimming
so it seems like if you're passing out but not from tired then it only checks if you arent swimming but have your swimsuit on
.... do you have to add in the passoutfromdamage (I don't remember it) into that then?
hmm yeah i think it's missing since there are no area's like that in the game.
where may I find the data in the decompiled code?
hm.....I think I shouldve used a fresh save to test the festivals...
also idk why but constance isnt at the festival wahh
I cannot pull up my appends I'm in mobile now
ugh, gotta slap my face after clicking an existing save again instead of making a new one
Not there as in her sprite is invisible or as in you didn't manage to actually get her into the festival setup properly?
I've been able to do it on previous saves
@royal stump i have some questions about FTM
Can we spawn the new coal nodes with it in quarry like area?
And : i don't remember ever selecting an option for spawning wood branches but some of my area do, can i control that somehow?
following the trail of code that happens when a player dies as far as i can tell it should be changing you out of your swimsuit when you get the "wake up in hospital after being killed" event too
so iunno why theyre still ending up in their swimsuit
i did debug where and it told me shes at her home
(also can someone maybe look at my animation idk if i should use her normal TheFishmonger name or the target i set her festival sprite as)
for flower dance, i mean
Nexus glitched and now I can't edit my own mod 
i am second guessing myself now
yeah nexus does that sometimes. gotta wait some minutes for it to catch up
Are you testing the flower dance now as well?
not yet, i am still at egg festival
tho rn i am not ingame in case i have to change something (i forgor the command hgnsfl)
!reload
-You cannot reload tokens, that's a forced restart unfortunately
-If you've done any CHANGES, then type into SMAPI:
patch reload YourMod.UniqueID
-If you've done i18n DEFAULT.jSON changes, then type into SMAPI:
reload_i18n then
patch reload Your.ModUniqueID
-C# Visual Studio has a feature called "Hot Reload": https://learn.microsoft.com/en-us/visualstudio/debugger/hot-reload?view=vs-2022
-C# Rider has the same: https://www.jetbrains.com/help/rider/Hot_Reload.html"
-Generally working in C# it will be called "Hot Reload" (usage may vary)
oh right it was called patch reload...
is "setup" used? I have setupadditional
Did you watch Constance's 6 heart event before checking the festival?
i have, i am using tias template from the wiki
and yes i did
Anyone know of a good way to determine if a location is instanced/a building interior?
currently making a new save since the entire rug on the middle of the egg festival was just a black void and i was like ok i changed the terrain so much and saved it without RTF i messed up :I
can you check if the location has a unique name? like with the id at the end
Lacks the isOutdoors map property?
GetContainingBuilding
Thank you!
I was considering that but wasn't sure if it would be reliable
I don't see anything wrong with your Egg Festival setup so hopefully a new save will work
- Yes, the ore section should accept "Coal" as an option. It might help to copy a fresh ore list from a new file, e.g. one from the HTML editor.
- I think twigs will appear alongside weeds and stones if you have the map properties "SpawnDebrisOnNewMonth" or "SpawnDebrisOnNewYear", but some might appear on any outdoor map regardless, if I'm reading the code right.
The map property "skipWeedGrowth" might prevent the automatic outdoor spawns.
hmm, i believe i have none of those property and it's an indoor map
and thanks for the answers 🙂
I'll see if I spot anything else of note, there are about a dozen "spawn objects" or "spawn weeds and stones" references throughout the location code
"ForceSpawnForageables" also causes those to happen, it looks like
thanks but no big deal, i was just curious if i missed some obvious "wood" option that would be defaulting to something in FTM
ahhh
that is it then
because i need it to... well, you probably guessed why 😄
huh
it looks like skipWeedGrowth and that are opposites, so using both would probably just skip forage too
if (this.map != null && ((bool)this.isOutdoors || this.map.Properties.ContainsKey("ForceSpawnForageables")) && !this.map.Properties.ContainsKey("skipWeedGrowth"))
the black void is the best option for storing large quantities of painted eggs
That is a problem. Did she work properly when you tested without any other mods?
i mean, i do feel at home but i dont think the townsfolk want it lol
(and no, FTM should only spawn those if you intentionally spawn objects 294 or 295
it doesn't have any presets for weed stuff)
tbh i went striaght into compat hell and didnt test her alone in the festivals
should try that ..
Yes it's always a good idea to make sure you know how to do a thing in its most basic iteration before you start introducing a lot of complexity.
Well, I think so, anyway.
I hate all the backtracking involved in jumping too far in.
Made yet another micro-framework.
Content Patcher authors can now have buildings added directly to a map without the need for additional code
https://www.nexusmods.com/stardewvalley/mods/27359/
damnit she is still at home
(Yes it's a de-hard code of the coop for the new farm)
(SpaceCore already does this right?)
did I do something wrong afterall..
Does it? 
I'm not sure if it does things like animal setup, but SpaceCore does have some kind of farm building setup in 1.6, yeah
Just checking in case you forgot since you started a new save: did you watch her six heart event on the new save?
thanks! i may ask pathos then, maybe the change can be sneaked in 1.6
.9
(tbh stuff like that (the farm building framework thing) is very two cakes for me though, i prefer smaller dependencies if a dependency i do need)
(or more focused dependencies rather)
Welp, this is my two cakes moment I guess 
tangentially, I don't think anyone's finished a "spawn building" trigger action yet
I was poking at one for EMP but never got around to it
well if Max's is tiled based id be happy
trigger action you say
Better Crafting has that I recall
(though I'll eventually be doing stuff like that in FTM, probably, some day)
i did yes
i thought BC had a like. building crafting table
does it also have an action? (i dont actually use BC besides for testing compat)
@ivory plume context of discussion is that apparently using property like the ones listed or ForceSpawnForageables may force wood debris to spawn in maps even if they don't list them somewhere, do you think this may maybe be separated somehow? Asking in case it's like, one simple line change that has no impact on vanilla, understandable if it's out of scope
Hmm ok. Might be worth doing a patch export so you can check if she's in the file properly.
It is, and (maybe spacecore does this as well) it works for other maps then the farm so ¯_(ツ)_/¯
though actually I'm not sure if it's exposed as a trigger action
the github links here are 404ing for me, though I see the repo; I think it wants /tree/main/ in the middle?
https://github.com/MindMeltMax/Stardew-Valley-Mods/MapBuildings
https://github.com/MindMeltMax/Stardew-Valley-Mods/tree/main/MapBuildings
does not seem so actually. You can go ahead with that fancy add building action 🙃
(can I get targeted name building) goodbye I'm in calc
depends what you mean by targeted. if you just mean being able to specify a Coop instead of a Barn then yeah. i dont know if anyone would get much use out of an action that spawned a completely random building on the farm... but maybe? 
hm idk how to do that properly
It did, thanks for catching that 
patch export Data/Festivals/spring13

Then in your main Stardew Valley folder you will have a folder called patch export. Inside that you can open up what the game has in that moment for spring13.json
Is your Include code block in your content.json correct?
Aba, your hack is seeming more and more like the only way lmao
Outside of just writing my own damn custom tile action in C# for it
I am a genius!
ok so
me forgetting the include and then adding it is not the reason, she still aint there..
Did you do another patch export?
not yet
yea no, nothing in there of her
ok whats going on
am i doing the when thing wrong
im gonna take it out for egg festival and check
Good idea
wait
what
oh my god finally
it wasnt the when i forgor a folder in the incvlude
shes here
still wondering why with my other mods the ground is black..
UH
huh...
[22:28:29 ERROR game] The game failed to launch: Microsoft.Xna.Framework.Content.ContentLoadException: Failed loading asset 'Data\BigCraftables'.
i have to check editdata buildings but if I wanna spawn a custom boat........ 
inchresting....stardroip suddenly doesnt wanna load all my mods
so because im lazy and love (/s) forgetting to actually register actions before i try and test them in game, i wanted to do this:
foreach (var action in Assembly.GetExecutingAssembly().GetTypes().Where(t => t is { Namespace: "BETAS.Actions", IsClass: true } && !t.IsDefined(typeof(CompilerGeneratedAttribute), false))) {
TriggerActionManager.RegisterAction($"{action.Name}", action.GetMethod("Action").CreateDelegate(typeof(TriggerActionDelegate)) as TriggerActionDelegate);
}
is there a better way to do this? particularly the delegate creating part, gettin the name is fine and i do the same thing for my books mod but getting the specific method in it feels like im doing it messily or in a way that might not be so reliable maybe
(it does work and correctly register the actions and their functions though but i just feel like im using that CreateDelegate thing wrong bc iunno why i need to give it a type if i need to cast it anyway)
(someone who knows better can give actual advice, but personally I think it's both kinda spooky and utter genius)
it has done me wonders in my books mod
i use it to generate all my CP tokens and GMCM config options automatically since they all follow the same template
as long as i dont mind keeping every book (or in this case action) i add in its own class, which, i do not
Use the generic form
CreateDelegate<TriggerActionDelegate>()
oh bless thank you very much
immediately much more pleasing to my eyes thank you
time to do this for all my GSQs and triggers too and retest them all to make sure none of em broke 
hm, just found out i somehow broke my i18n again, how do i keep doing this
being completely honest i dont really know what atttributes are besides the ones i use for harmony nor do i have even the slightest clue of how id make my own and then use it for something
so thats probably something ill look into in the future but for now i think im good with this quick (bc i already know it) way bc i wanna get back to writing the actual action i had in mind before i got distracted by this reflection stuff 
Super easy
does this just save me having to check the namespaces and compilergeneratedattribute stuff but not the delegate creation stuff? (also in that second link you're looping over the properties of one class, would it just work the same for looping over my assembly in general if my attribute-assigned things are in different classes?)
Yeah
I mostly did it so I could associate metadata
(Ie GMCMSection)
But I don't like magic naming tbh
Rather have a custom attribute
ill just go back to the actions i was making for now then without the reflection stuff and revisit this later tonight i think, thank you very much for the examples
This
foreach ( var spouse in allSpouses)
{
NPC fubar = Game1.getCharacterFromName(spouse;
if(fubar.justEngaged().Value == true)
{
allSpouses.Remove(fubar.Name);
}
}```
Gives the following error:
[PolyamorySweet Rooms] Failed in FarmHouse_loadSpouseRoom_Prefix:
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.List1.Enumerator.MoveNext() at PolyamorySweetRooms.ModEntry.FarmHouse_loadSpouseRoom_Prefix(FarmHouse __instance, HashSet1 ____appliedMapOverrides) in C:\Users\Apryl\source\repos\PolyamorySweetRooms\LocationPatches.cs:line 108```
How can I remove the npc from the list, without making that error?
why are you doing that
Because, when a person first gets engaged, if they go into the house, the game explodes. I was trying to remove them from the build the room list, temporarily.
allSpouses.ToArray()
best if you can actually find out what is explode here
Actually, you are right, this isn't what I was trying to do last night, I was trying to do what Chu/e just said, yes.
Please for the love of god
The "traditional" pattern is to iterate backwards
But RemoveAll does it right
wow convenient 
more clear naming than python's filter
still i wonder if you can just
delay the push to allSpouses?
to like next day or smth
assuming justEngaged means "engaged today"
Thanks loves!!! I am going digging into why it likes to splode...
The traditional pattern is o(n^2) at worst. RemoveAll is single pass and linear
It exists and you can Just Use It
You may question my sanity
I do, every day
no i think u r doing fine 
i guess you gotta move the elements around too
Yeah
okay, makes sense
I wouldn't recommend necessarily implementing RemoveAll unless you benched it (n^2 is the pathological case), but it exists and it's easy to use
So why not
man i hate how i cant use lookup anything during festivals :I
Hm. I kind of want to do a system for custom renovations and I'm debating how to go about it. The vanilla system is kind of a mess, but in theory I could make it work.
On the other extreme, I already have a conditional map patching system in place, so I could just add a system to, say, sell trigger actions in shops. The decoupled nature of this approach though makes it difficult to do vanilla-style previews of changes
Maybe if I do the second one I can have an optional field specifically to indicate a map patch preview?
Do you care about requirement to clear the area (like vanilla)
I feel that's the only reason to have preview 
Hi chu/e is the pass mail file on CP? 
And I wouldn't particularly mind if you just yeet my stuff into lost and found if I undo a renovation
Yes it's Data/LocationContexts.json in the unpack
That is a good point
And mail is just regular mail
It's been ages since I did a renovation, does the preview not show what it would look like if you built it?
yea its like any other data 
yes for like a few sec
but prior to pressing the button it's there to show where the renovation will be, and what placed items you potentially need to clear
Hypothetically.... if one were to make a mod to remove Harvey billing you if you married him, it wouldn't be too tedious no?
Oh that's... Not as useful as I thought
(for a beginner mod author)(Emphasis)
yea but i love burning the crib down it's top tier animation
So you just have to guess what it looks like before you buy it huh
it is just some CP data edits in the end, try it and see how it goes 
you know what GameStateQuery/Condition do right
Some mod authors told me about it when I was talkiing about making an event mod but I haven't messed with it just yet.
for harvey u just need PLAYER_NPC_RELATIONSHIP Target Harvey Married
the current one has a ! in front, meaning negation
Oooh, does is it kind of the same way as that mod where your NPC spouse saves you from the mines and reacts to your death, kinda way?
Isolated to harvey minus healthcare billings
no idea never looked at that
i believe your edit should be this
{
"Id": "{{ModId}}_FoundByHarveyMarried",
"Condition": "PLAYER_NPC_RELATIONSHIP Target Harvey Married",
"Mail": "{{ModId}}_passedOutHarveyMarried",
"MaxPassOutCost": 0,
"SkipRandomSelection": true
},
and then write a matching {{ModId}}_passedOutHarveyMarried mail
it has to go before the vanilla FoundByMarlon entry
anyone ever...lost their cursor
so you would want a MoveEntries
Yeah, you really only get a footprint before you buy it, but I guess it was less important to preview because the vanilla renovations are all empty rooms
seadude ate your cursor void gotta catch him before it's too late
do you mean losing the game cursor or losing LooseSprites/Cursors.png?
no like uh
I am still testing festival spots for constance so i ofc warp and change times a lot
and everytime I do that during spirits eve something weird happens
and just now i warp back home and my cursor was just gone
Hey modding veterans, is there a limit on the length for event scripts?
I had no cursor in any shape or form to click anything
Oh yeah Marlon's passed out mail is the 4th one. Harvey's billed one has this I've billed you {0}g
...This is probably way too much effort for me to be considering, but I am now pondering the though of a 'showroom' for Robin's that just has all of the renovations dumped on one map together to let people walk through before making a choice to buy one
it somehow fixed itself when a random farm event played but idk what happened?
Since I want to do prefab rooms, I may do that anyway >_>
Where does Robin get all that space 
She dug into the mountain, clearly
Or got the wizard to do her a favor once and there's a warp circle
I mean, the renovations are already instantly built, there's gotta be some magic involved there, right? 
Will you stop ppl from filling it with kegs 
Sorry chu/e
This game is anti alcoholism but pro breweries
And anti capitalism except on the farm
extra greenhouses? kegs
east scarp meadow farms? kegs
rsv summit farm? believe it, kegs
I'm married to Penny and my house is kegs
"Don't worry honey, these are for making potato juice! Just ignore the crates with the, uh, blue fruits next to it"
Not one you'll hit
Try to not go above int.maxvalue characters
I'm still tempted to try making a framework to let you run Yarn event scripts
But why?
Why not
Exactly, EnderTedi
Also it would let you do cool things you couldn't do otherwise in events (in theory)
Wait, what yarn are you talking about?
(i was also thinking of the package manager and very confused lmao)
No, that actually seems like a good idea imo
so would you transpile it to sdv event script?
I'd be reluctant to include it in SpaceCore since that's kinda a big dep to add for something nobody may use
or just write your own event system
transpiling? eww
I'm thinking either a custom event command that triggers it, or a C#-powered event (SDV already does this for the green tea event)
(transpile in the typescript to javascript sense, not harmony)
(yes I know, that's so eww)
Like the boat journey? No clue
Maybe becuase those don't need the normal event scaffolding like actors
IM LISTENING
Basically you can set variables and do things based on that
there sure is a draw function of all time in EventScript_GreenTea
Mid-event
I have a really silly question but I need some suggestions:
So I'm modding myself and my bf into the game as NPCs, and I'm stuck on a name for my bf because his name irl is Alex. His other favorite shortening of Alexander is "Sandy" but ofc there's one of those in Stardew already 😭 I've got an alternative BUT I'm absolutely dying to use Sandy as his name because I find it adorable. Should I just roll with it and have 2 Sandys? Canon-Sandy isn't that important to the game so I feel like I could maybe get away with it? Should I address the double names at all?
On a technical level, will it cause issues? If I have to, I'll give up on using the name Sandy but I really don't want to 😭
Technical level, just prefix the NPC ID with your mod ID and you'll be fine
Thanks
if you want other people to play your mod they may get confused
Yeahhhhh that's very true
On a technical level, I have fought with the idea of screwing with multiple viewports for events, in realistic terms, I will probably blow up the game
"Xandi"
Xander was my plan C so I'd do that if I can't make Sandy work
so....is there something special with the festival of ice or why dodnt i get constance in there, shes yet again staying home
Prefixing the internal name is just you remembering to reference it every time, gameplay perspective from people will think you're replacing sandy
(also hi Avi I might ask you more on this mod idea someone brought up, chu/e alr guided me with what to do) 
Link's reverse transpiler haunted my dreams
My silly goose self is considering having it both ways. Like making an optional content patcher patch where it can be Sandy. I don't care if it's more work, I'm just so internally hung up on having a fitting name for the character even though literally everyone else would just choose the main file because why would any normal person want 2 same name NPCs 💀
canon Sandy's name isn't even Sandy it's just good for business 😭 why must she do this to me /lh
Sorry gang I realize I'm not taking suggestions very well and it just boils down to me making a choice, I appreciate you guys listening
"This my brother mark" and my other brother, "marc"
Oh?
I can't search in discord on mobile it'll blow up, but it woke me up an hour before my alarm because my dream was an assignment of creating a reverse transpiler imma blame link for that
Do you mean like a transpiler on a reverse patch?
Is this it I can't see
Oh yeah that's it
Oh hai Mark
yeah, winter8 uses a different spelling of setup for its festival key, because That's A Stardew™️
Haunted me
It's not that complicated
excuse me, it's for main event. all other festivals use MainEvent_additionalCharacters; winter8 uses Main-Event_additionalCharacters (hyphen)
Hi loves! Any idea what's going on when this happens? Like, is something not loading? I managed to figure out exactly where in my code the problem is happening, but I cannot seem to comprehend the why. Any insight into this would be deeply appreciated!!!
[SMAPI] An error occurred in the game's draw loop: IndexOutOfRangeException: Index was outside the bounds of the array.
at xTile.Layers.Layer._RebakeRow(Int32 y) in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\xTileSource\xTile\Layers\Layer.cs:line 393
at xTile.Layers.Layer.DrawNormal(IDisplayDevice displayDevice, Rectangle mapViewport, Location displayOffset, Int32 pixelZoom, Single sort_offset) in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\xTileSource\xTile\Layers\Layer.cs:line 462
at StardewValley.Game1.DrawWorld(GameTime time, RenderTarget2D target_screen) in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\Game1.cs:line 15475
at StardewValley.Game1._draw(GameTime gameTime, RenderTarget2D target_screen) in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\Game1.cs:line 15248
at StardewModdingAPI.Framework.SGame._draw(GameTime gameTime, RenderTarget2D target_screen) in SMAPI\Framework\SGame.cs:line 227```
is this multiplayer
New feature for next SpaceCore version - opt-in separate NPC datability for host and farmhands
(It's on a per NPC basis, so doing it for your NPCs won't affect everyone's)
Singleplayer, at this point. (error lives in both)
what are the conditions for this to happen?
stupid question, but what's the difference between this and setting CanBeRomanced based on whether current player is main player?
(note: no idea how NPCs data and multiplayer data interact, if any)
In MP, farmhands will always see the host's value for CanBeRomanced
aaaaah TIL
So if you want it depending on player characteristics, or story progression, or anything like that, it won't work properly with MP
The condition of making this happening is when one enters the farmhouse. The game loads the farmhouse, which then, looks to load the spouse rooms.
The forage/debris spawning logic is pretty spread out unfortunately; there isn't really a clean way to fix that without the risk of regressions this late in 1.6.9.
sounds like it stems from whatever you did to put in the (extra?) spouse rooms, this error only really tells us that the draw loop crashed on map drawing
Thanks! I am going to try to look in the Xtile code, to see if I can see exactly what it is coming in wrong.
Hm, not entirely sure this is the case, I don't think I've ever seen this error but I can only hypothesize that you may be trying to apply a map patch outside of the map's borders, you may need to dynamically extend the farmhouse map to the right
What is funniest about this, is when I had a delay set to load the spouse room until after marriage, it would explode even after marriage, but then, when reloading, it would decide to work.
This might indeed be the case!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Lemem go see where I am extending the map... hold on...
I tried arbitrarily extending the map by 100... still broke.
what does keg_juice context tag mean
It's the juice of a keg
(Yeah I think it's for mods.)
brb making a mod to add that tag to all fish
hi so I was kinda frustrated while playing sv cause I wanted a certain haircut and a certain dress,how hard would it be to make them in game by modding the game? do I need to change the code or just a haircut and a dress' skin?
what code do I need to change then? cause barely isnt 0
It Depends imo on whether or not you'll fit in the sprite boundaries
But we can cross that bridge after you have art
cant believe it but besides festival of ice i managed to get the festival positions to work (idk why the main event part of said festival doesnt want to have her appear tho)
where do I start to change it and what do I use?
oh! thanks! I totally missed that when I fixed some other stuff
ok so another question: i jsut got a comment telling me they had constance as a winter star recipient but didnt supply any more info besides NOT having met her yet. I thought it would be enough to have her as hidden in the social tab and intro quest...did I miss something to exclude her? (also, on the same note, if excluded, how can i change her being in the gifteee pool of winter star again after watching an event)?
I'm so glad there's an option to let you dance at the flower dance w non-romanceable NPCs, I just found this out and ooogh 
thank you disposition page of the sdv wiki
Set up the WinterStarParticipant field in your dispo, it's a GSQ
i see
there are two ways to go about it:
- The vanilla way which uses Content Patcher. I found this guide which I think is still up to date for 1.6 : https://stardewmodding.wiki.gg/wiki/Non-Replacing_Hair_Resource_Guide
- The Fashion Sense way, which allows adding more elaborate hair styles for the Fashion Sense mod. You can follow this link for instructions: https://github.com/Floogen/FashionSense/wiki/Creating-a-Hairstyle-Content-Pack
her haircut is my reference for the one Im trying to put into the game,which method do you recommand?
(also her dress is also the one Im trying to make)
alright got that one set now, not to wonder how to change it back to true after watching her event when she attends the event again, hmm
you can probably do both her hair and clothes with Content Patcher, but it comes down to preference. Fashion Sense do allow for more elaborate accessories that go beyond the vanilla boundaries so most hair/clothes modder nowadays use it
if thats possible that is
If it's a GSQ field then there should be a vanilla GSQ for whether a specific event was seen or not
thx I think I will try fashion sense and if I dont understand or it doesnt work I will go for cp
🤔
PLAYER_HAS_SEEN_EVENT <player> <event>
wait, how would i put that...
The WinterStarParticipant field takes a game state query, so just "WinterStarParticipant": "PLAYER_HAS_SEEN_EVENT Current <event id>"
you can invert the condition by starting it with !, so "!PLAYER_HAS_SEEN_EVENT Current <event id>"
if you need it to go the other way
hm
but when I want them to participate after seeing the event without ! is right?
yeah, should be. sorry for the confusion, i misremembered something you said earlier
but i think it's still useful to know you can invert any game state query with !
yee
hi I dont understand what am I supposed to do here
I dont understand anything code related wth...
first of all what does the colors mean ?
and second version is the version of the mod or the version of stardew?
have you downloaded the example FS pack? It has premade hair.json files that you can just edit
If you hover over the red it should pop up saying what it thinks is wrong, that said, you're missing a comma after each line
look at the example pack in this directory: https://github.com/Floogen/FashionSense/tree/development/FashionSense/Examples/[FS] Example Pack
whats that?
ohh you mean this , ?
Yeah
thats called a comma in english? thats strange
English is a terrible language, I am deeply sorry
dw mine's worst
is it a problem if I dont understand anything about the template either?
oh damn it what I have been doing all this time was for the manifest.json
not the hair.json
have you made the hair sprites yet?
what does that mean
ye
I think I mean I made a pixel art of smt in png
according to the format desired by fashion sense?
and then put it in the folder under the name hair.png
I didnt understand what it meant
so I just scraped smt
A good idea to get started is to copy manifest.json, modify it to add your own name and mod id, make a new hairstyle by mimicing the Hairs/HairTemplate folder in the example, and try to get it to load in game
using the link I posted above
whats a mod id?
this line
copy the file, change Name, Author, Description and UniqueID to something unique to you
is an update key required?
you can get to that once you're ready to upload your mod to Nexus
so this version of my manifest.json works?
should work
maybe change Version to "1.0.0" or something to reduce confusion
version under author is your mod's specific version, not the framework you're using
I took the version in the manifest.json of the FS mod pack
yeah I should have clarified lol, leave MinimumVersion alone
tbf probably could use a bit of updating for the non-coders
i feel we do this same song and dance every time 
I feel like my first time on elden ring,no shit explained just go out and try to understand
Better than the first time in Dark Souls
it's not necessary to have a background in programming language, but it helps understand syntax
nah dark souls isnt a big free map...
Go out and- GET PUNCHED OFF A CLIFF
Remember to dodge the guy who punches you off the clif- GET PUNCHED BY THE SECOND GUY WHO DOES THE SAME THING
flip the versions
ContentPAckfor needs to stay 6.6.0
or you can just yeet it entirely
fashion sense recognizes itself
Im just gonna keep it like that then
ok if this is good enough now onto the next thing to burn my head,which now should be the sprite
are we talkin abt ds 1 or ds 3 here?
did ya'll do the song and dance about unpacking already? i just got home and i'm eating mcdonalds
unpacking?
!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!
(it's probably not specifically useful for knowing the structure a FS pack, but it helps for getting references from the game's own hair styles)
has the bald farmer sprites in there so you can have a foundation to work off of
In my experience, every DS game has been roughly the same level of remembering bizarre enemy placements and attack patterns
ds 1 got a specific tutorial zone with almost no way to fall off a cliff
except once beaten
beyond that, how to set up a fashion sense .json is beyond me, i stare at it eyes glazed
where do I find it?
once you've done unpacking everything -> folder named "Characters" -> "Farmer" should be something in there named "farmer_base"
Huh, I never perceived DS that way at all. But it's been a long time since I played the 1st title.
there is indeed that but what can I do with that now
well the asylum doesnt let you fall off or jump unless you have beaten the boss and got out
you can throw that .png into an art program of your choice, set a layer above it and you have yourself a head model
oooh
you'd just need the front, left/right sides, and a back
genius
I mean I never perceived it as "remembering bizarre enemy placements and attack patterns".
but I dont have an art program at all
Here's a list of software for pixel art and JSON text editors we recommend: https://gist.github.com/ishanjalan/c8efb21afa21f74a052293176db107f7
For making SMAPI (C#) mods, see the Requirements section here for which IDE to install https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#Get_started.
ds2 doesnt give you the choice its either that or get yourself jumped over and over
- the occasional skeleton hidden behind a wall or a door
I used pixilart online to create my first view on the thing
funny thing to think I now need to use it again and do everything over again
do I need to do the haircut for all 4 direction ?
if it looks the same for the sides, you only have to do 3 and just duplicate/flip the side
I have a file already but how do I compare it to the ingame haircut
if I could just adapt the drawing I already made to the standard of the game it would be nice
uh depending on the art program you can keep the scaling the same and not have it turn into a blurry mess
i honestly don't know what dimensions hairstyles are supposed to be
I used pixilart and honestly I dont have the strengh to redo the first one I made into a new version
if I dont have a choice I will do it
so this is the required set up to work on the haircut skin now?
for hairstyles there will only be four images, front, back, left, and right
so these are the only ones you need to draw hair on. Just to make sure you dont do any extra work
someone already told me so thats walkin front back and right? cause I dont see any left option
when you're done with that, you also have to move the hair around until it fits the template. to be honest it might be easier to just get someone else to make the mod for you
oh yeah whoops sorry
You can just do front back and right
ok now nightmare begin
if you dont have a left sprite, the game will mirror it
well thats useful
I just hope it doesnt make out a weird result
how do I get it to keep two of my canvas opened at the same time
is that too precise for the game?
hi all 👋👋 i’m trying to make seasonal outfits for my Leo arts mod coz i got requests for that; does anyone know of a tutorial or existing mod i could look at for reference? like for what outfits they’re expecting me to draw, and also how to make it functional in-game?
Alrighty time to sit down and update Forage to Farm
Just to understand but width 100 height 100 means 100x100 right? So can I transform it into a 16x16?
Well that would be cool but I dont know who to ask + I will get the little mod author thingy for the mental damage this is causing me
(And Im poor so no comission possible)
https://gist.github.com/spacechase0/f2e6dcf7cbbd003168f49af87f4c4c5b is the yarn script (using yarn spinner 3, which is on github but not nuget yet) + CP patch
Oh yeah and I already fixed invisible Penny
This is how you would do that with content patcher:
https://github.com/Pathoschild/StardewMods/blob/stable/ContentPatcher/docs/author-guide/tokens.md#FromFile
The {{Season}} part will be replaced with spring, summer, fall, or winter when content patcher loads the file. You would name your PNG files something like spring_Leo.png, etc.
Also, you may have thought about this already, but there are no seasons on Ginger Island. The technique above will still work, but thematically, there are no seasons.
okey!! thank you for the help :3
Hi does anybody know of a good up to date guide for adding a new food item (meat) to the game?
I'm using the existing sprites
but I tried to follow the guide and I'm persistently getting the same error
"🚫 Error Item (659) "
{
"Action": "EditData",
"Target": "Data/Objects",
"Entries": {
"1000": {
"Name": "Pork",
"DisplayName": "[LocalizedText Strings\Objects:Pork_Name]",
"Description": "[LocalizedText Strings\Objects:Pork_Description]",
"Type": "Basic",
"Category": -5,
"Price": 600,
"Texture": null,
"SpriteIndex": 659,
"Edibility": 15,
"IsDrink": false,
"Buffs": null,
"GeodeDropsDefaultItems": false,
"GeodeDrops": null,
"ArtifactSpotChances": null,
"CanBeGivenAsGift": true,
"CanBeTrashed": true,
"ExcludeFromFishingCollection": false,
"ExcludeFromShippingCollection": false,
"ExcludeFromRandomSale": true,
"ContextTags": [
"color_pink"
],
"CustomFields": null
}
}
},
Content Patcher (https://www.nexusmods.com/stardewvalley/mods/1915) is a mod which loads content packs to change the game's images and data without replacing XNB files. If you want to make mods using Content Patcher, start at https://stardewvalleywiki.com/Modding:Content_Patcher.
Follow these, this is the way! ❤️
How did you spawn the meat?
Your item id is 1000, but the error item is 659?
Yeah that's based on the tile number on the springobjects.png vanilla item sheet
The id I've tried different names
Doesn't seem to matter to that error
Do you mean here? https://github.com/Pathoschild/StardewMods/blob/stable/ContentPatcher/docs/author-guide.md#readme
As of 1.6 the item id and the parentsheetindex are separate
Should be able to find the pork item with (O)1000
Tho it's actually recommended to do <modid>_<name> for your items
So I did find in the SMAPI output that pork existed
I think specifically it's confused about what icon to use
💯 anywhere you are allowed to prefix with your mod id, you should do it
And i tried several different types of phrases in "textures" to tell it to use the same tile sheet as every other object
you don't have to but it's polite
Here's an example of an item:
"ApryllForever.RiseMermaids_Sapphire": {
"Name": "Sapphire",
"DisplayName": "Sapphire",
"Description": "A deeply blue, glistening gemstone; sapphic women are known to give these to their lovers in the areas around Rest Stop.",
"Type": "Mineral",
"Category": -2,
"Price": 696,
"Edibility": -300,
"IsDrink": false,
"Buff": null,
"ContextTags": [
"color_blue",
"not_museum_donatable",
"item_sapphire"
],
"Miscellaneous": null,
"Texture": "Mods/ApryllForever.RiseMermaids/Objects",
"SpriteIndex": 0
},```
Hmm I feel like null is correct for your case, since you just want Maps/springobjects
But I suppose you can try explicitly putting that in
Same result
And double check the sprite index perhaps 
are you spawning in new pork items every time you make your changes?
dunno if there are any sound people here atm, I need to raise a pitch an octave and a half but the game only lets me do one octave up. Should I raise it in audacity and then lower it to the 'normal' range in game, or make a higher pitched version of the sound that I use when it breaks an octave?
I'll try that, thank you
even if the sprite index was wrong it should still show something id think
I don't know what this means
if you edit your content.json, then you need to delete all your existing pork items in game
and then spawn new ones
I've been checking a recipe that calls for it
the old ones wont be changed
Spawn like cheat in one 
Oh are you updating the recipe too
As you been changing the item id
🫂
This kinda thing is why u should cheat in your item first to validate it is good
And then deal with places using the item
Hey there, I'm just a sprout trying to make Baby's First Content Pack following this guide here: https://stardewvalleywiki.com/Modding:Content_packs#Create_a_content_pack but I have a question about the wording of one of the steps, or perhaps I missed some other context somewhere that I'm trying to clear up.
Under the "Create a content pack" section, I have done steps 1-3 and the substeps under step 3. I've made my mod folder, made my .jsons in it, all that.
Step 4 says: "Add the files needed by the content pack framework (see its mod page for details)." Is this referring to the Content Patcher framework I plan to use? I'm not sure what files this step is referring to. Does this just mean "have Content Patcher downloaded" or something else?
is there a way to draw a "special" charater in chat box / bubble text? for example 🍓
if you're using Content Patcher, you'd want to follow Content Patcher's documentation, yes.
The important thing here is that a Content Pack is different from Content Patcher. Content Patcher is a framework, but it is not the only framework
How to check if the current game is the local split screen farmhand?
Oh dang, was I mixing the terms up? Sorry, there's a lot of terms to keep track of. I'm just still not sure which files in particular step 4 is referring to.
if whatever framework you're using requires any specific files, you need to add them. this will be different depending on the framework
The documentation for the framework you are using tells you what files you need
aw man okay :C i dont know how to code and CP is already a bit difficult so ill think of a new mod idea :3
from memory it should be something along the lines of Context.ScreenId > 0
would you mind having a dependency mod to do it for you? because that'd be a simple enough trigger action to add to my mod that you could then utilize
oh really? i would appreciate it so much 

but you don't have to do it, only if you want to! 
i can give you a ping tomorrow then after ive tested to make sure it works properly if ya want
is this correct?
"Target": "Maps/Custom_MT_Island_House",
"FromFile": "Assets/Custom_MT_Island_HouseEdit.tmx",
"PatchMode": "Overlay",
"When": {
"HasReadLetter": "{{HasFlag: anyPlayer}}MT.IslandBedroom"
}```
yes please, i might reply late when you ping (like now haha but let's not mention that..) because school ends late and im not sure what our timezones are but ill hop on dc as soon as possible :3 also, what is your mod so i know what to download?
Hello! Since im far from being a genius, but determined to make unofficial update for the clothes/hairstyles mod I totally love to ver 1.6, Im humbly asking for your help ;-; because i never did touched anything mod related for sdv. https://www.nexusmods.com/stardewvalley/mods/4154?tab=description aaalso i created a post #1278646044560855051 unsure where it would be better to write about this. Can someone help me with this? I dont even know where to start
I'm not familiar with doing farmer clothing so I probably can't help much but the first thing you'd want to do is decide whether you want to convert it to Content Patcher or Fashion Sense.
Fashion Sense i guess
then your best approach is to look at fashion sense mods and tutoriels
aye, ma'm!
and while the author is not updating, i believe she is around still
remember you can't publish such update without permission (mod may already allow for such, but you'll need to check), personal use is ok however
its for personal use only!
good! (i prefer to clear that from the start, some people aren't familiar with how it works)
like sure if i manage I can share via giving it to someone but not like creating mod in nexus and claiming it or anything
(it wouldn't be personal use then)
No, personal use means only for you, sorry.
i meant like giving a friend if she wants to use for her own risk or something like that. Not like putting it on mediafire etc
That still counts as not being personal use anymore. I'm not going to try to police that or anything, just letting you know.
There is a JA to FS converter, by the way if you want to look into that as well: https://github.com/bikinavisho/stardew-convert-to-fashion-sense
Thank you, ill check this!
@vernal crest sorry for the ping, but I think I should move my question here, do you know if AT would recognize the gate if I only use the item name gate? and then do a wide spritesheet for all the different angles/closing variations it can have next to eachother?
Don't know, I'm sorry. I've only used AT as a player and never looked at the docs or at how the code works.
Are there not fields in AT for specifying spritesheet dimensions?
anyone got the dimension of the stardew haircut?
there are! but I dont fully comprehend how AT knows where one texture inside the spritesheet ends and where the next begins
Mmm yeah I don't know, sorry
I'd have to do a lot more reading and experimenting to be able to understand the docs and I'm trying to not get sidetracked anymore from my nested questions tutorial.
please dont feel responsible for helping me here, I am so happy that you took so much time for me already!!
Have you unpacked the game content yet? The hairstyles.png is under Characters/Farmer.
I dont mean to bother you
You aren't bothering me! I am just sorry I can't help. Hopefully looking at Void's mod might be more useful.
thanks!! it is useful! and also still a bit confusing, but I will figure it out!
I wonder why fishtank isn't listed as a possible furniture type on the wiki.
Which wiki?
Odd that they are in furniture.json with type "fishtank" then
I think the _ => 9 means anything that's not one of the previous is 9, so if you put fishtank it becomes other
Then there's this, called when placing objects
...huh
So anything that needs the int will just get 9 but you can manually check for fishtank lol
Nah, it's its own subclass!
I wonder how it calculates the fish tank boundaries though
That's why I thought it was hardcoded
Also see TVs right before it
its just .png with no dimension
The fish tank boundaries thing was why I was looking at it in the first place because camiska wanted to know if changing the amount of glass compared to other bits of fishtank would do weird things with the fish #making-mods-art message
Wouldn't be hard to test
That's a layering question more than anything else
I would just draw a big X over a fish tank and yeet it into the game
Yeah, I think it would be a lot easier to just test than try to figure out through the code lol
Yeah that is what I told them to do
But I also thought I'd just see if the wiki had anything to say and then got sidetracked about the type thing lol
I would personally look at the size of the image and then divide that by the number of hairstyles on each row and column to get the allowed space for each individual hairstyle frame and then use that as a starting point to experiment with. But there's probably actually documentation on the wiki that explains it instead.
There's a mod that adds invisible fish tanks that accept fish ok
from afar I would say 16x16 but since its pixel I cant just put the .png into a pixel program to see
@vernal crest @latent mauve Looks like it's in the beta now
Why can't you put it into a program?
cause Idk what to use
!software
Here's a list of software for pixel art and JSON text editors we recommend: https://gist.github.com/ishanjalan/c8efb21afa21f74a052293176db107f7
For making SMAPI (C#) mods, see the Requirements section here for which IDE to install https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#Get_started.
Looks like this has an explanation of how the hairstyle spritesheets work. I just skimmed it so YMMV https://stardewmodding.wiki.gg/wiki/Non-Replacing_Hair_Resource_Guide
Aseprite is my go to, but it's $20 unless you want to try to compile it yourself (this can be difficult)
I looked at the compile instructions and decided maybe I can afford 30 bucks lol
ok thx
k a bit weird question, how hard is to make map mod by my self?
In as far as the json goes it's probably one of the easier things to do. Making your map correctly is a bit harder but it's okay if you pay attention to detail.
some here andthere
and making map depend of scope too
farm maps are more overwhelming
There's no up-to-date step-by-step tutorial that I know of.
🤔
I learned by reading the official wiki page (https://stardewvalleywiki.com/Modding:Maps), looking at vanilla maps, and looking at other people's map mods. And like Lumi said, farm maps are harder than other ones.
ty!! i'l for sure look into this
I had better use a million questions in Hiria's dialogue to justify the amount of time I am spending investigating all the ways you can modify the commands >_<
Gonna have to make them a private investigator
I have nearly 200 lines just for slightly tweaked repetitions of the same question 10 times so far.
Looking good so far
Still have to decide how to implement page shopevents and item rewards
does anybody know where the animation for monsters are programmed in? (which .json)?
i'm trying to make a custom monster
afaik those are all hardcoded.
you do have the option to spawn in custom enemies using FTM though.
Visit Mount Vapius does it that way too if you need an example.
https://www.nexusmods.com/stardewvalley/mods/3231
https://www.nexusmods.com/stardewvalley/mods/9600
Yeah - they are reskins of existing monsters though so they have the same behaviour as the vanilla ones. I don't think you can make custom monster behaviour easily.
Nice! And thanks for posting about it so other people can use the info in future too.
yeah I think I might make a quick tutorial page about it on the modding wiki
What i'm really trying to do is add occasionally spawning wild boar to the forest
that when you kill them, drop ham
I animated it, I made a ham a food in the game, I just need to figure out how to make the boar spawn and be killable and drop ham
Yeah, you'll basically need to reskin an existing monster.
And add that reskin with FTM.
Or program new behavior with c#
(I'm assuming that would be pretty difficult, given that no one's done it before?
I got this far 🤣
{
"Action": "EditData",
"Target": "Data/Monsters",
"Entries": {
"ShipsAhoy_Boar": "200/5/0/0/false/1000/ShipsAhoy_BoarMeat/5/.01/4/3/.5/false/5/Wild Boar"
}
},
but I'm not sure that's allowed
Casey also has Monsters, the Framework
It's not conceptually hard
The real problem is that (a) it requires a twofer (art AND code skills) and (b) stardew combat is too shallow to really support much anyways
And very few people want to rework the entire combat system
I did already animate the boar sprite so that's not an issue
and I'm not looking for crazy combat, just that it will damage the player on collision sometimes like most mobs
When publishing a mod on Nexus, does the "mod language" option matter when the mod only edit data ? I set it to English because the mod description is in this language, is it right ?
following the language of publication seems like a good choice in this case
alright thanks 👍
if you go this route you still need to do most of the work in C# because of how hardcoded the whole thing is. As mentioned you can use FTM to reskin a vanilla monster or if you're feeling adventurous MTF (lol)
I'm okay with doing C# but do you know if there is a guide for that anywhere?
Not sure of any beyond just reading the decompiled code
there are some very basic examples of setting up a C# mod on the wiki, but nothing especially complicated
look at the classes in the StardewValley.Monsters namespace probably. And the spawning logic in the location classes
you can also look at open-source mods to see how they are structured for hints
unfortunately I haven't been able to find anything but the data/Monsters.json which only contains the properties for the monster categories, not the animation
!decompile
If you want to make SMAPI mods with C#, one important resource is decompiling the game to read the game code. Here's how to do it: https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#How_do_I_decompile_the_game_code.3F
does AT expose an API to register textures by c#? I'm not seeing any mentions, but just wishful thinking
ahhh, nice! thank you
quick question, so there's this bit of base game code (mostly at least):
Can I do that but for custom animations and anywhere that a draw would happen?
like for this piece,
// Projectile.projectileSheet,
projectile,
Game1.GlobalToLocal(Game1.viewport, this.position.Value + new Vector2(0f, 0f - this.height.Value) + new Vector2(32f, 32f)),
new Rectangle(0, 0, 24, 24),
this.color.Value,
angle,
new Vector2(8f, 8f),
projectile_scale,
SpriteEffects.None,
(this.position.Value.Y + 96f) / 100000f
);```
I could make the custom projectile into a tilesheet and animation?
Asking because spawning the projectile above the monster's head looks awkward, having a 4-frame animation of it coalescing and then a 4-frame tail of it dissipating would look way cooler.
multiplayer.broadcastSprites(location, new TemporaryAnimatedSprite("TileSheets\\animations", new Rectangle(448, 256, 64, 64), 60, 5, 1, base.position.Value + new Vector2(16, 256), flicker: false, flipped: false));
b.Draw(
// Projectile.projectileSheet,
projectile,
Game1.GlobalToLocal(Game1.viewport, this.position.Value + new Vector2(0f, 0f - this.height.Value) + new Vector2(32f, 32f)),
new Rectangle(0, 0, 24, 24),
this.color.Value,
angle,
new Vector2(8f, 8f),
projectile_scale,
SpriteEffects.None,
(this.position.Value.Y + 96f) / 100000f
);
Yeah, that's how you would do it
sick.
What's the difference between Draw and multiplayer.broadcastSprites? Does Draw not create the sprite for other players in a multiplayer game?
Draw draws the sprite to the spritebatch of the current players game instance and has no influence on multiplayer
The multiplayer.broadcastSprites is mostly use for visual sprites only. I'm assuming you want the projectile to actually do something, so you would have to create an instance of or override an existing projectile class.
Inside that projectile class there will be a virtual draw() function that you can override. Each frame, the render pipeline will call the draw function on your projectile giving it a SpriteBatch b as an argument. You would call the method b.Draw to tell the renderer what sprites to draw for your projectile and where to draw them on the screen.
huh
Make custom projectile type -> add to multiplayer projectiles -> sprite is drawn for everyone
so in multiplayer, that second code block would be visible on the caster's screen only, but the explosion animation (first code block) would be visible to all.
I am pulling in the base game Projectiles bit
The projectile object would be replicated, and since the projectile object draws it's own sprite, other players will see the sprite.
ah alright
the explosion animation is not an object so it needs to be specifically drawn as multiplayer
Exactly
the other option is to make it not a projectile and just play the animation and apply damage/debuff but I've made it work with projectiles so far so it feels bad to redo it.
dunno if that will bite me later.
If we want a mod to include content patcher and C# files is it really two separate mods?
in terms of file structure
or can I have them all in the same Visual Studio project folder?
both
you can have them in the VS project folder in a way they're deployed automatically (dont ask me how tho :p)
but yeah when users use it they're 2 separate mods
Look inside the folder in your mods folder
what am I looking for?
a manifest.json file
it's there but I created my project in that folder to begin with
and it's three levels deep
I feel the manifest should be one level up, not under dependencies, but I"m not on my home computer to check how mine is set up.
I don't know why visual studio generated so many folders within a folder of my mod name
it's on the same level as dependencies I think though?
Every time I try to follow the most basic C# tutorial for modding I wind up with this weird three-levels-deep of the same folder situation
Would anyone be able to give me a high level overview on what it would take to create a smaller fish pond mod? The Smaller Fish Pond mod that's been created and refreshed for 1.6 is quite bugged and a new one probably just needs to be built from scratch for 1.6
did you put the Visual Studio project itself in the Mods folder? if so, that'll probably cause errors
!startmodding
Making mods can be broadly divided into two categories:
- Content packs are formatted text files, and don't need any programming knowledge. They can add/edit NPCs, maps, new items, shops, and more. To get started, see the list of framework mods, the wiki tutorial for Content Patcher, and there might be relevant guides on the tutorial wiki.
- C# mods use programming code to change fundamental game mechanics. See getting started with C# modding.
Usually it’s easier to start with making content packs, since you don't need to learn programming.
oh ok
(Tbh I would probably just harmony patch draw function of normal fish pond class)
SMAPI's nuget package should auto-generate a "wild game" mod folder when you build the project, but the code/project itself should be anywhere else
Yeah I'll move it then 😅
(with the new Data/Buildings I wonder if a 3x3 fish pond can just work or are there still hardcoded stuff)
theres a hard coded check for fish ponds in the getfish function
probably still there in 1.6
Yeah
making a data/buildings entry that uses the BuildingType and has appropriate patches might work, I guess? 
foreach (Building building in this.buildings)
{
FishPond pond = building as FishPond;
if (pond != null && pond.isTileFishable(bobberTile))
{
return pond.CatchFish();
}
}```
My guess is if you (a) make sure it is instantiated as a fish pond and (b) check draw and collisions you're most of the way there
1.6.9 does have the fish pond shadow too-- you might have to redraw that?
@royal stump @calm nebula Thank you both. Sounds like it could potentially be as easy as I'd hope it could be
I removed the project from the Mods folder but it's just not building/rebuilding into the Mods folder at all
have you installed SMAPI's nuget package? are there any errors at the bottom when you try to build?
Personally I wouldn't recommend using VS to edit CP mods as from my experience it does a really poor job when editing .json files
yeah, I've seen some people have weird errors due to UTF settings or some such 
(I have one VS project with CP bundled in, but it's 4 years old and idr how it's even set up now)
I have, and no there aren't any errors, but it's building directly to the folder the mod was created in
@lone ice Double click on the [C#] Wild Game and copy & paste the file that it opens.
I'm not sure offhand then; reinstalling the nuget package might help it figure out what folder it's in, now, but that's my best guess
hey guys, can you help me remove an invisible tile on my farm map?
https://drive.google.com/drive/folders/1Zlw4DYv-iJVfLeEE9220XUOOaeaKhtwm
here's the file :p
when relocating the farmhouse, you can't put it in it's original place again:(
No, they're something you install through VS; it's mentioned in the wiki's setup steps, but this page has more info:
https://www.stardewvalleywiki.com/Modding:IDE_reference#add-nuget
I set it up how I was supposed to then I tihnk
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<RootNamespace>Wild_Game</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="4.1.1" />
</ItemGroup>
that should be right, but iirc it would complain if it can't find Stardew Valley/Mods to put the output folder in
I'm not sure what else to suggest
yeah this most basic step went wrong last time I tried so I was doing Content Patcher for a month
but I really can't do what I want now without C# 😅
Are there any build errors
no
What happens when you hit the play button?
it builds to the wrong location
OneDrive\Wild Game\Wild Game\bin\Release\net6.0\Wild Game.dll
Is that where you keep your project?
And there's nothing else in this file?
It normally does build there. It just gets copied from there to the mods folder afterwards.
the files (and a zipped copy of them) should appear in the bin/Debug or bin/Release folder anyway, but they should also appear in the Mods folder
adding a game path to the project file might help
https://github.com/Pathoschild/SMAPI/blob/develop/docs/technical/mod-package.md#how-do-i-set-the-game-path
pathos's mod build config should be the correct package
Yeah that's right
Is there a reason you aren't removing it yourself?
it's bcuz I checked the building layer and deleted all the possible tiles that could be blocking but no luck, that single tile is impassable, not buildable too
@velvet narwhal helped me removed the previous invisitiles but it seems like they missed a little one, and they're offline now
You can remove invisible tiles yourself. Just use the eraser on the Buildings layer on that spot.
Keep in mind that the build and deploy are two separate things. It will always build to a bin\Debug or bin\Release, that's expected. However it should also create a .zip file and deploy the contents of that file to your mods directory.
If you see a zip file in your bin\debug or bin\release, but it's not ending up in your mods directory, then it means ModBuildConfig can't find your game. If the zip file isn't there (and you haven't disabled it, which according to your csproj you haven't) then there's something else wrong.
i tried but it's still there
true it's not creating a zip at all
I'll download it and have a look then
alr thank you
I saw a little exclamation mark next to the "Analyzers" in your project tree. Can you expand that to see which analyzer is complaining?
ModBuildConfig is an analyzer. It would appear to have some error and is not running at all.
me? I don't know what this means
Like I said, expand the UI where the exclamation mark is showing next to analyzers.
See if ModBuildConfig is the one that's broken.
yeah I just don't know what part of the interface is showing an exclamation mark
@next plaza HI, i have question about mod Space Core Version 1.17.1 on SV 1.5.6
what is "Type[] VanillaMainTypes"?
and how can i update type for android version?
@frosty hull You leveled up to Cowpoke. You can now speak in our voice channels and share images in all channels!
That's what they look like to me, anyway... but expand the ModBuildConfig one, what does it say?
Some of what's there might be noise, Visual Studio adds its own "comments". But if there's a real error it should show up.
yeah they're like 4 pixels high on my screen, I just couldn't see any exclamation marks until I got another few levels deep
Those particular ones are just warnings, not actually breaking stuff.
TFW your prefix patch doesn't get called unless you completely rip the code from the calling function into your own function and use that as another prefix
At this point it might be easiest to just post a zip of the solution, if you can - I suspect there's something higher level that we're overlooking, maybe a problem in the manifest or just something off about the overall solution structure.
System.Text.Json is not involved in Stardew mods at all, not sure why it even shows up there.
Trying to figure out if I can step through SV's IL or if I need to reverse patch or something
How big is the function you're trying to patch
The original function? Not large
That too, you can check the Output tab in VS to see what ModBuildConfig is doing as it does log its output - though I sorta suspect it's doing nothing at all.
Not small either, I don't think it's getting optimized out?
If a function is inlined harmony can't patch it
It's related to the base game's serializers - it shouldn't need changing for 1.5.6 anyways
Build started at 1:41 PM...
1>------ Build started: Project: Wild Game, Configuration: Release Any CPU ------
1>Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers.
1>Wild Game -> C:\Users\XXXX\OneDrive\Wild Game\Wild Game\bin\Release\net6.0\Wild Game.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build completed at 1:41 PM and took 00.293 seconds ==========
that's what it outputs
Well, that confirms ModBuildConfig isn't running at all.
I wonder if it's because it's having problems from being on onedrive
Whether that's because it's configured incorrectly or due to that "Skipping" line, I'm not sure.
It had hte same problem in other folders too
The IL has a call so I'm pretty sure it's not inlined, plus it's "big"/complex enough that it probably isn't being inlined
(Can't remember if I've seen that message before)
I've tried putting it in multiple places, not just one drive
I've seen the skipping line before, it seems like it happens when you directly right click and run? Or I've not noticed it otherwise
Try doing what the message says and run a Rebuild.
Inlining is done by the jit
Not Roslyn
You can't tell from the IL
If you still see no ModBuildConfig messages in the Output tab, then there's something wrong with the way the project is set up and it'll probably be easiest to track down if you post a zip of the whole thing.
Hmm, in that case it's possible, looking at the function again it's not as complex as I remember
(There are just so many reasons why an analyzer might not run in this case, and it's way slower to go back and forth for each possibility...)
Will the patch fail to apply or will Harmony go "yup it's patched" and then just not get called?
Also, regarding the other conversation going on here, if you need to patch the calling method I'd say it's better to put in a transpiler than to prefix that entire caller.
Last time this happened to me I just transpiled the caller
Yeah I may have to
But I can understand why people don't want to jump to a transpiler
I really enjoy transpilers
Tbh
If you find yourself copying the body of an entire decompiled function and pasting it into a prefix, that's the time to write a transpiler.
Maintenance isn't fun but they are fun to write
I've already jumped to a transpiler after three days of banging my head against a theoretically simple problem, at this point I don't care X D This is a bug fix mod that I expect to be deprecated as soon as the original mod's author comes back from hiatus
(in fact if I can figure out how to make the mod stop working when SV or the original mod's version number changes I will do so)
Which mod?
Aquarism
Ah
A mod Harmony-patching another mod's functions? (<looks sideways at Atra>)
It's a thing!
Believe me, I know it's a thing.
It's fragile though
In this case, the fragility is a feature
Huh, it actually works on my machine. Although I do notice your RootNamespace is wrong in your manifest, it says Wild_Game and should actually be WildGame per your code. But that doesn't seem to be the main issue.
You tried the "Rebuild" option in VS already?
I tried build and rebuild multiple times
One of my WIP mods harmony patches spots in S&S I specifically put there for me to patch 
Oh i got it, one question
did you forget to add "CustomProperties" condition?
because when I add new custom prop, such as add Mod Rsv field "hasRiveraSecret"
and "three serializer" for the SaveGame isn't create
🤔🤔
No, the custom properties is handled elsewhere, not by the serializer overrides
(Context: So Aquarism adds some metadata (and management of same) to fish ponds to track fish quality and uses a patch to decide which individual fish you get back when retrieving. This worked in MARGO pre-1.6, but now not so much. I'm pretty sure at this point (based on patching the same function) that the patch just isn't getting called even though the calling code is reached (based on extracting the entire calling function into a prefix and breakpointing it)
hello, I'm trying to make a mod where you can obtain refined fire quartz from smelting regular fire quartz, I'm not sure how to go about doing this, can someone give me some pointers please?
Just checking here, what's your VS version?
(side note: there are probably better tools for figuring that out than extracting in such a manner--maybe reverse patch?)
(or breakpointing the IL instead of the C#?)
Nah that isn't bad for debugging tbh
2022
I mean it's a little bad but if it's the best available then I'm not gonna cry about it : D
Huh. To be honest, I have no idea. Wonder if Pathos has run into this.
(For debugging, like. I'll just throw in a new StackTrace or whatever)
Everything about the project/solution is set up fine. Whatever the problem is, has to be related to your VS instance or machine setup.
Is that useful for stepping through OG code?
Last time I did it I knew someone was calling dispose on my texture and I didn't know who
So it was the fast way to figure it out
I say "mine"
yeah, that works
Oh, do you get the "Skipping analyzers" message even on a rebuild?
no
It wasn't mine, Elizabeth was doing the real debugging I just was offering advice over the phone
sorry I was trying to reply to this, no it doesn't




