#making-mods-general
1 messages · Page 41 of 1
easily shoot* (new keyboard woes...)
ralo there is literally nothing you can do here without C#
you will not find any texture for this. you cannot do it
alright 
the game uses staminaRect to draw the big blue box in the sky, and staminarect is just a 1x1 white box that is created as a texture in C#, not with an image, when the game loads
all this intro talk made me remember that unholy mayo grandpa that i did...
changing a color is probably simple enough you can get into it without MUCH hassle and then you will start coding more and get good at it and then you'll get into complex modding and then into gamedev and then
it stretches that 1x1 pixel out to the size required
and puts a layer of colour over it to make it blue (hrdcoded)
mayo?
for a while it was a thing to do totally funny mayo mods
like mayonase? XD
and I did mayo grandpa that was basically addicted to mayo but also a jar of mayo
yes
I wasn't even using mods during the mayo times lmao
wdym "totally funny" the mayoverse was very serious /s
(oh i remembered now why i wanted the footgun, it had something to do with the randomization of birth/adoption events)
funny as in joyous ofc
i never heard of that. i need to see lol
i dont know how it would help here either. you cant alter the code of any events, just run a trigger action action either before or after an event, and possibly change the value returned by the function if its a primitive/value type
i want to make a cursed mod where i turn literally everything into pam xD
unless theres one single function where all it does is check if adoption should happen today and returns a bool
public override bool setUp() i imagine this ain't it
but cracks knuckles back into the decompile i go
i started a mod where i turn every townsie into a sock....good thing I stopped at abby already
there are a ton of things that have a setUp function so i dont even know what function you're looking at
sorry brain, it's in the birthingevent.cs
lmao nice. i love cursed mods
as far as i recall from the last time i looked at it the code that checks whether or not the spouse should ask to adopt or have a kid just checks a couple things and then makes a random check in an if statement
so theres no way to manipulate that random check
this is all i have to show for it, might come back to it when i hit dark times and need something to laugh at
that's the backburner then-
nice xD
you need to put googly eyes on it
Sock puppet villagers would be hilarious lol
looking back to it it wouldve been funnier if everyone were sockpuppets
you could, technically, patch the random.NextDouble() function and change the result of that
however i dont know what the consequences would be of doing that overnight
lmao yeah that was what i thought at some point tbh
when a lot of other stuff probably also uses that
Sockdew valley.
maybe i will revisit the sock townsies one day
like one day i will continue the townsies as goths portraits
sockel doo di do?? idk it sounds good in my head lol
but yeah if anyone wants to show off cursed mods, feel free to ping me ;p
(ftr avi when i say "a lot of other stuff" i mean this isnt a stardew random check this is literally System.Random, so. id expect it would break a shit ton of random rng checks that should normally happen. but who knows maybe you're fine with breaking them for one night only)
there wasn't anything else i can think of off the top of my head that i could throw a prefix in with the footgun, most of my problems will come from my actual c# implementation
yeah i figured i need a specific bool checking only for the adoption/birthing question
it would actually be very very easy to write a transpiler here
it just hardcodedly checks whether the rng between 0 and 1 returned less than 0.05
so you could just change every instance of 0.05 found in the function to like, 1
you'd wanna double check you wanted to change it first which would ideally also be in the transpiler but that wouldnt be too difficult either
I believe this is in NightEvent.cs (or something similarly named) and you can probably change the result in a postfix if I'm understanding what you want
alternatively if you're already using C# anyway you could just patch the transpiler when you want to and unpatch your transpiler when you dont
its in pickPersonalFarmEvent
i was gonna attempt to set it to a different bool, something like being able to set it to a gsq
the BirthingEvent itself has no RNG thats when the child arrives. you cant delay that and probably wouldnt want to
yeah my baby steps of even trying to make the angry goose is going to be my toes into c#
...then it's maybe the birthingevent derandomization... then it's the karaoke suffering
(also to clarify, you could do this in a normal postfix absoutely. we were talking about my weirdo BETAS feature though that lets you define incredibly simple postfixes using Content Patcher, which will only let you change the value of a result if its something like a bool or an int)
(at the time that message was sent anyway. it did move on to normal C# afte tht)
(i swear i will get used to this new keyboard eventually pls forgive my dumb typos until then)
(you're just leveling up to your purple shorts)
Random r = Utility.CreateRandom(Game1.stats.DaysPlayed, Game1.uniqueIDForThisGame / 2uL, 470124797.0, Game1.player.UniqueMultiplayerID);
top of the function
Probably my most hilarious random yet
Atra needs little segment drops where a banner comes down and some music plays
this is an unrelated question now, but what does "file" do before the "sealed class" part
i havent seen that before
xkcd style, nice
interesting... is there a practical use for that in a stardew mod vs just something like private
would that let me yoink the random and not screw with the other randoms? 
i imagine so since yours is quite literally "no random i'm done"
technically yeah if you replaced that random declaration with your own. but a postfix would be easier
I'm persnicky
in normal C# land dr elizabeth mathperson was right you can just normally postfix this
I don't like it when my code has random boring irrelevant classes in internal name spaces
you dont need to change the existing rng check you can just do your own afterwards
I like things to be clean and neat
fair enough
ooh, yeah I missed that part
tbf to you, people should probably ignore that feature more often than not 
SoundInTheNightEvent.cs or whatever it's called is kind of a funky class generally
It's full of like a mix of content (events code) and C#
(the footgun will most likely go unused, i am just itching to do c# but something isn't clicking in the gears)
on a list of things that could be bad choices to start figuring out how to use C# for, this probably isnt on there at least
most of the code is already written for you from the original pickPersonalFarmEvent, you can just copy it but without the RNG check into your postfix
and if it resolves to true then change the __result
assuming you're trying to guarantee it happens
probably want to check a mail flag or something too so you're not doing this every 3 days or however long it takes for a child to be born
i'd probably set it to the mailflag
well, you'll still wanna check the other stuff anyway
yeah the birthingevent.cs has the -- ok
just to make sure that they are actually married, the player is actually at home, and that the NPC in question can actually have/want kids
(and that they arent already setting up to have/adopt kids)
sorry, pigeon brain got distracted, i could probably add the using reference to the birthingevent.cs to grab all of that necessary info though, yeah?
you dont touch birthingevent
you just patch pickPersonalFarmEvent
which is in StardewValley.Utility
pickPersonalFarmEvent returns a FarmEvent to whatever calls it, and the QuestionEvent it returns for adoption/pregnancy s one of those, so you would just intercept the function after it finishes to go "you're trying to return the UFO sound in the middle of the night event? sorry, actually, you're going to return a pregnancy/adoption event bc i said so"
(actually it would be the "dogs" nightly event not the ufo but w/e the concept is the same)
hey yall, i need some help with checking my content.json. is this the correct format for adding a new minecart network that's only available after finishing the boiler room bundle?
You're trying to create a new network or add to Default?
i dont know the format off the top of my head but i do wanna ask if you know why you're putting your DisplayName inside a LocationName tokenizable string
new network
im following the format on the wiki but decided to make an i18n entry (? sorry i dont know the proper term) for the destination name. why do you ask?
this is how I added a new stop on my farm.
{
"Action":"EditData",
"Target": "Data/Minecarts",
"TargetField": ["Default","Destinations"],
"Entries": {
"Zinnalynn_ModdedMeadowFarm": {
"Id": "Zinnalynn_ModdedMeadowFarm",
"DisplayName":"[LocationName Farm]",
"Condition": "LOCATION_ACCESSIBLE Custom_ModdedMeadowFarm",
"TargetLocation": "Farm",
"TargetTile": {"X":38, "Y":13}
}
}
},
{
"Action": "EditMap",
"Target": "Maps/Zinnalynn_ModdedMeadowFarm",
"MapTiles": [
{
"Position": {
"X": 38,
"Y": 12
},
"Layer": "Buildings",
"SetProperties": {
"Action": "MinecartTransport Default Farm"
}
}
]
},```
That's still not a new network, hang on
because if its a custom location you can just put the {{i18n}} token directly
The LocationName is for pulling the DisplayName of the location, you don't need it if you're gonna use an i18n token
im not even sure if itd work inside the LocationName token if the i18n doesnt resolve to an internal ID anyway
oh, this helps a lot. thanks 
it looks like itd just return an error so yeah i think you need to remove it and just put the i18n directly
alright, i'll try it out
You wouldn't use TargetField if you're creating a new network
(an error and make the string null, anyway)
Your whole Entries section should be the establishment of the network with the destinations in it
The default would just be changed to what the new network added is no?
If you want the whole network to be locked behind the boiler room, you can use the UnlockCondition field otherwise if you only want some of the destinations locked then you need the Condition field in each destination entry
I don't think TargetField creates new entries if it doesn't exist
not if theyre adding a new entry entirely to Data/Minecarts
ah
alright so: i delete the TargetField part, put the {{i18n}} token directly, and since i want the whole network to be locked behind boiler room, swap Condition for UnlockCondition?
Not exactly, I'm making an example, gonna take a minute though
I actually had to put a fix out for that one today because I had it set to target my map file, so taking it would just reload a fresh version of the map instead of taking to the one that's already been worked on.
ill let roku get the example ready but you'll need to change the structure of your entrire entry
bc currently your existing json is right if you just want to add one destination
not a whole new network
(or it would be right if you were targeting the destinations field in default, but i digress)
if you open up Data/minecarts in your unpacked folder, that entire block that starts with "Default": { and ends at the bottom of the file, is what you'll need to make for your new network
but just to be clear, this is creating a new network entirely, not a new stop you can choose from the normal minecarts
yeah that's what im planning, making a new network
with just the one stop?
{
"Action": "EditData",
"Target": "Data/Minecarts",
"Entries": {
"{{ModId}}_YourNetworkNameHere": {
"UnlockCondition": "PLAYER_HAS_MAIL Host ccBoilerRoom Received",
"Destinations": [
{
"Id": "FarmCave_SG",
"DisplayName": "{{i18n: ui.farmcave.mincart}}",
"TargetLocation": "FarmCave",
"TargetTile": {
"X": 8,
"Y": 43
},
"TargetDirection": "right"
}
]
}
}
}```
i was going to make two, sent that snippet to check before i do the other one :)
gotcha, just making sure. remember you'll also need a tile action (or w/e its called) on your map to open the network list too
thanks
i'll write this up and take a break after haha
goddamn it's 3 am already????
Big mood
time for a burger
Time for more caffeine
sleep deprivation ftw
the silly part is that this map is like, 2 small maps put together, but somehow writing up this cave area is the one that takes ages
(oh there's already plenty of mods that affect the baby chance thing, i can just read this and infer since my brain is empty, i am but a pigeon)
very good thing i've playtested everything else but the cave
Man, tell you what, Tiled doesn't like when it can see all of a map that's 500x with even just one layer full
Does this work for multiple different conversation topics? If so I assume it works like /e where you must input the precondition for each one as in /A <ct1> /A <ct2> and so on?
are you using content patcher?
if so, i'm not sure how universal it is but i think it can be used with most EditData patches, you can probably use a "When" attribute. I have never made a mod where dialogue was added though, so like... idk, that's just my guess. it's how I usually set additional situational requirements
are you responding to Konata? theyre asking about event preconditions, something entirely different from content patcher when conditions
oh okay. yea i was. it was just my guess. i had a question but i didn't want to like add it and then bury them lol
(i dont know the answer, is why i havent spoken up before)
event preconditions refer to the requirements the game checks when it sees if you have any events to watch when you enter a location, so something unrelated to editdata or when conditions or anything like that
feel free to ask your own question tho!
I don't know what other rendering issues there were, but it looks like the tree rendering one still happens with maps wider than 199 tiles
That's amazing
Do you see z fighting/flickrr?
(i tried digging into the decompile for the A conversation_topic and came up empty, i imagine event lookup would show it though considering it shows all of my chaos as long as it's not behind a 'when' condition)
I'll have to check when I get back
❤️ ty! I just realized i had one more idea to try first
Hi trying to figure out Farm Type Manager, and I'm going off existing mods' jsons for examples, I think I completely understand the Areas : [] portion, but I'm trying to grasp the purpose of everything after that. I'm noticing different jsons re-add different vanilla features? Why is this and which ones should I worry about in different cases. Sorry if this is super confusing, I can explain more with the files I'm working with.
I wouldn't be surprised if you got it on big maps
what do you mean, re add different vanilla features?
looks fine, let me try and just trigger one of them and see though
works just fine with just A {{conversationtopic}}/A {{conversationtopic}}
"Testing/A {{ModId}}_Conversation1/A {{ModId}}_Conversation2/f {{Marlon}} 250": "continue/64 15/farmer 0 0 0/pause 1500/end"
So in the content.json files theres "Large_Object_Spawn_Settings", "Ore_Spawn_Settings" and the like, where they appear to have some fields specific to vanilla features
like what?
are you infering only from existing mods? the docs are pretty good https://github.com/Esca-MMC/FarmTypeManager/blob/master/readme.md#large-object-spawn-settings
Nice, thanks for the thorough answer.
Here's a quick example https://pastebin.com/c7krxQTz
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.
yes, some mods use FTM to spawn ores nodes to specific quarry locations, which wasn't possible without FTM in previous versions of the game, but i believe now can be done with map property/CP too
however if you make a non farm map it's still useful to have FTM for that
I'm not looking to do anything with ore spawns, I don't think, I'm looking to add new foragables to be dug up
Thanks so much for helping btw, this is my first time working with FTM
Is FTM now not required at all? A lot of maps still require it (could be holdovers who don't want to update to CP).
FTM is pretty much required for a lot of stuff still
FTM is actually the spawn stuff framework
not the custom farm framework
if u wanna spawn stuff u need it
So I could make a quarry on a farm without FTM, but to do it fancy you need FTM.
forages can be added by CP BUT you don't get that much control of stuff like spawning in specific areas of the map and there's no real way to have stuff like "spawn 5 mushrooms after each rainy day"
yea iirc game only has basic quarry tiles so u cant customize
ahhh very fancy spawns, makes sense.
There's also technically still a benefit to using FTM for forage spawning even without any special conditions (vanilla can only spawn a small amount of forage at a location at a time, so the more modded forage you have the less likely you are to see a lot of it)
(i really appreciate being able to do stuff with CP, but while it can handle pretty well any sort of elaborated condition for what to spawn, the when/where is limited)
Makes sense, time to keep using FTM
(technically mods can increase that value but they can't know how much forage mod you'll have so yeah)
i had a mod that used only CP for the rerelease that will also have FTM in next update because it's more convenient with it for some stuff like, indeed, ensuring that i add to vanilla forage rather than replacing it
(last time I saw someone talking about it they couldn't change the max amount of forage a map can have at one time?)
(i dislike strongly being in spring 13 with still no dandelion found)
(there is a field for that in theory but maybe vanilla maps are ignoring it somehow?)
Ok so stupid question, what happens if I just leave everything in Ore spawn settings blank or null? (I'm looking at the FTM readme again and the specific names of these fields are indicated as (global)
Huh, didn't know that one was a field; still, it's not likely forage mods will change that field since they don't assume players will be playing with a lot of forage-adding mods (and even if they did it would likely still become too low at some point) so FTM is still favorable in some cases
You can just leave off bits you don't need iirc
I think it's mostly great if you want to make a forage map
I'll try it yeah, does the same go for the global(foraging) index that adds the vanilla forage? Like, if you're changing "Forage_Spawn_Settings" do you need to always have a section for default foragables?
(yeah it's not like you can do stuff like "existing value +2" or whatever)
No z fighting or flicker with just these trees or the environment/character. Anything in particular I should test it on?
Hm, don't try to take a screenshot of a 500x map
It does eventually work, but wow that took a long time
It's a uh, 32,000x32,000 png lmao
Well, based on previous messages and my testing, I think the rendering issue with height is no longer a problem
I'm sorely tempted to reduce the width of my map and scale up the height just to see how far I can go before I break something else
int.MaxValue height
so you're telling me i can make a 199x2000 map and nothing'll break?
I can test that lol, I have only gone up to 500 so far
(something will break by 2000 i just know it)
Technically even at higher than 200 on width, the only issue I'm seeing is the tree stumps rendering over the trees
I honestly think that Tiled is going to give out before SDV does
I think if I stay zoomed in then it should mitigate most of the slowdown issues I'm getting in Tiled lmao
when are you porting daggerfall into sdv
say what are the reasons to use smapi reflection helper
i ask cus i had some reflection stuff with in a static method, and im unsure if its worth refactoring to use helper
Multiple layers like back2
smapi does some caching stuff with reflection i think
my chaos map was working pretty well, given, it's not a real map so i don't really want to bother creating a location for it, but the buildings layer worked fine for blocking me out 
I'm kinda surprised at the lack of zfighting
i was gonna change the code to cache FieldInfo yea 
My tree stacking at the top of the map is using 4 Buildings layers and 2 Back layers to get it and I don't notice any flickering up there
but if i use smapi's would it be shared across mods and be nicer
disclaimer i have no idea WHAT kind of caching or optimizing stuff it does i just recall it. i dont use the helper
Yeah smapi would do that
I tend to want to go one step further and cache delegates
Which smapi does not do for you
Width wise no flickering, so I'll move some down lower and see if it happens there
Yeah, I expect to happen at around a couple of hundred in the y axis tbh
Put some down at the very bottom, close to 500, 500 and they look fine
Running around, staring at them, nothing really changing
but do they change when theyre not observed though
Hm, Schrodinger's pine tree
possible name for a candle scent
Lmao
oh yknow, that's something i'll probably put into my expansion, "treants"
You walk off screen, come back and that tree is just gone
exactly, terrifying
Lol, putting in a 202x2000 map seems fine
No z fighting still, not seeing any rendering issues
I might be biased but maybe the load time was slightly longer
Interesting we had a lot reports of z fighting on 1.5.6
Maybe monogame made the sort on that stablw
I'd seen a lot of people saying they thought 1.6 changed the size limitations, but nobody was very sure which is what led me down this rabbithole, so maybe the rendering is at least fixed
Aside from trees when the width is over 199
Though it's actually trees that are past 199 on the X
is it "trees" or any terrain feature
And it's only ones you can chop down
Hm, good question, not sure what other terrain features I can plop down
Without some C#
Trees (and in turn fruit trees as well) are the only Terrain feature I know that is split into 2+ parts so it couldn't happen for other terrain features
Hello, does anyone know what event or at what time this lewis sprite is used?
When eating the big omelet
It's an event that happens after you complete the egg special order
thank you very much!!!!!!!!!!!!!
I can now move forward with my mod
Event ID 3206194 in Data/Events/Saloon, if you need that
Making a new map but I want it to have a puzzle mechanic anyone got ideas. I was watching pokemon fire red stream and saw one cave with a "don't step on twice tiles". How to best implement?
I already have a Map with hole sprites touch action warps
is there even any 'sliding' feature 
ig you could also do an invisible maze in the form of the pool, with 'whirlpools' that teleport you out/around 
Sliding like forced movement?
horse only tiles 
Chair puzzle, you have to bring a chair to bypass obstacles (I actually don't know if this works anymore lol)
how cursed
but hm i can sort of imagine how to do forced movement
you need to set farmer CanMove false
and maybe use specific frame
Doesn't getting into and out of water have forced movement?
Forced movement is easy
(if you mean like chair to get to the secret woods early etc, pretty sure it does, I think CA has left that working on purpose, and I know people have gotten stuck on a modded map once because a seating tile kept putting them on the side they weren't supposed to be able to access)
I was so disappointed the first time I ran at a ledge in this game and stopped dead
How do you do the mods on Stardew PC version?
If you mean how do you install mods, #modded-stardew has some pinned info that will be more helpful
Were you looking for that or help getting started making mods?
changing time with console commands briefly lets you see the world without natural light.
i must uncover the secrets of the shadow realm(tm) to exploit for my own nefarious ends 
i was hoping for an outdoor ambientlight so i could have a darker feel for my maps 
You can use AmbientLight outdoor if you set the location to ignore outdoor lighting
I can't remember if that's specific to a location type or something you can change
yeah i'm digging through maps docs
is it... TreatAsOutdoors..?
says spawning though idk about that
I'm gonna guess it has to do with the location type rather than anything you can set
The Woods uses it, but there's nothing in the properties for it
Yeah
I swear I once had a custom outdoors map that used AmbientLight with no issue, or maybe my memory is failing me 
Woods has a whole method for messing with its lighting
It's location reset method disables ignoreOutdoorLighting and then calls a method that does a bunch of hardcoded lighting changes
@ivory plume good morning, new 1.6.9 map property flags request 
Type (Optional) The full name of the C# location class to create. This must be one of the vanilla types to avoid a crash when saving. There are too many to list here, but the most useful types are likely StardewValley.GameLocation (default value) and StardewValley.Locations.DecoratableLocation.
would i be able to throw StardewValley.Locations.Woods into that
Well there's consequences
Yeah, but I don't know if AmbientLight would actually work there
Of becoming secret woods type map
ah right NPC pathing
Gotta read whole class and make sure it doesn't have side effects you don't want
shakes fist at npc pathing
npc pathing depends on the location name, not the map type in this case
you'd also get a slime infestation
No NPC Pathing should be in Data/Locations
instead you'll get hardcoded tile behaviours, slime spawns, seasonal debris, light shafts, secret stardrops, etc
This is a benefit, adds like 10% property value 
it might also force your health bar visible while you're there, but not sure
You can always become C# mod now
you could, but the more vanilla capability the better
Custom location class had been a theme last couple days
Also a benefit, as far as I'm concerned :P
(sorry about that)
(I made my health bar always visible lmao)
(my memory was indeed failing me, the location does indeed still use outdoor lighting)
There's only a couple locations that hard set this bool to false
You shouldn't even need harmony to change it for your specific map
throws it into the endless void of c# code that i have stockpiled but have no idea how to implement
Sounds great for a framework!
Yeah I'm like seriously considering it lmao
shhh i'm trying to get it in vanilla
Data/Locations have a CustomFields
don't spoil my focus
(i dont actually know what you guys are talking about)
Easy ebough to do in a ltitle custom fields
i hate custom fields. it doesn't respect my ideas
We're talking about our ocerdramatic coffee maker of cours
My last like 2 or three mods now have been based on CustomFields lmao
yea it is bit succ that u can only str in there
"that's too little content for a framework" crosses my mind meanwhile I have a "framework" that just allows special orders to be untimed, probably same amount of code
does C# have equiv of ast.literal_eval 
At the rate I'm going, I can mash all these CustomFields frameworks together and call it CustomFields Utilities or some crap
custom custom fields...
Custom Thing Fields, or CTF
Unlimited Custom Fields
Customizable CustomFields Custom Edition
what do you need this for
Uh
Why
Probably yes. But why
yea ig it make no sense in strong type language
and i should really just go json str -> newtonsoft -> a model
tbf literal eval like that woulda been very nice for BETAS
but the only good solution i found woulda required me to ship another dll with it and i didnt want to
but if you didnt care you could do it
Clearly everyone should just make their own core lib as I once again ponder the lack of unit tests on atrabase and what I can rip out for net 9
absorbs everybody's mods into SpaceCore
it's that perpetual self conflict, do you become another spacecore and dump all of your ideas into a singular core, or do you pump out little frameworks
id rather everyone had their own core lib than everything shoved into spacecore
(Net 9 makes me actively happy.)
I sorta agree, but on the other hand... so many deps to download
(with nothing against spacecore, i just like when the mod i install for dependency reasons does what i need it to without anything else)
So much of AtraBase can get reimplemented better. But that is #programmers-off-topic
IMO there's a balance between "everything in SpaceCore" and "this framework dehardcodes exactly one function"
i'm pretty sure that's the neverending debate in modded-farmers as well
True - originally the dungeon stuff was gonna be part of a new framework for example.
but how do you get to the middleground without starting at dehardcoding one function, bc the alternative is to give that dehardcoding to spacecore
There's a third option, actually
Get Pathos to de-hardcode it in the game 😛
(Or me, if I would actually take the take to do some of these things)
yeah we're kind of in a beta with our favourite peon senior software developer at the wheel
is it too late into 1.6.9 to ask pathos to turn literally everything into a variable i can change at will?
i'm sure we can make small requests for single properties to be added to a model lol
this is for content code 😌
i dont know what you mean but dehardcoding things would be very good for non content patcher mods too
i would appreciate being able to dig into those bools from cp (from data/locations)
You're a wonderful person and also could you make those three map properties
(Also fix the issue with backgrounds and sleeping in a tent on island north.)
i'm willing to pay off roku to remove marnie's monopoly
I do worry about frameworks getting too big but I personally understand the extensions part of spacecore so I guess I worry less about that
Buh, UI hard
ik u can do the second one in other ways but it bothers me that they left sunflower seeds where they are in Crop.harvest
It's a "machine" that's an (O) and not in Data/Machines
Yeah, like, I wouldn't add something crazy like a magic framework to SpaceCore
my biggest personal issue with huge frameworks that do everything is that it is impossible to find a framework you need unless you already know that e.g. spacecore has something for it
Also like this is active modder conversation now so I'll go debug work's coffee machine now
Have fun!
(or ofc by asking in here for smeone else to already know for you)
yea nexus search problems
Normalize describing every detail of your mod in the title
are we gonna become amazon titles
(I would be happy to let you absorb my mod Untimed Special Orders into SpaceCore, considering it's heavily based off of code I already borrowed from you once, i think that's fair enough)
I'm gonna need Nexus to increase SpaceCore's title limit
while we're at it can we normalize putting your commonly used acronyms in the title of your mod too
On the bright side if you want to make your own Crab Pot-like items, there's a framework for that. No item query that mimics its behavior yet though
(I did notice it looked awfully similar to the S&S code 😅 )
I suppose there's LOCATION_FISH but it needs tile coords, and vanilla machine data don't pass that stuff in yet
Somebody convince me to do something productive
are you finished with your website
Please do. It's silly every blasted major expansion has that code
(yeah i asked you once if i could borrow it for a mod of mine (not untimed special orders, another one), and then I was like "this could be easily converted to be more versatile and let people use with CP", so ;p)
Debug my work coffee machine?
could i interest you in several hardcoded map properties
you have docs to migrate still right
Nope
I worked on it some yesterday
I'm not saying I'm looking for something productive to do
I have a list of things I could be doing
Instead I'm... sitting here chatting in #making-mods-general
oh convince you to do so ok
Oh. Go do something productive then

Enjoy!
i'll trade you cat pics for you to be productive
.choose casey should do something productive, casey should take a break
Choose result: casey should take a break
well SOL
i need to conjure a visual indicator for "edited"
It’s too late at night to be productive
my attempt at convincing: it becomes easier to be productive with stuff later if your personal website for docs is set up to easily add more documentation later. the sooner u do that the sooner u can triple ur productivity for free. dont ask me to show my work on that
It's totally not
it is, it's currently 2am which is way too late
An asterisk *
It's only 7:00 PM here
I'm still at work 😦
Oof
i also agree with asterisk
where would it go tho
Noooo
I have that weird problem of "oh no, only 2-3 hours until I go to bed, that's not enough time for anything"
but yes asterisk is what i think of too
Top right corner
I should do laundry tbh
except i think its a funny symbol in sdv font right
top right corner, maybe add some padding first
If you can, probably needs an outline of an opposite color to it
That way no matter what it's sitting on, it should be visible
I thought I had weird hours but nooo
I'm hoping I get to go home before the sun goes down
I think asterisk is still in the font? I thought I was using it in a letter since you can't do italics
you could also try adding some slight tint of some colour to the background of machines that are edited
or the border around them
Yes
Tinted border is also good, though I would definitely need to know beforehand that it was intended to mean something special
Even if I don't know that asterisk indicates that something has been edited, I at least associate it with something is special here
Tinted border + add "Edited" to the tooltip?
if it only tints after you edit the machine, i think it would maybe be intuitive enough if it changed only after you changed things
Render the machine in italics
Ah, right, let me just pass SpriteMode.Italics to SpriteBatch
there's no indication for an enchanted tool, is there?
Nope
Slap EDITED diagonally across the image
I've seen the word edited too many times now and it's starting to both lose meaning and look like it's spelled wrong
honestly the qualifier could also be a good indication since that means it's been "touched"? idk
Everyone loves some good old semantic satiation
i actually wanted to do gray scale but that doesnt seem like something already in spritebatch
WOW I can't believe Casey ignored my offer for Cat Pics, hurts almost as much as hamster pic rates /s
(For anyone who doesn't know what hamster pic rates are, good, stay oblivious, I'm not telling /j)
it'd have to be some actual filter aka work 
gray scale would indicate to me that its disabled or unusable somehow anyway
not just edited
Right before you posted that I received a cat pic from someone else, so...
yea hm
Render the machine in 4k
Are you saying my cat pics are worth less than theirs? 😔
Considering yours are currently just hypothetical? Yes
no
Damn
(i would've suggested a pencil looking thing as the other option for an indicator but i don't think we have one?)
(then make one)
Show the git diff interface
pencil to me = edit_able_ but not edit_ed_
ah yeah true 
(for the curious yes I am a crazy cat hamster lady rambling about the craziest of things)
(More surprised that you value your hamster pics so low then)
(it's not me that does; it's casey she set the conversion rates)
(I'm more of a cat person than a hamster person, you see)
(The things that happen on the ES server)
(Ah, a biased system /j)
(would that green x be more understood as like, did you touch this? you did)
my pigeon brain was still digging through cursors 
Green X feels more like, selected?
welp i give up then, i'm out of ideas
I feel like you saying “I’m more of a cat person than an X person” is true for many such X
I agree that since the effect only shows up once the user edits a machine whatever effects you pick probably isn't that important
(I like the pencil though)
You're not wrong
Dr. Elizabeth is bisexual flowers
(i wish that we could access the ES quotes here so I could share hamster pic rates related quotes, but on second thought I don't want to come off as more unhinged than I already am)
I am a delicate wilting flower
Oh no
(Ok maybe I’m not actually very delicate or wilting)
Where does one go to learn to use content patcher?
i'm a chess piece that wore a mouse costume for a little while
There’s a page on the wiki with some basics, let me grab it
!cp
Content Patcher (https://www.nexusmods.com/stardewvalley/mods/1915) is a mod which loads content packs to change the game's images and data without replacing XNB files. If you want to make mods using Content Patcher, start at https://stardewvalleywiki.com/Modding:Content_Patcher.
Ah yes
It’s the last link there
There’s also extensive CP documentation in the CP GitHub
And you’ll want to unpack the game assets to reference them
!unpack
Follow this guide to unpack the game's content files in order to see and explore how the game data is structured.
It's helpful when making your own mods, or just to learn about how the game works!
Is there a command for those docs?
There’s some information on the game assets on the wiki as well
i don't think i even use the wiki for cp docs anymore
https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide.md
Uh idk one offhand but the docs are linked from the basics page
The basics page is literally just meant to get people doing “baby’s first mod” level stuff, once you’ve made one cp mod the cp docs are better
But it’s nice to have that wiki page with things broken down and terminology defined
i feel like any kind of icon's gonna be bit hard to see 
Anyone know which folder the Traveling Merchant cart is in? Having some struggling finding it..
loosesprites/cursors
which CP doc is it that explains the difference between game asset paths and filesystem paths? i consider that very important basic info to grok
But a very pretty flower
Is there one?
clearly time for glowing border
Wrote a rant on modding wiki on this idk about official docs
I recall a very spirited discussion on this channel eons ago about this, which is a good indicator there isn't any yet
I thought there wasn't a good explanation anywhere, hence why so much time was spent trying to think of a concise way to cram one into a command
The asset name in the Target field doesn't include the language. For example, "Target": "Dialogue/Abigail" (the asset name) will change the content loaded from Content/Dialogue/Abigail.de-DE.xnb (the file path) when playing in German. If you want to make the same change in every language, you don't need to do anything else. i don't think this is what you were looking for
(theres been at least two just in the time since 1.6)
(two discussions i mean)
i'm pretty sure i remember a game asset/file path explanation. maybe it was only good enough for me, a programmer, and not sufficient for laypersons?
I just stuffed it into a wiki page, it’s definitely way too long for a command
Maybe i should rename the page because right now it’s mostly about game content vs local files
it isn't at all possible to get the texture2d for a tilesheet in c#, is it?
can't even load it from temporarycontent since tilesheet image source is given as a local asset
maybe with a little butchery on the smapi asset key 
- Can't find something from the game? It's probably in LooseSprites/Cursors.
I hate how correct that is
or maps/springobjects
i think this mostly explains like, an adjacent but related thing separate from the asset name vs file paths issue that causes confusion (and spirited discussions)
Ah ok
There has to be a way
Maybe that one is on the wiki page for CP?
But maybe not
If it takes a whole discussion to explain it probably could be a wiki page instead of a command
it's only my own tilesheet so i think i can ModEntry.Instance.Helper.ModContent.Load<Texture2D>(where.Map.GetTileSheet(entry.TileSheetId).ImageSource.Split('/', 3)[^1])
well, i think part of the want for a command was to have something to link to at all
Or a section of a wiki page
Easier to remember commands with links than the links :P
"A filename is how your computer sees the file. An asset is how Stardew Valley sees it. You need to load your file into an asset before you can reference it in Stardew"
idk
I don't believe there isn't a way to get the texture2d
How does smapi load tilesheets
I never got the hang of texture management in C#
the bits are there. there must be a way to get them (but the way may not be pretty, or fun, or efficient)
Hah!
I wrote working code but I don’t understand it
were u doing things more than just load
i feel like that's gonna be my entire career for c# modding
nono i think i've got it, it's just being silly
just wrote the msg before thinking about it
This was JA code; tilesheet stitching
oh fun 
actually no it doesn't work since the map is loaded in a cp component and the code doesn't have those assets lol
Not pretty but it worked
No wonder, it's HIDDEN within the damn png with never ending cursors smh
does it have nice api like oiio or are u just doomed
i'll just add a load for each tilesheet in the cp component ig
Did you do the reflection thing Casey does
Or the weird rented array thing I did
No nice api tbh
You are either doing repeated get/set data
Or basically calling memcpy
Probably reflection. I understand the renting in theory but not in practice
I slowly sank into the NO ALLOCATIONS camp huh
Yeah you really went all in on performance at some point
(looks at your wearables implementation)
In related, I'm the "no seriously we need proper impedance matching" person at work
(And the multithreading I commented out from the macro pathfinder)
new TemporaryAnimatedSprite
say sdv being "not thread safe" is just about the fields on various sdv things right
can i bread just to load and preemptively cache some stuff in the back
Sure, as long as it's all internal to your code and no textures are involved
back in 1.5.6 i used a thread to load my mod's music after game launch, since each file took about half a second to load and there wasn't a good time to stop the world to do that
i gotta move the texture stuff out then 
but hm
the thing i wanted to cache is item textures for representing a context tag
For the record the issue is that you cannot draw, getdata, or setdata
rn i am just get those as needed, which is alright
On a Texture2d on a non ui thread
Also for the record you should be careful when even viewing data structures other people may edit
would it be too much to have a custom implementation of nighttiles involving critters
temp sprites just won't do 
Yay I get to go home!
Critters aren't even netsynced
Or serialized
Maybe clouds have feelings
@teal bridge hello it seems like ViewMenu doesn't check bounds of floating elements on overlay, so clicking on a scrollbar in an overlay exits the overlay instead of letting you interact with scrollbar
OK so it turns out Automate registers any CrabPot instance as a Crab Pot Automate machine, and your water sifter class inherits from it, so it wasn't as "not too hard" as expected. I can solve this one of two ways
- Make a PR to Automate to not register your water sifter in favor of my own custom integration
- Harmony patch Automate itself to do so
I'm doing 1(because I've committed enough Harmony crimes against Automate's code already), but that means the integration itself will be weeks away, until Pathos can get back to mod updating after 1.6.9. Just wanna let you know the status
It sounds like you've already narrowed it down, do you want to submit a PR? If not, I can look into it soon, though I'm in the middle of some other things right now.
yea sure ill poke around
i did attempt changing the check from outerbounds to containspoint but that doesnt work consistently 
maybe i just make FloatingBounds?
Given that floating elements can technically be anywhere, I think it requires an explicit bounds check for every floating element individually, otherwise you could end up in a situation where a float is way off in the corner and you can't click anywhere to dismiss the overlay.
kk ill see about why containspoint no work
Probably the best performance will be: cache both the actual bounds and a union of actual bounds + all floats, and then if you find a point that's outside the real bounds but inside the union, check the individual floats (that is to avoid iterating the list on every single hover event).
If you find yourself in over your head then no worries, I just got the impression from your post that you already had something figured out.
ContainsPoint would only be a world of hurt, you'd have to do translations to view-space and even then those queries are not cached very well.
i see why it is getting poped but i wasnt sure how to check real bound 
but yea what u said makes sense ill give it a shot
commit crimes against harmony
that's fair / understandable
Yeah, I imagine this could get a little finicky, I don't think I foresaw overlays and floating elements actually interacting.
selph what about junimatic intergration

#dehardcodecrabpots2024
Crimes with harmony against automate!

tbh a harmony patch might be better.
Like harmony patch a postfix to see if it sees a water sifter instead of a crabpot, to use the right bait
tbh I thought I made the water sifter it's own thing based off crab pot and not inherite the crabpot class.
I'm pretty damn sure you can just make the damn crab pot a normal data/machines machine tbh
actually, weirdly enough, and only if I'm reading the code right, Junimatic should just work™ because it doesn't do any fancy behaviors; it just tries performObjectDropInAction on every item in the inventory (compared to Automate's bespoke logic)
like there's a lot of stuff here by comparison: https://github.com/Pathoschild/StardewMods/blob/develop/Automate/Framework/Machines/Objects/CrabPotMachine.cs
Oh that's. A lot of custom logic tbh
yeah that does mean Junimatic crab pots don't benefit from the xp gain, or ||that book that gives a 25% chance to double harvest||
(do we need to spoiler 1.6 stuff in here?normies don't go to this channel right)
Yeah machine output delegates get the blasted machine instance
(not required just softly encouraged)
Should be super easy to convert to data/machines but also automated has a lot of caching
would be nice. definitely out of scope for 1.6.9 though
We encourage spoilering in here? I'd have to think that anyone who's making mods is going to expose themselves to the game content one way or another. I'm definitely not gonna spoiler.
I think you forfeit your right to be surprised when you start digging through the game's source/decompiles/unpacked assets, lol
its probably a lot less relevant now, s'just what the pin says from when 1.6 launched
I have still managed to avoid learning all the 1.6 spoilers
And I still haven't played enough to actually come across them in game yet either
iirc no exp is intentional for junimatic
Darth Vader is ||Anakin Skywalker||
Harry Potter ||was a horcrux||
Bella ||picks Edward||
What a twist!
I wish I had twists that weren't niche and could be spoken of without people being either confused or wanting to beat me with a folding chair for talking about it out loud :<
I wish T_T
atm it's a Frankenstein's monster of how it is set up.
I got the data/bigobject but when you place the object, I have harmony intercept the placement and instead place the water sifter object. Since for some reason crab pots (thus water sifter, fish net, ect) doesn't check for like what object to turn into when placed in the data and is handled by C# code.
u dont have to use big object for machine rule tho
Self-replicating furniture FTW
yeah, that's only one part of the hardcoded mess that is crab pots though
(to anyone interested in making a non-hardcoded water machine and don't fancy reimplementing CrabPot again, this can help: https://www.nexusmods.com/stardewvalley/mods/22975)
I know, crab pots don't even use the regular machine rules ether. they use a custom one in their own class.

is that made by some one named Selph
if it is, shill away
I might switch over to that.
sadly would kill anyone's water sifters.
yeah, pretty talented fella I heard
it's true!
I can confirm, it is true.
1.9 seems like it would be a good switching point
1.6.9*
I haven't spent much time modding lately. but today I spent some time fumbling blindly around writing controller code for hhd. and yesterday I added a thing for per-player instanced locations to mumps because it seemed like fun and I hadn't seen anyone else do it
I feel like I have no idea what im doing with controller menu stuff tbh
architecturally
your best, usually
HONESTLY
what is mumps
complicated menus are hard in stardew
my forever project to add random utility features for map makers
it's got some neat stuff in it!
MUMPS! I've been looking forward to that one
But at the same time, recoding the water sifter is going to be a pain in the behind 😭 already did it once
one of these days I'll actually test everything and publish it
I'm assuming you don't mean the disease when you say mumps
that is definitely more preferable than an infectious disease XD
the main thing I've been procrastinating on has been the Sound Code for music regions
how about Map Extension And Some Location Extra Stuff
easy: figuring out where you are and transitioning screen volume
hard: figuring out who should be getting music in split screen
maybe I could call it SMUT: Some Map Utility Things
MEASLES XD
okay but for real have you ever looked at the music priority code in Game1? it's headache-inducing
the correct solution is obviously play both tracks, one left channel and one right channel
taking notes
wait I could call it Some Useful Map Stuff
@teal bridge i attempted caching with ObservableCollection for floating elements but alas i forgor bounds dont get measured until later 
For now i just CountainsPoint, it is prob fine cus this is only on click, not on hover https://github.com/focustense/StardewUI/compare/master...Mushymato:StardewUI:master
maybe the caching ought to go on OverlayLayoutData
split screen co-op so cursed for making mods T_T
i like the sinz approach, it doesn't exist to me
Can you add easy lava method. Just spent days doing that
I did add a way to change water color with map properties. I'm not sure what all goes into volcano lava rendering, but if it's more complicated than water color, I can look into it
OH what if you added in the bool from woods
hm? like the lighting override? that's in there
yeah I mean I'm always down for suggestions
dreamy basically implemented the whole cooledlava bit iirc from volcanodungeon.cs
"You may fascinate a woman framework author by giving them a piece of cheese suggestion w/ the implication of using their mod"
hey, i definitely kept my promise, i just can't find a use for the secret note framework for my currently published mods
Is there vanilla touch warp that makes u jump in a hole
Aw ok
I have vague ideas for npc mod and one desire is ability to jump into a hole to go to their home area
ptsd about sims 1
What's sims
hell
That's where the caching goes, yes. Not sure where ObservableCollection would come into play, it's not used anywhere. Changes to bounds can only happen in a measure pass, and specifically a measure pass that returns true because something has changed. But it's alright, you've got a workaround for now and I'll take a closer look later.
sometimes u decide that a 1-line map property isn't cool enough, and u end up with a 700 line data file held up by 3 models across 500 lines of code and minus 3 hours
But is it pretty
knowing blueberry's track record it probably slaps
u right
Meow
Meow!
cant even send a timelapse since 8hrs at 1s=10min ingame turns into 30mb so you'll just have to imagine i did something cool 
Perms question: Am I allowed to make an unofficial update for a mod that's not open source? It's a simple mod (Fast Forward) so I just made a 1.6 version on my own, so while it technically doesn't use the same source code, I'd also feel bad not crediting the mod that it's based off of...
I’ve definitely sent “gifs” (webm or whatever it’s called) that size before 
i dont think thatd be considered an unofficial update, just another mod, if you didnt use any code from the original
depends on if you decompiled the other mod ig
if you wrote your own code that happens to do same feature i think it's fine
Hm, okay... I feel a bit weird about it, since it's not that it just "happens" to do the same thing, but rather that I intentionally wrote a replacement... Maybe I'll at least mention it in the mod description? An unofficial unofficial update 
i dont think the concept of fast forwarding time in a game is unique enough to feel weird about it, but its not like it hurts either, so you do you basically. but from a permissions standpoint, you dont need to
there's a mod line sprinklers that inspired line sprinklers redux, with the later not using any code from original
so does your version of fast forward mod explode npc pathing 
I would very much like your version, please! Blueberry helped me out with the hurry command but I would like Fast Forward for checking pathing. I don't have the skill to make my own version.
https://github.com/atravita-mods/StardewMods/blob/1db0a9587f1f5963a2f7e09ebd40824f351326c4/SinZsEventTester/Framework/FastForwardHandler.cs#L25 (It's super easy to write)
Literally
// // TODO: override finalizer only if 'Dispose(bool disposing)' has code to free unmanaged resources
have you done this yet atra
Lol (yes)
I have looked at this several times...but I don't know what most of it means and I don't know how to make it actually happen in the game (there's nothing about pressing buttons or anything - at least that I can see, so I'm lost) so I've put it in the "think about later" pile haha
I needed rokugin to hold my hand through how to change "press any button" into "press one specific button" because I made zero progress on it on my own. I am still extremely baby at C#.
Will do! I'm about to go to bed but I intend to post it tomorrow 
Oh pressing buttons is straight up in modentry
Yeah I can do it now!
(Just)
I also don't know how to have any .cs files that aren't ModEntry yet
Like I said. Baby haha
that one is also easy at least, you can just make another one
your first one doesnt even need to be named ModEntry.cs
Would the game be able to use it just because it's there?
I don't have to like...call it from somewhere else?
it all gets built into one .dll in the end anyway
Is it like with the content.json where I could have it all in one monster cs file if I wanted to?
you technically could. not advised but you could
iirc i vaguely remember "you can shove everything into modentry, while impractical, it'll still work"
(I am not expecting personalised teaching btw, so if you are not interested in teaching me more about it then I will not be upset. I am just asking because I am curious and you are replying haha)
baby's first c#, everything into modentry
(Ftr, the example SMAPI mod in the modding docs deals with pressing buttons! https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#Create_a_basic_mod
And yes, all mods are made using SMAPI's Mod class, and upon running, SMAPI calls every Mod's "Entry" function - so basically, the call is handled for you)
You have to call it from somewhere else
Yes I know :) That was the code that I had which I couldn't figure out how to turn into "press one button" haha. It was very sad xD
From the ModEntry.cs that button says I don't need anyway? /gen, just confused
you need a file with an Entry function i just meant the file name doesnt have to be literally ModEntry.cs
You have to have a class that extends Mod and implements Entry
That file can be named SpanishInquistion.cs for all SMAPI cares
ModEntry.cs is just conventional
Ah, I see.
This bit being the entry class?
(That is copied from the example mod in the get started page moetrash linked)
Yes
in all seriousness mumps is my stress project that I work on when I get bored. It's great for that because there's basically always new ideas (from me and other people) to add and each feature is relatively self-contained. So I can just go in and screw around with whatever for a few hours
(i wish to attend the blueberry school of draw effects, i want to make a really cool pirate ship animation
)
Thank you atra, Button, and moetrash for taking time to teach me this stuff 
I can do a t-test for you if you ever need one xD
i like seeing people venture into C#
i vaguely remember what a t-test is from stats class and the less i have to think about them the better i think
i feel like i should turn off intellisense while doing my c#
why is that
i hit tab and it just gave me an entire block that i'm not sure is correct
(i do not remember what is intellisense and what is intellicode and what is intelli ai or whatever )
it's vs22's ai
oh. yeah probably not the best to learn with
probably the worst thing for me that i'm staring at it like 
might get you something but if you dont know at all what its doing or how to edit it then, eh. pretty bad
yeah--i'm back to that pickpersonalfarmevent
{
helper.Events.GameLoop.DayEnding += GameLoop_DayEnding;
}
private void GameLoop_DayEnding(object? sender, DayEndingEventArgs e)
{
throw new NotImplementedException();
}``` and i'm like yep, i have no idea if this is correct
i just disabled the c# suggestions bit 
that... doesn't look like the work of the AI bit
(if its got other stuff then i would listen and keep it, take my words with that grain of "i dont remember what those things are"
)
it just implemented the event delegate for you
this is 100% correct C# and definitely a way you can do it
yeah i was mid-typing dayending, hit tab and it finished off the definition
minus the throw line, which is meant to be replaced by you
time to break some eggs
I don't think that I am using CreateOnLoad right. I'm trying to enable Always Active so that my map can be used in multiplayer. does anyone know what I'm doing wrong?
CreateOnLoad is a model, not a boolean
"CreateOnLoad": {
"MapPath": ...
"AlwaysActive": true
}
ah, okay. thank you!
theres a debug command for marrying if you need it
i have 0 idea if i did this correctly
but it built and smapi didn't scream at me
(lemme just enable cjb because it's acting strange with just pure debug commands)
did i put it in the wrong spot
can you show what you've done
i think it's because i need to replace the last part return new SoundInTheNightEvent(2); with QuestionEvent(1); yeah?
if you are postfixing with Harmony (you should be postfixing with Harmony) you dont return anything
Are you aiming for a night event
yeets this onto github
Iirc there was some framework that let u just use event script
i'm trying to first be able to have a consistent adoption/pregnancy question, then i want to be able to set it to GMCM after i figure that out
yeah baby's first c# i wanted something tangible that didn't involve me drawing an angry goose
Is the QuestionEvent a vanilla thing I never used it
yeah button said to postfix pickpersonalfarmevent
there is stuff to unpack here but for starters your patch has not patched anything

because you've not told it what to patch
and this is not how harmony patches are made
sorely clueless
uhhhh would you like me to write up a proper patch for you to learn by example or did you want me to try (and possibly fail due to my fault not yours) to explain via text
if it's fast, i do learn by example
if you wanna wear down your keyboard for those sweet chat xp, by all means it's probably helpful to throw it here 
i might be able to do half of both by just finding a good example of a patch for somethin else from one of my mods hold on
oh i finally understand that line, now that you said that's not how harmony works [HarmonyPatch(typeof(Utility), "pickPersonalFarmEvent")] i've been attempting to decipher from https://github.com/f4iTh/StardewValleyModding/blob/master/AdjustBabyChance/Common/IL/EventPatch.cs
the rest of it, in one ear out the other
https://github.com/Spiderbuttons/ButtonsExtraBooks/blob/bb931cc0fe15773d62c518db644a5a990a686cbe/Button's Extra Books/Powers/Luck.cs
ok this is a simple enough one, this is a postfix to the daily luck getter to change the result that the function returns
(tangential but you can do nameof(Utility.pickPersonalFarmEvent) too since its public but the string will work but just lettin u know)
the patch in this file is named Postfix so i dont have to tell harmony that it is one, so the only annotation i need is to tell it which function its a postfix for
but your postfix will also need to be static void, you're not recreating the signature of the original method
you're writing a new method that Harmony will run after the original one
pickPersonalFarmEvent takes no arguments so thats fine, but you'll want to add an argument of ref FarmEvent __result which means harmony will give your function the original result that the original method was gonna end up with
it needs to be ref because you plan on changing it
but once youve got the signature and the annotation set up correctly the code you wrote in your function is like. it will work but its not what you want
if you just want to guarantee that the question will be asked, all you need is the relevant checks (if marriedorroommates, can get pregnant, etc) and if those are true, just do:
__result = new QuestionEvent(1)
this will overwrite the original result of pickPersonalFarmEvent
you dont need to create an rng or do anything with NextBool (which doesnt guarantee it anyway) bc you dont want rng you just want to change the result to the questionevent if the NPC can have children
you also dont need the if statement checks for the birthing event and dont need the SoundIntheNightEvent fallback
bc you're only concerned with the pregnancy/adoption question
(also if you're wondering you dont need to wrap things in a try ... catch block i just do it anyway)
? c# static void Postfix(ref FarmEvent __result) { NPC npcSpouse = Game1.player.getSpouse(); bool isMarriedOrRoommates = Game1.player.isMarriedOrRoommates(); if (isMarriedOrRoommates) { bool? flag = npcSpouse?.canGetPregnant(); if (flag.HasValue && flag.GetValueOrDefault() && Game1.player.currentLocation == Game1.getLocationFromName(Game1.player.homeLocation) && r.NextDouble() < 0.05 && GameStateQuery.CheckConditions(npcSpouse.GetData()?.SpouseWantsChildren)) { __result = new QuestionEvent(1); } } if (isMarriedOrRoommates && Game1.player.team.GetSpouse(Game1.player.UniqueMultiplayerID).HasValue && Game1.player.GetSpouseFriendship().NextBirthingDate == null && r.NextDouble() < 0.05) { long spouseID = Game1.player.team.GetSpouse(Game1.player.UniqueMultiplayerID).Value; if (Game1.otherFarmers.TryGetValue(spouseID, out var farmerSpouse)) { Farmer spouse = farmerSpouse; if (spouse.currentLocation == Game1.player.currentLocation && (spouse.currentLocation == Game1.getLocationFromName(spouse.homeLocation) || spouse.currentLocation == Game1.getLocationFromName(Game1.player.homeLocation)) && Utility.playersCanGetPregnantHere(spouse.currentLocation as FarmHouse)) { __result = new QuestionEvent(3); } } } }
oh wait i forgot the multiplayer part
you do not want to skip the other checks
you dont want to do it JUST if theyre married or roommates, the other stuff is still important regardless
What if u do transpiler
you dont want to do it if the NPC in question is set to not want to have or adopt kids, you dont want to do it if the farmer is not actually sleeping at home, you dont want to do it if the NPC is already set to have a birthing event
(a transpiler was my initial thought earlier today bc it would be easy buuut a bit less so if you want to make it configurable)
and then because of the playerscangetprenganthere i have to implement that last bit right? private static bool playersCanGetPregnantHere(FarmHouse farmHouse) { List<Child> kids = farmHouse.getChildren(); if (farmHouse.cribStyle.Value <= 0) { return false; } if (farmHouse.getChildrenCount() < 2 && farmHouse.upgradeLevel >= 2 && kids.Count < 2) { if (kids.Count != 0) { return kids[0].Age > 2; } return true; } return false; }
that code is hard to read on just discord so i will Not and just say you basically just want to copy everything inside that else block in the original function and just remove the r.NextDouble parts from the if statements
you do not
actually
why is that function private whaddahell
well. okay. yeah you can just reimplement it yourself then. you could use reflection but thats a bit more to explain unnecessarily
you want to copy the whole part inside the else block bc everything it checks in there is still something you wanna check. its just the rng you want to remove
and ofc replace both of the return statements with __result =
once you've got it working then you will want to go back later and at the top of your postfix do your checks for like mail flags and config and stuff, bc without that this postfix will run every time and your spouse will ask you every single night they can
Stardew Valley 1.6.9 beta is now on GOG!
To get the beta:
- In GOG Galaxy, click Stardew Valley in your installed games.
- From the options icon at the top, click Manage installation > Configure.
- In the "Beta channels" dropdown, choose "Change private channel password".
- Enter the password
stardewvalley169. - In the same dropdown, choose "beta" and click OK.
(hello Pathos is it too much to ask for that function to be public'd or is it private for a reason)
(is there a difference between farmHouse and cabin?)
(Sure, I can make it public in the next patch.)
theres a couple private functions in Utility actually that would probably be helpful as public 
isCategoryIngredientAvailable() and itemsShippedPercent() mainly
prooobably dont need to unprivate the utility function that calls the garbage collector 
Cabin inherits from Farmhouse so its got some extra stuff for farmhand related things but you can still pass it into the function
Done in tonight's beta update!
Excerpt from the changelog:
Fixed tile index collisions.
Vanilla logic that checks for a map tile index now consistently checks the tilesheet ID (case-insensitive), which eliminates the entire class of bugs related to tile index collisions (e.g. custom tilesheet tiles being unexpectedly treated as lights).
Breaking change: if a custom map doesn't follow vanilla conventions (e.g. the paths tilesheet having the ID
"Paths"), some vanilla behavior like forage spawning may no longer work.
Awesome! I missed at least a couple locations in my list, but hopefully you caught those since you all know the code better than I do 
(also Avi since that function is gonna be public in 1.6.9 it means once it comes out you won't have to reimplement the function yourself you can just call it normally)
(also thank you Pathos i forgot to say after my pufferheart)
Yep, I reviewed every place we called some variant of getTileIndexAt. If you spot any that were missed, feel free to let me know.
i am egg, i will put it in comment but is it just static void (function) __result
what do you mean
if i'm calling the playersCanGetPrengantHere, or do you mean it's just going to be automatic because it'll use the Utility.players*
for right now i've just deleted the Utilities part of it and reimplemented to get the squiggly to go away 
for now until 1.6.9 you'll need to rewrite the function yourself (the reflectionless way) and then change that part of your patch to call your function instead, which will be identical
if you named it the same and its in the same file then yeah just removing Utility works
after 1.6.9 you can put the Utility back. you also dont have to use the public Utility one but it would be better to in case someone else patches the function that determines if they can get pregnant there
Wait why can't avi use reflection
i am egg
they can i just didnt wanna explain it
i have 6 training wheels on right now 
Reflection is just breaking into ppl's houses it's not that complicated
i worded it a bit badly i just meant "this is the reflectionless way so you'll need to rewrite it"
now just double check that doesnt happen every single night after clicking yes
In this case you r hoping to call private function which u normally can't do
oh y'know you're right one second
i closed out of excitement 
haven't exactly figured out hot reload myself just yet
but with babies!
Just restart everytime 
it does not 
at the risk of being the "uhm aktually" person i think it would still only lead to one child
but idk the inner workings of pregnancy code that much
But iirc VS hot reload is automatic right
yeah i'd have to set up my smapi to vs but i haven't bothered
(which is perhaps its own kind of horror. literal neverending pregnancy/adoption paperwork...)
Red tape
I see we are Highlander'ing the children now, I approve of this gladiatorial infant combat
alright now the fun part, writing the modconfig
i should really do baby's first c# and shove it all into modentry but i don't think i'm that chaotic
also, is the entry(IModHelper) actually necessary or should i just yeet that
oh, even if it only has just the dayending and an empty definition?
yes
Thanks! (For anyone else, the option for me is "Add private channel", not "Change private channel password" - maybe it's different on some OSes)
without the Entry function even if SMAPI still loaded it, if it was never called then none of your code would run, bc nothing is asking it to run
(it won't compile without the Entry method.)
(i meant more in the sense of "even if it hypothetically would load it anyway")
(but yes it wont compile)
So this mod is for tweaking pregnancy right
yeah just for me to learn what the heck i'm even doing
/adoption
okay, now i read how to make a config
Hmm, why would SMAPI simply say a mod is no longer compatible, without any specific errors?
What is the desired mechanism?
and you ARE checking trace logs?
basically removing the rng of the event and set it to be configurable, or even set it to a mailflag
Ah, you're right, it's in verbose.
verbose/trace. i can never remember which one is which
GetContainingBuilding no longer exists... guess I do have some things to fix, sigh.
verbace
Do u want ppl to be able to set whether they want a baby in some interactive way 
something like a publicly available key probably 
iirc that ones just a name change i think maybe?
to fix it anyway
Or is it more for mod authors
I see Automate is also broken - for others who've gone through this, will updating the Pathos mods make them incompatible with 1.6.8?
oh i was slightly off its just a field now called GameLocation.ParentBuilding
more for mod authors, so it can be used like a addmailreceived
Yeah they have beta versions
And develop branch only builds for 1.6.9 *without change
Spacecore needs change too, casey posted it in this channel yesterday
Ironically, AFS (the fishing mod, which is more transpiler-heavy than any other mod I've made) seems to have problem at all. Ah well, tomorrow.
might be easier to have it check CustomFields for something that says they want a child asap
(I don't run Spacecore, but yeah, I saw that)
Oh and cjb cheat menu broke couple builds ago
10 speed for debugging i miss you every day
Need to do the fix yourself
Or just comment it out if u don't care about the social quest
Yeesh, even Content Patcher is broken. This'll be an adventure.
i was gonna say content patcher worked for me earlier but i guess i didnt test it on the very very latest beta version so iunno
That one has a beta build on nexus which works I think
Well, that's what the trace says anyway.
Broken code in ContentPatcher.dll: reference to StardewValley.ArgUtility.TryGetEnum (no such method).`
i think you just have outdated beta CP
I don't have beta CP at all. I was on 1.6.8 until 10 minutes ago.
oh i thought you meant like the latest beta broke CP's beta, mb
Tbh if u got pathos repo checked out u can just build from develop 
Btw does AFS have way to turn off jelly predictions
Sure, in the settings. Every rule can be set to "never".
Ah it's in 
Well, on the bright side, only one of my mods seems to be "fail to load" tier broken. We'll see how many actually still work.
I'm not 100% sure yet but I think whatever VMV did to spawn fish bubbles causes AFS to display fish bubble countdown all the time 
Well in theory there should always be one visible - there's always a current or next splash spot.
Except at like, midnight.
I'm not sure what VMV would be doing differently - splash spots are one of the few things that does not involve transpilers or other funny business, it's just a straight recreation of the seeded random logic.
I do remember hearing that VMV has bespoke C# for spawning fish bubbles
(
the customfields on npc_data wiki has circular logic, but i'm going to assume it's string->string, to which i need to google how da heck)
Depends how bespoke it is, I guess.
you've already got part of the if statements checking npcSpouse.GetData so you can just get that data a little bit earlier to check the custom fields (and then reuse the data in the if statement later on so you dont have to use Getdata twice)
lost i'll just finish attempting this
it is definitely screaming at me because i'm trying to use a bool
in your customfields?
y-ea-h
yeah, its a string to string dictionary. cant use bools. just strings
you need to check in your C# whether that string is parseable as a bool
NPC the class doesnt, but the CharacterData returned by GetData does
same way it gets SpouseWantsChildren
i seem to be stupid
npcSpouse.GetData()?.CustomFields(); although i think attempting to follow the cropdata example is losing me in the process
CustomFields isnt a function
its just a field
CustomFields IS the dictionary
so you'd use things like CustomFields.TryGetValue(etc etc)
oh
OH
if (string.IsNullOrEmpty(stringName)) {
__result = new QuestionEvent(2);
}
if (stringName == "Yes")
{``` 
the rest of it, idk i'm pretty sure i'm doing it wrong
i feel like you should turn intellisense back on
but the red squiggly of screaming is gone
it is back on now
well it's been on since button held my hand like the baby i am
i dont know what questionevent(2) is or why you'd wanna change the result to it, but all that seems roughly functional assuming you have more code after the bottom
2 is the wolf howling
why do you wanna make the wolf howling event happen every night


