#making-mods-general
1 messages · Page 60 of 1
i'd just do a sin on the globalwind minus baseline, but at the same time i want that inertia behaviour where it swings away from the resting point and back
I feel dumb there's already a not human mod it just needs compatibility patches
Vinegar in mandarin is 醋 and goose is 鵝, which respectively sound like chu and e
The cos(w*t) term on theta is what drives the oscillation
Oh then yes! Chu is vinegar goose now 🪿
You can try screwing with the constants maybe as functions of wind??
Like g (gravity)
Maybe not L (pendulum length)
Possibly w (oscillation speed)
yeah length is a trick here since the sprite is rotating around an origin of 0.5x 0y
so technically no length from the axis
bush shake code gives a bad result, but it at least moves to each side:
changing that to circular motion almost looks good
.. but only moves to one side
can the wind number become positive
wind only moves one way in sdv, left and slightly down
but whether or not it's going to be blowing the other way, the object should still swing back right after being blown left
Do you have gravity modeled in
guys, is there any wiki page that elaborates on how to make dialogues like these? with choices on them and different npc reactions
in the sense that i've got r = math.clamp(r - 0.0035, 0, 1), yes
yes the wiki has several options explained, for events and dialogues
i suggest looking at quickquestion in event, and i don't remember the name for dialogue, but question is a good start
What is t
well there's not exactly a defined time, maybe the method will make some sense. again, butchered shake code
public void UpdateRotation(GameTime time)
{
float d = (float)Math.PI / 300f;
this.RotationMax += Math.Abs(Game1.windGust) * this.Data.Resistance * 1.5f;
if (this.RotationMax > 0)
{
if (this.Direction != -1)
{
this.Rotation -= d;
if (this.Rotation <= -this.RotationMax)
{
this.Direction = -1;
}
}
else
{
this.Rotation += d;
if (this.Rotation >= this.RotationMax)
{
this.Direction = 1;
}
}
this.RotationMax = Math.Clamp(this.RotationMax - this.Data.Resistance, 0, 1);
}
float scale = (float)Math.PI * this.Data.Limit;
float ratio = 1f - Math.Abs(this.Rotation) / 1f;
// CircularFromRatio(ratio) = 0.5f + 0.5f * (float)(Math.Sin(-Math.PI * 0.5f + ratio * Math.PI * 2f));
float rotation = Utils.CircularFromRatio(ratio) * scale;
this.DisplayRotation = rotation;
}
first video used rotation, second used displayrotation
maybe i can just screw with circularfromratio to give a wobbly result
whats CircularFromRatio
it's in the comment 
it just turns some 0..1 value into an equivalent along a sin wave
never had to use wolfram alpha for modding before lol
though it wasn't for this, it was for the colour and position of a sunset. somehow
rotation is the value that goes into draw right
it's in the caption 
but this.Rotation and this.DisplayRotation to clarify, not rotation
i meant in general, you are do maths to derive the rotation argument of spritebatch.draw on the lantern
oh right, yep that's just plugged right into the rotation arg
Hmm, I see pendulums
i think math.pi * 2 * this.rotation might be it
if only the gd wind would blow
nvm it sucks

