#making-mods-general
1 messages Ā· Page 443 of 1
true, but a lot of user error can be guarded against
so is using text operations not really a good way to edit an event?
there are only a line or two that need to be changed, and I thought that was the best way to do it
@ivory plume is this expected Content Patcher behaviour? doing a text operation on something that doesnt exist (in this case an event) makes it exist but then if the resulting operation leads to a null value, it continues to let it exist even though normally turning something into null would have Content Patcher remove it
in this case that lead to errors when the game tried to parse a null'd event script
it just depends on your usecase and what you're trying to edit. you're trying to edit entire commands, so you can use TargetField or Fields to edit whatever field number that command is on
TargetField and Fields support slash-delimited strings
so for example if you wanted to edit the 3rd command in a script, thatd be the 2nd field, so you'd target #2 within the script in TargetField
you could also do the same kind of Targeting with TextOperations maybe? but not much point to that vs just using TargetField or Fields
this does have the downside in that if the event you're editing is changed unexpectedly (like the original mod updating, or someone else editing that mod before you) your edit might break it, but odds are it'd be broken in some way anyway if the original script changes
Hmm, I'm trying to edit the text inside speak commands. Is there a way to do that without potentially messing up the original event if it's changed in the future?
Oh sorry I just reread your last message, so kind of no matter what the edits are relying on the original event to stay the same
yeah pretty much
if you give it early priority it'll happen before other mods make edits to it, but that's still not a guarantee
Okay good to know. Thanks again!
It's intended for append/prepend, since those would always result in there being a value. It's not intended for other text operations which may result in no value though.
yeah that sounds about what id expected
@next plaza: do this (7d ago)
hey, the switch event thingy still has the wizard specificTemporarySprite-ing, is there anything I might do?
I've never tested this or seen the event, but both commands in the sewer event just create temporary animated sprites & don't edit anything else. You could see if removeTemporarySprites or removeSprite <x> <y> get rid of them.
(The first command spawns them at 15,13 and 17,13, but the second is randomized, so probably not easy to specify.)
Gotcha, Iāll test it out later!
I think you have the language for this a little mixed up. EditData patches use Early, Default, Late priority, with the earliest happening first. Load patches have Low, Medium, High priority, with the highest being the only one to load.
i definitely did--i had no idea they were different! thank you for clearing it up
edited my message
caseyyyyyyyyyyy
hmmmm it's now occurring to me that just selecting a random key from the fish data dictionary is likely to yield rare fish far too often
but the alternative is iterating location data, combining all the fish entries, and then selecting one, which sounds complicated and annoying
maybe what I can do instead is just select a random location with fish defined and then just roll that table?
Random location that the player has been to?
So end game locked locations dont get hit
well this is planned to be endgame anyways
I just don't want it to be too ridiculous and follow general rarity rules
although now that you mention it, that's not a terrible idea
you can go on fish value maybe?
so far my plan is this plus postfixing HasMagicBait
line of sight, i imagine
Line of Sight
oh that makes sense
looks like its only used for LavaLurk's to avoid some damage logic so they are always hittable when they aren't invisible/invincible
guess its so being in the lava doesn't count as an obstruction and skip some loops and logic
Hey, am trying to get the flamethrower attack of the dinos to do more damage, but increasing the damage of the dinos just changes its touch damage.
Hey SinZ still owe you that log, didn't forget it.
looks like the flame projectile is set to always deal 25 damage in code
That would explain it, with the mods I have they are doing zero to no damage.
hello
is there a way to reference the farmer's name in map strings?
The @ ends up appearing as a ā”ļø in text
yeah, use Message instead of Dialogue i believe
I have to go to bed soon š
(I happened to open this channel accidentally, and this was the first message it showed š )
Remind me in 20 hours to ACTUALLY merge PRs and what not
But of course, dear kittycatcasey (#6898028) (20h | <t:1759961302>)
.8ball are you bugged
Computer says no.

does CodeMatcher have any way to like, apply a block to an entire InsertAndAdvance or do I really have to manually add the blocks to every single instruction
/me has always written transpilers by hand without codematcher
^
(And really needs to stop doing that because it sucks)
I used to but man. it is so much less tedious to use tools
I enjoy the friction as it gives an incentive to find non-transpiler ways to get the same outcome
Yeah.
I think I was one of the first people to use transpilers, so had to figure them out on my own.
And I didnāt discover code matcher, so now my habit is to not use it š
I mean, just the friction of doing the setup is enough for me. 90% of the time I'm just using passthrough postfixes since those are just infinitely easier, even with transpiler tools
/me scurries away to crime thread to see if doing any-direction collision handling is as bad as I remember
you have to dig through the il, and figure out where and how to write the damn thing, and god help you if you wrote an instruction wrong and need to debug the output
wdym block, do you mean something like Repeat
Back in my day, we didnāt have pass through patches.
exception blocks
(Back in my day, we had to patch functions using unsafe pointers, so no, weāre happy for the change)
stop yelling at the cloud
Also couldnāt you use a local function?
define "had to"
Or not feasible with code matches
There was no harmony, so it was the only way to patch stuff
I donāt know if anyone besides me even did it
this is with a local function. I need to feed in params and do a small branch based on the output
having used raw transpilers, and later codematcher, i am team codematcher
Ah.
RIP
I do not miss the old days in minecraft modding where you just replace the .class files in the jar and delete META-INF
yeaaah
are try catch blocks in transpilers cursed in the same way as the ones in prefixes and postfixes
<insert small rant about deleting meta inf actually breaking the game on Mac, and you only needed to delete certain files in there (even on windows the same deletions would work fine)>
h... how are they cursed in prefixes and postfixes
macos doesn't exist so its fine
what does this mean
iirc they just don't always trigger, that's why finalizers are a thing
what is the block to apply 
I assume they are label based and so might be fine?
they are not
Oh
they are their own metadata on CIL instructions
RIP x2
i continue my usual strategy of "pretend try/catch does not exist" /j
ive never had my try/catchs fail in any kind of patch fwiw
I remember attempting to wrap something in a try catch while doing harmony and being utterly ignored at least once
in the specific context of Harmony, each CodeInstruction has a list of try/catch blocks it belongs to, which unfortunately also includes any foreach loop
I couldāve sworn there was at one point a function for recalculating stack frames or whatever to fix that, but Iām likely thinking of MC core mod bytecode stuff (from the olde days pre-mixin)
but do I remember what I did to deserve that? no I do not
I was gonna do that but I'm worried it'll make the patch fail, or have some horrible nightmare bug down the line
Well the thing u r inserting is like a list of instructions right
maybe I just ignore it for now and see if things explode
Can u do some linq things bolb
What's the worst that could happen if you ignore exceptions?
Heck, there's even a bonus (for you) - the exception won't look like it came from your mod (or not as likely), and so Pathos gets your bug reports on SMAPI instead!
(not so much a bonus for Pathos I suppose)
look up what the reasoning behind finalizers is, find a wild pathoschild in the github issue
(yes, pathos would know, but the users don't know how to read stack traces, so...)
oh yeah I guess I could select to array. that would be kinda cursed
Cursed is better than crimes (if you're a coward)
finalizers are a great place to hide crimes in stardew mods, as the pathos build of harmony which renames the staccktrace to say what mods touched it, doesn't happen for finalizer patches
...what
Well if it makes u feel better u can make some helper method with param
New crime avenue, how exciting
finalizers just get like _Patched or something
This seems like srs bug
I used like at least 2.5 finalizers for completely arbitrary reasons
(nobody tell @ivory plume )
also if you throw an exception in a finalizer it will say it came from the original method, not the finalizer method
smapi lore found in the harmony repo issues
when I added profiler support for adding arbitrary support for finalizers to log and optionally supress the exception, I messed up and had a null reference exception, causing the original method to now blow up instead of not blowing up
how are bookseller dates determined? the wiki says randomly. is there code to prevent him from showing up on a festival day, for example?
got it! and randomly picks from those i assume
yeah no code to stop him from showing up at festivals, other than the fact the vanilla festival dates aren't one of those numbers
I do not understand why this transpiler is considered invalid
..popping back in here for a second
Can you not make reverse patches with manual patching
oh I think I had the parameter order fucked up
I think so? let me check how I did it
yeah it's CreateReversePatcher
and then you call patch on it
(presumably so you can re-create it if other patches are applied to it and you're using snapshot mode)
when are you not tbf
generic abuse is wonderful
thank you pathos for (indirectly) teaching me how to do horrible MakeGenericMethod crimes
I just used MakeGenericType
I feel like thatās the exact same thing I just saw in pathos code the other day
Basically I wanted to use TargetMethods to patch all subclasses, but also be able to call their original methods with reverse patches
it's in content patcher, that's how I learned about it
makes sense, I was recently breaking into content patcher
Basically I'm abusing the fact that generics have their own static variables for each instantiation
I have since thought of a way to do what I wanted without ever prefix skipping content patcher methods but I have also been advised to please not do what I wanted in general 
(I may or may not have some Things⢠on that front on my eventual todo list)
Hey yall, just joined and will probably be jumping into my first mods soon. Excited!
Hoping the scripting is pretty powerful
Boy is it
ooo
glances at my most recent project
depends what you mean by scripting haha
can most things be reloaded without restarting game?
True
no donāt look at her recent project itās Crime /lh
CP not as much (but still super powerful considering there's no code, just json), but C# mods, definitely
it Dependsā¢
Hey now, code crimes are fun
I'm just now looking into all this, CP is? I assumed it was all C#
CP = Content Patcher
ah
It's a framework for making mods without having to code, essentially
(still gotta use json though)
was about to ask
so content patcher is a mod thatās basically its own declarative programming language at this point
but I'm assuming I can do everything CP can via C#?
We don't have loops. So no
š
okay I bet you might could do something with includes and local tokens and conditions, but let's not manifest that into the world
event gotos in .7 say otherwise 
yes (CP is just a C# mod), but CP does a good job so it's broadly wise to defer to it
That's the game's event stuff, not CP itself
I'm coming from Skyrim/RDR2 modding (for content), and you can do pretty much anything with pure scripting. Hoping stardew is similar
pathos is unfortunately pretty careful to stop me (personally. I guess the rest of you too) from doing fun loop crimes
But yeah definitely don't look at my most recent thing I'm working on because it very much is full of code crimes.
Just so you know where to avoid: https://discord.com/channels/137344473976799233/1414326612215992446
oh god
Please don't give the framework modders access to SQL JOIN
Please
shhhh itās 4am everything is one big blob of code
okay so kitty is the one to bother when I inevitably have questions
good to know thanks yall
I mean I am probably the most knowledgeable modder besides maybe Pathos...
But I'm not around this channel much lately (unless pinged for a bug in one of my published mods), and I really only know C# stuff
casey, author of famed mods Spenny and Spenny Deluxe and also some less important ones like spacecore
Wait, did he add cycle prevention??? š
Correct, glad you have the priorities straight
I'm not looking to make mods of any real substance. Unfortunately just real brainrot type stuff
Those are the best ones
youāll be glad to know I have four spenny emotes, casey
well I guess I'm in the right place
Most of my most recent published mods are joke mods
I once made a mod that just lets you rename any character to āBoncherā
Literally the only thing I know about stardew mods is stardew extended. which I've never played
This is my most recent mod published (haven't been around for a bit until recently): https://www.nexusmods.com/stardewvalley/mods/33407
top 3 favorite joke mods go
i made one that does it automatically! (nearly)
the only thing you need to know about SVE is that you WILL get comments asking if your mod is compatible with it
edom rorriM
This is my next mod: https://www.nexusmods.com/stardewvalley/mods/26444
The third most recent mod technically has some semblance of gameplay value: https://www.nexusmods.com/stardewvalley/mods/26121
I made animals poop
But then it's another joke mod after that
https://www.nexusmods.com/stardewvalley/mods/21513
(And this is ignoring the random error generator mod I made for pathoscat.mp4, since that wasn't published)
kitty these are incredible. Do you make these for content anywhere other than nexus?
didnāt button once make a mod that just did ascii art smapi log spam
The source code is on github, but I don't have most things elsewhere because uploading updates is such a pain
I more meant yt etc
Eventually I might automate it if Nexus gets an upload API
and 99.9% of people is on nexus anyway
Oh, like demonstrations of my mods?
Not really, most of my mods have been things that don't have a lot to show.
because these are the exact type of mods I'm looking to make
Other than Spenny, of course
You can see the random error generator in action here. (For those who haven't seen the glory of pathoscat.mp4)
https://www.youtube.com/watch?v=m8tTdU-BJ6g
Based on a true story (and totally not from a joke on the stardew valley discord modding community)
Brought to you by a custom mod, and Firefox's "Inspect Element" tool. (Totally didn't skip a step in the repository deletion process out of laziness.)
Definitely didn't take a whole five hours to make (between the mod and the video itself).
Cod...
Who is both perfect and youtubeable
ok I'm excited, thanks for the warm welcome! Hopefully I can cook something stupid up
I did say "most"
(some nonsense here)
i have a few shitpost mods but this one is probably my finest https://www.nexusmods.com/stardewvalley/mods/28276 (mentioned above)
And to be fair moon misadventures original version did have a trailer
if we're shilling our own joke mod then this one of mine is probably the closest qualifying one
https://www.nexusmods.com/stardewvalley/mods/36611
Artifact Spot Duggy is probably my most shitpost-y
amazing
I just wanted to smack his little face
Over and over again every time I find an artifact spot
Every once in a while there's an era of a genre of them.
Like a while back the mayo mods, more recently the tortilla mods I think
(I do have a few mayo mods)
Both of those were, uh, phenomena
You have an omelet mod
I gave you the art for it š
True, but I don't consider that a joke mod š
Whattt
It has gameplay value. That's not allowed for joke mods
two quick questions:
- How easy is it to play custom audio from within a mod?
- Should it be easy enough to get a websocket running from within Stardew?
even if half the reason I wanted to make the mod was for what happens when you try to get a second one in a day
- easy
- However easy it is in normal C# I guess. I assume there's libraries for that already
cool
I'm using external libraries for my code crimes I linked earlier
No way was I gonna parse a .gltf myself
- that's simple enough
- I'm not as knowledgeable about network stuff but plenty of mod did network stuff also, though be warned that if you're thinking of uploading it to Nexus you'll need to clear your mod with them first
nice. I use websockets in almost all my mods so good to konw
Oh, right, I forgot nexus has restrictions on network stuff nowadays
Last time I did that was the year stardew came out for the MP mod š
is this a deceptive banner ad or a new āfeatureā?
it leads you out of nexus
I haven't made a stardew "mod" but I recreated the entire intro in HTML/JS so I could replace grandpa's desk letter with whatever horrible messages I wanted
Looks like a deceptive ad
Gosh dang it this is why I don't hang out here anymore
I forgot what I was doing
I thought so too but it was consistent on two separate page loads and itās also translucent 
i really should hang out on here less. discord is the distraction machine
Crime thread is fine. Programming off topic isn't active enough to be an issue usually
Distractions are good
Fun mod projects are better
Why not both?
...because I don't have two brains?
Enough caffeine and anyone can have multiple brains
Pretty sure that's not how it works
And caffeine would actually make me calm down thanks to the magic of
ADHD 
no you just have to drink even more
not an ad, new āfeatureā. website is kinda sketchy imo so watch out
dont listen to how fast your heart is beating thats not important
Oh, how exciting
-# I totally donāt drink 3 energy drinks alongside my adderall to function at work like a normal human.
it claims all keys are given to them by the publishers but I have my questions about how true that is ngl
yeah that popup was offering me like 30c off stardew earlier today
yup.
even on switch and xbox, according to them
they also have a listing for haunted chocolatier claiming itās coming out in 2025
renowned mod-friendly stardew platforms switch and xbox /j
itās a key reseller, not a mod platform tbf 
And where do they claim they get keys from publishers
oh i thought you got linked from nexus about it
I did, but the website itself is just a generic key selling website? strange stuff
Hmm, the way it's worded they don't acutally say they got them from the developer, just the keys were issued by them. (ie. they could get them from somewhere else)
Still will point it out (especailly since it says HC 2025)
there are tons of key sellers out there
some of them are allegedly reputable and work directly with publishers/Steam itself for keys
some are, well, black markets that accept keys from anywhere, including from stolen accounts
(Though I assume the HC thing is definitely not something that anything can be done about)
Yeah, it's mainly that people might thing it's authorized based on the terms of use that I wanted to point out
Might not be able to do anything, but worth bringing up
...wait, do you not have verified mod author
Why would you be seeing ads
(wow, pathoscat.mp4 still has less than a 100 views after months, sad)
no, i added a small (and configurable) happy halloween message art for Graveyards that showed once on game launch for the modjam
oh I do lmao I just opened through discord so I wasnāt logged in
Sadly I have discovered that you cannot in fact use static lambdas for harmony because they do not actually compile to static methods
They compile to instance methods on a static singleton with no fields for god-knows-what-reason
Hmmm or maybe it's only because they're unnamed
singletons make me kind of miss scala. in a stockholm kind of way
Tragic (though I only use manual patching when I can't avoid it, like now)
disappears but for real this time
I use manual patching because the wiki says to and I always follow the rules (donāt look at my code)
So in other words, #blamepathos
casey how are you typing if you disappeared
(He wrote that back when annotation patching didnāt work cross platform because of monogame/XNA and Stardew assembly name being different)
Wellllll
My computer is locked
And Iām just going to the bathroom before I go to bed
And also Iām a ghost I guess
ohhhhh interesting
Aaaaah interesting. Apparently this is for performance reasons, because delegate... stuff... is built for handling instance methods, and since static methods have no this, the clr has to fuck around with the stack a bit which has a performance penalty that isn't there for instance delegates. So it's computationally cheaper to just load a blank dummy singleton from a static field and ignore it than to use an actual static method
huhh i just never learned annotations bc they seem 2 spooky 5 me
(To be fair, it still wonāt pick it up with like method renames that SMAPI normally fixes, but Iād argue if something changes that the SMAPI fixer fixes, you probably will want to adjust your patch anyways, just with the nature of harmony patches)
I used to use them and then xamarin shanked me in a dark alley
Clearly we need a way to force it to be static.
Iām voting for static static () => {}
Itās double static, you see

i, too, listened to the wiki when it told me not to use annotations because something something breaking rewriters, but also i just don't like organizing my classes the way that is required for annotations to work
i use annotations bc im lazy
I never read the wiki beyond copy-pasting the manifest template
To be honest Iād like a hybrid - annotations on methods, bot having to make whole patch classes.
Maybe if I get around to improving my source gen thatāll change.
Youāre a scrub who doesnāt use the manifest builder? /s
Of course I'm not sure how much wiki there even was when I started
I do now, but that wasn't always a thing ;P
i'm a scrub š
Ah, I read āreadā as present tense not past tense
Curse you English language
And now Iām in bed, so actually disappearing for real 100% this time.
(Tragically and heartbreakingly, the cat is not sleeping next to my pillow like normal)
Yeah I need 2 sleep
Sneebless :(
Just to be sure, it's not possible to define custom tabs when adding a shop to Data/Shops, right?
and does anyone know what would happen if one was to add tabs to a shop that shows a portrait a dialogue? would they overlap?
so this might be a bit of a long shot - there is a game called Absolum which uses .xnb files, which i would like to be able to look around in the code of. in researching what a .xnb file is, i found loads of stardew valley resources. all of the guides and programs i tried to use result in the same error: Invalid file magic.
does anyone know what i could be doing wrong, if anything?
i totally understand if this is a bad place to ask!
tabs?
btw @gaunt orbit, do you have a link to the code of HHD? I want to look into how stuff is classified in the tabs, for FF compat.
I'm confused, that game isn't out until tomorrow?
there is a demo
these on the left
I can't remember where you see these other than the catalogue 
also dresser
ah, I see
anyway, can you say which guides and/or programs you were using?
I made a data model to add tabs to Storage Furniture made with FF, but I'm thinking about making a separate framework to add tabs to any custom shop (compatible with FF of course)
can shops have a mix of furniture and non furniture?
well yeah, you can put anything in a shop
so the non furniture would go in the "all" tab only, I'm guessing?
and you can setup a Furniture to open any shop with FF
xnbcli, xnb extract from (this guide)[https://steamcommunity.com/sharedfiles/filedetails/?id=1709011717], https://lybell-art.github.io/xnb-js/, and StardewXnbHack
it would also help to see a screenshot of the error I guess
I'm talking about custom tabs with custom icons and conditions
so the specific tabs of the Furniture Catalogue don't really matter
ohhhh I get you now. yeah that would be a cool framework!
I'll have to test to see what it looks like when the shop has dialogue, I think they might overlap
it would be through content patcher rather than contentpackfor, right?
yup
I think I can either make it fit in the ShopData's CustomFields or make a new asset to target.
could always just move the portrait left yourself (and make me cry when dealing with compat in the portrait framework I'm working on)
I'd rather not mess with UI. I started messing with the tabs because I only have to add data in a list for them to show up.
anyway, I'll see when it comes to it
omfg ShopMenu.setUpShopOwner and ShopMenu.SetUpShopOwner are different methods...
"Invalid file magic" sounds to me like those xnb files might be structured differently internally maybe? the error strikes me as referring to the magic number files use to identify what file type they are
sorry i got timed out lol, this is what i see when i try to unpack any .xnb file
this says to me that it isn't an xnb file.... but it.... is
its expecting the first bytes of the file to be XNB but is getting some different stuff instead
that looks to me like it may be encrypted
encoded differently maybe or smth since its getting ASCII, or encrypted
which makes me wonder if the devs really want you unpacking these files š
i mean probably not
aren't xnb files binary files anyway
well thanks for the help!
(genuinely asking I never thought to check)
iunno
pretty sure that's what xnb stands for, xna binary
who's to say its actually xnb as in Xna Bank file or w/e it is and not just xnb for something else
ah i see, the B in XNB stands for A Binary
if they weren't binary I would've figured you could just unpack them with 7zip or somesuch similar to some other packed formats
where i come from we call them 01011000 01001110 01000010 files
would different encodings even apply to binary files (again genuinely asking, it's 8am and I haven't slept)
tried that, tried changing the file format to .zip too
yeah I wouldn't have bet on that one personally ngl
it's worked before
on xnb files?
no, this is my first time encountering them
best trick in the books to unzip a powerpoint presentation to get the original images/videos
some microsoft and valve file formats can be unpacked in that manner, but not xnb
adobe too iirc
I would check the mime type if you haven't yet, and if it doesn't say anything useful then yeah I'm guessing encrypted
well the developer is french, so i assume the mime type is authentic?
octet-stream š„
developers protecting their ip š”
I guess you have to wait a day to find out what's in the full game 
unpacking the xnbs would have only shown you assets anyway, no code
yup
that's already a spacecore feature, with the exact fields I would make, so I'm not going through with this.
what's the proper way of editing the spacechase0.SpaceCore/ShopExtensionData asset with SMAPI (not CP)? It doesn't have an API, so I don't understand how it works... https://github.com/spacechase0/StardewValleyMods/blob/develop/framework/SpaceCore/VanillaAssetExpansion/Shops.cs
I'm guessing something with reflection
This may be a very naive suggestion, but isn't it the same way that you edit a vanilla asset?
well, editing a vanilla asset, I can do var editor = asset.AsDictionary<string, ShopData>().Data;, in this case, I don't have access to the type that would go in the place of ShopData since it's part of the spacecore code
Also, I'd want it to make an optional dependency, so it shouldn't be required
I thought that since spacecore is loading it into the content pipeline you would be able to edit it like a vanilla dictionary but I guess I did misunderstand, sorry 
it would be possible if I had access to the class of what is inside the dictionary I'm trying to edit.
it's an asset, isn't it? so I assume you should make a model for the asset and then do that
I don't think it needs to be the same actual class, just an equivalent model
which fields do you need?
sorry if my phrasing is off btw my brain is going haywire today
Oh, I didn't know that, I guess I can just copy-paste this then?
public class ShopExtensionData
{
public enum TabType
{
None,
FurnitureCatalogue,
Catalogue,
Custom,
}
public TabType Tabs { get; set; } = TabType.None;
public class CustomTab
{
public string Id { get; set; }
public string IconTexture { get; set; }
public Rectangle IconRect { get; set; }
public string FilterCondition { get; set; } = "TRUE";
}
public List<CustomTab> CustomTabs { get; set; } = new List<CustomTab>();
}
I think so, yeah. you're deserialising the asset again I'm pretty sure so it shouldn't matter if it's the same class
events peoples, does running a trigger action during an event actually make it happen in the event, or afterwards? specifically i want to run a meep interaction image
hold on meep needs custom fields in a trigger action so it cant be run as a string alone
in this case how would I pop up a large image in the middle of the screen? just temporarysprites is the way to go?
-# depends, is it a portrait--
no...
content pipeline doesn't use pintail, the type from FurnitureFramework wont be the same type as spacecore
the content pipeline doesn't serialize/deserialize, it just is the type that is loaded
when CP EditData makes changes, it (de)serializes the Entries/Fields to the specified type when making edits
my bad, Leroy 
can you make it use pintail somehow? or do you need a hard reference to spacecore to do this?
can just use reflection
wait
yeah I was about to say 
can't need a hard reference because content patcher can't reference everything
sometimes I say sensible things, today just isn't looking like one of those days
https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/Framework/Patches/EditDataPatch.cs#L390 is where Entries gets deserialized
and https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/Framework/Patches/EditDataPatch.cs#L460 is where Fields gets deserialized for the not deliminated-strings case
well im using temporaryanimatedsprite until someone says im wrong
in CP's case its not directly reflection, as it mostly just passes the type down to newtonsoft to do the reflection
though the model editor for TargetFields and some other stuff would have some reflection in it iirc
It's what I would have suggested but I hesitated about it because that's what I suggest for everything lol
hahaha
@lucid mulch do you have an example of how I would do this reflextion then? Not sure how to get a handle on the spacecore namespace/class
Something I'm not sure about is how i would center it on the screen? or should i just estimate based on where the player is and calculate a tile position? I want it to be like a meep image interaction where the image that pops up is like an item that you interacted with
and how do I shove the reflected type into a dictionary to actually edit the asset?
New quote added by atravita as #6676 (https://discordapp.com/channels/137344473976799233/156109690059751424/1425447035007402106)
(Can you use dynamic)
the least effort way would be to just have the data model you want as a json string, and JsonSerializer.Deserialize(jsonString, Type.GetType("SpaceCore.MySpaceCoreType,SpaceCore"))
and then insert it into the dict like anything else as you can have the variable just be IDictionary
You could estimate but I think different zoom levels will end up affecting where it ends up. I wonder if you could actually use meep. Is it possible to do a map edit to the map to add the meep close up interaction tile sometime before the event is due to take place and then use doAction to activate it during the event, then remove it again after the event is over?
oh what an interesting approach
i may try
every time i debug ebi my farmer is shirtless
is this normal
No lol
/temporaryAnimatedSprite Cornucopia.CookingRecipes\\RecipeBook\\Delta_Intro 0 0 120 109 9999 0 0 30 9 false false 1 1 1 1 0 0
Hm, my sprite isnt working and theres so many fields I could have messed up (its a 120x109 texture thats already been loaded)
I didnt know how to make it not animated so i set 0 for everything
It's on github, should be linked on the "information for modders" article
You need at least one frame for it to exist. I usually set the loops to 999 as well
It looks like you might also have it set to fade instantly
where does it get the type though?
you get given the type in the AssetRequested edit handler
can't Leroy do that?
yup
oh cool, so don't even need reflection really
the reflection would be used to create a new instance of the type, or letting newtonsoft do it for you
wait, how would you access the type of what is inside the dictionary with that?
yeah I assume letting newtonsoft do it for you is the best way
I have this for now, haven't tested yet. Really interested about how to get the required type from the asset parameter
string json_string = "{\"Tabs\": \"FurnitureCatalogue\"}";
Type? type = Type.GetType("SpaceCore.VanillaAssetExpansion.ShopExtensionData");
if (type == null) return;
var obj = JsonConvert.DeserializeObject(json_string, type);
var editor = asset.AsDictionary<string, object?>().Data;
foreach (string shop_id in Data.FPack.FPack.AddedCatalogues)
editor[shop_id] = obj;
is this in the OnAssetRequested event handler?
yup
else if (e.NameWithoutLocale.IsEquivalentTo("spacechase0.SpaceCore/ShopExtensionData"))
e.Edit(asset => {
string json_string = "{\"Tabs\": \"FurnitureCatalogue\"}";
Type? type = Type.GetType("SpaceCore.VanillaAssetExpansion.ShopExtensionData");
if (type == null) return;
var obj = JsonConvert.DeserializeObject(json_string, type);
var editor = asset.AsDictionary<string, object?>().Data;
foreach (string shop_id in Data.FPack.FPack.AddedCatalogues)
editor[shop_id] = obj;
});
I would just do asset.GetData<IDictionary>() to get a non-generic interface reference to the collection that you can then Add(object key, object? value) into, with the value being a newtonsoft deserialized shopextensiondata
though IDictionary also would let you do that foreach loop too
oh, yeah, that make sense
though Type.GetType you probably want to make that assembly qualified (append ,SpaceCore or whatever the assemblyname actually is for it to reliably work cross assembly)
I've had poor success for Type.GetType cross-assembly without explicitly specifying the assembly
didn't you say the type was also available through the event args?
i'll try both ways
the e.AssetType or whatever it is would be the Dictionary`2<string,[SpaceCore.VanillaAssetExpansion.ShopExtensionData,SpaceCore]>
which you can use type methods to extract the generic arguments but #effort
I've spent too much time with reflection and the syntax that Type.GetType supports to by hand type that out with the correct syntax to specify assembly qualified generic arguments
ok, AsDictionary<string, object?> causes an error, testing with asset.GetData<IDictionary>() now
well, I can't pass IDictionary without the type args...
you can
IDictionary and IDictionary<T,U> are different types, you might just need to add a different using
yeah it works! Thanks a lot!!!
/message \"'The Queen of Sauce'\"
/removeTemporarySprites```
I still dont know what value I'm getting wrong, the event is centered on 32, 13 so it's definitely in view haha
do you have an example on hand for me to check against?
is it disappearing instantly?
Did you try with 0 for the alpha fade? (Just so it does no fading while you're trying to get it to appear) Also I am having a great deal of trouble with the field order but I think you have set the scale to 0 this time. I have an example but it's animated. Hopefully it's still helpful.
temporaryAnimatedSprite TileSheets\\critters 0 192 32 32 1500 2 9999 18 14 false false 1 0.0 1 0 0 0/ -- add squirrel/
You have alpha fade set to 2 and scale at 0
aaaaaaa
They are hard to figure out when you have to read them as one long string like this lol
I took so long to reply because I had to check it about five times
I'd also (personally) prefer using the flag hold_last_frame (appended at the end of the TAS command) instead of looping it a big number if times
Putting all the fields in a spreadsheet with one field per row with a name and then concatenated afterwards would make it easier to figure out, I suspect
Ah yeah that's a good idea for a static one Tedi
I have never done a static one so I have clearly glossed over that flag many times
now aside from my farmer being a lil freaky with it, my first event is perfect hehe
I had her roof tiles on AlwaysFront2 to get in front of this bush that's there in vanilla, but if a player plants a tree near the cart, the layering is ruined. Any ideas for this bush?
AlwaysFront2 also makes it so walking under the awning on the side makes it cover you fully, but i can always put something there to block the player if i want to
It's a terrain feature so I dont know
not alwaysfront because planting a tree below it theres no clipping
You mean it's from the paths layer?
yea
what happens if you put your roof on alwaysfront? (is that where it is in the screenshot?)
But putting the roof tiles on Front doesn't cover it?
correct
My thought is just yeet the paths layer tile
i believe front and alwaysfront use the y coordinate on screen to control order but i'm not sure
if its on always front its fine with the bush but then it does this if a player puts a tree there
Was AlwaysFront the lowest layer you could put it on to cover the bush?
As in, Front9 didn't work and neither did AlwaysFront-9?
what about AlwaysFront-1 lol aba same braincell
I tried Front2, i'll try front9
oh
no, those options have their respective issues still
I return to yeet the bush
i believe that the bush persists regardless of path layer but i will try
yeah once it's been parsed from the paths layer (on map creation) it's permanent without rtf or other C# fun
It'd persist on existing saves, gotta use RTF to remove it, but should be fine on new saves
im trying not to resort to that
BETAS lets you yeet mid-save
Oh good!
Nic is using it for something
that's what i needed
if anyone complains about this i'll just tell them to uninstall the mod to fix it
-# invisible tiles on Buildings layer
i wonder if i should remove and put back the bush every day?
like so it's there when she's not visiting
probably courteous to do if you can swing it
yeah i'll just run the trigger action every morning and put the bush yeeting tile on her cart patch directly
And make sure you give her some dialogue about how she's magically able to move the bush away from there so she can park her cart there :P
hahaha
in my mind her cart is narrow enough that its just blocking the bush from view
sadly the bush does not agree
I'm almost certain resetting the terrain features daily would cause the cindersap trees to regrow instantly overnight rather than the course of a few days, which you can either consider a bug, or spin it into a nice QOL feature
ahhh ok so the betas feature clears bushes from a specific spot, not resets it based on map data
Oh is it spot specific?
Nice
no need to touch the whole map
can i do a map patch during an event? If I want to remove a specific tile (not a terrain feature)
You can use changeMapTile to remove a tile I think
Nice
Ah no you want removeTile to remove it
I'm being yanked around..
I apologise for not having every event command memorised 
I see no event masters here
You're the event master
I just look at ilspy for the given event commands
How to actually chain them together to get a desired outcome, no clue. But can tell you what each command individually does well
(just in case this is unwanted behaviour, note on removeTile: the tiles you remove with it will remain gone even after the event until the next time the map is invalidated)
Wonder why the town has special behavior here, not curious enough to look into it
Town has old code that predated some of the more modern map modification systems to power cc/joja and pam house.
And maybe just being a large map idk but it runs in its own content manager that disposes whenever you leave the map
Farmhouse also has its own, but doesn't explicitly dispose when leaving, but I think part of that is so cabins/farmhouse don't mutate each other's layers
I usually look through the github decompile repo, curse github search for being so awful, get distracted, and forget to actually check
SpeedySolutions prevents town from being special with seemingly no consequences except splitscreen users lose the bottom half of Pam's house as it somehow applies the edit twice
It will get invalidated when someone else wants to edit it via content pipeline
I wonder if you can use changeMapTile to add it back at the end of the event
does content patcher not invalidate it every day
im fine if it just comes back the next day
Content patcher only invalidates if its state has changed so it wants different behaviour to happen from what it previously wanted
You can cheese it with a conditional patch on the location that does a non player visible edit
there already is, since her cart, which is a map patch, appears and disappears every friday and sunday
so i think that would handle it
Though you would be adding lag every day when you could cleanup after yourself in the event itself
Could you cleanup? Not sure there's an event command to reverse removeTile or to add new ones
I would only advocate for non-visible changes forcing invalidation in places where you were changing a different asset anyway and it just doesn't propagate as intended, like spouseRooms.
(And would do it with a dummy map property)
If you can't add it back in with changeMapTiles, I'd try using changeMapTiles to set it to an invisible tile and then back again.
I'm going to be real I dont understand what is being talked about given the terminology about game asset handling, so I'm going to assume that leaving it alone is fine since nobody is yelling at me about it directly
I don't mind if the tile returns or not right after the event, as long as it's not permanently gone for the rest of the game
ChangeMapTiles can only change tiles that exist so it can't add in new tiles,
But in any case, the Cart patch should be enough to cover this scenario anyways
thanks tedi 
haha let me put it back in case someone else has one in the future
Where do I find the file that controls a single seed type that outputs multiple colors? Like Blue Jazz or Fairy Rose
it is in Data/Crops :)
under TintColors
Does it not use MapRenovations?
thank you! haha
just chiming in to mention that its handled by TintColors
Ahoy everyone!!
Got a quick question, I'm brand new to adding mail to the game, and got two small issues with my letter system
1: Why does the mail send all at once, even on day 1 on a new save file? (Im new, so please dont be too harsh haha)
2: Any other issues I have with it?
It looks like your when conditions are formatted wrong. Look up Game State Queries for the formatting
yea you seem to be mixing CP's token names and arithmetic operators into the Condition field
if you want to use those it's a different format, but also you don't need them since you can just use GSQs directly
follow the formats exactly as specified in the wiki page above
and use Condition, not When
So here is an example from my most recent mod where I wanted mail sent when the player got a specific flag:
"Action": "EditData",
"Target": "Data/TriggerActions",
"When":{"FarmType":"Huskyn1nja.SMeadows/SylvanlightMeadows"},
"Entries": {
"{{ModId}}_BlackShrineMail": {
"Id": "{{ModId}}_BlackShrineMail",
"Trigger": "DayEnding",
"Condition": "PLAYER_HAS_MAIL Current DLX.Bundles.Huskyn1nja.BlackShrine_Bundle",
"Action": "AddMail Current {{ModId}}_BlackShrineReward"
}
}
},```
you really wont use arithmetic operators with CP or GSQ
(tangent but there's also a GSQ for farm type in case you're not aware)
So I saw that after... but this worked and I was too lazy to go back
100% fair reason 
Thanks! I'll try this out!!!
Thanks! Do we have any public sites/documentation on the styles that the letters can come in? I know the default #, but I am unsure if there are any other styles from vanilla game that we can pick! 
https://stardewvalleywiki.com/Modding:Mail_data Near the bottom under Custom mail formatting
Hi! @rancid musk I hope you're doing well. I'm creating a lot of events with your More Nightly Events mod framework, and I was wondering if it would be possible to allow script events to also have the Output field, just like placement events. This would be extremely useful because it would allow for more interesting script event outcomes. Anyway, thanks for your amazing work!
Thanks!!
..last question, I almost promise
How can you send mail the day after someone catches a specific fish? I was planning on doing this, but if it's too hard/complex then its fine!!
(Sorry for asking too many questions, I am trying to make my mod as immersive as possible š )
PLAYER_HAS_CAUGHT_FISH gsq
tyy!!!!!!!
I think the issue as to why its not triggering is DayStarted? I dont know how else youd be able to make it so:
When fish is caught - > Next day you get mail
im testing it on basic tuna (vanilla fish) for testing purposes only
Fyi you can use debug gq to check the current stats of gsqs
It said: "ConcernedApe: Nice try..."
You type that in the smapi console
it worked, thanks!
now lastly, adding a gift
i tried adding with AddItem but that got wanky and didnt attach itself to the mail
hellooo! can the {{i18n: _____}} things still work inside a i18n file?
I think I know why, lemme try
i wish I could answer this (ik someone will soon), but thats a great question i never thought of
you need to add it in the mail itself
yup just saw docuemntation lo
look at the mail format
ima try:
"{{ModID}}_TunaCatchLetter": "Ahoy @!^^Congrats on catchin' a Tuna!^^Here's a little something for your efforts!^^%item id 797 1%%[#]Letter from Willy"
It worked!!!!
: D
you cannot use CP tokens in i18n, but you can pass arguments to it and use the value of an i18n token as that argument
uhhh could you maybe send a link explaining that? not entirely sure what an argument is lol
ty 
was finding the link on my phone lol
specifically i was thinking i might set up queries in my i18ns and then have the alternative lead to another i18n key, would that work?
yayyy okay!
tysm 
I tried myself at Harmony 
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
does this look correct and safe?
I'd be very happy about feedback!
looks fine at a glance
I would wrap the riskier external mod patches in try catch blocks just in case they change the signature
how do you feel about me editing the wiki to clarify that one of the arguments (i forget which one, i think alpha fade) must be a float? itās something that always trips me up because the rest are all ints
apparently an int DOES work for alpha fade, never mind!
(if i have that wrong, someone please correct me)
Looking at the game code for the TAS event command, animation interval, layer depth, alpha fade, scale change, rotation and rotation change are all floats
when you say this, do you mean that it doesn't work if you just write 0 instead of 0.0 for that argument?
yeah afaik mine never work if i just put 0
but layer depth i know works with an int so??
That should work fine 
0 is definitely acceptable, I have done multiple TASes before with 0 for alpha fade
i should test it and see if i can reproduce
i might be crazy but i could have sworn it required 0.0
temporaryAnimatedSprite Textures\\{{ModId}}_PutridGhost 0 0 16 24 500 4 9999 54 87 false false 3 0.0 1 0 0 0/temporaryAnimatedSprite Textures\\{{ModId}}_PutridGhost 0 0 16 24 500 4 9999 54 93 false false 3 0.0 1 0 0 0/temporaryAnimatedSprite Textures\\{{ModId}}_PutridGhost 0 0 16 24 500 4 9999 55 90 false false 3 0.0 1 0 0 0 -> saving original version here for posterity
hmm yeah changing those 0.0s to 0 seems to have had no effect? i guess i am crazy then
maybe we've just been using 0.0 for convention
I'm guessing the 0.0 thing is because the range for that argument is 0.0 to 1.0? so it's like a reminder of that
relevant number of sig figs and all that
yeah could be
is there a way in CP to easily* evaluate what item a player interacts with a tile with? like how the luau checks what you put into the soup
*easily as in not item by item, but doesnāt leave any possibilities out
i may end up writing C# for it anyway but
BETAS has a holding item GSQ
though I don't think there's a way to consume that item specifically
I think u need some framework for it so it helps to describe your usecase in detail
iām thinking about an action at a custom festival where you choose an offering of sorts to throw into the fire. i was assuming it would be possible with a trigger action on interaction to play sound, remove item, then evaluate what you threw in to set a CT
doesnāt have to be super specific, but people should comment if you threw in trash for example
that would need custom C#/a framework
alrighty 
i may end up releasing this as a separate mod then since iām hesitant to potentially break things for my one (1) android player
a question in generalāhow different is it to make a framework vs writing custom C# for personal use? like potentially would it be completely different code to make it a framework?
thanks, will do!
this also depends on how someone personally defines what a framework mod is
you would just be adding a specific custom tile action which i wouldnt call a framework but it also wouldnt be limited to personal use bc its just a tile action, if someone else had your mod installed theyd be able to use it just as easily
yeah that was poor wording on my partāthe extensibility for other modders is what i meant!
so thatās good to know it would be accessible to others too
the game has registries for tile actions and trigger actions and event commands and whatnot, you just register your handler to them
but if all it is is depositing an item and setting a CT, there isnt much extensibility there, its just One Thing and one result
so i wouldnt personally define it as a framework
can you use the config mod to select different spritesheets?
the skin tones of some of the characters im making is ambiguous in canon at best but the fandom has a range of headcanons so id like to make different spritesheets for different skin tones for each of the characters so that people can play the way they want but i was wondering if anyone knew if that was a thing
you would use the config option as a config token to determine which Loads/EditImages apply
using either When conditions or using the tokens in the file names
no i was thinking more broadly of returning an evaluationāmaybe categories of excellent/good/neutral/bad/awful? and then i could personally use that rating to set my CT (maybe adding a context tag and checking that?)
Yes! Is the main Main CP or C#?
that is not something you do with CP regardless. you cannot do an action and act upon the result
All CP so far
ooh ok ty button!
event commands, tile actions, trigger actions, etc dont return results
(besides "true/false" which is just to tell thegame whether they succeeded)
(GSQs obviously return true/false as results, but those just tell whatever they were put on (a shop entry, a trigger action entry, etc) to apply)
hmm okay. i mean it doesnāt have to be useful for others, but i did want to explore the possibility in case it would be helpful
i am talking about in any case, not just the case of a framework
if you want the CT set, you should set it as part of the tile action
or event command, or whatever it is
tile action yeah
if you have a generic DepositItem tile action, then that tile action is what looks at the currently held item and sets the CT accordingly. it does not return "this is an awful item"
Ah ok! It took me probably too long but I figured out how to do this for my weird mess where the c# mod provides the config menu and cp swaps out/patches the spritesheet
:0
okay so there canāt be a middle step? i was hoping to avoid having to check every single item
you dont. your tile action handler looks at the players current item and figurs out what it is at runtime
the only thing that happens when you click on a tile action tile is that you are telling the game to do something. your CP code does not wait for a result and it cannot know anything about what the tile action does besides whether it succeeded or failed
the tile action cannot directly talk back after it is activated
Heyyy guys so as some ppl may know, Iām making an expansion mod that adds many things.
So, yeah, thereās many things I need to do, and Iām starting to get exhausted and the mod might take a bit longer to release (I have psychological issues that influence that, but thatās a private matter.)
Many ppl are helping me in many matters, but thereās still many things to do, I just wanted to say that, if youāre also interested in helping, I would be reeeeeaaaaally happy :D Can be with art, tips, coding or anything you want.
I am always down to do c#, time permitting
I mean, as long as it's not anything super crazy
DMs, I'm able to help out with fishing and mail!
ofc rn im busy but whenever i got the spare time i can 100% help
Tyyyyy everyone!!!
I can help with art or try to to help with art^^
helloo! so for i18ns, should there be a space or no space? example:
1: {{i18n: exampletext}}
2: {{i18n:exampletext}}
or does it not matter?
it doesnt matter
https://pastebin.com/YQCfBGNh
I added try catch blocks for the mod patches!
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
tryna make a question with like 3 layers(?? idk how else to put it) of i18n and I AM LOSING MY MINDDD /j
like 1 question 3 answers?
or question>question>quesion?
||german keyboard doxxing me||
uhhh idek how I'd describe it, but i'll send a screenshot of my wip code-

(deleted an attached photo that had a mistake lol)
whoop i just noticed a mistake
okayy there we are
yeah im losing my mind just a little
a tad
a smidgen of insanity
so you are asking how to display a reaction after a response was chosen for 3 different possible responses?
oh nah, just venting lol
it wasn't a question haha, i was just complaining about my code lmao
ah! :D
omg someone please save this as a quote bc this describes my entire existence
New quote added by tlitookilakin as #6677 (https://discordapp.com/channels/137344473976799233/156109690059751424/1425581155339604119)
I'm trying to use a GSQ as a precondition for an event, specifically IS_COMMUNITY_CENTER_COMPLETE. In my testing I noticed that it requires ! in front if I want it to check for the community center to be complete, rather than that checking if it hadn't been completed like I thought it would. I just want to double check that that's the correct format for checking if the CC has been completed
it sounds strange
someone with code can confirm possibly, but it sounds counter intuitive
can you post your code
do you also have the JojaMember mail flag at the same time?
the GSQ checks for all the CC flags (ccBoilerRoom, ccCraftsRoom, etc) and not having the JojaMember flag
if you have all of the CC flags and it still requires the !, that means you have the JojaMember flag. if you're 100% sure you dont have the JojaMember flag, then you dont have all the CC flags
I was testing in a new save and had used the debug completecc command
does the debug command not add all of the flags?
the flags in that should cover them all, assuming you weren't a joja member already, but I'm not sure when events actually run GSQs offhand, you could try sleeping before testing the events
okay, I'll go ahead and try that
the events are checked when you enter a location
Hey guys, so this is my NPC's schedule. Very simple
"spring": "610 Town 12 57 0/1030 SeedShop 17 28 2/1400 Town 74 75 1/1700 Mountain 58 25 1/2000 ArcheologyHouse 6 17 1",
okay I just started a new save, used the debug completecc command, slept, saw the cc completion event, slept, and the event still began
But he's wandering into the clinic from the side when he should be going to Pierre's, and then he's just stuck in the clinic's entrance the rest of the day
How do I fix his pathing?
off-topic but I love your mods 
Aw ty āŗļø
I'm not sure if this helps but here's the log:
https://smapi.io/log/37d0d62a5fce4af6878cfcc442fe8966
Log Info: SMAPI 4.3.2 with SDV 1.6.15 build 24356 on Unix 6.16.4.114, with 7 C# mods and 3 content packs.
š¤ you know now that you mention it my npc has been walking in circles through walls
and im not sure why either
actually I'm sorry, I just realize I had left the GSQ without the !, sleeping has fixed it
what does he do when you reduce the number of points on your schedule? like try making him just go to pierre's and stay there
Mm lemme see
Question - I have a need to increase the size of a custom map. However, doing so will then put trees and such in the wrong place for existing saves. Is there a way around this?
other than using new map names I guess?
BETAS have an action for resetting trees and bushes
there's Reset Terrain Features on the user side, too, though that involves explanation
(and I'm not 100% sure if this unofficial fix still works? I made my own at the time)
https://github.com/Lake1059/ResetTerrainFeatures_NET6/releases
that one does still work
yeah RTF still works, doing it in BETAS just mean you don't have to tell users to run the terrain reset
OK I'll think about those options thank you
Also vague question for Esca since you're here, I have had a few users report I have no monsters in one of my FTM locations, is there a common reason for this to happen? They have not supplied logs.
Same thing, walks straight thru everything including a tree, enters the clinic from the side, gets stuck in the entrance
not in particular; if the area's a temporary location (e.g. the mines), FTM can have issues, but otherwise it'd probably be an issue with spawn conditions
Town 12 57 is inside a bush which may be causing issues with pathing
technically users can limit FTM monsters per area in their config.json, but I doubt they'd set it to 0
I changed that to 13 53, still doing it
did you sleep after changing it
Do you test on a limited mod set up or on a normal full modded save?
Full modded
If sleeping doesnt solve the issue try with just your mod and what is needed to make it work
Just in case a mod adds a warp somewhere that cause weird issue
unless you're specifically testing compatibility in general i recommend testing with a limited number of mods (your mod + dependencies + modding tools like debug mode)
OK, thanks. Oh and I said 'one area' but I think it's in general not spawning anywhere for them. I haven't seen it myself.
if someone provides a log, I can always check it out if you @ me with it
the trace messages should say why each spawn area is disabled, condition-wise, though it's less clear if FTM sees no valid tiles or some such
I do usually test things with all mods but when facing weird issues trying with limited set up is great
Understood, thanks. If I see more like this I'll follow up. I think the two reports I saw were both in Chinese with no logs so I'm not going to beat myself up chasing them down.
Rrgh sleeping didn't fix it
Does the NPC have enough time between going to their first schedule point and the second?
I would think so, the first point is 610 the second is 1030
If they're spawning in a map far from town maybe they aren't reaching the spot before the 1030 scheduled location
That's his base schedule or you're doing an edit to an existing schedule based on conditions?
what is his spawn set to in his data/characters entry
if it's still Town 12 57 it'll be the same issue as before
does he successfully path to Town 13 53 starting at 0610?
Yes
without walking through buildings etc?
Yes
and it's the exact same behavior on a minimal modpack?
did you test on a new save after removing mods
Yes
Nope
He's going straight from his first point into the clinic instead of the SeedShop
you tried another tile? what about trying changing the time from 1030 to later
I'll try both of those
@next plaza: ACTUALLY merge PRs and what not (20h ago)
do them one at a time so that we know what the issue is, if it's one of those
also as always make sure to patch reload + sleep or new save between every thing you change
Okay so I changed it to 1200 instead of 1030 and he's still doing it
Also he's not actually moving til the time hits, is he supposed to start moving before then so he's AT the SeedShop BY 1200?
You have to put an a before a time to indicate arrival time
Like a1030 to arrive by 10:30
If you set up a home location for him in data/characters does it still happen?
I'm gonna try that next
make sure you're sleeping every time you change the schedule
and the Home in this case
Got it
can you send your current schedule to me so i can test something myself?
@hallow prism just a quick heads-up: your mod Toddlers like parents always flew under my radar because it doesnt have the "works with 1.6" tag on nexus
||and it looks amazing
||
Does anyone know the easiest way to get the numbers for each spot to create NPC schedule
open the relevant maps in Tiled
ok
hover the mouse over the tile you want and look for the coordinates displayed in the bottom left
thank you for helping
would you say a mod that either
a) leaves the havebabyquestion unchanged
b) allows changing it to "Should we try for a baby?" or "Do you want to try for a baby?"
c) allows for entering a custom question
should be flagged as nsfw?
and if you think that yes, would you say removing the option for a custom question make it sfw?
I do not want to make an "officially nsfw" mod
not in my opinion. babies are a fact of life, it's not like you're adding a cutscene of "trying for a baby" or anything
if someone wants to input their own text that's on them
thanks!
Okay yeah so I ended up kinda rebuilding him with Miss Coriel's NPC creator and his pathing is working now, I added a home tile and adjusted the schedule a bit
Now his sprites are being weird but that's a lot easier to figure out
Thanks for the help guys!
Does anyone know if Love of Cooking intentionally disables "poisonous" foods? Like Pufferfish and Sap and whatnow. I'm working on debuffs/detrimental stuff for my Joja shenanigans, and I couldn't figure out why they weren't damaging me. Turns out it was LoC and I'm trying to figure out if it's just a conflict on my end somehow.
!npc miss coriel's NPC creator is outdated and likely to cause you issues. i recommend following the tutorial linked here
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.
-
Feel free to jump into the https://discord.com/channels/137344473976799233/1277457201077813280 thread for more interactive feedback and help!
-
Fireredlily has a WIP NPC Builder Please do report any errors you get with it into the NPC thread!
Ah okay
i spent about an hour figuring out scale up to add this unnecessarily high res painting of my dog to the game
this is what modding is made for
im trying to get iron pyth Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'IronPython, Version=3.4.2.0, Culture=neutral, PublicKeyToken=7f709c5b713576e1'
on to work in my mod i get this error
python
heres my code
using Microsoft.Scripting.Hosting;
using StardewModdingAPI;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using IronPython.Hosting;
using StardewValley;
namespace pythonmod
{
internal sealed class ModEntry : Mod
{
/*********
** Public methods
*********/
/// <summary>The mod entry point, called after the mod is first loaded.</summary>
/// <param name="helper">Provides simplified APIs for writing mods.</param>
public override void Entry(IModHelper helper)
{
ScriptEngine engine = IronPython.Hosting.Python.CreateEngine();
ScriptScope scope = engine.CreateScope();
string currentUser = Environment.UserName;
string[] files = Directory.GetFiles($"C:/Users/{currentUser}/StardewValleyPyMods/*.py");
foreach (string file in files)
{
try
{
engine.ExecuteFile(file, scope);
// FIX: Use scope to get the variable, not engine
dynamic entryFunc = scope.GetVariable("Entry");
entryFunc(helper);
this.Monitor.Log($"Successfully loaded {Path.GetFileName(file)}", LogLevel.Info);
}
catch (Exception ex)
{
this.Monitor.Log($"Failed to load {Path.GetFileName(file)}: {ex.Message}", LogLevel.Error);
}
}
}
}
}```
i dont know csharp so i was trying to make mods in python
i recommend learning C# instead
are you trying to write a python API to interface with the engine
your life is going to be miserable inside python.
there is a reason I delibrately never released my mod that allowed python modding
but to answer your actual problem, you need to add a flag in the csproj to have the IronPython dll correctly copied to the mod folder/zip
inside a PropertyGroup block
<BundleExtraAssemblies>ThirdParty, System</BundleExtraAssemblies> <IgnoreModFilePaths>System.Configuration.ConfigurationManager.dll,System.Security.Permissions.dll</IgnoreModFilePaths>
IronPython is a DLR that lets python effectively run directly in the .NET ecosystem, and so the python code can just call anything C# as if it was C#.
but you have none of the editor tooling to help you, everything is blind duck typing, no autocomplete, no typing, no intellisense, no tooltips
i feel like there are 2 options for why you'd be trying to make mods in python:
- you don't know any C# and you don't think you can learn any, in which case trying to fumble through making python work will probably not be fun
- chaos monster (you do you)
even writing like a minimal "hello world" python mod, I had to effectively write it in C# first to know what to 1:1 port to have it run as python
if you can program in python it should not be too difficult to learn C#
and there are guides on the wiki
that take you step by step on how to compile C# mods, which is the main "annoying" difference w python imo
So I'm making a little personal content pack for Farmer Portraits for mine and my wife's split-screen co-op farm using our player names (and also trying to do season, weather, and location-specific stuff with various tokens). I saw that the Farmer Portraits 1.6 mod allows for reaction images based on the emotions of the NPC being spoken to, and was wondering if there were tokens I could use to achieve the same effect with my Farmer Portraits content pack? I tried poking around some mod files as well as the modding wiki, but idk if I'm not finding anything because it just doesn't exist or because I'm too dense lol
the problem with the tokens you want is that they are there and gone in an instant, right, since the dialogue screen comes and goes super fast. while it's definitely possible they exist in a mod somewhere it would have to be done in C# because CP does not have the update rates needed
I'm a bit confused because you mention Farmer Portraits having them but also not?
but I'm not super familiar w Farmer Portraits
im just experimenting
doing it for fun really
Gotcha! Thanks for the clarification. And I'm talking about the two different versions that are up on Nexus. There's "Farmer Portraits" as well as "Farmer Portraits for 1.6". The former has been updated more recently, and is the one that allows the portraits to be based on player name and thus be split-screen co-op compatible. Whereas the other one allows for "reactions," but doesn't work with split-screen co-op as far as I can tell. So I was wishing I could combine the two lol.
with enough C#, you certainly could
looks like one is misty and the other is aedenthorn
aedenthorn open source licenses all their code, so this is actually possible
i think they came back recently? which is i assume why farmer portraits got the more recent update
you could either ask them nicely if it would be feasible to combine them, or you could try messing around with the code yourself and send a PR
@uncut viper i have a question about BETAS! i've written a trigger action to regenerate terrain when my map edit is not being applied. i think i've misunderstood how it works, though; it seems to have doubled the bush. do i want to couple this with another trigger action to clear terrain features just before my trigger action to regenerate them?
or am i misusing it entirely, and need to do something else?
it will regenerate the paths layer, but it will not clear it first. you'll want to use the ClearTerrainFeatures traction first to wipe them all
sounds good! do i need to do anything special to make sure it runs before the regeneration, or is simply putting that patch first in my json enough?
Data/TriggerActions is an ordered list, so the order in which you add the entries matters
first one added is first one run
same with the actions in the Actions list of the trigger action entry
oh wait yeah i can just do multiple actions with one traction
I will go to bed now but maybe my latest try at including compat patches will bring someone joy
so many froge...
out of curiosity, why is ClearTerrainFeatures X Y X' Y', instead of X Y width height like RegeneratePathsLayer?
i hope sam likes frogs.
because the game has a built in method called loadPathsLayerObjectsInArea(x, y, width, height)
and was added much later in BETAS
interesting!
I am making a content pack for Advanced Melee Framework. One of the weapons I have is a Hammer [Classified as Club by SDV]. Whenever I try to add a right-click skill for the Hammer, its smash attack animation gets overwritten and does not play at all. Is there a way to prevent this from happening? I want the normal smask attack animationto play, then have the projectile get launched.
https://smapi.io/json/content-patcher/fbe0b37cf9bf408a88cc4f031b3ff646 hmm i'm seeing that the bush is fine on day 1, but then day 2 appears to be duplicated. this is part of an include which is gated behind this query, if that matters: "When": { // default "Query: ({{TNT_Location |contains=AutoDetect}} AND NOT {{HasMod |contains=FoodTruck.8BitAlien}}) OR {{TNT_Location |contains=TownSquare}}": true, } },
i made sure to test it on a fresh save
@lucid mulch im guessing <IgnoreModFilePaths>System.Configuration.ConfigurationManager.dll,System.Security.Permissions.dll</IgnoreModFilePaths> ingores that dll but its not happening im getting a error envolving System.Configuration.ConfigurationManager.dll
Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Configuration.ConfigurationManager, Version=6.0.0.0,
@inland rain I'm converting a mod to Custom Mounts and it's very cool, thank you! Unfortunately, I have run into a slight issue with translation: because the Stable field for the mount takes the building name rather than its ID, I can't allow the name to be translated into other languages without losing the connection between the mount and its stable (building the stable spawns a vanilla mount instead). Is there any way to let the Stable field use the building's ID instead/as well?
buildings have IDs?
Well, they don't have an ID field but in Data/Buildings they're listed like this so I was taking that to be an ID
(The Stable bit, not the Name)
Dictionary key, I guess?
okay, the problem is getting the key from just the building... lemme see
Thanks for having a look at it. If it's not going to work I'll just make a note on the mod page that the building name has to be English.
i have two questions about the wiki:
- can/should i remove
Content/from this? i don't recall any other parts of the wiki having that, and it confused me into thinking my target might need to beContent/Data/Festivals/myfestivaldate - can/should i add a note somewhere that a mod wishing to add a custom festival needs to also edit
Data/Festivals/FestivalDatesin order for it to work?
i would go for it
Just add a sentence at the end "also there's FestivalDates"
phrased better tho
(If you feel like adding the current festival data for fall27 while you're at it, I see that's currently 1.5.4 so it's a bit old. No pressure though)
sure! do i just copy paste directly from the unpacked file?
Is that a feasible change?
Yup, just make sure it looks the same as what's currently on the wiki page as far as formatting etc goes. If there's been no change to the data since 1.5.4 it might end up with identical content too but that's ok if it does.
updated on nexus now
You are speed, thank you! Will that break the existing mods using it? I'm happy to contact them about updating if it does.
(you might want to reach out to the two existing mods using Custom Mount since that breaks them)
whoops beaten
yeah I downloaded the code, it definitely breaks them
0.6.1 should fix that
speed x2
Wizardry
just don't test your code, is my motto
:'(
Ah, of course. Babby wiki editor. That's okay, don't stress about updating the raw file. Just do the little edits you initially intended.
okay
where do i put <IgnoreModFilePaths> again?
yeah it kinda sucks, you can't make edits above a certain size or include any external links
I can do the raw file edit if you already have it ready to go
I think I'm allowed now
yeah, how do you want me to get it to you?
your csproj
Up to you, if you want to bung it in a file and send it over might be easiest
https://www.nuget.org/packages/Pathoschild.Stardew.ModBuildConfig#configure for more details on what the fields do
this is the content of the entire page
Okay I'll add the relevant bit in when you are done with your edit, so let me know :)
[23:15:14 TRACE SMAPI] (Error: System.Exception: Rewriting Microsoft.Scripting.dll failed.
---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'System.Configuration.ConfigurationManager, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
``` im lost
done!
if someone can better explain what Data/FestivalDates actually DOES be my guest; i only mentioned it existed and mod authors should add an entry for a custom festival
can you post what your csproj look like
(though you may want to ping sinz for help once you do, I'm not very familiar with this stuff lol)
Hooray, German Enchanted Grove!
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<BundleExtraAssemblies>ThirdParty, System</BundleExtraAssemblies>
<IgnoreModFilePaths>System.Configuration.ConfigurationManager.dll, System.Security.Permissions.dll</IgnoreModFilePaths>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IronPython" Version="3.4.2" />
<PackageReference Include="IronPython.StdLib" Version="3.4.2" />
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="4.4.0" />
</ItemGroup>
</Project>
``` i already pinged lol i cant do it again
- what bush are you even talking about because the one in your screenshot earlier is not in the rectangle you've specified? 2) are you sure its doubling and not just a dark shadow?
hmm that looks correct to me, I got nothing lol
you might get away without the IgnoreModFilePaths at all then, my smapi install has had a bunch of extra schenanigns in it so I might have just inherited weird stuff
i typoed the coordinates; i meant 42, not 62. but that makes me more confused because this is what i'm seeing
as my smapi-internal folder has both of those dll's in it
ill try it
changing the coordinates has made the shadow lighter, but the bush is still flipping
are you testing on a minimal mod list? i shouldnt even think thats possible as the dictionary that holds terrain features is keyed on the tile, and the function wont add anything if theres already something on that tile
it's my mod, dependencies, and some QOL C# mods. i can try removing everything but the absolute bare necessities
does it happen if you just do Spiderbuttons.BETAS_ClearTerrainFeatures Town with no further arguments?
let me try that
actually, scratch that, it checks if there's a terrain feature in the GameLocation's terrainFeatures dictionary, and if not, it adds the bush to its largeTerrainFeatures list...
it looks like two bushes, but no flipping or duplicated shadow
yep:
// untested
"Action": "EditData",
"Target": "Data/TriggerActions",
"Entries": {
"{{ModId}}_TerrainReset_TNT": {
"Id": "{{ModId}}_TerrainReset_TNT",
"Trigger": "DayStarted",
"Condition": true,
"MarkActionApplied": false,
"Actions": [
"Spiderbuttons.BETAS_ClearTerrainFeatures Town",
"Spiderbuttons.BETAS_RegeneratePathsLayer Town 9 42 11 11",
]
},
}
},```
oh not a fresh save, let me do that
fresh save, day 1, bush flipping. haven't tested sleeping yet
same thing day 2
@lucid mulch it seems an error with Microsoft.Scripting.dll heres the full error
Log found, uploaded to: https://smapi.io/log/baa02de3d12c4ed088a03a67ea469e23
if (!this.terrainFeatures.ContainsKey(tile))
{
this.largeTerrainFeatures.Add(new Bush(tile, 2, this));
}
i dont know this area of the code well enough to know what the reason is that it checks terrainFeatures before adding to largeTerrainFeatures. even though it shouldnt matter here anyway since I clear both with ClearTerrainFeatures..
can you try splitting them into two different Data/TriggerActions entries?
sure
okay i forgot i had a second patch targeting this area. my coordinates weren't typoed, i did genuinely mean the other area. testing both together now, then splitting them up. sorry for the trouble if this was the problem
(this is why i will always say people should send their entire jsons and not snippets)
(regardless of whether or not they think anything else is relevant)
as in theyre split up now, one trigger action per, or as in theyre both inside a single Data/TriggerActions
i have two trigger actions total. one for area #1 and one for area #2. each has two actions: one action to clear and one action to regenerate
Raw data updated now too, thank you!
and it works fine now with no duplicate bushes?
yep, no duplicates, no dark shadow, no flipping
remind me in 18 hours to add a note to the BETAS docs about clearing before regenerating
really spiderbuttons? that's what you need a reminder for? okaaaay (#6899695) (18h | <t:1760052696>)
do you want my patch?
