#making-mods-general
1 messages · Page 25 of 1
i dont know if id call it that since we can get the code in both C# and IL form, more so just normal engineering your own IL
like thats how mods for stuff like Valheim that arent at all mod friendly even come to be
and sticking the IL where you want it
so what is a use case example
hm there's no way to make a string field on a record modifyable right
and why couldnt we just use regular c# in those cases
if you want to change one line of code inside a bigf function that does a lot of things
then you want a transpiler (which puts in IL)
ooo interesting
do i just change it to string builder 
that is neat
Records don't normally have fields, unless it's a struct record?
Technically, as long as you don't try to inject your IL where they've injected theirs, you should probably be fine
otherwise, with Harmony, you can only do something after that function, or before that function and stop the original from running at all
Unless you mean the backing field underlying the auto-prop.
then if you wanted any part of that original function, youd have to re-write it, in that insatance
but stopping the original from running is a problem if someone else wants to do stuff with that function too
i prob meant property sorry 
and yeah, you'd have to rewrite basically the whole function
basically i have this thing representing 1 icon + decorations
internal record RuleItem(
List<IconEdge> Icons,
string Tooltip
);
There's no way to make a read-only property writable because a read-only property is just literally missing the setter method... it's not an access modifier, it's a thing that's not there.
thankfully if you ever get that far its still easier than the dumb stuff im doing with IL
and i wanted to modify the Tooltip of the final RuleItem
yeah i was gonna say doesnt sound like ur having fun tho lmao
after its first init
The field, on the other hand... well, reflection ignores readonly entirely, so there's that.
maybe i just make it a List<string> its fine
So if you need to write to a record, I believe you could find the backing field and write to that, though it's in gross violation of how records are supposed to work (but hey, we don't care about that).
(in my case im not writing transpilers, im building entirely new functions out of IL code, and determining which IL opcodes to place based on parsing strings defined in a Content Patcher mod... and then sending those newly built functions to Harmony to turn into Harmony patches)
so youre a contributor to the api as a whole?
so just entirely forward engineering of functions from scratch
yea ill take the list overhead 
oh god no im way too dumb for that
lmao
Good choice.
ignorance is wisdom ✨
me as a python architect every day
i can hold my own with some basic reflection stuff but trying to make something like SMAPI work (or even just Content Patcher) would be beyond me
(especially considering im still making mistakes like, yknow, checking to make sure my postfix isnt actually concetanating twice and is instead just being called twice intentionally)
i just think were all pretending we got it more together/uderstood than we really do and deep down were all like AHHHH WHAT IS THIS CRAP at least once a day
Speak for yourself.
this talk is bit off topic but you are welcome to head to #programmers-off-topic
aka home automation that involves too much EE for me
i didnt know there was a programming off topic, thanks. man my smapi keeps stuttering and ive no idea why
thats actually a #1272025932932055121 topic, but first thing u can do is profiler
ive done affinity shutting off core 0
its even when my mod isnt loaded
so i think its a pc issue
#vanilla-tech-support if it's unmodded, #1272025932932055121 if it's only with mods. Seriously, offtopic.
no no, thats why i mentioned it because, its with smapi, but with 0 mods
but yeah ill google
nbd
Give it a scroll bar please
(that would still be in the support channels)
Lookup anything is god tier
i have a wip PR for LA that added links and uh, the way i did it was to just record a bunch of rects for use in the top level handle click menu
If adding a scroll bar wasn't actually a huge PITA, I would have definitely already made a PR for that lol
if you do can you steal my idea to use focustense's UI thing to make an in-game ILSpy-like method/type/etc lookup
(Adding a scrollbar is easy in <shilling redacted>)
This is where being allowed to use masked links would be great
It was just a little self-deprecating humor, wasn't trying to avoid moderation or anything.
maybe stardew UI can help me here
It's not just for menus FYI - I did the fishing balloons using the same system.
oh you prob want GMCM for this
Will GMCM allow you to bind d-pad buttons? Never tried doing that...
hmmm
i thought it just accepts the key signal
ive had bmcm before
thats not a bad idea actually, you just madae me realize how silly it is to even have to press a weird button combo to assign a key
i dont think GMCM cares what button you use for it for the most part (just Esc i think?) but i could be wrong, been a while since ive done keybinds
There are some keybinds you definitely can't do, like the A, X and B buttons.
i just use GMCM, player can set their keys in there, then theres no accidental pressing the 2 bumpers simultaneously and bringing up the thing
Not sure about d-pad.
what about outside of GMCM, with my thing, can i do those buttons? i htink i can, but id prob want to do them in combination
well as long as you have the config.json
im thinking instead of dpad, hold back and hit face buttons, for example
you can just type the key names in there
It's not that GMCM cares about them per se, just that the way GMCM is written, it doesn't understand them being pressed in the keybind popup.
just tested
what is it
that's the GMCM menu for one of my mods
My mistake X button can be bound, just not A or B.
ohhhhh gotcha
what about in combination, im going to try with mine see how it goes
now i gotta figure out how to listen for combos
B works as well
it's just A since that triggers the exit button
without knowing what buttons they will be, etc
(woops wrong pic)
it allows you to do 2 keys yea, but you just cant have distinct keys for the list
Although the GMCM style is a little backward here, as this is more about having permanent functions defined for the D-pad buttons and assigning slots to those functions, not the other way around (having slots and binding buttons for them). You can sort of make it work in reverse, but it's awkward.
bam called it
yeah, i can probably just make the "Set bind" button configurable in GMCM and call it a day
oh are you doing the zelda thing but with tools 
yeah pretty much
but like ff xiv on console, or like, cook serve delicious on controller
as an optional way to do it
but i think for me id just use dpad
but i want now for people ot be able to be like, hold left trigger, hit any face button, 4 diff binds there
so i gotta make it look for combos too
"this will be simple" is no longer simple
i started thinking of caveats 10 minutes in -_-
thats how it starts 
well gmcm is prob fine as a start, you can come back and make a custom config menu later
hmm you can define a modifier key and the 4 additional keys
yesss
thats what i think would be rad
cuz pictureing, lke 4 diff meals (energy potion, health potion, salads, spicy eel), 4 different offensive items, (chery bomb, mega bomb, regular bomb, sword)
then like another modifier for pickaxe, hoe, desert totem, farm totem
i dont wanna go all out tho, i want it to be any slot people want, so staircases, whatever
seeds, idc
making specialty slots just for weapons and stuff is a cool idea but someones had to have done that, right?
like standalone bomb slots (that still eat a backpack space so its fair)
thatd just be visual flair anyway
I just did the radial menu. Stardew isn't such a quick-reflex game that you need various binds and combos and chords. But like I said, personal preference and all.
oh is that your mod? or just what you use
its slick
but im too invested at this point
If you want binds, make binds. You'll have to deal with the cases where tools change which slot they're in, or when they're no longer in the player's inventory.
yeah i think id probably let them know? dont want to nag tho
was considerinmg that ,should i maybe just unset bind if they move it>?
or should i make the bind stick with the item
decisions decisions
now im picturing zelda
and havei ng like a little ui spot that says select modifier key
then in the directions you choose what you want on abxy
and you can use l1, l2, r1, r2, l3, r3, select as your modifiers
so a possibility of 28 binds
but then id have to make all that UI . -_-
thanks for helping me with this btw you guys are GOAT'd
why cant i do if e.Held.Count() > 1
e.Held[1]
do i have python brainrot
28 binds... you can barely have that many items in your inventory.
hm can i change the font of drawTooltip
which ones? font is a parameter in some of them, or the draw functions they call
would stardewUI work for uh... not sure the term. I want to make a building where you right click it and it opens a crafting menu but not the one in the regular menu.
IClickableMenu,drawTooltip
it calls drawHoverText which passes in Game1.smallFont
looks like we'd have to use that instead yea
wdym by not regular crafting menu
i have a easier idea, make your buliding a milll
pressing e and then going to that tab is regular crafting menu. I want a crafting menu thing specific to this building.
put stuff in get stuff tmr
It'll be for "infusing" weapons and slingshots into the harpsword.
yep that takes whole day trust
I mean it could I guess, juminos work overnight to tape the galaxy sword onto a harp.
Sure, if by works you mean can it be used to make the menu. As far as right-clicking on the building, that's just regular "modding stuff".
if you're fine with adding a dependency and just want a vanilla-like crafting menu that contains custom crafting recipes not found in the regular crafting menu that is accessible by interacting with a big craftable or a building, Better Crafting's API can do all of that
https://github.com/KhloeLeclair/StardewMods/blob/main/BetterCrafting/author-guide.md
you only need a to make a content pack with JSONs
I say building since it isn't a machine and will have an interface, I don't know if there's a better term.
oh hm idk if the ItemConversions stuff support combining 2 items actually
no it doesn't
I will keep better crafting in mind, the other mod I was looking at was mystical buildings
I briefly considered it as a bonus thing for EMC
yea rip junimos can't glue the harp to the sord
but machine rules? sure go wild
it's a ways out. Combat core, then skills, then the rest of the spells, then the events and buildings/recipes.
if you do this would the recipes be required for perfection
probably not, since the recipes only exist in BetterCrafting, not vanilla
but I might be wrong
Think I figured out a way to make the cave fishing (and other fishing, to a lesser extent) less time-wasting but still fair: recast to reroll. You can continually cast and cancel (not waiting for a bite) to try to target a specific fish, and each roll is every bit as random as vanilla, so you might have to cast 20 times to get an ice pip and burn up most of your energy in the process, but it takes 1 in-game hour instead of 10 and doesn't require burning up all bait and tackle in the process.
It's probably going to be considered a cheat by many regardless, but curious if there are any thoughts about balance. Maybe I should put it behind the sonar bobber so you can only do this while it's equipped? Shelling out the cash for an Iridium rod in mid-Spring is a painful choice, but on the other hand, would allow you to make it up pretty quickly while grinding for a few of those essential jellies.
is TailoringMenu.GetDyeColor seriously the correct place to get item colors from 
yeh
could always parse the context tags yourself if ya want
(that's what I use~~, and that will be what 1.6.9 uses for machine copy color~~ wait actually looking at the decomp 1.6.9 duplicates its logic in the copy color code for some reason, so in a way it uses it, but not directly)
(i also use it except when i don't)
ill use it i just didnt expect it to be in a menu 
only thing I can think of is that you'd need no energy with the efficient enchantment, but at that point I don't think it matters lol
gating it behind sonar bobber could make it balanced
Yes probably - once you're off getting enchantments, fish-smoking is merely recreational.
yeah sonic bobber sounds good, since that bobber is otherwise not very used.
I heard smoking lava eel is a legit late game strat to make big bucks
It's actually not - not in vanilla, anyway.
Targeted bait is not really profitable because the only alternative is trash, so you recoup nothing from "misses".
true. what about one layer up (ice pips/ghostfish)?
You might get perhaps 10 lava eels in a day if you're really lucky? Which isn't bad, I suppose, but it's much worse than conventional money-making strats.
I thought the strat was lava eel fish pools.
the thing about other money making strats is that they primarily use crops/machines right? so you have to wait around anyway
Yeah, lava eel ponds are not bad (but compared to spending that space on a shed full of kegs, still not nearly an optimal profit strategy, just decent).
I mean, if we are talking minmaxing then your thousand kegs will be running 24/7.
unless at one point you have so many sheds and kegs you spend all your time running around collecting them (and resources to make them)
yeah
lemme check inflorescence i used something else
Late-late game strategies include the garden pot shed to keep up with insane levels of kegging (like filling 2 sheds + quarry + desert + railroad)
I use Automate, so I don't run around collecting from kegs. Maybe it subtracts a point from my "balance" cred but Stardew gets too tedious without it.
yeah there's a fine line between fun and balance. I do use AutomateChests (need Hoppers to activate Automate) to make that line finer
there's ItemContextManager.GetColorFromTags but i may have misunderstood what you need
To me, the fun is the planning and expansion. Where will the resources come from, how can you keep inputs and outputs balanced, what territory is available, etc.
ItemContextManager.GetColorFromTags doesn't handle colored objects. the dye menu function does (and in fact calls GetColorFromTags for uncolored objects)
(oh i lied earlier its GetColorFromTags that i use lmao)
The fun is not the drudgery of hauling items from point A to point B. That's called fetch quests, haha.
(luckily i didnt need to care about coloured objects for my use case of it)
ooh thank you.
Anyhoo, maybe I'll sonar it. Would make sonar go from totally useless item to pretty OP item, but it does totally fit with the idea of "sonar" as not just some lame thing that lets you see which fish is on the hook but actually lets you scan the surroundings.
are flowers of the same type but different colors of type ColoredObject or
yes
(With apologies to Button for essentially making "even better sonar bobber")
better is always subjective! to me id rather a new bobber. wont stop me from calling my own better than vanilla though, i think the vanilla one is, as you say, utterly useless
it's fine, UI Info already did that (well technically the inverse, there's an option to gate its fishing-related features behind the sonar bobber)
(also, two cakes)
Using the sonar bobber (or any tackle) actually adds some balance in another way, because until you get mastery, you won't be able to equip a spinner, curiosity lure, etc.
So you can fish-scum, but you'll have to wait longer for a catch.
New bobber/tackle type would imply sprite work, crafting recipes, shop edits, etc. Definitely not my area of specialization. (and sonar would still be useless in that case)
come to the content modder dark side. I made my first "serious" content mod with Chicken Feed and I loved it
nah
but you get to write mail! and draw pixel art!
I'll need some content for StarLog, when I get there. But that project has gotten down low on the priority list.
I did actually add mail to Pen Pals.
Pixel art is a definite nope.
aww pixel art is fun
It's fun if you can do art, yes. I'm not opposed to making pixel art, I'm opposed to me making pixel art.
Does anyone know which file in my unpacked folder would have these missing tiles?
Spring, screenshot from bus stop. Used spring_outdoorsTileSheet for the grass recolour but don’t see these missing tiles on there.
I believe it's in one of the 1.6 tile sheets
have you checked cursors yet
😩 I didn’t notice there were 1.6 tile sheets. Thank you!!
Found it, thanks so much!
one Stardew day is 1750 minutes, as far as processing time goes for machines, right? there's no way to simply make it be 'ready the next morning' instead of a set amount of in-game minutes?
you could probably do it but you might need c# if it's not already a feature
(well you can do like anything with c#, so)
If you are looking at the machine to always output the next morning take a look at the DayUpdate trigger in the wikipage https://stardewvalleywiki.com/Modding:Machines#:~:text=worm bin.-,DayUpdate,-%3A apply this rule soda machine uses it to output each morning, might do what you are looking for?
has anyone worked with BaseItemDataDefinition using some custom Identifier 
GetData uses the custom qualifier in ParsedItemData.QualifiedItemId, but CreateItem uses "(BC)" in Item.QualifiedItemId
the custom item is a bigcraftable, but shouldn't its own identifier/qualifier be used instead? the items are being marked as error items ingame and i don't know if this is why
well, to perhaps put it better, I'm adding some custom items to the ||Dehydrator||, and I'd like it if I could make them be done the next morning, just like the Dehydrator does with vanilla items. will -anything- that goes into a Dehydrator be done the next morning, even if it's a custom item?
Yeah I linked you the Moon Misadventures necklace definition earlier that uses it. Admittedly for old 1.6 alpha so maybe something has changed
or would it work like I want it to if instead of "MinutesUntilReady 1750", I put it as "DaysUntilReady 1"?
Yes, the || dehydrator || has a "DaysUntilReady" set to 1 (rather than minutes) so it will always output the next morning
awesome, thank you :D
🥙
The difference will be the DaysUntilReady will be the next morning regardless what time the input went in, Minutes will take exact amount of time so it will technically be a "day" but will finish at the same time next day in 1750m
Oh I misread you question blueberry
Or rather missed the second part
Hmm
Remind in 12 hours to look into blueberry’s question (if they haven’t solved it already)
…Uber?
that is what I was hoping for, thank you! I wanted the custom items to have the same ||Dehydrator|| behaviour as vanilla items, so wanted to make sure that I was putting the right information in. thank you very much!
remind me in 12 hours to be pinged
I'd rather boot myself on an unprotected windows XP install than deal with you but we can't all have what we want, can we? (#6229523) (12h | <t:1725823633>)
Maybe it didn’t like the parenthesis
remind me 
OHHHH
Remind me in 12 hours to look into blueberry’s question (if they haven’t solved it already)
私のユニコードパーサーが壊れているのを助ける (#6229525) (12h | <t:1725823669>)
Your welcome (also, might want to spoiler tag the || dehydrator || as it is 1.6 - I forgot to myself, oops!)
(I just went to bed, hence the delay 😛 )
ahh, fair, I'll go do that
I didn't know Maru bot made language jokes, that's hilarious 
what does the code inside OutdoorPot look like?
the constructors are like this atm:
public class OutdoorPot : StardewValley.Objects.IndoorPot {}
public OutdoorPot() : this(itemId: null, tile: Vector2.Zero) {}
public OutdoorPot(string itemId, Vector2 tile)
{
this.initNetFields();
// Item
itemId = this.ValidateUnqualifiedItemId(itemId);
this.ItemId = itemId ?? OutdoorPot.GenericName;
// Object
this.Name = itemId;
this.TileLocation = tile;
this.IsRecipe = false;
this.bigCraftable.Value = true;
this.CanBeSetDown = true;
this.setOutdoors.Value = true;
this.setIndoors.Value = true;
this.Type = "Crafting";
this.Category = OutdoorPot.BigCraftableCategory;
this.Fragility = OutdoorPot.fragility_Removable;
this.Edibility = OutdoorPot.inedible;
// IndoorPot & OutdoorPot stuff
// . . .
}
If OutdoorPot isn't overriding TypeDefinitionId to set it to BB_RGB, then its just going to inherit the behaviour and be (O) or (BC)
is that so
and IndoorPot overridesTypeDefinitionId to just unconditionally be (BC)
the ItemDataDefinition is to provide a standardized interface to create arbitrary items regardless of what type backs it, but its the underling items job to say the correct thing once its been instantiated
looking at the various 1.6 native items are a good reference for it, with ||Mannequin|| and ||Trinket||
omg it works
what does BC stand for? Big Craftable?
yes
i think it's an emoticon
oh
thank you! it's no longer an error and it's working like normal
and it spawns through cjb which wipes out so many mod comments
for context, the code for QualifiedItemId
/// <summary>A globally unique item ID which includes the <see cref="P:StardewValley.Item.TypeDefinitionId" /> and <see cref="P:StardewValley.Item.ItemId" />.</summary>
public string QualifiedItemId
{
get
{
if (this._qualifiedItemId == null)
{
this._qualifiedItemId = this.TypeDefinitionId + this.ItemId;
}
return this._qualifiedItemId;
}
}
as to why that behaviour happens and why TypeDefinitionId is important
Late to the conversation, but why not use Tempestarii? It's an old medieval term for a magic user who controls the weather.
And it's 11 characters like archaeology, so it would fit.
does anyone know why my seeds aren't showing up in Sandy's shop after the Beet Seeds? Beet Seeds should be object number 494, but using either BeetSeeds or (0)494 results in this error being thrown
I'm not very familiar with shops but you've written (0)494 with a zero instead of (O)494 with a capital letter o like you're supposed to.
...that would probably do it, yeah XD thank you for being the extra set of eyes to see what I didn't type correctly
yep, that was absolutely it. it's fixed now, thank you again
You're welcome! :)
one step closer :')
aww, those are cute!
theyll be cuter when they show up in the gd crafting page :')
it should be (O) as in Object not (0) as in zero
oh was already answered nevermind
Mavis Beacon Teaches Typing had failed me, what can I say? XD
yay it's craftable again
does khloe's Better Crafting still require you to do huge api implementations to get custom class items to appaer in the custom crafting menu?
it doesn't craft. wonder why 
// CraftingRecipe.cs
public virtual ParsedItemData GetItemData(bool useFirst = false)
{
string id = (useFirst ? itemToProduce.FirstOrDefault() : Game1.random.ChooseFrom(itemToProduce));
return ItemRegistry.GetDataOrErrorItem(bigCraftable ? ("(BC)" + id) : ("(O)" + id));
}
couldn't crafting recipes just use qualified item ids 
that moment you try making your second NPC and they down exist when you test and you dont know why :I
when i go debug where and it tells me my npc doesnt exist does that automatically mean i already got the dispo wrong or...
maybe! you can show the code so we can see if something is mmissing
wait
I think I already found the issue omg
lemme see if thats the problem before i bother you with looking over my textwall
sure! 🙂
huh, i got another error now
progress!!
Ah, I see it!
extra }, or missing },
The closing curly brace on line 177 closes the Changes block.
So extra one, yes!
thanks, i wasn't sure in which direction it was 😄
dangit, i already took one out further above lmao
it happens, i know i did that plenty of time when copying stuff
Wait a minute, no it doesn't, I think I was wrong!
i still think it's an issue of bracket somewhere but it's hard to spot
Yeah, it's missing one!
thats it
omg
brackets and commas are the arch enemy of basically every mod maker, huh
shrimply, let intellisense do your brackets and commas
i already have a thinge that automatically closes my " and any brackets but thats useless when you copy paste
vscode is too intimidating to use, im staying with notepad++
lets see if she appears now
hurray!
heey guys, how do i reload on the fly
load, unload, and reload are all non-wrking in smapi console
any secrets i dont know?
i like debugging cuz i can breakpoint, but i hate relaunching the game and going thru menu to test every little change
!reload
-You cannot reload tokens, that's a forced restart unfortunately
-If you've done any CHANGES, then type into SMAPI:
patch reload YourMod.UniqueID
-If you've done i18n DEFAULT.jSON changes, then type into SMAPI:
reload_i18n then
patch reload Your.ModUniqueID
-C# Visual Studio has a feature called "Hot Reload": https://learn.microsoft.com/en-us/visualstudio/debugger/hot-reload?view=vs-2022
-C# Rider has the same: https://www.jetbrains.com/help/rider/Hot_Reload.html"
-Generally working in C# it will be called "Hot Reload" (usage may vary)
nows the question...do i put the skeleton of each npc in first or work on this ones dialogue for now....(events I always leave for later cuz i dont like making them lol)
Choose result: dialogue
i should trade you, i'll script your events but i want the grungly music, 3 events per grungly bgm 
too bad i never know the outcome of my music fgjggkdfgfd
tho ive been thinking to see if i can find another free music maker thingie to play around with
i tried soundtrap but it's annoying without a midi keyboard
hey guys any way to get a list of all SButtons that are for controller?
and all SButtons that are for keyboard?
tty mate
i found that when im debugging i can just hot reload most of thew small changes
ahh yes your note says that
yeah im shcked that actually works in this case haha
you know what nevermind with the music rn cuz windows wont let me isntall more cuz C is too full and i cant use my other drive because ofc all dumb proggram nowadays still want to install core components to C despite selecting isntall oin a different drive, sigh
and I am not confident taking out my old C drive and slapping my new one into the motherboard all on my own :I
ill just make my food and work on dialogue like i originally decided
hey guys quick question, what constitutes a "tick"
such as, JustPressed checking current tick
what does that mean
afaik in sdv/game dev terms a tick would describe a update cycle iteration, of which in sdv theres ~60 every second, while in general cs terms tick would usually mean singular increment cycles, like the system clock incrementing its tick count every cycle
(yes, the 60hz tick, not the 100ns tick.)
morning all, I'm trying to clean up my mod process and make sure I'm not doing anything that's frowned upon/problematic; if I want to use the cotton candy concession sprite as a standard food item, what's the preferred way to include the vanilla sprite?
you can simply write in the filename in the Texture field and it will use the vanilla image (LooseSprites/Concessions)
make sure to adjust the spriteindex as well
Are there any modding softwares for SDV? I wanna try to mod
basically you need to tell us a bit about what kind of mod you want to make, but
there's no modding software per se, we use mainly
- text editing
- image editing allowing pixel art
- whatever the C# modders use to code C#
- tiled for maps
!software
Here's a list of software for pixel art and JSON text editors we recommend: https://gist.github.com/ishanjalan/c8efb21afa21f74a052293176db107f7
For making SMAPI (C#) mods, see the Requirements section here for which IDE to install https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#Get_started.
I want to make a mod where you can pick up the children XD it’s very random
it sounds like C# territory. I can't tell the complexity
Ah okay
i would suggest starting with something maybe easier then see if you want to do it still
depending if you already know some coding language or not
OK So i figured everything out.... except..... when i go to my journal, everything stops working
nothing else breaks my dictionary like this lmao
but man im so proud i got it working this well, i prob just have to mirro rthe data somehow, opening journal doesnt like... reassign hotbar order, does itr?
nah even my debugger stops noticing the keys
i wonder if it kills the MP player ID
@ivory plume I know this is like super last minute, but I'm pretty sure if crafting recipe didn't forcibly add a qualifier in two locations, crafting with different qualified item ids would work
it doesnt
man i am LOST now, any mod veterans here who can tell me what the heck is going on id love u forever ty
basically, i set slot 5 to J, i set slot 6 to K i set slot 7 to 9, i press j k 9 and watch it fly around the slots, for a half hour, then i hit F , not even set anything to it, just hit F, it brings up journal, i close it, suddenly none work... hmmm i bet its simpler than im thinking
i bet its storing an extra button somehow
in event dialog, when doing the response ids, do those need to be unique across the game or just within the event/character? and can they be strings or numeric only?
the wiki only shows numeric examples for response ID's so I'm hoping they are only unique for the character to prevent collision!
Response IDs need to be unique across the whole game and strings are totally fine now.
sadly i don't know C# and can't help, i suggest taking a big break and returning here later with maybe different persons to ask to
yeah strings are fine in response, someone confirmed that recently
and i believe there are some ways to check for such responses with a GSQ or something so they are across the whole game (otherwise you wouldn't be able toc heck them)
so long as they're strings that works, with numbers i was just envisioning the conflicts 😛
I am also trying to puzzel out when to use $q vs $y vs question vs quickQuestion 😛
yeah it's so quick with numbers, we got mostly lucky that for event ids there was a convention before
ah yeah
i like quickQuestions in event
since atra made me see the light
and understood that you CAN have multiple commands in a block
how do you specify which NPC is speaking the question?
if you separate them by \\
usually
i do the question in a speak
and then a stuff like "what do you answer" in the quickquestion
ah gotcha
so you only use the quick question for the farmers response
not the initial question itself
that makes sense
gives it the ol' college try
yeah it is also good when the npc doesn't ask a question but i want to offer the player the choice of response
ex :
"InnMoira6HMoira06":"I got nice comments, but it's pretty much all.", "InnMoira6HFarmerQuestion":"(What do you say?)",
Can you even use $q in events?
That seems like it would be complex given the number of dialogue keys you need for it.
yeah, i've used it in speak commands before
but yeah, it is complex, and frankly annoying, which is why I was digging around in the wiki for options
and vanilla uses all 4 methods I brought up, it was part of my confusion honestly
Hmm that means you can probably have nested questions in events then.
yeah i feel CA was a bit "hmm i made a question thing but it's not convenient for this use case, let's make another"
Yeah probably lol
I'm very amature at events/dialogue so i'm fumbling around quit a bit with how it works myself
hopefully I can get away with only a few events for this mod and then call it a day. Actually since you folks have done this more, is there a trick to making multiple NPCs move at the same time without one of them repeating the movement and going way off track?
yes, advanced move
and also
you can get away with pretty much everything, nearly no event is totally a viable approach
i didn't have a lot in VMV initial release, i will have more soon, but it's BECAUSE i was able to accept that it was ok to not have a lot of events
if you don't like making them, don't
yeah, the only ones I feel like I really "need" is the one that unlocks the new area and the one that plays when you get knocked out in the dungeon, I'll probably avoid having much more then that
and I'm going to leave the schedules pretty basic for the NPCs since their primary job is to be shop owners
I was originally going to make another NPC to build stuff in the new area, but decided I'd just make Robin slog to the deep dark cave and build me a shed 😛
She'd probably enjoy the challenge tbh
Use quickQuestion lol
There are four options and only one is implemented in a way that doesn't make me want to tear my hair out
(well, depend of what reactive dialogue you want but there's CT and mail flag)
Even if you do it's about nine million times easier to add a mail flag tbh
(if you do want to keep options open)
hey im wondering. is every single texture (piece of furniture) for the town interior on the towninterior.png? or maybe another png like furnitire.png? or is some of it maybe hardcoded? for example im not seeing jas' pink bed or emily's big blue bed on there. ive also been unable to locate a couple other textures as well.
My two go-to options for finding stuff is opening the map in Tiled and right clicking the tile I'm interested in with the stamp tool selected, takes you to the appropriate tileset and selects that tile, you can edit the tileset to see what the name of the sheet is; And using Lookup Anything in game to see what is being used during actual runtime
there's a towninterior2
if you're on tiled open the map you wonder about
right click on the asset you wonder about
good idea ty
see what tilesheet it focus on, see what is it named
i looked on there but didnt find what i was looking for
and yes it's what rokugin said already
but yeah finding things can be tricky
As far as Jas's bed goes, it looks like a regular bed to me
So maybe you already have a mod replacing it?
nah not yet. but i am redoing some of the rooms
but yeah i will take a look with tiled
Emily's bed is also just a normal double sized bed for me
i found it on furniture but im not sure if thats the asset for it
Depending on what exactly you're doing, things should be easier out of the box on 1.6. Do you need custom rendering for the menu view? If not then it should probably just work.
i dont think it is since i changed all the furniture on that png. i think those are just for the player
can you show a screenshot of what stuff you mean?
and yes, furniture isn't used in maps
ah okay. good to kno
vanilla maps only use tilesheets found in the Maps folder
They have to be inside the Maps folder to be used in maps - what 6480 said lol
yall got any good examples of pulling config parameters into the code?
for anyone with my problem in the future, it was simply that my else wasnt resetting the buttons pressed -_-
ahh c# models
easy enough
does it have to be Modconfig.cs?
No
kk ty
But that is standard
yeah might as well
I don't believe it has to be that, just make sure you're pointing to the correct script when you access it with the helper
i already got ModEntry.cs
I find that the more you deviate from convention/tutorials, the harder it is to remember to make the change every time
I already had to Google "python equivalent of cref" once already today lol
God I hate docstrings
I can't believe I'm about to defend xml but I miss xml docs
and now im a py architect hahaha
(I don't know what architect means here.)
docstrings are slkuppt tho
sloppy*, i am the father of a code base for a company
its my stack, i birthed it, i will see it to adulthood
fastAPI/htmx/mongodb
i will refactor it at least 8 more times, as is tradition
tbh, not to derial this chatroom any further than my last message on the matter, its a bitcoin miing and solar panel farm with over 10000 antminer s19, s21 and whatsminers, and thosuands of solar panels in massive fields, and those things all have python libs for their built in apis, but not nuget packages, so the choice was obvious
If you were the father, wouldn't that mean you did very little and will ignore it until it does something to make you proud? /j
(you could always go to #programmers-off-topic for further discussion!)
yeee
i should really go there
i clearly have an itch to scratch
anyway, we can write to these configs programmatically?
Outside of using GMCM to update values, never tried. Is there a benefit?
idk ,just to store it to pull it next tim the play i was thinking
so they set a few diff keybind shortcuts im sure theyd like that to auto load next time
and its cool to see it in the config i think? not sure
It creates a json that stores all that
SMAPI I think?
Oh yeah, if you're not using GMCM looks like you have to write the changes to the config yourself
https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Config#Using_the_config_file
Bottom of this section
Prior to gmcm being commonplace I would run the game to generate the config json, exit the game, edit each json to change config settings, and those persist.
Gmcm is huge.
Did the config not generate with whatever values you set in the model?
No they did, just to customize from the defaults.
Unless you were speaking to youstaygold.
Nah, you. Just wasn't sure if you meant like to ship a different set of defaults or for the actual modification of config files
The second one for when I was setting up a new run.
On the topic of mods and GMCM though, I saw someone say they were putting a GMCM api .cs into their mod. I don't have that but GMCM still works for me when all I have is the configMenu.Register on my ModEntry OnGameLaunched event. Is pulling in an instance of the API required?
I have no clue what you're trying to say
My guess - and this is a guess - is that you don't need to copy the api interface because you hard reference spacecore
that's probably it yeah
I just converted my JA crop mod to CP, I made sure the object IDs are consistent with the JA version but don't think I can do the same for the crop IDs. How are people handling releasing a new version with a breaking change like this on nexus? should I release it as a separate mod and deprecate the old one? or upload it as a new file with a note that it'll break any crops planted from the old versions?
shouldn't objects have the same issue with IDs, since the point of Json Assets was to assign IDs?
I thought it would but it was looking for a string ID that was something like username.modId_seedName
so I was able to use the same ID
hi! if anyone has the time and knows anything about mods could someone help me with my smapi crashing? sorry if im interrupting btw !!!
#1272025932932055121 will be a better place for help with that
thank you!!
oh ok, that must be how 1.6 json assets assigns ids to objects. that makes perfect sense, in fact
Done in the upcoming 1.6.9 beta patch #114. The logic now uses recipe.GetItemData consistently, which can now handle already-qualified item IDs:
string id = useFirst
? itemToProduce.FirstOrDefault()
: Game1.random.ChooseFrom(itemToProduce);
if (bigCraftable)
id = ItemRegistry.ManuallyQualifyItemId(id, ItemRegistry.type_bigCraftable);
return ItemRegistry.GetDataOrErrorItem(id);
Yayyyyyyy!!! Thank you so much
yeah for crop IDs it is still auto-assigning numeric IDs though so any crops planted from the JA version don't load the texture properly and the planted crop looks invisible but will still produce crops
as for your actual question, if it were me i'd do the latter (new file/version, note breaking change), and i'd leave the previous version available for download for a while so you don't force people's games to break
can you ItemRegistry.Create a flavored item
no
but you can assign flavors to it after the fact
or just use the FLAVORED_ITEM query tbh
basically i was try to make sturgeon roe icon
definitely use FLAVORED_ITEM then (or CreateFlavoredRoe)
originally i thought i can just get color from sturgeon but turns out sturgeon is hardcoded
where can i find spritesheet of inventory, and those windows which appear when you pick items?
Maps/menutiles
thanks
Hi! I have a problem for the game to detect my dialogues.json and schedule.json for my NPC mod. It says is blank, but is not. What I am doing wrong? Here are the files, just did a few tests.
Schedule: https://smapi.io/json/content-patcher/592315cfcec44a8dbe591c0504840bf7
Dialogue: https://smapi.io/json/content-patcher/944755fae4c74ba5a5688044bb0c420e
Tested now: The gift dialogue works, but not the standard one.
you loaded the dialogue before that?
you need to basically create the file (load it) to edit it after
also note that naming your npc just Dorian isn't very solid and that the naming convention is having something like yourmodid_dorian
Is fine, is not for a public mod, is a gift for someone.
can you show the content.json then?
Sure
Oh wait, maybe is "Load" instead of "include"?
ok you're doing that here : { "LogName": "Blank JSON load", "Action": "Load", "Target": "Characters/Dialogue/Dorian, Characters/schedules/Dorian, Strings/schedules/Dorian", "FromFile": "assets/data/blank.json" }
so it's good
what "says it's blank"?
Important note: Your computer username may appear in the log. If your username is your full name, please be aware of this before uploading it.
Please share your SMAPI log file. To do so:
- Open this page: smapi.io/log.
- Follow the instructions at the top of the page to upload the log file. (Don't copy & paste from the console window!)
- After uploading, it will show a green box with a URL to share. Post that URL here.
Please do it even if you don't see any errors. This has useful info like what mods and versions you have, what the mods are doing, etc. If the issue didn’t occur in your last session, please load the game to the point where the issue occurs, then upload the log.
It is
try
{ }
adding this to it, test if it solves the error
if not, provide a fresh log using the link
Ahhhh, yes, it should be that. I skipped that part in the tutorial... let me check
Yes, the dialogue works now, thanks
@teal bridge there's some strange behavior with gamepad scrolling and focusable views
the checkbox is Frame > Lane > Image, while the item icons are Frame > Lane > Lane > Panel > Image
if i move the focusable up to Frame > Lane > Lane > Panel it is fixed 
If you can submit a simple repro case then I will definitely look into it. The "vertical lane of horizontal lanes inside a scrollable view" is one that I'm using in SL so it doesn't seem to happen with every possible configuration.
(Focus search behavior is recursive and therefore complex so there are likely to be some obscure edge cases; I'll likely only discover them as people submit them.)
Btw, that looks vastly improved over the other day's prototype, so grats on that.
i gotta figure out what do with all this whitespace 
You could just make the frame thinner.
Although it could look slightly silly at like 200px wide.
Ok I got the harpsword working with left click being sword swing and right click being a "hold still, charge a shot, play a sound when it's charged, and releasing shoots a projectile." Still needs some work for the polish but it works.
But, it's still a melee weapon so the action button enters the parry animation and function. Is there a way to suppress the action but keep the cooldown? Also to change the cooldown? Do I have to use Harmony prefix to stop the parry from happening and can I make it only suppress the harpsword and not other swords?
BTW I did try making it a custom slingshot instead but found it was being a little cumbersome to create it as a slingshot when it's much easier to create a custom melee, and to do the custom bits of swapping the aim/shoot and sword part, especially when the only thing I wanted from slingshot was the "aim" bit but without ammo, so I went melee weapon.
i don't know the answer off the cuff, but i would not be at all surprised if the melee weapon right-click behavior was hardcoded for sword/dagger/club, so be prepared to use harmony
I am thinking so.
depending on which method you intercept and how the result is processed, it may be possible to do via postfix, which i recommend whenever it is possible
I was thinking prefix so when the action button is pressed, the prefix intercepts the defenseSwordEvent, but could a postfix take the event and trash it and that's better?
postfixes are generally more desirable for compatibility/reliability, since they aren't skipped. but sometimes they aren't suitable for a given problem (letting an undesired event happen and then trying to negate it is one of those times, i suspect)
I bet it will be a prefix on MeleeWeapon doAnimateSpecialMove but I need to read up more on Harmony.
excuse me, can someone explain to me how the Leah bot and the mod showcase channel work? how does one even get their mod to be showcased here? i'm just a lil confused, i kinda couldn't find any explanation for that anywhere
you need to have the mod author rule (orange username)
which needs level 25
otherwise you can ask a mod author to showcase on your behalf
err and how does one even get levels?
Next SpaceCore will have a fix for zero schedules causing problems with showing in the wrong location and broken schedules on some days.
(This isn't in the base game yet because we're concerned about regressions this late in 1.6.9 - much easier for me to re-release a new version of SpaceCore if something is broken rather than do a new game release)
keep chatting 
the first column behaves fine, second column is the weird one
https://gist.github.com/Mushymato/1ff478ff5918fc433c3b675413141b89#file-focustest-cs-L33
@brave fable: be pinged (12h ago)
@next plaza: look into blueberry’s question (if they haven’t solved it already) (12h ago)
It looked like it was solved already
if you want a mod you made showcased someone who is mod author can do so for you
seriously, if a modder wants to get their mod showcased then they have to spam the chat?
that doesn't sound quite right...
too bad... i guess my mod shall fly under the radar then... 😿
It's not spamming the chat
its pretty common, e.g. #mod-showcase message
It's participating in the community
do you have something you want to share 
Thanks, I'll check it out as soon as I get the chance.
spamming the chat wont work anyway afaik you only get lvl points, like, every minute or so 
anyway, chat, how OP would it be if a normal dialogue would give the farmer a stardrop tea(or would it be more balanced to give it in a little mini event)
maybe if it only happens once
It would be more about how often you gave it
or once a year at most
hmm
running my mouth for no purpose, when i have nothing really to add to the conversation is yapping, last time i checked and yapping in text = spamming
but thanks, 😕
i guess, i will just hope for the best, that my mod wont get spammed forward by useless machine-translation mods in droves.
you could just post your mod in #modded-stardew
I mean, asking questions if you get stuck counts too.
Also, like chu said, someone can showcase your mod for you
aka the channel where ppl actually play game instead of testing mods all day
it would be no "no purpose" if you just normally talk in chat, thats what you usually do in a chatroom, no?
[You actually get points for one message per 30 mins, afaik]
hm, maybe ill jsut give another tea instead of the stardrop one. i dont want to make it too complicated 🤔 just wanted a "hey i mentioned wanting to give you a cup of tea" kinda moment
yeah but i figured shit out on my own cos 1. its art, not script, 2. i did my homework and read the guides online, so i can unstuck myself if needed.
really? that sounds actually p low O:
That's fair, I usually try to figure out stuff myself too
looking forward to void's tea expansion \s
Teas? I like tea 
Completely unrelated, but did I ever show S&S's dual wielding here
(Implemented recently)
dual wielding?
ive only seen the chakram
You should either way, because it's cool. 
did you mean helicopter /j
Like using two weapons at once?
Chakram isn't S&S, it's MMR 🙂
Yes
I'm curious now
(one XP point per minute, one level up per 30 points, so 30min at the earliest for a level)
my two teas btw
i didnt wanna figure out the keg so its just....like any cooking recipe...
You talked about it but I have not seen a clip, that would be really cool to see.
(both are rose teas btw)
(The most interesting part to me is that there's no XP curve per se. It's 300 for every level.)
Still a couple bugs to work out when using custom weapon types (like chakrams showing in-hand when you guard, or using the chakram ability doesn't let the guard work if the sword is in the offhand), but for vanilla ones it's fully functional
You can even equip two daggers and get double the stabs
lowkey wondering if i should go a bit bonkers with teas afterall since constance does like them quite a bit but, hmm
There can never be too much tea.
can i put a torch in my offhand
Oh that's cool.
Just weapons
burn the enemy
(Specifically melee weapons, no slingshot)
Slingshot probably would be a pain, since you need to aim it
Yeah
you can do that with your teeth
Time for an auto-aiming slingshot!
become one man band but with weapons
Oh and the chakram combo swings don't seem to work when chakrams are in the offhand
Fun fact: There IS code for slingshots to auto-fire, but its blocked off from player-access for some reason
ie.
First set of swings is chakram offhand, second is chakram main hand
When chakrams are in the main hand, they have different swing patterns consecutively
how about...two penny frying pans...
beautiful
...If you manage to get two of them
You can buy them both from DF theoretically
Can't you get one a year though
I didn't mean to imply you couldn't
Just that it would take a while
I know, dw 😆
go into mines, make everything fear you with two infinity gavels /j
also idk how likely you can get em, i jsut live for the mental image
goes to add more tea to my possible scope creep fishmongger update list
ill never finish this update :)
How in the world is __instance null
Apparently I encountered it before since I have that __instance = ...;
But... how?
Oh I'm patching the static version
Rider complains at me for checking if that's null all the time. Take that, Rider. /s
I think I remember someone mentioning there being dotnet templates?
I'm trying to find them if anyone know about them.
for stardew mods? I think it was focustense that made one but i can't remember 100%. i just use my own
Found it
Why is it not on nuget >.<
Okay, looks like you can use templates installed from the commandline inside Visual Studio.
Rider too! very handy
I remember just 4 years ago, you had to make a separate VSIX project if you wanted a template to be usable in Visual Studio. That was annoying.
Is the only difference code wise between a sword and a club, the special attack?
yea they have different base speed
Also clubs have more knockback
all weapons in the game are MeleeWeapon class though, if thats what you care about
they just have different parameters
apologies if this is a a dumb question, but do items have a unique ID? and if so can i bind a key to whatever slot that item is in by getting an array of items from back pack and then finding the item ID
You could iterate over the backpack and find an item by it's ID, though you'll probably want to account for holding multiple stacks
All the item ID's can be found in the unpacked files, primarily in Data/Objects but depends on what ID you're looking for
aight thanks, and i didnt even think of multiple stacks goddamn i didnt wanna go that deep, welllll do they keep the id across stacks tho?
It's all the same ID, it's nothing as unique as like a unique ID for the inventory
hi guys, first time doing this, i created a custom hat that replaces the vanilla '???' hat (ID 92), which is normally unlocked after completing the game. the mod works fine, but i'd like to make it so that the player automatically receives the hat as soon as the mod is loaded, instead of having to wait until game completion. what's the best way to do this?
you can add the hat with the AddItem action with a trigger action
(and probably set a mail f lag too so you dont keep adding it every morning)
Could also send it in the mail
Was replacing the hat intentional, didn't want to just add a new hat?
mail is also the usual way to send items yeah. i just took "as soon as the mod is loaded" to mean like, immediately. but if you want a lore friendly way to do it then mail is the goto for sure
I think you're just addicted to trigger actions right now :P
i mean, you need them to send the mail too
i thought i couldnt add a new hat and had to replace an existant one
Yeah, that is true
(unless you do it in dialogue)
Nope, you can make new hats
hm im unsure how your mod is different than spawning the hat directly
might make more sense to add it to some shop so its got a cost
How are you changing the hat currently?
i changed the pixel art of the hats.xnb file
Oh, yeah xnb modding isn't suggested anymore
its an xnb mod and not a Content Patcher mod?
!startmodding
Making mods can be broadly divided into two categories:
- Content packs are formatted text files, and don't need any programming knowledge. They can add/edit NPCs, maps, new items, shops, and more. To get started, see the list of framework mods, the wiki tutorial for Content Patcher, and there might be relevant guides on the tutorial wiki.
- C# mods use programming code to change fundamental game mechanics. See getting started with C# modding.
Usually it’s easier to start with making content packs, since you don't need to learn programming.
use content patcher and add new hat
or do you just mean you unpacked the xnb and edited it after but used it in CP?
can checkout fashion sense too
i unpacked it and then made an assets folder with content and manifest to make it into a mod ig
no idea tbh what im doing lmao
JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.
If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.
When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.
fair, and I can use assetrequested to change the speed/reach/whatever to my liking, although the end result item might look odd. I'm just thinking on what would be easier to override the special action but I'm reading on harmony to see and then I'll play with it.
Can you change their parameters after they're in your inventory though?
I mean, obviously you could specifically iterate over your inventory and make the change, just don't think asset requested will catch it
Unless weapons are different in that regard, haven't tried
for the initial balance I'll just tweak until it feels good and make that a base. For updates (like when infusing other weaopns) that will be a fun interaction to explore when I get to that point.
oh so its still an xnb mod, ish
Lol, a hybrid mod
I always forget CP can just load xnbs
You don't have to convert the image back to an xnb before using CP to patch it in
to add to that, you shouldnt convert it back to an xnb
I guess this is technically just a full on XNB mod using CP to do it though huh

I mean, it's the least offensive way to do an XNB mod, because it's technically non destructive
Content Patcher lets you edit vanilla content or add new content without touching the xnb files so that everyones mods can play nice together
I don't actually know if loading an xnb into the hats file would mess with editdata on hats after
I'd assume so?
I think if it was the first patch to happen it might be fine
But if it's later than any others it's just going to load over the whole file
I guess it'd be the same as just normally editdata priority affecting things
Which I guess isnt technically worse maybe. i dunno
as long as you're the only mod loading to hats
Goes back to the normal amount of "you shouldn't do this"
I was not aware of this, just make sure it lets you specify the author (-au) and name (-n) parameters because the template fills in quite a few of them and they're a pain to change later. (Which is why I made the template!)
If this is a personal mod that you don't plan on releasing and you don't have any other hat mods you care about, this is technically still fine to move forward with
yea if it was for me it would be ok as i can spawn it with another mod i use, but i plan to release it soo... i will look into not replacing but creating a new one.
(Rolls in)
!cp I believe this is still a good place to start?
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.
For getting familiar with CP itself
me had a funny idea of making a bike shop that sells bikes like in the pokemon games!
https://stardewvalleywiki.com/Modding:Items#Hats
This is the page for hat data, it's unfortunately still the old single string version, so that table is gonna be really important to reference
https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide/action-editdata.md
It might be linked in the guide, but I'll send it anyways, this is the github docs for CP, very useful
thanks for the help 
Best advice is to find another up to date mod that does either what you want or something similar and see how they did it, as long as it's a CP mod you'll be able to just open their jsons and see everything they're doing
yeah, i think i found one so i will try that. thanks again
all the custom objects' draw behaviours are handled from the usual draw/drawinmenu methods. does 'easier' mean implementing the BC API still?
It should be the same if you need custom draw code, and easier if you don't need custom draw code.
thank you pathos! i wasn't sure if this would ever be changed since legacy crafting recipe strings survived the 1.6 alpha. wonderful ticket turnover time
I actually have some ideas for how to handle people doing weird drawing things without needing to use the API too, but I haven't gotten there yet.
thanks, i'll redownload better crafting when i'm free and see if my items survive. item registry is wonderful
It is!
raised garden beds test release getting warmer 
oh also while you're here, is there a hook for listening to cooking events through better crafting? i think i saw some mention of love of cooking not gaining skill xp with your menu enabled instead of mine
i only have a patch on the default menu's on-recipe-clicked behaviour and ofc my own menu, no behaviours for other mods atm
For users of the debug repo, I suppose you can't hit breakpoints in methods once they've been through a transpiler, huh? Have any of you found any clever workaround for that?
i have a dum idea, what if you copy the function from decompile into a skipping prefix and have break points there
It's a very long function that accesses a lot of internal state - I could potentially do that though I suspect it would take all day.
For now I guess I'm just going with the "log a whole pile of crap to the console" approach.
Nope!
Once a method is patched breakpoints stop working
Yeah, I mean it's understandable since the method being invoked is literally no longer the method in source, it's an entirely different method in an entire different assembly. But I hoped maybe there was some clever source-mapping hack or something.
everything works as intended now, the only issue is that when I used the '???' hat the earrings etc got hidden but i cant seem to do it the the new hat
!json share your content
JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.
If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.
When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.
I ended up finding the issue, in any event. I was this close to the conclusion that it was a game bug, but nope, turned out I just missed the chance argument to the RNG.
(Rule #1, the bug is always in your code. Except when it isn't. But it probably is.)
You can add a handler to the PostCraft event:
https://github.com/KhloeLeclair/StardewMods/blob/main/BetterCrafting/IBetterCrafting.cs#L1504
example from Yet Another Cooking Skill: https://github.com/Pet-Slime/StardewValley/blob/master/CookingSkillRedux/Core/Events.cs#L34-L44
Just realized CJB Item Spawner is working again 
How do you stop the player from moving for a certain time. I am trying to get animations to halt the player/slow down a preexisting animation.
there is Game1.player.CanMove = true; (replace with false as needed) that you can stick into stuff.
Awesome, thanks!
I already found purpose for my little mod
You might want to use Game1.freezeControls instead of manipulating Farmer.CanMove.
the best part at the end, when i set L3 + X to go to food item, it just startes eating for me, amazing considering when i usually need food on the fly
It depends on the exact purpose of course - whether you want time to pass normally during that animation where the player can't move. Some vanilla animations freeze time (like eating), others don't (fishing casts).
def gonna be a loooot of refinement
you speakign to me ort the other dude? prob other dude. but idk i couldnt get supress to work super well yet
im at the point where i think i HAVE To make whatever it does - whatever button i end up choosing, whatever i supress, i think i gotta make the key combo also preform one of said action
so if its bomb, it should lay the bombv
exciting
that might actually be the entire mod, i make it just use X thing and then go back to Y , Y being what you had on originally oOOoOo
I can't see anything in your json that points to why the behaviour would be different. Maybe your hat texture is smaller and that's affecting it? (I have no idea, I am just throwing an idea out.)
its the same png tho that i used before
Was it doing what you wanted before and isn't now?
Well, you were doing an XNB mod before and you can change image sizes with that
So you should make sure your png is 20x20
If I wanted to display what button was bound to each spot, what lib would yall rec
Or should I just draw er on
if you want something custom drawn you basically gotta draw it yourself a lot of the time
Aight, yeah just anal text like L3+X
Shouldn't be too bad
I am noticing that if I'm on a different page of my backpack the binds still go to slots on those pages anyone know how to make it go to the specific page and slot?
And I'm prob gonna allow any button to be a modifier of any button now that I think about it cuz I love that it matters what order I'm hitting the buttons in, so I can have a bind for l3, x, then a bind for x, l3
So I can manipulate the player's ability to move, but how would I do that for any duration of time?
is it always going to be a set amount of time or do you want to return control after something happens/finishes?
Which viewport is the "screen" viewport? Like, would work correctly in co-op.
Game1.uiViewport apparently is not it.
Both cases
well, some things let you define a function that fires when it finishes. you can always return control at the end of some other method manually. you could use UpdateTicked and just poll for when you should return control. you can also use a DelayedAction. theres not one answer
I actually just finished doing that.
thanks @rancid temple and @uncut viper for your help. i uploaded the mod 
Figured out re: the viewport, for some reason the width/height are correct but the x/y are weird. Explains why I always ignored x/y in older code.
Part 3 of 4 finally done.
Figure out the issue or just fine with how it's working now?
yea its fine for now maybe another time hah
i credited you in the description for your help 
Hey has anyone here worked with the StardewMods repo ? https://github.com/Pathoschild/StardewMods I'm a newbie to C# and I'm getting this compilation error I'm not sure about: 'string' does not contain a definition for 'EqualsIgnoreCase' and no accessible extension method 'EqualsIgnoreCase' accepting a first argument of type 'string' could be found
EqualsIgnoreCase is an extension method in Stardew 1.6.9
so you need to update to the beta if you want to build that repo at HEAD
Ohhh thank you so much
I see in the game code loc.Map.RequireLayer("Buildings") where loc is a GameLocation. However I cannot access RequireLayer with my code... what am I missing here? I also can't use the class Tile which also shows up.
right click, take VS's suggestions
(I think)
(RequireLayer is an extension method.)
your using for RequireLayer is StardewValley.Extensions
for Tile, it Depends TM
(I need more context, it might be xTile.Tile?)
yeah, I think it is
and Extensions worked, so ty there
Tile tile = loc.Map.RequireLayer("Buildings").Tiles[x, y];
for context
and using xTile.Tiles got that - thanks for the tip
(also VSCode might actually be smart enough, but it also very aggressively automatically inserts random using lines so I turned that feature off so I don't end up having to specify which Vector2 I'm using constantly)
oh to blacklist using System.Drawing from ever appearing in my projects
while we're at it fuck system.numerics too
(Ahhh but system.numerics is soooooo goood!)
not good enough to know when its not wanted
(I appreciate the very strong opinions - we are all correct)
Don't you want TotalOrderIeee754Comparer<T>?
Were light sources given string ID's for a specific reason?
Hey, I did say I really wanted to do more simd stuff lol
for qualified naming most likely
removing lights used to need iterating whole light source array
Oh, oof
(Fwiw this is one place where I'm not exactly sure which version is faster. )
N approx 50
It's probably the dictionary
There seem to be some functions, either private or protected, that I can't mess with using Harmony. Is that working as intended?
Private you should be able to patch, I dunno about protected, don't think I've tried
You can
You just can't directly reference them
If you use AccessTools.Method to get them it will be fine
You can't use nameof() on them but you can just write their names with a string
(Or just specify the name without nameof-^ for annotations)
I probably have something wrong in my syntax then, or I'm calling the wrong things.
Don't use nameof
You can't with private/protected/internal
Just use "beginSpecialMove"
ah like this
that worked but broke only the move part of my charge mechanic which makes me think the "stop player from moving" wasn't working to start, so that's progress!
and then later I can add a postfix that adds some kind of animation
ty
Does SMAPI automatically make lightsource ID's unique between mods?
No
Mk, many thanks
(it's at least easier than before?)
Adding implicit usings for all the XNA types goes a long way to eliminating the issues with System.Drawing and System.Numerics.
(if they're already in scope, VS won't try to add imports)
(I wish C# had scoped imports)
ie, "import this namespace but only in this function" type of thing
What would that help with?
if you have conflicting imports
quite often in stardewland I had to have, like, xTile's Rectangle and Monogame's Rectangle
Yeah, that's always annoying
You can alias them as xRectangle and so on though.
I did that for one of my game projects, it definitely helps
(which is what I do.)
Try doing it in Java where you have to write com.company.product.foo.bar.baz.something.utility.manager 80 billion times.
but certain other languages I like let me import into smaller spaces 😛
(I think c++ is fine.)
Certain others are... Rust? Trying to remember if it actually has that, but can't think of any other language you'd be putting in your "liked" list here.
Anyway, on topic again... is it safe to write to realMillisecondsPerX fields, or is that something you should never do?
I think I've done it before for Capstone Professions
are you trying to slowdown/speedup time
Hmm, nope, that did something else
Hm, searching your repo and I don't see it.
Speed up, in this case. I know there's ExtraMillisecondsPerBlah for slowing down.
I could've sworn I've done it at some point
And assigning a negative value to the extra seems sketchy.
Huh, I just noticed I don't have the GMCM options button in the main menu on the beta
It's definitely still there lmao
Just invisible
Oh no
Uh oh, that means Casey has to update GMCM, which means I have to update all my hacks.
what the hell could have changed
Well, I'm not writing 2.0 just for that
Lemme rip this down to a more basic list and check
Do you have any mods that recolor it?
So no one knows about the game speed thing? I can just try it and see, but I'm figuring a lot of things might be very subtly broken and not show obvious signs right away.
Though I don't see how that would suddenly break
Like, I don't know, NPC schedules and such.
Shouldn't have anything that recolors
I wonder if OnRendered isn't getting called on the title menu anymore
Specifically Helper.Events.Display.Rendered
oh no
it would probably cause issues, huh
it looks like timespeed alters Game1.gameTimeInterval
https://github.com/cantorsdust/StardewMods/blob/master/TimeSpeed/Framework/TimeHelper.cs#L26
you might be able to get away with making all the npcs run
in 1.6.8 I get the GMCM button doubled sometimes (with a recolor) in case that's useful info
What do you mean doubled?
Oh interesting, I saw gameTimeInterval but didn't even occur to me that it might be writable
[Mod Options]
[Mod Options]
right on top of each other
i feel like that is same thing as modifying realMillisecondsPer* tho
That's probably a better bet, thanks.
oh, I meant more
npc.Speed = 4;
npc.isCharging = true;
do you have a mod that stashes and replaces GameMenu?
Well, most sub-ten-minute calculations use gameTimeInterval along with one of the realMilliseconds fields, they're always used together. So for some reason I assumed gameTimeInterval was fixed.
Just to be sure, took it down to just GMCM and it's not there
Oh, ingame? I didn't realize that happened, but I thought rokugin meant the main menu
I wouldn't be surprised if I did - this is in my main save with lots of mods. It's not a problem I'm really trying to fix, just thought it might be useful to know there's weirdness in 1.6.8 as well so it might not be the beta having a particular issue
Sorry, had to leave quickly earlier. There are events for crafting, yes. Yet Another Cooking Skill uses them if you want to see an example of them in action. Sadly patches to the original menu can't really be supported with how my stuff works.
ah, gotcha, haven't seen that in the main menu so nvm 🙂
yeah, it's known that if you stash and replace GameMenu, GMCM will insert its button twice 😛
Actually wait, I think gameTimeInterval is the same as the elapsed milliseconds per frame, and Timespeed is really weird for writing to it.
fwiw, it also wouldn't fix npc schedulign issues
It's not "milliseconds to use for the next interval", it's "milliseconds that the last interval used"
I don't think there's a good way to make sure they don't break
unless you like, really really want to rewrite scheduling
minus that, just make them run lol
Haha, loop through all NPCs and change their speed I guess?
yup!
I don't deal with a lot of NPC stuff except for penpals, are NPC references all "already spawned"?
er
would patching the Speed getter suffice
do you want the answer?
Like GetByCharacterName, that's the actual instance of the NPC?
SP or MP
It's definitely true for the host or single player!
Well, I need to know the answer in the sense of "does changing the speed on this thing actually change the NPC's speed"
that's alright, my menu's the same - too much specific behaviour piled into the original menu clicked behaviours to just call them from my own
(also time fuckery only works on host or single player anyways iirc.)
why wouldn't it work (outside of the vsync risks of taking 16ms sometimes)
Hmm, that is a good point, I should perhaps just disable the fast-forward feature entirely in multiplayer.
I thought you had to do something like, I don't know, ask the GPU for a different slice of memory
if you wanted to resize
you can JUST ASSIGN THAT and don't run into issues with that?
what do you mean by this bc the mod(s) ive used that slow down time have worked for the person i play MP with. is it something different about speeding up vs slowing down
Actually maybe it would be kind of cool to be waiting for a fish bite and watch both the clock and NPCs whizzing by at warp speed.
that code isn't all that different to what SMAPI has pretty much always done
no, you can do that! It's the resize that is bothering me
the resize
are you host?
I've started doing dynamic texture stuff a little in Better Crafting, just to match recolors with my custom textures. Stole it (with permission) from Matt and his stuff.
Again, GetData/SetData are fine (in moderation)