I would just yeet all code and go with a simple pendulum
Derive that from scratch
I would do that for you but I can't hear you over, well
Oh blueberry I had a question while you're here
if it's about wind or pendulums i don't need it
Lol no
I'm guessing you're maybe aware of the error with upgrading the frying pans and having ui info suite? If not I can post the bug when I upgrade my pan next but it spams the console trying to fetch info about it (maybe the icon like the other tools for upgrading?)
That's a UIInfoSuite bug
oh dw i know about it since yesterday, supposedly uiis has a fix for that but it hasn't been merged/released for like 4 months
Ohhh alright, I always have a hard time figuring out who's end the bug is on
the only fix i can make on my end is using the sprite indexes for the trashcan, but i have no idea what that'll break
i could probably just harmony patch uiis
Idk it didn't like it that day
honestly transpiling a different mod sounds more appealing than looking at maths letters like t and funny w and italics g
i wish that took longer
back to wind
Yeah! But whatever blueberry is doing seems beyond simple and into something else
Simple pendulum + wind force + damping is still only three forces right?
It's silly, but anyone know where the crop fairy sprites are in the unpacked folder? Trying to find them and can't put my finger on it 
... Found them, in Cursors. I had it open but they're so pale I didn't see it on the transparent grib background arf
Hello! I'm not quite understanding this section of the Modding Dialogue wiki. Does this mean I have to first edit the Strings/StringsFromCSFiles to a question and then add the give_ action to character dialogue? Or am I completely wrong there? For context I want to add custom dialogue for Leo when accepting the pendant like Krobus has.
hm is this needed in 1.6?
I've read that the strings are not hardcoded anymore so I'm assuming not, but thats where my knowledge ends
you can use keys like "AcceptGift_(O)109"
Alright I'll try that!
You can add an AcceptBouquet key to their dialogue file instead in 1.6.
Is that the same as the pendant?
For engagement dialogue, you can add an <npc>_Engaged key in Strings/StringsFromCSFiles.
(I'll update the dialogue page for the new 1.6 keys.)
So like this?
"Action": "EditData",
"Target": "Strings/StringsFromCSFiles",
"Entries": {
"Leo_Engaged": "{{i18n:Leo.Pendant.Platonic}}"
}
}```
Or have I misunderstood
Yep, that looks right.
Perfect I'll go test it thank you so much!
Hello
Making my first farm map currently
It's supposed to be an island but does anyone know if someone has made custom ginger island tilesheets? I need more darker grass tiles!!!!
why does it need to be island specifically 
Which tiles are you missing? You can reference the game's Ginger Island tilesheets for any tiles you want to use on those.
Its working now! Thank you so much 
Welcome!
(The dialogue wiki page is now updated for the 1.6 changes.)
Random fun detail: when a Junimo harvester drops a crop that doesn't fit into its hut, they always toss it in the direction of the player.
@calm nebula: remember Canadian Thanksgiving is on the 14th (20d ago)
it's funny that the game makes the same number of 16~64 WeatherDebris instances no matter how large your screen is
maybe 64 crammed into 1280x720, or 16 spread out over 3840x2160
New dev here but I'm curious if there is a way to load directly into a stardew valley save file so I can bypass the title screen and test my mod faster.
I've honked so many times since I've started.
the Skip Intro mod can skip you straight to the save loading screen
!hotreload
dont know if theres one that will skip to a specific save though (or if skip int ocan already do that? i just use it to skip the intro)
I need Cliffs w the darker grass from the islands jungles
-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 YourMod.UniqueID
-C# Visual Studio has a feature called Hot Reload
-C# Rider also has Hot Reload
-Generally working in C# it will be called "Hot Reload" (usage may vary)
oh my god
Anything helps. Thank you!
Oh, can you build/modify your dll while the game has loaded it?
do also look into the reloading stuff in the command atra had the governor post too, if its not something you absolutely need to restart your game for
🔥
public void UpdateRotation(GameTime time)
{
float dt = time.ElapsedGameTime.Milliseconds / 50f;
float wind = dt * -Game1.windGust / 2500f;
this.Momentum = Math.Clamp(this.Momentum + wind, 0, 1);
this.Velocity += wind;
float d = 0;
float alpha = 0;
float theta = this.Rotation;
float v = this.Velocity;
float g = this.Data.Resistance;
float accel = (float)(g * Math.Cos(theta));
float r = (this.Data.TextureRegion.Width + this.Data.TextureRegion.Height) / 2f;
d = (float)(v * dt + accel * (Math.Pow(dt, 2) / 2));
v = (float)(v + accel * dt) * this.Momentum;
alpha = v * (float)(Math.Acos(d / r));
this.Momentum = (float)(Math.Max(0, this.Momentum - Math.Pow(g, 2)));
this.Velocity = v;
this.Rotation += alpha;
this.DisplayRotation = (float)(-Math.PI / 2f + this.Rotation);
}
so much work for so little reward
you can, but it won't work if you are running Linux
Yeah! That's what Hot Reload is
Super useful
Interesting linux quirk. I have a windows dev partition too.
Can't say the code is beautiful, but the animation is wonderful. 🙂
maths is the exact opposite of beauty 😌
Not that I'm saying it's ugly, I just don't understand it. 😐
False
Math is the only beautiful part of the world
wow so we're getting personal now huh
Yes
I dunno, cats are pretty beautiful
Please consult my discord username
So r is the radius....
(So are women but that’s just me
Being Lesbian ™️)
V is likely velocity. The heck is alpha other than maybe theta?
i appreciate the addition of the ™
Save yourself some sanity and use MathF.Pi
i'm sorry how long has mathf existed
Or go the meme route and use chatgpt
Yeah alpha is what I would call theta
Net5
It comes with XNA/MonoGame
I thought
Is it .net 5?
Actually it's super old
Ah I was thinking of mathhelper maybe?
Hmm
See, I'm confused because momentum doesn't have a mass
Another quick question regarding hot reloading.
patch reload LittleFarmer.Fell.LittleFarmer is the command I'm trying, and after typing it I get [22:14:17 ERROR Content Patcher] No Content Patcher content pack with the unique ID "LittleFarmer.Fell.LittleFarmer".
This is my manifest.json file.
{
"Name": "Little Farmer",
"Author": "Fell",
"Version": "1.0.0",
"Description": "",
"UniqueID": "Fell.LittleFarmer",
"EntryDll": "LittleFarmer.dll",
"UpdateKeys": []
}
Patch reload is for Content Patcher packs
Hot reload is a feature in your IDE (or dotnet watch if you’re using the command line)
Hot reload is specifically for c# mods
Nah, trudging through Microsoft Visual Studio.
I’d get a screenshot but I’m already in bed
But when the game is running there should be a red fire icon near the pause button
(In Vs)
(does it still need to be enabled manually, or is it on by default?)
I see the attached article the bot supplied. My VS doesn't have anything with a pause or fire button yet.
If you’re running the game through mod build config it should just work I think? Or maybe that’s with the net version we’re using. Either way, I didn’t have to configure anything when I got this computer
Are you launching the game with the debugger using the run button (green triangle) in Vs?
Specifically the filled green triangle
No, I wasn't aware of this workflow. 😮
Yeah, that’ll also let you set breakpoints to pause the game execution at certain lines of code in your mod for example
To let you look at variable values and such
That'd be really handy but the wiki doesn't really explain how that's done.
https://wiki.stardewvalley.net/Modding:Modder_Guide/Test_and_Troubleshoot#Basic_testing
And trying to build the solution with the game running nets me this write error message.
Error (active) [mod build package] Failed trying to deploy the mod.
System.IO.IOException: The process cannot access the file 'C:\Program Files (x86)\GOG Galaxy\Games\Stardew Valley\Mods\LittleFarmer\LittleFarmer.dll' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
at StardewModdingAPI.ModBuildConfig.DeployModTask.CreateModFolder(IDictionary`2 modPackages, String outputPath)
at StardewModdingAPI.ModBuildConfig.DeployModTask.Execute() LittleFarmer C:\Users\mdaga\.nuget\packages\pathoschild.stardew.modbuildconfig\4.3.0\build\Pathoschild.Stardew.ModBuildConfig.targets 87
the SDV wiki isn't meant to include instructions for VS and other software, these have their own docs and tutorials elsewhere
Close the game first
It can’t overwrite the DLL if you have the game already launched it
Oh, I misunderstood. I thought there was some sort of hot reload or something for non content packs.
There is
But you have to launch the game through the debugger first
If you launch the game otherwise it won’t work (unless you attach the debugger)
Oh interesting. I think I found something that works. And I see that play button now and the fire icon.
I assume the play button would do the same thing? I'll have to test!
It should yeah, the mod build config sets it up
It does! Wahoo!
I gotta sleep now, might be around tomorrow
Thanks for the hand holding. I wish I knew about this yesterday. Gnight
Good night, Casey!
@calm nebula: cry over reflection. See https://smapi.io/log/e0b0d2bdc12742508d6a813f8e8a8683?Levels=trace~debug~info~warn~error~alert~critical&Page=14&PerPage=1000 , https://github.com/Pathoschild/SMAPI/blob/develop/src/SMAPI/Metadata/CoreAssetPropagator.cs#L689 only handling updating the tilesheet references in DisplayDevice for one player, etc. (4d ago)
Holly shit that's awesome, I did not know that it could do that lmao
You can use FTM to place objects on the map, including fences and gates. You can also make them indestructible.
(Disclaimer: I haven't tried it)
those are for big terrain features. you want items
a gate looks like this underneath:
ABA
or ABBA
where A = fence and B = gate (these are objects)
iirc
there's some wonkiness where you can put a gate on a fence
but for now you can almost certainly ignore that
Heya modders! I want an event to fire on the farm but only once the player has built a Big Coop. I tried this, but the event didn't fire, I suspect because I only have Deluxe Coops on my farm. Any suggestions how I could do this better?
"{{ModId}}.EggNodeArrival/t 600 1200/G BUILDINGS_CONSTRUCTED Here BigCoop":
i started watching bogwyytch videos' Something Wicked Witchy Stardew Valley and she had the mod expansion Alchemistry by Morghoula but it can't be found
Hi! This channel is for making mods. iirc, Alchemistry is in beta only. You may have more luck finding out details in Bog's server.
thank you very much
I don't really do events, but can you do an ANY on the GSQ in a precondition?
G ANY \"BUILDINGS_CONSTRUCTED Here BigCoop\" \"BUILDINGS_CONSTRUCTED Here DeluxeCoop\"
Here's to hoping
Name of the building might also be an issue, since in the data it's Big Coop and Deluxe Coop with spaces
Content Patcher does not like that GSQ entry.
I wonder if this would be better:
G BUILDINGS_CONSTRUCTED All "Big Coop" \ BUILDINGS_CONSTRUCTED All "DeluxeCoop"
Hm, maybe, though I feel like preconditions are probably AND's rather than OR's
hmm
(That should be correct, not sure why CP doesn’t like a GSQ, CP shouldn’t be touching anything to do with GSQs at all)
I think the escapes are off, at least my schema isn't yelling at me if I do them this way:
G ANY \"BUILDINGS_CONSTRUCTED Here BigCoop/" \"BUILDINGS_CONSTRUCTED Here DeluxeCoop/"
And I should have been clearer, Content Patcher couldn't parse it
(that was why it was mad)
forward slashes arent gonna escape the quotes though, i dont think that will work either
'{{ModId}}.EggNodeArrival/t 600 1200/G ANY "BUILDINGS_CONSTRUCTED Here BigCoop" "BUILDINGS_CONSTRUCTED Here DeluxeCoop"':
does this work? im not sure if content patcher will like this one either tho
That didn't work. Trying something slightly different.
what error does it give?
Well, this didn't have the same JSON parsing error, but I got a whole set of different ones:
"{{ModId}}.EggNodeArrival/t 600 1200/G ANY BUILDINGS_CONSTRUCTED Here \"Big Coop\" BUILDINGS_CONSTRUCTED Here \"Deluxe Coop\"":
thats bc the ANY query needs the other GSQs within it to be quoted, bc it treats everything separated by a space as a different query to check
unless something is grouped in quotes
Ah, gotcha!
I'm still getting this error too
Was also getting it when I escaped some quotes around the building name
Seems to be failing much sooner for some reason
Why’s it treating each individual word as it’s own condition rather than as arguments 
i also just realized bc i was copying from a previous message that the one i suggested had the building types wrong, so it mightve needed to be this:
'{{ModId}}.EggNodeArrival/t 600 1200/G ANY "BUILDINGS_CONSTRUCTED Here \"Big Coop\"" "BUILDINGS_CONSTRUCTED Here \"Deluxe Coop\""':
Let me try that
as for why rokus doesnt work, ive got no idea why its not treating the inner query as an actual query... strange
It seems like the ANY isn't acknowledging the quotes
It's treating every single thing after that as it's own GSQ
the 1.6 migration page did mention something about event preconditions now being quote aware b ut i, admittedly, dont really know what that means
This couldn't be parsed at all.
StardewModdingAPI.Framework.Exceptions.SContentLoadException: Failed loading asset 'data/events.json' from SMAPI/logophile.eggalong: an unexpected error occurred. ---> Newtonsoft.Json.JsonReaderException: Can't parse JSON file at /Users/meredith/Library/Application Support/Steam/steamapps/common/Stardew Valley/Contents/MacOS/Mods/Can't We All Egg Along/data/events.json. This doesn't seem to be valid JSON.
maybe there needs to be quotes around the ANY itself?
inner quotes would need to be escaped, though, right?
…at this point it might be better to put the GSQ in a trigger action that sets a Mail flag and check for the Mail flag in the event instead
'{{ModId}}.EggNodeArrival/t 600 1200/G "ANY \"TRUE\" \"FALSE\""':
does doing this at least let it load?
i also agree with what ender says though lol
eek. Trigger actions scare me a bit, ngl
But, let me try what you suggested, Button.
theyre ezpz! nothin to be scared of c:
This makes my schema checker angry.
So I don't think it would load.
Yeah the key can't use single quotes
keys can use single quotes
Well maybe the schema can be ignored then
i have used both single quotes and no quotes at all before
Because it cries with single quotes
Guess it's not validated with the CP schema then
Let me try it with the single quotes.
Validates but same error
{
"Action": "EditData",
"Target": "Data/TriggerActions",
"Entries": {
"{{ModId}}.EggNodeArrivalPrecondition": {
"Id": "{{ModId}}.EggNodeArrivalPrecondition",
"Trigger": "DayEnding",
"Condition": 'ANY "BUILDINGS_CONSTRUCTED All \"Big Coop\"" "BUILDINGS_CONSTRUCTED All \"Deluxe Coop\""',
"Action": "AddMail Current eggnodeMailFlag received"
}
}
}
this should work for a trigger action though i think if you just wanna go that route
if the ANY doesnt work bc of weird nested quotes you can always do two different trigger actions too
I think that might be best, since this route is giving me the twirlies.
each one with a different GSQ
So if I go the TriggerAction route, then I would need to add a MailFlag received into the event precondition, correct?
(in which case the condition would be "Condition": 'BUILDINGS_CONSTRUCTED All "Big Coop"' and similar for deluxe)
yep!
Oh, hey wait a min! The single quotes worked! My event triggered!
oh
The dialogue didn't work the way it was supposed to, though.
that would be a separate issue, i think
Which ones worked? Be good to know lol
So, the "true" "false" worked

I think the issue is the way it's parsing the ANY
with the quotes around the ANY? hmm
Because the true/false each one doesn't have any additional arguments to check
if the ANY itself needs to be quoted then im not sure how to get the triple nested quotes necessary for the building name
if you wanted to confirm that roku you could try replacin it with like, DAY_OF_MONTH or somethin simple
i would but i do not have a test content pack ready
Well I did try wrapping my any in quotes and it didn't change the error I was getting, but I never simplified to true or false
As long as I didn't make the json invalid, the issue kept being that it was treating every space as a break between GSQ's rather than honoring the quotes to check the GSQ and its arguments
i think the problem is the precondition code just grabs every argument after the "G" and concatenates it into a string
but strips the quotes in the process
so it might just not work with any gsq that requires arguments
Which would be good to know (and to note on the wiki).
im not 100% on that though bc i dont know for sure if the code im looking at is the one responsible for stripping the quotes or if its some other issue with it somewhere else
i dont know when/where/how arguments first get loaded and shoved into an args array
Okay, so it'll accept GSQ's that have arguments, but if you need to wrap anything in quotes it scrubs them out which causes issues
So I can check if I have a Coop built but not a Big Coop
Wrapping Big Coop in quotes causes it to think I'm checking if I have Coop number of Big's built
Tried checking for BigCoop and Big_Coop but neither of those are valid for the building name
The curse of spaces in internal names
Though it definitely seems like there's a lot more wrong with just the way preconditions are handling this in general
i didn't even know G was an available event condition
It's still on the migration page
that's fair
It's an alias for GameStateQuery
Which is the easier way to find it on that page lol
would the singular ' work in forcing it to ignore the quotes with the any? probably not since it's just concat the whole string, right?
i just read up
Need a way to escape spaces lmao
this is what i get for sleeping between 1pm to 9pm
oh this falls into that weird thing where if you have no conditions in a string event ID it'll never fire, huh 
I wonder if this is just not working then
that would work as far as i can tell bc it just turns it into SEASON Spring as a query
Yeah I'm actually not sure why that would even be necessary there
maybe it's not 'quote aware' but 'quote ignorant' ? lmao
the problem is that when it tries to turn what comes after the G into a query, it splits the rest of that precondition bit by spaces and quote aware, and the end result is everything in that resulting array of strings has their quotes removed. they keep the spaces, but dont keep the quotes
Well I'm using this to check for the Coop and it works
yeah. so its only fucked if you need to quote something within a query itself
So it's weird to add quote awareness to a part that doesn't need it lol
which doesn't make sense, since we're told to use quotes for buildings with spaces
thats the kicker, eh
it's the same for the addtemporaryactor of like, a Blue Chicken, or something, you have to escape quote \"Blue Chicken\" to get it
Right but that actually works lmao
Yeah, but escaping quotes in a query in an event precondition doesn't seem to work, lol
it might be that /G was just used as an example bc it was something being added in 1.6 too but the quote awareness is really only useful for other preconditions, maybe
bc unless im missin somethin i also dont see why you'd need to wrap SEASON Spring in quotes
squints at addtemporaryactor code
might be worth asking Pathos about?
Yeah I'm not familiar enough with preconditions to know if any of them would benefit from quote awareness
same ive never done event stuff
This test is the first time I've ever written any event script lmao
i don't... need quote awareness in the basics
Ok, I might be mush-brained, but if my TriggerAction is adding: EggNodeMailFlag received
Then my event precondition would be:
n EggNodeMailFlag
??
i believe so
Seems right
Ok. Just making sure. Thank you!
love the three different degrees of certainty we displayed there
Lmao
lmao

like the most craziest i have is LEFeelings/e LERealization/l {{ModId}}_10HeartJACK/A {{ModId}}_10HeartPause/f Lance 2500/ if i actually needed something via a GSQ i just naturally turn it into a mailflag because.. idk, i guess i'm crazy
Maybe not?
Well, you weren't aware of G before :P
I mean, trying to use a GSQ in an event precondition is a little crazy (as I've found out)
i guess if you didn't want to touch trigger actions, but it's so embeded into anything i do that it just comes second nature 
(at least its only a lil bit!)
I love trigger actions
This would be my first, so it's all new to me.
The last mod I worked on with events was pre 1.6 and all of this
I opted to make a couple of my debug commands into trigger actions instead lol
looks disapprovingly at my 3 jsons of trigger actions from two different frameworks and vanilla 
They do seem much easier to implement than GSQs
was anyone else gonna be brave and actually ping pathos to ask about the precondition stuff by the way
oh p event condition sounds fun, y'know, i might go a little buckwild with my event conditions-
i was trying to find the code for GSQ
and then i'll ping
I would ping him, but I wouldn't know how to explain it
seems like somethin thatd be nice to have in 1.6.9, if it even can be made to work with that stuff
Do you guys know a simple custom npc I can reflect on so I can learn to make an npc
i also have not yet bc i was tryin to make sure i fully understood the issue first and am only like 90% there
Oh man, I already made a bunch of work for Pathos the other day when chu/e and I discovered the save serializer changes had borked a bunch of stuff lmao

Except to say, hey, this doesn't work
!npc
Keep in mind that making NPCs is a complex process that requires learning many different aspects of Stardew modding.
Here are a few links that can help get you started on all that you need to know:
-
Tiakall has a great tutorial on making a custom NPC for 1.6.
-
NPCs no longer use dispositions, check the wiki page for the new NPC data.
-
Aviroen has put together a template that will allow you to easily create a romanceable NPC.
-
Feel free to jump into the https://discord.com/channels/137344473976799233/1277457201077813280 thread for more interactive feedback and help!
is the command in Event.cs?
I'm not sure where event script parsing is
this particular issue starts in Event.CheckPrecondition i believe
I remember looking for it but I don't know if I ever found it
where the precondition is split into an array of strings
Thought it would be easier to learn events from the C# side rather than events I'd never make lol
im just trying to make sure im not totally missing something where the quote awareness for a /G precondition is actually helpful bc i feel like i must be missing something lmao
...item_context?
but then it won't work, right?
awareness is the idea that the code actually sees the quotes, right? which is like, not exactly what we want
Just register your own C# preconditions
[OtherNames(new string[] { "G" })]
public static bool GameStateQuery(GameLocation location, string eventId, string[] args)
{
if (!ArgUtility.TryGetRemainder(args, 1, out var query, out var _, ' ', "string query"))
{
return Event.LogPreconditionError(location, eventId, args, "must specify a game state query");
}
return StardewValley.GameStateQuery.CheckConditions(query, location);
}```
the quote awareness means that if you write G "BUILDINGS_CONSTRUCTED All Coop" that it will get sent to the precondition parser with two strings in the array:
G
B)BUILDINGS_CONSTRUCTED All Coop
if you didnt put quotes or it wasnt aware of them then you'd have more strings in the array for every word separated by a space (so it would also be "BUILDINGS_CONSTRUCTED and Coop"
which is all fine and good but when the G precondition actually parses the query itself, it takes every remaining argument after it and puts it all into one query string
so BUILDINGS_CONSTRUCTED All Coop is equivalent to several strings of BUILDINGS_CONSTRUCTED, All, and Coop anyway
@ivory plume, hiya! I ran into a wee bit of trouble trying to use
\G ANY \"BUILDINGS_CONSTRUCTED Here BigCoop\" \"BUILDINGS_CONSTRUCTED Here DeluxeCoop\"
in an event precondition.
(if you want to backread, the conversation starts here-ish #making-mods-general message).
What I wanted was for the event to fire if the player had built at least 1 Big Coop anywhere.
We tried several variations of quotes, quote escaping, and nothing appeared to have worked.
the quotes are discarded when the precondition is first parsed, theyre just used to make sure you split at the right place
ah we force the junimo to do it
that works
but theyre needed for queries with things you need to add quotes around
buildings_constructed sure is wordy
Aren't there worse GSQ's? lol
yeah, any of the item ones because even i still can't grasp it without staring at BETAS/item docs 
those dont seem long to me
WORLD_STATE_FIELD is fun because it's parsing things
oh yeah, my context is me staring at the code
the only one that actually consistently trips me up is PLAYER_HAS_MAIL because HasFlag
Well the first is a GSQ and the second is a CPatcher When condition, right?
So at that point it's about choosing which one to use based on purpose
my constant screwup is: PLAYER_HAS_FLAG 
I have all the flags; I don't know what you're talking about.
oh that's what i was going to do
i was trying to create a local variable of Vector2 so i could use the add(new crow) bit for my buildings
does anyone know the size of a portrait in pixels, off the top of their heads?
64x64
64x64 iirc
thank you
The event didn't fire. 
yeah id double check with a new save to make sure its not the issue of the trigger action already being applied or the event already being seen from when you did the true/false thing
oh, that's a good point.
Well, I can still debug the event to see if it works properly.
It does, so at least there's that.
Thank you all for the help, btw. I hadn't said that yet.

stares blank faced at my map properties to see what other fun things i could do
always happy to help
and always happy to know its not me being dumb when my help fails and is instead just the game—
With the exception of the event firing, everything seems to be working accordingly. The item is given, I can put it in a coop incubator, so next step is seeing if the creatures behave the way they're supposed to.
i can't tell if it's my internet, but nexus takes like, 3 business days to load
it's been slow-loading for me too, lately
considering the whole house is asleep save for my husband and i, it shouldn't be my internet cause my youtube is fine
welp guess that means no checking on any bug reports for me goes back to my c# blank stares
also, ugh, 64x64 is huge compared to what I'm used to working with XD
maybe i'll actually be able to get something to stick by reading button's dynamic patcher 
Hehehe, it's crows
The first has G but not the second?
Im on phone so i may have missed context
thats probably a typo bc our other experiments had it with the G proper
Yes, sorry!
https://en.wikipedia.org/wiki/Dovecote#:~:text=A dovecote or dovecot %2Fˈ,for the birds to nest. tbh i'm making the art for one of these but it's crows
Btw is chicken feed mod working on custom coops?
thats what the original issue was
Yeah I have no idea what I'm doing for the art still, I just needed a placeholder that wasn't absolute dumpster fire bad
it looks adorable!
we tried basically every combo of ANY and quotes and escape characters
Dirty test that in a trigger action and set a flag to use in event? See where the issue is?
using a trigger action for a flag instead was the eventual solution
Ok so its quote parsing in event the issue then
unfortunately so 
Not like the gsq itself or another thing
I fixed the typo to show the right query we were trying to use.
its definitely the precondition parsing that causes the issue
Ok!
just only with queries that you need to do quotes with like when writing "Big Coop"
Thank you for looking, though, Lumi! 
I used several gsq as event precondition but i dont believe i used any with quote
Sure
...you know, I wonder if instead of making a farm building and having to make an NPC to sell from said farm building, could I turn Fizz into an NPC that only sells this stuff once Perfection is achieved? or is he hardcoded to only sell Perfection waivers, and nothing else can be added to his 'store'?
It is frustrating when you hit a wall
Indeed, it is. Especially when the wall doesn't behave like a wall and instead acts like a wormhole.
i dont think Fizz is an actual NPC in Data/Characters but its not like thats stopped anyone from revamping a fake NPC before. just a lot more work
Fizz is hardcoded, iirc
You can easily patch a little stall or something
darn. yeah, sounds like a little stall would be easier than trying to revamp a whole NPC to be more 'real'
also points at ichor
doesnt Lance have an actual disposition at least though? or has it been too long since ive actually played sve
no my marlon mod
he does but he doesn't actually have a schedule, nor does he move
hardcoded like gil 
At least Gil has a chair to sit on.
Gil has a disposition!
Fizz just stands at the back of that cave.
Not a good disposition! /j
beggars cant be choosers n all that
anything to free me from this wheel of 64x64 character portraits XD
i need to make a debugging folder for just my c# now
oh, i'm not stupid, i finally got annotations to work

[HarmonyPatch(typeof(Farm), "addCrows")]```
now i'm ready for roku's unique id 
I question the user who installs two mods to deal with crows lmao
the people with 1000+ mods probably just install everything that is compatible
yeah, if i can actively avoid incompat, i will
i'm especially avoiding incompat because i'm doing the skip crime
or you could use patch priority instead
how do, i am egg
kinda funny there's no docs on it
somewhere in here? https://harmony.pardeike.net/articles/priorities.html
[HarmonyPriority(Priority.First)] or something
oh wait, after
then Last
or Lower or whatever
just anything that goes after Normal
Oh, how much tidier things would be if I just used Harmony annotations for patching... 
i still prefer manual
you can define a priority in the HarmonyMethod constructor
yep
but it didn't work for me
it definitely works
this is kind of my "i'mma throw any harmony crimes i can commit" into, project, so annotations were higher up on the list of things to learn
i don't have a ... harmony method constructor ... i think?
don't worry about it, use the HarmonyPriority attrib
HarmonyMethod ctor is for manual patching
oh that's my fallback
Harmony.Patch(
original: AccessTools.Method(typeof(Utility), nameof(Utility.pickPersonalFarmEvent)),
postfix: new HarmonyMethod(typeof(Postfixes), nameof(Postfixes.Postfix)));
Harmony.Patch(
original: AccessTools.Method(typeof(Farm), nameof(Farm.addCrows)),
prefix: new HarmonyMethod(typeof(Prefixes), nameof(Prefixes.Prefix)));
*/
Harmony.PatchAll();```
yeah, I know, it's still a mystery to me, I'm just saying that I can't help much either if it doesn't work
Oh, Harmony.PatchAll can only do assembly-wide. Yeah, that wouldn't work for me!
Not for MEEP at least. A bunch of features whose patches only get enabled depending on whichever is used.
So if I did it annotation-wise, they'd all get their patches patched.
you can set patch categories, too
imo you should always patch everything anyway
it saves you from the game/SMAPI updating in the future, and you thinking MEEP works just fine, only to realize one of these conditional patches didn't, but no other mod you had used it, so it wasn't patching
Good thought...
also helps with any cross-mod compat, if people patch the same methods MEEP does
(except MEEP does it conditionally)
Just going to force everything to be enabled when running in debug. Problem... partially solved.
yeah, that doesn't solve the latter problem
I just... feel icky patching methods I don't need to patch.
i cannot say the same, mine are conditional based on if there's a field in the customfield and also that my specific keywords are there
but i'mma still make harmony acknowledge my patches just incase something blows up
I mean I have a two-layer system in essence.
- A mod uses a MEEP feature, the feature's patches get run if necessary.
- The mod is set to enabled.
I can theoretically run a patch and just not set the mod to enabled, which would just skip everything inside of the patch.
yeah, i did the baby-easy route of setting everything to if statements
if exists -> and string is there -> and has the correct 'bool', fire
I went the route of demanding a little bit more from people using MEEP! Want to use the closeup interactions?
"DH.MEEP.CloseupInteractions": "" in your manifest, or you're getting nothin'.
Downside of this route is I don't think MEEP will ever show up on the mod stats even with enough packs.
...do i spawn crows from giant crops 
i make a dedicated "crow only" mod for spooky month
...yes.
the nexus mods image for that needs to be a box of spooky month's favorite cereal, Oops All Crows
lol, that works, too
i forgot to update my build package copy paste 
Hiii a question plz,What should I do if I want to draw something when the mouse is over an area?
No u
@ivory plume hey sorry for the ping, was there a reason that the UI coordinate display was removed from debug mode? i found it really useful and was just wondering if it is able to be reenabled by some config or something
I think in the meantime you could quickly render your own preview with the mouse pixel coordinates multiplied by the UI zoom?
if i'm using Game1.getMousePosition(true) to get my hardcoded UI co-ords, is this a valid way of setting the position ? new Vector2(838 * (Game1.viewport.Width / 1920), 472 * (Game1.viewport.Height / 1080));
real programming
does anyone know whats happening? i updated her schedule from the bus stop to the players house but now she keeps showing up at the bus stop still! i'm new to programming so forgive me if its a simple fix 😭
https://smapi.io/json/content-patcher/4ef4d27989f64fac9547a02c2d555bb6
remind me in 4 hours to come back and ask for help with this if it still isn't fixed
yeah, yeah you'd like that, wouldn't you
(#6296809) (4h | <t:1728757016>)
okay so apparently this is meaning that it isn’t drawing on 1080p monitors right
mine’s 1440p so it’s possible that the scales are all off
If this is a custom NPC, try setting the home instead, also I think there was something with 600 not working at some point but I am unsure if that was fixed. You will need to sleep a day for the changes to happen.
My schedules tend to use 610 rather than 600 because 600 did not work.
If it's an interior change for the Coop/Big Coop/Deluxe Coop then yes it will work automatically
If it's a new building then you need to set feed item override in the building data
Can content patcher make storage containers?
Stumbles back in after months. Hello I am alive i just got a job. Gotta scroll through nexus to see what yall have been doing while I wasnt looking
You need Expanded Storage
okay
I knew CP couldn't do it in 1.5, but with all the new features it got in 1.6 I was unsure.
try setting the home? whats that? 
Hi! Can you send me a minimal repro content pack I can test it with?
I just checked through the mod's Git history, and so far as I can see it never had that feature?
was that a different mod then ?? i'm like 99% sure i used to press the keybind and it'd show the debug mode ui and then in the top left a red bit of text telling me what world space / screen space x&y my mouse was at. this was like, 2 or so years ago at this point
Oh, that's the game's built-in debug mode. You can try enabling AllowGameDebug in the mod's settings to bring that back.
okay, so i changed it from FarmHouse to Farm and shes still not showing up. changed the time to 610 too
In the Data/Characters json, there is a Home entry that determines a character's spawn point each day. Changing schedules requires sleeping a day for the character to follow the new schedule. If your NPC still cannot path there, then it is most likely either blocked from doing so by a NPC Barrier tile or otherwise attempting to use a path that is hardcoded to exclude NPC pathfinding, such as the backwoods.
I would try sending them somewhere that is not the Farm to check if they are just unable to path onto the Farm itself
Oh, something else I am just noticing now that I am more awake: schedules need TWO destination points in them to work
So you need to add somewhere for them to go after the Farm in this case.
ended up with this in the end, though i don't know if it's right. it's still off a bit with little weird adjustments depending on the window size and shit but i really dk what to do anymore so it's good enough:
Helper = helper;
BoxBounds = new Rectangle(new Point((int)Utility.getTopLeftPositionForCenteringOnScreen((int)(156 * 11.5 * (Game1.viewport.Width / 2560f)), (int)(96 * 3 * (Game1.viewport.Height / 1440f))).X,
(int)Utility.getTopLeftPositionForCenteringOnScreen((int)(156 * 11.5 * (Game1.viewport.Width / 2560f)), (int)(96 * 11.5 * (Game1.viewport.Height / 1440f))).Y)
, new Point((int)(156 * 11.5 * (Game1.viewport.Width / 2560f)), (int)(156 * 7 * (Game1.viewport.Height / 1440f))));
initialize(BoxBounds.Left, BoxBounds.Top, BoxBounds.Width, BoxBounds.Height, true); // initialize (mostly for close button)
populateClickableComponentList();
Vector2 start = new Vector2(846f * (Game1.viewport.Width / 2560f), 504f * (Game1.viewport.Height / 1440f));
BatPositions = new List<Vector2>();
for (int y = 0; y < 2; ++y)
{
for (int x = 0; x < 4; ++x)
{
BatPositions.Add(new Vector2(
x: start.X + (x * 225 * (Game1.viewport.Width / 2560f)),
y: start.Y + (y * 225 * (Game1.viewport.Height / 1440f))));
if (BatPositions.Count > 7)
break;
}
if (BatPositions.Count > 7)
break;
}
for (int i = 0; i < ((amountOfStardrops > 7) ? 7 : amountOfStardrops); i++)
{
var tas = new TemporaryAnimatedSprite("", new Rectangle(0, 0, 16, 16), 0f, 0, 9999999,
new Vector2((int)Math.Round(BatPositions[i].X), (int)Math.Round(BatPositions[i].Y)),
flicker: false, flipped: false, 1f, 0f, Color.White, (11.5f) * (Game1.viewport.Width / 2560f), 0f, 0f, 0f, true) // 1.179487179f is the magic number here and i cba to explain it so stfu
{
texture = Helper.ModContent.Load<Texture2D>("assets/bats.png") // if ever need different stamp textures, make list of different paths then access by [i]
};
TemporaryAnimatedSprites.Add(tas);
}```
Thks, it is penhell’s coop if I recall correctly which adds 4 extra feed slots & capacity. I will it then.
like it's nearly bang on here but if i shrink the window it all goes skewiff
Is it borked only when you resize with menu open?
no just anytime
i have this to fix that:
public override void gameWindowSizeChanged(Rectangle oldBounds, Rectangle newBounds)
{
BoxBounds = new Rectangle(new Point((int)Utility.getTopLeftPositionForCenteringOnScreen((int)(156 * 11.5 * (Game1.viewport.Width / 2560f)), (int)(96 * 3 * (Game1.viewport.Height / 1440f))).X,
(int)Utility.getTopLeftPositionForCenteringOnScreen((int)(156 * 11.5 * (Game1.viewport.Width / 2560f)), (int)(96 * 11.5 * (Game1.viewport.Height / 1440f))).Y)
, new Point((int)(156 * 11.5 * (Game1.viewport.Width / 2560f)), (int)(156 * 7 * (Game1.viewport.Height / 1440f))));
upperRightCloseButton.bounds.X = xPositionOnScreen + width - 20;
upperRightCloseButton.bounds.Y = yPositionOnScreen - 24;
Game1.activeClickableMenu = new TrackerMenu(AmountOfStardrops, Helper);
}```
must be some float/int math problem then
but as long as it looks good on 1280 1920 its fine 
oh shoot okay!! let me try this out
fixed it. thank you so much. 
probably yeah. is there a standardised way to do what im doing or is my macgyver method the usual way ?
I need someone to talk me out of making rotatable versions of the crane game trees you can get as prizes
I don't draw trees but I want it
If u aren't using any framework then yeah just gotta maff out the pixels
Oh yeah, probably a bit late for this mod, but this mod exists @astral prism: https://www.nexusmods.com/stardewvalley/mods/20250
Still very much in development from what I understand, but still likely useful!
damn that would've been a godsend like a week ago
thanks though, i'll keep it in mind for future
also this #1293051032904925255
the shared library version is usable rn if u just submodule it
isnt this what i need to make her spawn? whys she not appearing where i put her
i used it for this mod https://www.nexusmods.com/stardewvalley/mods/28261
...I did not know that existed*.
its nice 
Are there any errors in your logs complaining about the location or NPC sprites/portraits being missing? NPCs are persnickety.
They won't spawn unless they are fully realized with the art and at least one piece of schedule data.
You're getting credit in... at least one future mod for making me aware that exists. I need a lot of UI, and writing a whole custom UI framework is effort.
well u should probably credit focustense instead 
I have placeholder files for portraits and sprites that I use just to make sure the code stops yelling at me LOL
the api version that works through a custom markup lang is prob what you want to use instead in the future
Oh, I'll absolutely credit both. 
i used leahs portrait as a placeholder, i just wanted to see the sprites i made for her ingame, still gotta figure out how to make schedules
was gonna leave that for last but apparently i cant
shared library is why that mod's dll is 372.2kb
Well, just adding a spring schedule is enough for a start to get the NPC to spawn
Spring is the fallback schedule
is there any template for that lol
I think the wiki gives you Abigail's block in the Scheduling mod page?
!npc
Keep in mind that making NPCs is a complex process that requires learning many different aspects of Stardew modding.
Here are a few links that can help get you started on all that you need to know:
-
Tiakall has a great tutorial on making a custom NPC for 1.6.
-
NPCs no longer use dispositions, check the wiki page for the new NPC data.
-
Aviroen has put together a template that will allow you to easily create a romanceable NPC.
-
Feel free to jump into the https://discord.com/channels/137344473976799233/1277457201077813280 thread for more interactive feedback and help!
3rd bullet point has a template
- bullet point
the third one in the bot response
oh maybe u r on phone so bot formatted weird? line that says
Aviroen has put together a template that will allow you to easily create a romanceable NPC.
i think the big numbers are the ingame hours, but what are the little ones?
Tile Coordinates and facing direction IIRC
Yeah, it's detailed better on the wiki
Which is why I was trying to point you there
ye im here
"(optional) The direction to face after reaching the destination. The possible values are 0 (up), 1 (right), 2 (down), and 3 (left). Defaults to down."
That bit is the 3rd small number
yknow this doenst seem that bad actually
Who rang 
If you're talking about this mod then it already works, since it doesn't add a new building:
https://www.nexusmods.com/stardewvalley/mods/21221
Schedules are easy, events are where the terror comes in
ehhhhhh
the pain of events is debugging it because you want the timing of something to be perfect
Depending on if you want to get fancy with it
personal pain: writing
(still stalling on my temporary horse Actor event)
i assume because you want a character to sit on said horse
No, but I need the horse to animate xD
Basic event is Malon taking care of Epona, so I am gonna add a brushing sprite animation to her too, probably
addTemporaryActor \"Horse\" 32 16 <x> <y> <facing direction> false Animal horseactor
addTemporaryActor \"Duck\" 16 16 95 17 2 false Animal duck1
animate duck1 false true 100 24 25 26 27 28 29 28 26 25 24
16x32 it looks like
then it's just a matter of fiddling
I'd like to change the kind of fish I can catch on the farm map to only ocean fish, is there a reference sheet of flags I can look at?
data/locations has the multiple farm information, there's Farm_Standard, Farm_Beach etc etc
you'll need to understand https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide/action-editdata.md#target-fields target fields, to be able to get to the "Fish" portion of the fields
thanks
@astral prism: come back and ask for help with this if it still isn't fixed (4h ago)
hey how do i edit values for hats? i need to make it to where some do/dont remove hair. if someone mentioned it already, im sorry, i lost it.
no clue bout FS but for CP it tells you on the wiki https://stardewvalleywiki.com/Modding:Items#Hats
Sorry if it's dumb but can you have an animal able to be in coop or barn with the "House": "Coop" bit something like "House": "Coop or Barn"in JSON CP Assuming it is a coop spritesheet/size
i dont believe thats possible in vanilla iirc, but Extra Animal Config may have something for it? i remember it coming up at some point but i dont know if it ever got added to it
Thanks!
Try the dumb thing first
"House": "CoopBarn"
I recall this being a weird string contains
But it might be in the other direction
EAC doesn't support it yet
But atra's thing might work, try it first
the building you're trying to move them in would have to contain the whole "CoopBarn" string
if not I'll consider adding it some time later (PC still in 10000 pieces on the ground)
if (buildingData?.ValidOccupantTypes != null && buildingData.ValidOccupantTypes.Contains(this.buildingTypeILiveIn.Value) && !building.isUnderConstruction())
{
return building.GetIndoors() is AnimalHouse;
}
(this being the animal)
Hmm
one last workaround you can try is modify the coop and the barn's ValidOccupantTypes list to include your CoopBarn "building"
might have to do it for the upgrades as well
and need compat with modded buildings
thanks, i will see if i can work with this

hi!! im so sorry to bother. i wanted to ask for some help- i'm attempting to make a portrait mod but i have absolutely no idea how a content.json file works and i fear i am too lost to understand the guides. i've tried looking at other portrait mods files but it's either Not There or there's so much text i don't know what to look at
Yeah I think this will work just don't know if I want to have it so all animals can be with my mod some people may not want that. I know it is still fully optional whether or not you use it but still. I know when making a custom building you can have the ValidOccupantTypes be both coop and barn.
which guides have you looked at? have you looked at the content patcher documentation itself yet? iirc it uses portrait replacements as an example in the docs
that would be such a smart idea. i should do that 😭
OH yes i have looked at that actually
Yeah I misremembered the direction lol
at least itd be an easy postfix, i think
it got me through the first couple steps! but i think it's because it's seasonal/festival portraits im missing something and i am not sure what
Enjoy!
or i'm just! reading incorrectly! could equally be that /LH
i should ask, are you trying to change portraits for personal use only or to publish a mod?
personal use, i suppose! i know i can just as easily replace existing pngs with my own, but i figured i'd try challenge myself to make it a functional mod that i could publish for my friends to use too
it's not the end of the world to me if i get too confused and give up on it haha
okay! then, you'll probably wanna use EditImage to replace your portraits instead of Load like in the content patcher examples, but its very similar
interesting interesting i will have a read (and probably be back with more questions) tysm
i believe for beach and seasonal portraits you just name the file like Abigail_Winter.png for example?
(or Abigail_Beach.png
i mean your files dont need to be named that but it'll match them with the targets, which wont have the file extensions
would i have to do that for every season? like repeat it a bunch?
just for ease of remembering
i thiiink so? i think doing that for all the seasons works, but admittedly NPC stuff aint my wheelhouse. you can also add things to a characters Appearances list using EditData that will replace their portraits or sprites based on conditions you decide, like season or location or festival, but thats a lil more complex for a very beginners mod. not a lot! but more so
admittedly i am half hoping that someone more knowledgable about NPC stuff just jumps in instead of me to give you more helpful guidance—
HMMM interesting interesting. that does sound like exactly what i need admittedly HAHA
HAHAHAHBAH
using appearances has more examples from current mods
i would also definitely recommend at least Notepad++ for this
got it!!
Seasonal Cute Characters actually uses the new appeparances system in 1.6 so like 6480 says it might be a good mod to look at to figure out how to do it
my mod is some how breaking a part of sve's mod where it has an overworld sprite for dusty the dog. yesterday i edited the dog house for all season variants on the map file and that seems to have been what caused it. however, when i reverted the doghouse back to the vanilla one, the sve sprite is still gone. no idea how this is a thing <o>;;
oh perfect! that is in fact the mod i was basing most of this off so im glad im looking in the right place!
there is a Lot of code in it though bc it does stuff for the farmer too and for, yknow, every single character, but you can look at just the Abigail.json file inside its assets/Code folder to see the stuff for just abigail as an example
perfect perfect that's actually so helpful. thank you so much!! even if its not your wheelhouse you've been a huge help
and ofc pls dont be afraid to come in here with questions if you dont understand something still! the more specific the better ofc
just make sure you're also keepin the content patcher docs handy to reference while you look at the other mod example
modding in a nutshell
Curious what I'm doing wrong here. I'm learning C# as I learn to mod so bare with me me please. ♥
I'm attempting to read the event argument NewTime from helper.Events.GameLoop.TimeChanged but trying to read from the event argument is giving me this error. What step am I missing here?
Error (active) CS1061 'EventArgs' does not contain a definition for 'NewTime' and no accessible extension method 'NewTime' accepting a first argument of type 'EventArgs' could be found (are you missing a using directive or an assembly reference?)
public override void Entry(IModHelper helper)
{
helper.Events.GameLoop.TimeChanged += this.OnTimeChanged;
}
int i = 0;
private void OnTimeChanged(object? sender, EventArgs e)
{
if (!Context.IsWorldReady) return;
i++;
System.Console.WriteLine("Time has updated.", LogLevel.Debug);
System.Console.WriteLine(i);
if (e.NewTime = 1600) return;
}
here is a link to the docs I'm looking at: https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Events#GameLoop.TimeChanged
Also if there is a better channel to ask questions, let me know. I don't mean to bog down this one.
you want the function to take in TimeChangedEventArgs e, i imagine. also, your modentry class has a Monitor object you can use for logging (Monitor.Log iirc?)
also, currently you're not actually comparing e.NewTime to anything, you're assigning it
this is the correct channel for your question
and hm your IDE should have noted something like that
rookie mistake on the comparitor, nevermind that.
oh ig its valid cus EventArgs is base class
My programing experience is mostly out the window from a few years ago when I dove head first into JS and react for a bit, but I'm realearning a lot of fundamentals here.
yeah, so wont have the stuff specific to timechangedeventargs in it
Oh interesting. I didn't see TimeChangedEventArgs anywhere in the documentation. Is that implicitly implied to more veteran coders?
uhh. to be honest i dont know. i think i originally just sort of assumed it my first time i used it bc the examples i saw had names like that (like DayStartedEventArgs and GameLaunchedEventArgs on the wiki) and once i started typing my IDE started autocompleting and just showed me all the others, so i just knew it from then on ig
this is a C# pattern
when u have event like this
event EventHandler<GameLaunchedEventArgs> GameLaunched;
it can take on delegate with signature void Handler(object? sender, GameLaunchedEventArgs)
not a smapi construct just how C# is
I see why I didn't notice the auto complete then. I just copied some boilerplate code from an example and have been modifying it over time. I haven't dove into the parameters yet. Thanks!
In c# I rely heavily on VS
Not in a way where it programs for me
But in a way where. Hmm
I can have a thought and it'll help me fill it in
This syntax doesn't mean much to me yet, but I appreciate the explaination regardless.
yeah sometimes i just start typin just to see where the autocomplete takes me to see whats available
Like I'll be like "I'm thinking of a method of his shape on that class"
And it'll help me out
Hi sorry if this is a dumb question I know literally nothing about c#, but can you use harmony to patch an internal function? Specificaly I want to add a postfix to ItemContextTagManager.ResetCache but the compiler says that 'ItemContextTagManager' does not contain a definition for 'ResetCache'
you can yes. you just need to use a string for the method name instead of nameof()
(That said, why are you patching that.)
Thanks!
I want to add season context tags to seeds and it seemed like the best place to do it that I could find. Is there something else I can use that would be better?
i would 100% do that through the content pipeline instead through AssetRequested
what's with the division by 2560x1440? you're good to just pass in the size of your menu, like 600x400 or Sprite.Bounds.Size.ToVector2() * Game1.pixelZoom or something, and it'll centre it regardless of screen size based on the viewport (which you also don't need to give it)
you may have over-engineered it a little lol
the game default res is 1280x720 btw in case you're wondering what the minimum to support is
I tried following that at first but I couldn't figure out how to read asset data? Like I assume that the cropdata objects and stuff didnt exist yet, so I'd have to load it myself, but I don't know where to load it from cuz I don't know the file paths?
Or like I don't know what edits I need to put in the dictionary without loading the object first, and I can't figure out how to load the object
the asset requested event happens when the asset is being loaded. you can follow the instructions in that link to edit things in the dictionary of objects and add things to specific objects context tags
when the Data/Objects asset is requested the dictionary you get access to is a dictionary of every object in the game, like in your unpacked content folder. You don't load a specific object
(Fwiw I'm also not sure there is a sane way to do this.)
For some assets, the game expects one to be loaded ahead of the other
And in particular here, objects is before crops
is that an issue for just adding context tags to seed objects?
maybe u can patch Crop instead
It means you can't look at crop to edit objects
Past Atra apparently decided on a custom query instead
can someone explain to me what this means
oh dear
yeah but resizing / re-positioning the stuff is like
needs to be manual tho
right?
One of your dialogue keys is formatted wrong
It’s hard to for me to tell in what way it’s wrong
dialogue keys? what does tha tmean
Spring_1 maybe
There’s something wrong with how a dialogue is formatted
I’m not convinced spring_1 is a valid key tbh
Usually heart levels can only be multiples of 2
season_# is used for marriage dialogue
this?
The number being day of month
i got these from a template online
Valid. It's a date
I'd guess its because the dialogue is all blanks?
I usually put "..." in mine until i write actual dialogue lol
How do i check if a tile is empty ground or if theres something placed there
Blanks shouldn't throw errors, should just be a no translation throw
🤔
how do you mean? your menu's going to look the same, no matter what the screen size is right? you're just going to set your starting position to be whatever centres it on the screen, then reapply component positions with that start position
(i'd link you to any of my mod menus, but surprisingly the only one that uses GetTopLeft is totally outdated and bad and never released, and each other mod does things way differently to the next)
JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.
If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.
When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.
wat
you do have to update all the components and whatever other variables you have yourself manually, but it's just a matter of lumping all those changes into the gameWindowSizeChanged method, and calling that once on created for your first setup
throw your entire json into the parser at smapi.io/json
And share the link, troubleshooting without seeing the code is really difficult
Yeah empty string is gonna be a problem
Just ignore errors until it's fully filled in. Or remoce lines you aren't usijf
the dialogue json or the content json
I have plenty of empty strings 
ah
Could do both
do i send it here or
Yep
could this be causing it? thats the only error in the dialogue
Possibly, that would certainly cause some issue
id correct it, check if it fixes it and if not jsut send the new json here
Does anyone know how to find the tile actions menu? I wanted to find out how to modify Robin's menu (carpenter) specifically in the cabin updates section. I've tried everything to find out where it is, from StardewValley.Menus.Carpenter (but there are only things about building updates here) and StardewValley.GameLocation, which is where the smapi documentation teaches how to register new actions. However, I can't access the registeredTileActions variable correctly because it's a protected variable. I tried using Reflector, but the dictionary variable still comes up empty for me. Can anyone help me find out how to change this part of the updates?
Or if anyone knows of a mod that changes the price of the house upgrade for me to analyze the code, maybe I can figure out what to do.
house upgrade is in robin's dialog which is nested in the gamelocations
check GameLocation.carpenters
there is number of branches there, helps if you can describe the desired feature
Imma finally attempt sleep, atra is correct if you're not using i18n tokens and you haven't set your dialogue keys. You can have large swathes of blanks if you're using i18n though
What I want to change is the price of the cabin upgrade, and the materials for the upgrade.
fear.
The problem is that this is done through a menu, right, unlike other buildings
you need to patch GameLocation.houseUpgradeAccept()
its most likely a transpiler
also need to change the strings ScienceHouse_Carpenter_UpgradeHouse1 2 3 ofc, but thats trivial
Thank you very much, I will try to modify the function using Harmony to see if it works.
if I made a 32x32 asset for a building, that would be equal to a 2x2 tile square building footprint, right?
it can be 1x2 if you want
awesome. I was thinking of making a giant vault, like you'd see in the repaired community center, and you stash your g inside to 'buy' the promissory notes/meme items and then I wouldn't need to worry about having a character portrait because it's a self-serve vault (that mandates honesty, somehow, don't think about it too hard)
you better let me go in and swim in the gold scrouge mcduck style
Where can i see the documentation for the entire game1 class? Not just whats on the wiki
There's not really anything that robust, you can look at the decompile
I recall someone saying that return to title was raised for farmhands
the inside needs to be a hot spring, but the hot spring is filled with gold pieces? XD
Can someone confirm?
the game doesn't have documentation, even a comment is rare lol
How do i do that 👀
!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
Hello everyone! It's me again with another question 
I've been trying to load marriage dialogue (ik that sounds weird) for Leo but I keep getting hit with this
Happy to post code or upload zip if needed
Edit: I should also note I am only testing this with Stardew Valley Expanded and Grandpa's farm because that's what my save file is. I have removed all other mods
oh yeah you might be getting tired of the pings, but also I don't think you want to set Game1.activeClickableMenu = new() here haha, i know I said to look at JunimoNoteMenu but also it does some dumb stuff sometimes
i don't have the code on me atm but I do remember it just rebuilds the entire menu whenever you resize the window and I remember thinking that's some real peak dumb
basically nothing else does that, so don't you do it too
do i gotta add the 2 for this to work? ive tried everything but the water overlay doesnt show up ingame
is the location outdoors
the 2 is footnote, not to be added
you can use lookup anything in game to check if your tile property correctly applied 
need tile lookup on
@next plaza: look into spacecore animations not working in other languages and the 0-schedule fix breaking marriage schedules (6d ago)
I have the impression from Pathos, Casey etc. that there are actually a lot of comments in the game code, you just won't find them in the decompilation.
Which is, of course, of no real help whatsoever to anyone here, it's just an explanation.
Remind me in 24 hours to look into spacecore animations not working in other languages and the 0-schedule fix breaking marriage schedules
😏 (#6297566) (24h | <t:1728863143>)
I wouldn't go so far as to say a lot, but definitely some
I don't have any personal stake in whatever this 0-schedule thing is, but I think it's time to set the snooze button from 24 hours to "six to eight weeks".
Well it has to get done before 1.6.9 releases since it's half implemented in the develop branch 😅
Alternatively, rip what I have out
what stops you from making that vanilla 
It's too risky of a change for us to do this close to release
(I've already asked Pathos)
I have an event that's not firing - the precondition is a mailflag added via TriggerAction. I'm not seeing in the patch summary where the mailflag is actually added, though, so does that mean my TriggerAction isn't working?
I did confirm that the mod loaded and edits were applied.
my new computer is finally alive, and I'm looking into adding a new field to EAC to specify extra valid houses. it should be straightforward, though I'm wondering why buildingTypeILiveIn exists and is a netfield
(you can move animals later)
right, but in the vanilla game it gets set once to the data field House in the constructor
and I'm struggling to think of a use case where you want to change this in mods
oh i wanted to ask for letting animals out in winter
@lucid iron I followed your tip about the houseUpgrade location, I even managed to make it charge something different for the cabin upgrade, if I have enough for the new value, it charges, but if I have enough for the old value, it charges for the old one... I also found the part that generates the price dialog, I even tried to change it using harmony, but I'm not able to modify the dialog. Even applying the new function using harmony, the old menu continues to appear with the old prices. Não entendo o que to fazendo errado.
its fine if u dont want to do it cus ill send PR eventually
lol if you already have a PR then go ahead
the dialog you can change just by modifying the asset directly, no need for harmony
you need to transpile and change the const values in the function, or do a skipping prefix
no i dont and tbh this is also a 2025 coming soon project, but i was thinking of it when i was talk to kat who has the no snow winter recolor mod 
this function
private void houseUpgradeOffer()
{
switch (Game1.player.houseUpgradeLevel)
{
case 0L:
createQuestionDialogue(Game1.parseText(Game1.content.LoadString("Strings\Locations:ScienceHouse_Carpenter_UpgradeHouse1")), createYesNoResponses(), "upgrade");
break;
case 1L:
createQuestionDialogue(Game1.parseText(Game1.content.LoadString("Strings\Locations:ScienceHouse_Carpenter_UpgradeHouse2", "65,000", "100")), createYesNoResponses(), "upgrade");
break;
case 2L:
createQuestionDialogue(Game1.parseText(Game1.content.LoadString("Strings\Locations:ScienceHouse_Carpenter_UpgradeHouse3")), createYesNoResponses(), "upgrade");
break;
}
}
yea just change Strings\Locations
ah okay, in that case I can look into it 
i think its just 1 particular if check to replace
but yea this could be something to do per animalhouse 
dunno if ppl would want it per animal since that seems annoying to manage
though does she want a global check, a per house check or a per animal check
the way my mod's set up as a framework means I'll likely do the latter 2, but I can do the first one if needed
i got no clue it is not like we spec'd this out 
@humble timber sorry for ping but do you have opinion on this "animals can go outside in the winter" proposal?
To clarify, these LoadString things are looking for <asset name>:<string key>, where asset name refer to stuff in content and key refer to key in the asset
Strings/Locations.json
"ScienceHouse_Carpenter_UpgradeHouse1": "I can increase the size of your house and add a kitchen. It will cost 10,000g and you'll also need to provide me with 450 pieces of wood. Are you interested?",
"ScienceHouse_Carpenter_UpgradeHouse2": "I can increase the size of your house and add a nursery. It will cost {0}g and you'll also need to provide me with {1} pieces of hardwood. Are you interested?",
"ScienceHouse_Carpenter_UpgradeHouse3": "I can add a cellar to your house. The cellar can be used to age certain products, like wine and cheese. It will cost 100,000g. Are you interested?",
you can change these with normal content pipeline things
uhh hang on can i get more context LOL hang on lemme backread a bit
i mean i think it sounds neat
i would prolly use it 
personally i think per house is best cus, if it was per animal then u would have to open door for particular animal in the winter and let everyone else in the house freeze 
vanilla's only got 6 animal house cant be that bad to assign the custom field or whatever for all of em
CustomField sounds good, though that does mean you have to handle compatibility with modded buildings
that's why I was wondering about a global toggle
then again it's probably not so bad, since I too have to wrassle with modded coops/coop-like buildings in my own mod
@lucid iron I managed to edit the dialogue, now my only problem is really the double charge, charging both the old and new price simultaneously.
I took a look at your repro content pack; the problem is due to a combination of three issues.
- You have an extra
"at the beginning (the'is supposed to be the starting quote). - Escaping quotes in JSON strings is tricky. For example,
'"\"example\""'sends'""example""'to the game, since JSON consumes the\. You need to escape the escape, so that JSON doesn't consume it (e.g.'"\\"example\\""'will properly send'\"example\""'to the game).
// current
"'{{ModId}}.EggNodeArrival/t 600 1200/G ANY "BUILDINGS_CONSTRUCTED Here \"Big Coop\"" "BUILDINGS_CONSTRUCTED Here \"Deluxe Coop\""'
// fixed
'{{ModId}}.EggNodeArrival/t 600 1200/G ANY "BUILDINGS_CONSTRUCTED Here \\"Big Coop\\"" "BUILDINGS_CONSTRUCTED Here \\"Deluxe Coop\\""'
- The
Gprecondition parsing isn't properly quote-aware, which is fixed in the next 1.6.9 beta patch. Thanks for reporting it!
Escaping the escape. lol. Thank you so much, Pathos!
(*a double escape
*)
(It gets even more fun if you need to triple-nest quotes, like '"\\"\\\\"example\\\\"\\""'.)
No thanks. I'll leave the fun to everyone else. 😆
yea if you are use prefix instead of transpiler, you must return true; with prefix in order to skip the original function
https://harmony.pardeike.net/articles/patching-prefix.html#changing-the-result-and-skipping-the-original
I recommend doing transpiler here instead, for this reason
it is a pretty small and targeted case though, so not the worst thing to do 
(return false)
Thank you both very much, yes it was return false
god why do i get this wrong every time
i think it's cus false = not run original in my brain
cause you don't commit crimes, you're a good child
i blame api design for this
thats correct tho
false = not run original = skip the original
then i dunno
it's probably the same brain damage that makes me get left and right wrong all the time irl
it's ok i pick the wrong return value on every vanilla class that deletes itself in bool update()
it just means you dont do bool prefixes often which is a good thing
yea i just commit transpiler crimes instead
well, i am currently doing oop crimes i think
for stardewui? or your own thing
trinket tinker yea
My idea is to turn everything into barter, and not use money in the game, the only thing missing was the house improvement, and now the next thing I'm going to edit is the JojaMart package, as for the house improvement, how many gold bars would be a fair price to charge to improve the house, instead of 10 thousand gold? Is 40 gold bars a reasonable price?
it's currently 100% harmony free
i think the main feature that's gonna require harmony is letting ppl change icon of trinket in tangent with the variant
i realize, i have never bothered to look at how much bars cost in gold
but u know, u can just make a second trinket 
1 gold bar costs 250, so equivalent exchange, yeah
To be fair
It's not consistent
Question for the crowd
Does ReturnToTitle fire for farmhands in splitscreen
If yes, how do I know for whom it fired
I think atra means the SMAPI event, but I'm not even sure how to test that lol
no idea either, but since the button isn't there i'm like ou
doesn't Game1.player always refer to the current one even in splitscreen?
Has anyone had issues with the greenhouse spawning? I added the map property in tiled.
in a new game right
Does that still hold even after everything is unloaded
please don't ask why I've decompiled smapi despite the fact that I could literally open VS to it
it's raised here, in this method
well, the sgame instance is still valid here....probably...
My issue
greenhouse spawns weird in my custom farm map loaded with content patcher and a tiled map property was used
ahhh I don't own a controller so I have no bloody idea
how can i test for you atra
can you tell me what this prints>>
private void OnReturnToTitle(object? sender, EventArgs args)
{
this.Monitor.Log($"Return To Title for Player Index {Game1.game1?.instanceIndex ?? -7}");
}
Exit with P2
Return To Title for Player Index 1
rename my tilesheet to untitled got it!
yea exit to p1 gave index 0 even as i was doing inputs on p2
it does yea
so it is work correct
oh well, it doesnt like, quit smapi process
u can exit to title as p1
this is an amazing bit of code. CA, never change

does it not boot p2 as server closed connection?
wow
it boots p2 i think 
exit from p2 = return to non split screen mode
exit from p1 = return to menu
whooot thank you!
there's only 1 button in the exit menu for split screen
the real question was because I wanted to forcibly replace Game1.mapDisplayDevice with my own implementation, realized I needed to check if someone was fighting me over it
realized I needed to check if SMAPI was fighting me over it (SMAPI would not), realized I would need to check if any player returned to title, then started digging through SMAPI code trying to figure out what it would do
and I own zero controllers so I can't get into splitscreen mode myself
(maybe with a controller emulator?)
In the context of event handlers, true usually means "I handled it, so stop running other handlers", so maybe that's the confusion.
Question: I swear I've seen it somewhere before but Google isn't helping me out. My NPC is supposed to be compatible with Nature's Bounty, but I only want it to be an optional mod (not everyone is into 4/20). How do I make my NPC gift tastes not bug my character out if someone chooses to NOT use that mod?
iirc gift tastes don't care about things that aren't there, they just skip them
OH THANK GOD
considering i put my very niche mushroom item into a gift taste of a completely separate mod and i've gotten no errors, probably safe
That's a relief! I've encountered a ton of errors with my code because of me trying to format it differently. I tried to model my code similar to Ridgeside Village, but considering how that mod is VERY COMPLEX and doesn't only include NPCs, I shot myself in the foot 😭
Keep in mind that making NPCs is a complex process that requires learning many different aspects of Stardew modding.
Here are a few links that can help get you started on all that you need to know:
-
Tiakall has a great tutorial on making a custom NPC for 1.6.
-
NPCs no longer use dispositions, check the wiki page for the new NPC data.
-
Aviroen has put together a template that will allow you to easily create a romanceable NPC.
-
Feel free to jump into the https://discord.com/channels/137344473976799233/1277457201077813280 thread for more interactive feedback and help!
You probably want to look at singular npc mods instead yea
Yall are a godsend
i might inevitably throw in my "How to add in gift tastes via text operations cause you're lazy/editing an npc that already exists"
What is it with Google searches being absolute garbage with looking up stuff for Stardew modding? Almost everything is "my mod isn't working :/ help me troubleshoot a mod i downloaded" but hardly anything for people doing modding 😭
I'd love to mess around with the official NPCs, mostly to be a troll and treat the NPC like a crack fanfic
unfortunately, all the knowledge is in here, and nowhere else save for a little on the nodding wiki
My event handlers return qbits, so i can later notify another event handler that I changed my mind on my ability to handle something
so you'll never find it on a web search
The modding wiki is difficult as hell sometimes
But are there conditions that look for if a mod is downloaded (and functioning of course lol)?
if i weren't afraid of screwing the entire wiki formatting, i would've helped move 1.6 into their respective pages
Here me out: We make a new wiki
Specifically for 1.6
Remind me in 12 hours to write this, you've got all your pieces now
...ok. but you owe me. big time. (#6297747) (12h | <t:1728828720>)
Whooooo
Feel free to get on that if you want to
also, i keep on losing track of that dependency page
DEPENDENCY, THAT'S THE WORD
Also document this on the wiki you dumb fuck, lol, so other people don't have to do this sleuthing
The HasMod token may be right for you
You add dependencies to prevent your entire mod from loading
You use HasMod to prevent parts of your mod from loading
I don't think there is lack of public docs so much as presence of out of date docs that muddles the search
Esp for things like modding video tutorials 
yeah unfortunately the video tutorials get outdated real fast
If I had time and no terror about posting stuff on the internet I'd make devlogs 
And a lot of stuff like this isn't really documented anywhere
You just either heard it from someone
i 100% heard it from someone here, and it's burned in my memory
Or you checked the decompile yourself
Yeah I think that's just the expectation when working with closed sourced thing
i checked the decompile to reaffirm that gift tastes is the bane of my existence because an 'npc' no matter the simplicity, needs one
Hi Esca!
the wiki is the best source we have, but the wiki is just us, and i almost never edit it because 1. i'm busy off in cloud cuckooland and 2. i am terrified of putting incorrect info on there
Long time no see
On the contraire please put incorrect info on there
i just inevitably wait for tia to yell at me with "
"
Is it easy to add a custom location warp to a custom farm? I want to add a wreck ship entrance.
Nothing gets nerds fired up like "someone is wrong on the internet"
Yeah sure
