#making-mods-general
1 messages Β· Page 190 of 1
New quote added by chu2.718281828459045235360287471 as #6312 (https://discordapp.com/channels/137344473976799233/156109690059751424/1333972272205009028)
Xmas in the mines
unrelatedly, if anyone wants it, this is on nexus now
https://www.nexusmods.com/stardewvalley/mods/31271
I imagine I would have to make a separate compatibility patch to LA to get it to say otherwise, not entirely sure where to start with that but I can take a look... uh eventually 
Actually it looks like it isnt working which might by why this is happening - I crafted everything aside from the two recipes that I intended on excluding and they don't show up with your debug command on the recipes needed... but I also don't have the crafter master achievement
Wait wait i thought you were supposed to get a little notification thing why didnt it do that... Qi's walnut room says 100% so maybe im insane (or havent reached the craft master achievement enough times)
Did you sleep?
doesnt it have one of those little star things -sssssssoh
Sometimes achievements don't pop until you sleep
i did not because i was using this world farm for craft testing lmao
B) Good to know its working then
Thank you for the mod it's very cool
I was sad when I couldnt exclude the recipes from perfection alongside the crop shipment and npc requirement :3
Lemme know if you have any issues with it, I did some testing but being thorough with something like this is difficult lol
other than lookup anything telling me i still need gold bars to craft something there's no issues I can see :D
that and me not realizing the achievement thing
how did you do the perfection tweaking roku
Just postfixing the methods that calculate your percentage completion
Create a list of recipes, remove the ones that are excluded and then check the way vanilla does for which ones are made
i guess the easiest LA integration would be setting player.craftingRecipes
I honestly didn't even know that LA would tell you if you needed something for perfection still lol
You sure you're compat with perfection tweaker here
but it gets messy cus i think that is also unlocking stuff
Does anyone know the answer to this?
I'm almost certain I'm not lol
Tbh roku there is a workaround typically anyways so
For recipes?
Yup
here's where it do the check and make field
What is it? I've seen people ask how to exclude recipes from perfection a lot and nobody has ever mentioned a way lol
You patch in the recipe only when you want it unlocked
You put it as a default unlock
So you'd still have to craft it though
i don't know of a tutorial for this specifically. the content API page on the wiki is the closest thing i know of but it's not comprehensive.
if your mod is simple enough you can probably do it with CustomFields on whatever kind of thing you need to modify
selph do u want homework
Thank you Selph π₯Ή
for when ur not touching grass
I love you 
Or do you mean only patch it in when you open the crafting window and remove it when you close it?
also like. what if i want my recipe to be purchaseable anytime but excluded from perfection
nervous laughter
what is it
have u heard of Clothing selph
You make it sound like Selph is a nudist
yeppp just backread and saw fireredlily's DM from hours ago
wow so the homework had already been assigned
Is there a way to increment that from a trigger action
Which that?
increment what
increment clothes
β€οΈ hi Selph, sorry for bugging you!
I was asked if it was possible to do something with the massive overabundance of clothes my laundry machines create so I thought about recycling them, but, uh, yeah.
_>
They can just throw them away, it's fine
no prob lol, I welcome all manners of bugging
anyway I wonder if swapping out the clothes with a holder item containing the clothes instantaneously in the prefix and then swapping back if it's not eaten in the postfix will work without exploding things
check back in uhh 3 weeks
Sounds good, my only thought was 'it becomes cloth and nothing else' if that simplifies things at all
i look forward to shirt honey
I mean, on the upside, if this homework does eventually happen, that's also one step closer to "shirt becomes cloth + a dye", or shirt + dye = different thing. >_>
i remember flavored object can only have flavors from object though
(I will 100% make a custom item for dyes to go in via CP for this)
since it use preservesheetindex to store flavor iirc
just make a new "query" called FLAVORED_SOMETIMES_NOT_OBJECT
alternatively, drop a blueberry and a dyeable shirt in to get a blue shirt. Oops, you stained it. xD
maybe if u store the shirt's taste in mod data
i do think the other way around is just dyed clothing and probably doable with a straightforward item query
given that EMC already has shirt output
I mean for the dyeing machine, it'd definitely be better to limit it to dyeable clothing
unsure how much point given sewing machine
do my eyes deceive me? pathos making actual mods? for fun???????
I'm so happy I could cry
he never confirmed it was for fun /j
pathos, if you're being held hostage, blink twice
(It is kind of fun, working on the Central Station map content currently.)
kind of...
does anyone know where the event where Mr.Qi t-poses you off of the side of a cliff is
Mostly not made from grubs 
a resounding endorsement
It's not in the temp files from what i can see and there's no summit map loaded 
I kind of want to build a bunch of shops now for that rotation, LOL
sounds more fun than my character sprites right now >_>
im happy to see that Central Station will continue the tradition of ridiculously overcharging for food and drink
as all transit centers do
it feels like a legal obligation for them to do it at this point
Yep, now we just need the novelty gift shop trinkets. We've already got the t-shirts in that rotation.
(That also reminds me I wanted to make band merch for Sam at some point)
as a loyal customer of joja donuts, you are unfortunately not able to redeem your joja points for rewards at this location
Is it Duty free though
hey Pathos, you're looking for even more scope creep right? let me buy weekly or monthly bus passes for discounted rides 
Joja donuts...
Book stand, with random books
If you use CJB cheats menu you can find it in the wrap section I think.
dont forget to run a trigger action when you enter Central Station that removes all drinks from your inventory
Also Totally unnecessary travel maps
(I'm fully scope creeped for 1.0.0, but it'll be easy to extend in future versions!)
Pathos, if you need spritework, feel free to hit me up!
that's only if you're boarding planes
I remember that very vaguely, so I could be wrong.
eventually Central Station will handle planes tho
(honestly, a trigger that temporarily steals your cooked dishes in the movie theatre would have been so on-brand)
wouldnt be too difficult to do really
no no i meant in the content files sorry
I want to look at the data for the event
Do you mean the Summit event if you cheat up there?
Yeah that one
It's hardcoded
I think the Qi summit event was hardcoded?
If you know the name, you can search for it in whatever file explorer you are using.
Both events are hardcoded
pathos can i put arbitrary tile data for the shops?
of course it is 
You might be able to find individual strings somewhere? If anything.
Nope, they're set in C#
oof
Summit.showQiCheatingEvent
I mean the event is ... very interesting to look at for sure so I imagine they did it for that reason - though i did do a quick play of it and it looks like he doesn't actually call you kid in that one so i am free from having to edit it B)
And they're even private
just to make things extra good
Mod-provided shops will probably be in 1.1.0 and the Central Station map is still being designed, but yep the idea is that the vendor shop will have a closed-off area when you can specify an arbitrary texture (of the right size) to draw so each shop can have a custom appearance.
Oh actually, looks like his dialogue is in Strings/1_6_Strings:QiSummitCheat
I love the idea of a pop-up store location for rotations, honestly. β€οΈ
The current plan is to have three shops: a permanent food court and gift shops (which lets us change the map accordingly), plus a rotating pop-up vendor slot.
So you can at least see what he calls you
oh u see i specifically wonder about whether i can put arbitrary tile Action bc i want to do -2 work in letting people sell animals via livestock bazaar
but besides that it could also be used for minigames (e.g. crane game)
The background effect setup is funny 
cant wait to buy livestock at the airport
(and an outdoor area in future scope-creep, yes?
)
Exotic animals
They cost 10x as much as normal
Arcade prize counter time xD
Hmm. Originally I was just going to have a shop ID, but I could make it work with a custom tile property instead. So the data for a custom shop would look something like...
{
"ShopAreaTexture": "...",
"CounterTileProperty": "Action OpenShop SomeShopId",
"Conditions": "..."
}
What does "%noturn" do in this bit of Pam dialogue (green rain)? "It's a sign from the Almighty... We're doomed...%noturn$s"
no 'kid' mentioned which means im FREE IM FREE
yea 
Makes them not turn to face the player
although hm, i hope no one uses the npc rect features in here
(Maybe I could support a map patch instead of a texture, so mods could do stuff like animated shop tiles.)
Future scope-creep: NPC locations guide for placing custom NPCs in the Central Station. We could beat SVE to the new area. xD
(That's actually already on my list of ideas for upcoming versions; you'll be able to add random non-social NPCs to the rotation which can appear in the central station too.)
This will end up being a super-detailed single-room expansion mod with a side transport feature.
t r a i n
i figured out what i think is a decent way to support this explicitly, and aside from one "when does this actually load" problem, it seems to be working, so expect a framework from me Soonβ’οΈ
Happy Lunar New Year, guys!
:SDVpufferchicklunar:
I'm curious, are there any flags for when the player buys their first cows/ducks/ etc.?
We were just discussing this in another server π purchasedAnimal_[animal type] for the CT and PLAYER_HAS_CONVERSATION_TOPIC [Player] purchasedAnimal_[animal] for a GSQ of it
Has Pathos fallen into scope creep content hell? 
(that conversation topic only works in English, btw)
why?
because. for reasons unknown
purchasedAnimal_[displayType]
not internal type
DISPLAY TYPE
anyways
happy lunar new year, everyone
on my way to display favouritism by creating some purchasedAnimal_poulet conversation topics
Happy Lunar New Year, Atra!
π
really though that feels like a bug that ought to be fixable in any minor version update
the NPCs who use that CT for dialogue dont actually even have the translated display name in the key. so that dialogue has just never been seen in other languages i guess
unless "Chicken" and "Dinosaur" are the display names in every language
They're not, maybe one or two languages share those words with English, but that's it.
french stardew players have never seen Demetriums excitedly talk to them about a dinosaur 
Is demetrium a new mineral
no, scientifically its a new fruit.
How does this look for the Central Station pop-up shop feature? Any changes to make it more extensible before I implement it?
(This may change a bit before release, depending on the final map layout.)
are you open to the idea of including maybe a CP Token that returns which shop ID was chosen that day?
Possibly. I assume it would mainly be useful for NPC dialogue/schedules, so I'd need to see when those are set to see if the game state queries are ready at that point.
did you choose Conditions (plural) deliberately or by accident? most game assets use Condition (singular)
sincerely, a person who chose Conditions for his framework by accident
NPC dialogue/schedules mostly yeah
I can change it to Condition for consistency.
maybe a GSQ to check what shop is there if thats easier and a token is not feasible?
is there weights
Yep, but that runs into the same race condition. For example, we might end up with:
- A content pack checks which shop will appear today, and sets its NPC dialogue for the day.
- Central Station selects its shop.
- The shop's
Conditionreturns a different value than it did in step 1, so a different shop is selected instead.
So I'll need to make sure Central Station can fully select the shop at step 1 (which means GSQs needs to be fully ready for the new day; e.g. the date is already set, etc).
a GSQ wouldnt be used for setting the NPC dialogue because it cant (by default) be used for when conditions
i was thinking more for a LocationChanged trigger that can add a conversation topic for the day once it checks what shop is there
or for GSQs in dialogue actions
You can use the Condition field with queries like RANDOM to make a shop rare, but you can't have a guaranteed day; every mod shop has an equal chance of getting selected (if its Condition matches that day).
which wouldnt need to be set conditionally via a token at the start of the day, can just have it be used in ordinary dialogue
(plus then C# mods can also use the GSQ to check it any time during the day for whatever reasons they may have)
(I might be turning another Google Sheet into a shop builder template in preparation for pop-up shops)
(selfishly: if you provide me the name of your asset, my automated gsq checker can also help check the gsq in your framework: https://github.com/atravita-mods/StardewMods/blob/f15bf0d29c019ea038da5809b9976cf1ac2e29ac/SinZsEventTester/IEventTesterAPI.cs#L6)
(The format is all still subject to change until it's released. I'll have a technical beta soon so mod authors can try it out in practice and give feedback before we're locked into the format.)
In multiplayer, are the farmhands all required to install any mods the host has that add or edit events? I'm not sure how much I need to do for multiplayer compatibility
Best practice is for all players to have exactly the same mods installed, yep
Like say I edit a vanilla event but the farmhand doesn't have the mod, would they just see the vanilla event or will they die
I think most modders don't bother with MP compat, to be honest π MP bugs are hard to troubleshoot
if you use broadcast AT ALL everyone must install that event
AND that event should not be conditionally patched in
otherwise, if you use the wait for everyone in multiplayer command (don't ask me its real name, I forgot), ...everyone needs that mod
OTHERWISE you're fine to have different mods in multiplayer
Okay, so if I avoid those then the farmhand shouldn't crash out at least, thank you 
(i bother with MP compat, but i dont bother with "what happens if two players dont have the same modlist?" compat, and i dont think anyone should)
(I used to bother with "what happens if two players don't have the same modlist" issues)
you'll notice every one of my mods lists this
okay maybe not every one, but the default template has that now
Sometimes I go mucking around with things that aren't the mod's main focus in order to macgyver a workaround for one issue or another, so I'd like to avoid introducing additional problems when doing so 
Q: Is this mod safe to use by myself without syncing in MP?
A: Feel free to me know
With Livestock Bazaar 1.1.1 the conversation topic now works in all languages bc i switched it to use type
did you make sure to add a completely different CT rather than changing the existing one to not break any mods that already use the old one
no i specifically changed it bc it would fix some vanilla dialogue that never appear in other languages
but that does break any other mod that has been using those CTs for things like custom animals
for all the other mods, their keys previously only ever worked in english
or ones that actually translated the CT key
I can imagine that is zero mods
im saying that if a mod added a custom farm animal with internal id MyName.MyMod_GreenCow, but the DisplayName was just "Green Cow"
then if they added a dialogue to an NPC for purchasedAnimal_Green Cow, its now broken
yea thats true 
i imagine that is not zero mods
tbh I on the other hand would be very surprised if that number is higher than zero
its ok though i think i rather have ppl see the vanilla stuff
i suppose i could like, trigger it twice?
is that an alright thing to do
i mean, the whole reason chu did it is bc someone was asking about using those CTs. so, clearly it stands to reason that people are using those CTs
technically someone asked if those CTs exist
theres no reason you cant just postfix the function that does it instead to also add a CT for internal name
the point is that its not something people dont think about or know about
so why should it be assumed to be unused
it might be nice to also like
when you can also just, not break it
add a mail flag tbh
so its easier to use in cp
i'd say thats enough arguments for switch to postfix 
you can do all 3 for absolutely free
i only uploaded this for like 10min so its fine if i dont bump the patch version right
if i were in your shoes i wouldnt bother bumping it if i was quick enough
Is it possible to make a specific tree only be chop downable by for example an gold axe or higher?
i think u put the big log?
I would like a regrown tree to only be doable by the iridum axe
this is literally just me thinking out loud, but at some point (possibly not the initial release though) it may be good for there to be some kind of MutuallyExclusiveWith field? it can't really be done via GSQ for obvious reasons but say you want to make sure that your mod's shop is never used at the same time as another mod's similar shop for example
There's only one mod shop selected per day; the other two shops are permanent shops from the Central Station mod.
that would do it 
did the scope creep into having NPC yet
(Probably not in 1.0.0, but there'll be randomized non-social NPCs in the station in later versions.)
if there are tokens for which shop is there, would an NPC be able to optionally have a special shop schedule that takes them to specific shops?
or is the station blacklisted for npcs entirely
There's no warps in or out, you can only get there by boat/bus/train. So it's not technically off-limits for NPCs, but I'm not sure how they'd get there unless they started the day there.
Question about Central Station because I'm building shops now: If the shop has an opening time condition (only open in the morning, etc), would it be possible to have multiple shops load per day so that another shop can take the spot when it's closed?
its not like theres anything stopping someone from doing a map patch to the central station itself if they really want/need to, right?
I'm making a food shop and deciding if it makes sense to have a breakfast shop or just put in all the different menus throughout the day.
I'd hate to take a spot away from someone if my shop's only open for 4 hours, you know?
Currently no. You can display a message the rest of the day, or even (with some conditional map edits) switch between multiple of your own shops.
Okay, so the best case would probably be to swap shops with conditional map edits then, so my mod had a breakfast shop and then something else from my mod took its spot in the evening.
Thanks!
Currently I've got a bookshop, an entertainment (movie posters, mostly) shop, a toy shop, and a snack shop. xD
(It can also be used for non-shops; e.g. you could have a little display with messages on interaction. The shop area isn't finalized though, so I wouldn't suggest designing the actual maps yet.)
yep, I'm just coding them right now, not working in Tiled until we have a map area.
Does anyone know if rainy day dialogue is also used when the weather is stormy? I probably can't write a line about liking the soft sound of rain if it is 
You might be able to use a weather: storm patch to change it if it does?
Don't trust me on the syntax for that though, it's late and I am sleepy
Ooh, good idea, but I'd still like to know if it's necessary before I fire up the game to check for myself
afaict from the code, it does count storms (and green rain too, though that might get overridden by other dialog, idk)
if its daily dialogue it'd be loaded before the tokens apply
Mm, okay, so I should make one regular and one with a when condition for storms, thanks 
i do not believe that will work bc of that

it happens in NPC.loadCurrentDialogue fwiw, though I'm not sure when the game actually accesses that
the CP docs specifically calls it out as a limitation
i might be wrong though
i am wrong actually i misread it
i should sleep
my brain took "custom update rate" and saw the "c" and filled it in with "condition"
I figured you'd still be using the rainy dialogue key and just changing what's in that key, yeah?
ah, I see
Ah, okay. Yeah, I'm just editing the dialogue/rainy file
you wouldnt be able to change it based on time or location when you talked to them abt the soft rain but ignore me originally thinking it wouldnt work for all day
(by that i mean with time or location update rates. not location based keys like it says on that page)
yeah, going by the phrasing at least, I guess CP can edit it at DayStarted OnDayStart before the caching happens, just not afterward
Woo, shops are all coded and given the 1.5x upcharge for being in a travel hub. π
@old edge Hey, you're the person behind Cape Stardew right?
Hello again, so I looked a little bit into the code of the skateboard mod and I see that the asset is being loaded but for some reason the asset still doesn't load in the game, there are no runtime errors and I am using mac os
what is boardKey set to?
are those asset keys referenced correctly in your content patcher pack / other places in the code? Even if an asset is loaded, it still has to be used
(silly question but where may I find crabs in the world? Not as an item but like, crabbin' around? Wanna test my Krabby sprites π )
In the cave?
i thought besides rock crabs they only ever existed as items
you need to fight the fake rocks
these crabs don't crab around? D:
Hmhm--mystery crabs then. I assumed they were in the world bc they're part of the critters sprite sheet!
thinkin about it more i think they jump off the pier on the island when you leave willys boat
...IS THAT THE ONLY TIME?

i cant remember another time ive seen a crab critter but i dont have the greatest memory
in vanilla, anyway
Everyone gets to see Krabby exactly once (without another mod) π
Thank yall for helping me solve the mystery!!
oh i thought it was random chance when you arrive, not just the first time
Okay, that would be much better then lol--
They appear in Willy's event. Not sure which hearts event.
I think it's one from a special order?
Or... Idk
But it's the one where there's a bunch of crabs in his shop
Yeah you can see him once in a while, I've definitely seen him more than once!
apparently there's a 10% chance (each) for two crabs to show up in the BoatTunnel map, aside from the island itself
both location checks are on resetLocalState, so presumably repeatable
iirc there's at least one mod that adds them to the beach as reskinned rock crab monsters, too, because I recall them greeting NPCs 
(okay yeah, 25% chance of 1 crab on the island, while the first time has 4 guaranteed)
In the console it prints that the skateboard has been loaded, but I get this error in the game, the asset is in the right folder and named corretly
that means there is no item with the id "-42424201" loaded into the game. an incorrect image asset likely has nothing to do with it
how did you add the item into the game asset?
because I doubt its ID is intended to be "-42424201" EDIT: see ramble below, it is
hmm okay ignore my question, I looked at the source code of the original mod and it seems the skateboard item isn't added anywhere into the game data at all
instead it's all runtime, with the item being created at runtime with a modData key, and with special game logic (even draw) running only if the item has said modData key
which, well, I guess aedenthorn didn't want a dependency on JA
if it were up to me I'd probably tear out all of that code and do it from scratch using 1.6 functionality, but that might be a tough ask on your part
(like in the original mod the crafting recipe for the skateboard is added by Harmony patching the crafting page, not by adding an entry to Data/CraftingRecipes)
For the text: is there a star character that's shared between all languages fonts? I know that "=" is a star in english, but not in other ones
i have a question about modding object sprites
so i've been trying to start out with something simple (editing a few sprites) before i get into anything more complicated but apparently its a lot more complicated than it looks?
i know i have the files named correctly and have them in the right place within the mod folder i created, and everything else is running fine, so does anyone have any ideas on how to fix it?
do i need to do something else entirely to get it to work?
also included a screenshot of the code i'm using in case it's something with the code
Are you sure you've called your folder "asets"?
Is it in the same folder as your manifest and content files?
did i seriously misspell assets
Yes

It's alright, you need a nap 
probably do lol but thank you so much mr. duck 
uh
yeah definitely time for a nap
What's the total size of your hay.png file? The dimensions, not the size in kb.
16x16
Then your FromArea X and Y is wrong
ohh
It should be 0 and 0
That's okay, it's quite a common thing to not quite figure out the FromArea properly
should it be 0 and 0 for all three of them then? since they're all the same size
Yep
and then the ToArea should be where the pixels on the springobject png starts?
The X and Y are the coordinate of the top-left pixel of the box including the asset you want to use/replace
Your FromArea X and Y are intended to point to the top left of the box that contains the image you want to replace the vanilla image with.
Yay you made a mod, good work!
do I have to define a set of area coordinates when loading in a new item's tilesheet? I have my fence set up in the same locations as other fence tilesheets but my sprite pops up as if the tilesheet starts at 0x 0y
afaik itll always start at 0,0 unless stated otherwise(could be wrong tho)
mm ok
just confused then cause my sprite shows up as just the very bottom right of a 16x16 despite being in the same locations as the vanilla fence tilesheet so I'm not sure if I should move things or what..
Did you give it sprite index
I didn't, another one of those things that I just didnt find when searching how to put this stuff together
Does anyone know of a reason why a custom npc event would trigger in debug mode and all work fine but not trigger when I go to the area at the stated day/time/friendship level? My other events seem to be working fine but I canβt get this one to work in actual gameplay without using debug π€
!json Can you send your code?
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.
The event code?
Yep
2724222
No, your code, not the event ID
Sorry I donβt know what it is where do I find that? π₯Ί
...the code? That you've been writing for the event?
The thing you've been creating that you're having trouble with
I can't read a word of that with the screen glare. Use the bot command I linked earlier and upload it to the json validator
Why did you choose to take a photo instead of a screenshot or just copying the actual text π
Because Iβm not online on my laptop
(This will be much easier with Discord running on your computer, yeah.)
Sorry I know itβs lame itβs an old laptop and the WiFi doesnβt work I have to hook it up and im not home it sucks
Never mind Iβll try again when I can get back online with it
Ahh, perfectly fair!
yeah there is no rush, you can ask for help later once conditions are better
note that the json parser will create a link so if you don't mind copying bunch of letter and such
it IS doable (but tedious) to copy that on your phone
2724222/F/f Sanemi 250/t 600 2600/d Mon Tue Wed Thu Fri Sat Sun
That seems to be the key part from that, at least.
I know nothing at all about events, but that might help others help. 
Ohhhh thank you
(recently my sibling sent me a link to an amazon wishlist for their birthday on phone and my phone refused to let me copy paste it, so i had to retype the whole thing into my computer's browser, i wasn't happy BUT it worked)
oh well
you are excluding all days
so there's no valid day
WHAAAT I thought those were the days the event happened on omg that is so DUMB π
(yes, d is counterintuitive)
Excuse me while I pass away
Iβve been at this for hours changing the times and thinking Iβd done something wrong so I thought right Iβll put all days on.
let me verify
oh no i'm mixing with seasons
should be fine
but also unneeded, don't list all days if all days are fine π
(sorry, it's the hard part, some stuff list allowed stuff, some stuff list excluded stuff)
No need to apologise I appreciate the advice
what is F supposed to be?
I think itβs βnot on an event dayβ
My other events work with it in so I donβt think itβs the problem
Generally anything listed in the event conditions is something that restricts it in some way. If you don't define something, then it's open to any conditions
ok i have confusing reading of the wiki
And the event plays out perfectly in debug without any errors in smapi so itβs just got me a bit confused
debug ebi ignores all event conditions
yeah so when event plays in debug ebi but not for real it's a condition checkup that isn't fulfilled
d excludes the day of week, yep
Wait, quick sanity check... do you have the required friendship with the NPC?
Right so it must be to do with the conditions then I guess
Because (I think) that's saying it's requiring 250 points?
Yeah I got the friendship set before hand
As Lumi already said, it's because you were excluding all days of the week
that is that then! i was like "oh notday is listed in deprecate stuff, it's not that"
yeah i was right first time but the wiki listing changed at some point so i was like "oh, guess i remembered wrong"
anyway don't worry it's the most common issue in event precondition i believe
people excluding the season and day they want the event to happen
CA made stuff the way he needed it which means that sometimes it's not what modders would need
Ahh okay! Thank you all so much for the help I canβt believe I got mixed up with the days thing I thought I was setting the days not excluding them! π so dumb. gonna get back into it now and try without.
(Note that the short-form event preconditions are semi-deprecated. I suggest using the newer long forms like !DayOfWeek instead of d, in which case it'd be more apparent.)
Great Iβll get all that changed over as well! Thank you so much!!
it's also faster to see what is "non festival day" than "K" in a quick glance π
Yeah good point! π
Hello! I'm having some trouble with adding cooking recipes of custom items to shops. I've added some cooking recipes of some custom items I have in the saloon shop and they show up fine. However, despite purchasing them, in the cooking menu it shows that the player doesn't know the recipe even though it's been purchased. I've added a cooking recipe in the Adventurer's guild and the recipe is unlocked when it is purchased so I'm not sure what is causing the issue.
Here is the shops file I have: https://smapi.io/json/none/d6d535c676e34dd8a444e2594abdd43c
Here is the recipes file I have: https://smapi.io/json/none/a2dd2b10a051475a9391a154a7ffd536
where is the code for the items?
Heres the code for the items I have: https://smapi.io/json/none/d29ab278c2654f1d849deaea64dfbce6
looks fine. what's your content.json looking like?
my content.json looks like this: https://smapi.io/json/none/49184692e2dc438dabea010aed6d006d
you should change format to 2.5.0
also, might be a good idea to replace HeyImAmethyst.CP.ArsVenefici with {{ModId}}
ok! I'll try doing that
@high maple You leveled up to Cowpoke. You can now speak in our voice channels and share images in all channels!
the code looks fine to me, recipe wise. perhaps a smapi log would help? (or someone who has a sharper eye can look at it, heh)
Ok the item code has the "Type" as basic. Try and see if changing it to cooking helps?
Hello! Does anyone have a guide that helps explain Custom NPC Dialogue Questions/Strings/Where all that should be located? I've been doing research and tbh this part has really been difficult to grasp. The wiki just confuses me, I need something a little more in depth.
Do you mean "custom dialogue for an existing NPC" or "dialogue for a new, custom NPC"?
You don't need the (O) in front of the item names, nor do you need the parenthesis that say recipe
that could be causing an issue
let me get an example (you can add the recipe as the id for your thing though)
"Id": "AngelOfStars.PizzaBagelRecipe",
"ItemId": "{{ModId}}_PizzaBagel",
"AvailableStock": 1,
"IsRecipe": true,
"Price": "600",
},```
huh i didn't see that. nice spotting lily
doesn't the ItemId need (O) though? idk mine has it
as far as I can tell not in this case
Hey, I have a TriggerAction that seems to be firing at the wrong time. Can someone take a look at this and tell me what I'm doing wrong? The mail is getting sent on Spring 5, so the date part seems to just be getting ignored. I've also tried SEASON_DAY summer 9
{ "Action": "EditData", "Target": "Data/TriggerActions", "Entries": { "{{ModId}}_Trigger_MaruBday": { "Id": "{{ModId}}_Trigger_MaruBday", "Trigger": "DayStarted", "Conditions": "PLAYER_FRIENDSHIP_POINTS Current Sebastian 750, !PLAYER_NPC_RELATIONSHIP Current Sebastian Married, SEASON summer, DAY_OF_MONTH 9", "Actions": [ "AddMail Current {{ModId}}_Letter_MaruGift Now", ] } }, },
It was like that for the default recipes and it still worked for the one in the Adventurer's guild
funky
here's my shop code
"Id": "Sushi_Gospel",
"ItemId": "(O){{ModId}}_TheGospelofSushi",
"AvailableStockLimit": "Player",
"Condition": "SEASON_DAY Spring 2"
},```
You probably CAN and or should add it honestly
the "Recipe" bit isn't needed tho
I know I made my shop entry that has these recipes a bit ago but CP still reads them right (i havent had any complaints about them not showing up in shop anyways)
the (O) is fine
dunno if putting (O) in id would cause any issues with smapi. tbh it might
did you change the type for the cooking recipes from "basic" to "cooking"?
you should probably use the GSQ SEASON_DAY summer 9 for that instead of both of them but otherwise are you starting a new save where you didn't trigger the mail to be sent?
I'm testing it now
alrighty. please don't ping me in replies
my game is taking its time XD
fair. i tend to disable most mods when testing
it's probably best to test with other mods loaded, now that i think about it
No, I forgot to start a new save. But I'm going to test quickly to see if capitalization of the season fixes it
All old saves will trigger this, regardless of season and day, if I have enough frienship points with seb :/
capitalization of Summer didn't fix it, and changing to SEASON_DAY didn't fix it either
So idk
only test with mods you're directly trying to see compatibilty with (or the ones that definitely wont interfere - like cjb cheats or smth)
I only have my mod on, and debug mode
your recipe data looks... odd to me
sorry i was tlaking to Amethyst :3
xD no worries
out of curiosity... do any of the GSQs work?
like does it just get sent to you automatically
Oh I just noticed something. I put -8 instead of -7 for the category
-7 is the cooking one XD
Sometimes it be like that
I spet hours on this XD
Turning on my testing GSQ (weekend/weekday toggle) to check
Im not sure if this is actually the fix - especially if your OTHER trigger actions are working - but "Conditions" is supposed to be "Condition"
My weekday/weekend one is broken now, too, so I must have screwed something up. Dang
Will go back and retrace my steps. Remove stuff until that one works. But "Conditions" was a good catch, thank you!
Will make that fix right now
yup changing the categories fixed it
(you see a goblin running in background yelling "cookies". This is strange without context)
Is it solved?
yup I had the item categories set to -8 instead of -7
oh i didn't know this one, i'll keep that in my list of "weird reasons recipes aren't working"
π
is there a soundbank noise for like... a fail sound?
specifically looking for something that's would give the player playing the slot machines and then failing
the game uses a kind of shaker sound for a few different errors, if memory serves (thinking of the "out of water" sound when using an empty watering can)
i should make a soundboard mod that just puts up a grid of all the loaded sounds so you can click to play them. every time i want to find a sound i suffer for not having it
i have the program the wiki suggested but let me tell you
looking through all of these is very very annoying
maybe ill take the effort to input what each one is on the wiki (or at least a description for the ones that need it)
maybe
somewhere i have the unpacked wave bank but it's all files like 000000ca.wav with no metadata and i have to cross-reference against the danged list and it sucks (or i have to load up the game and run debug playsound <whatever> over and over again)
that's definitely better than what i have
debug logSounds
speaking of sounds... who can help me figure out a scheme to uniquely identify dialogue lines within an event?
lacey voice acting mod
regular dialogue gets loaded from a key, which is saved in the Dialogue object itself, so i use that when it's available
but in events it's just speak NPC "text here" and i'm not sure the current command index is going to be enough
(for example, quickQuestion probably fucks that right up)
not to mention forking/switcheventing
quick question my beloved
voice acting framework
Can u just use the whole command as key
It's not that long and if it changes well better redub that
design goal is to allow specifying line readings without putting any data in band, so i need a unique id for the particular dialogue box page
for regular dialogue, that's the dialogue key and an index into the dialogues array
just the current event command, event requirements/id and index into the event should work?
unless you want it to withstand updates and reordering
it would be ideal to withstand those. but i may have to accept not
no vanilla support if so π
make a mod that rewrites the entire game in i18n ez pz /j
Are they just fine bc the whole language is a mod to begin with
could be. maybe they just baked it in? (i haven't checked)
TIL you can put a translation key instead of literal text in the speak event command
Criminally underused feature
i probably would have used it if i'd known about it
Criminally underdocumented feature
Maybe if vanilla use it in 1.7 
it looks like i'll have to settle for event id and index and a prayer. i'll likely make a note that using translation keys in your own events will make the connection less brittle
someday I'll get this mod published. but today I must fix tilesheet alignment and unforseen size issues due to my inability to count correctly
Wait is it not commonly known that you can do that in the speak event command?
I thought it was honestly - i dont even know how I figured out you could do it if it wasnt wheeze
i assume it is practically unknown. i don't know of any mods that do it.
i don't remember it from any documentation and i only discovered it now because i was reading the game code
SVE uses translation keys iirc .. (im also using translation keys)
anyway thinking about it some more, chu is probably right and the best result may come from just using the command string as the key. yucky but probably for the best
lily, are you thinking of i18n tokens? different thing
i think it was added in the possibility that, if there's another update, it'll be good for events to use it so they are easier to be translated without needing a script per event per language
It occured to me that "command string as key" means you might not be able to play french game with eng dub though
Unless u pick the eng key as truth somehow
1.7 bring me an event data model and i'll never ask for another thing (not true, i absolutely will)
"ID"
"List<EventPreconditions>"
"List<EventScripts>"
Ig it'd be something like that? I don't know how much more seperated it could be
at a minimum, yeah. even with nothing else that would still save us a bunch of string->string induced headaches
True! They are a lot nicer to work with. I tried using a data model for creatures in NiTV instead of slash delimited bs, but found that it reduced performance. My implementation might've just been bad, though.
was just thinking about doing some bullshit like explicitly loading the english version but it's giving me daymares about whether they are even in sync.
also now thinking about translated lines (or any lines, frankly) overflowing the single page of dialogue box and breaking dialogue indexing 
debug warp VolcanoDungeon
[game] No location with name VolcanoDungeon
debug VolcanoDungeon <floor>
Its not a location as much as its like the mines
Which in the same way you use debug minelevel <floor> to go to
that also doesn't work
debug VolcanoDungeon 0
[game] Unknown debug command 'VolcanoDungeon'.
Custom pack spawning 
good news: overflowing lines do not break indexing.
bad news: i have to handle it correctly so audio doesn't cut off
That was cus you were mailing the whole model over network i thought 
Nono, that part was unrelated. The creature data itself was never being sent over
Just the data on which were spawned/where they were
It reduced single player performance
Each spawn was like.. 1-2ms longer on my pc
Is ur mod open sauce so i can look at it 
I have an old version open source, I'm bad at updating it on git aha
Whenever i used a custom asset i always cached it so that the lookup cost is just dictionary tryget
It is somewhat expensive to go through content pipeline yes
The data is stored as well, so yeah its just a dictionairy target
Ima update it to show what it is in most recent update
And/or what it is now
Then it is just, is 1~2 ms worth thinking about over the content modder experience?
Trade offs 
1-2 ms does seem high if it's every spawn, and will add up very fast. but chu's point stands
anyway, gotta go for now, friends. take care
Take care! It is something I considered, if I know what a data model was from the start I probably wouldve went with it
But changing it now means the content packs that are made / are in the making wouldn't work. Or I could try figuring out loading both
If u want to change things now you still can, just need to introduce a new target
Let's say you have nitv/current that mods target rn
You introduce nitv/newfancymodel and update docs to reflect that
And add a asset requested nitv/newfancymodel that loads whatever's in nitv/current
Into equivalent new form
I'm not sure what you mean about the targets, I guess that'd be for a custom asset?
yeah the Target line in content patcher
Right now everything is being done through content packs, like the contentpackfor method. Though I've heard recently that might be old
It's not a deprecated feature or anything
iot still works but you can g4et the same functionality through just CP
with the advantage of all of CPs features
There's just lots of advantages to doing things via custom assets
(I sure hope not, we'd need to deprecate Content Patcher then.)
(well, the important same functionality anyway)
The downside to doing custom data model content packs via Content Patcher is you have no way of knowing the source mod.
do you think theres any mod idea that would ever be able to overthrow CP enough to make it considered deprecated and old hat
Would I still be able to use OnAssetRequested for making objects and such based on additions to my custom asset?
Yeah
you can at least include a "ModId" field in your asset and tell people they must put theirs in there. even if you cant Technically verify they didnt put someone elses ID, its probably good enough
Check out Expanded Storage and Custom Bush for two mods that have their content pack formats loaded by Content Patcher
(without copius reflection etc etc)
That's what Central Station does; entry IDs that don't follow the unique string ID pattern (with an installed mod's ID) are rejected.
Prefixing ids with {{ModId}} is the best practice, but people still can do whatever they want
I guess then I could load the old format using content packs and then use a model for the custom asset
unless you enforce it! like Central Station, and my recently released mod too
Nothing stops me from converting the old format into the model on my side anyway
Here is my 1 file example of using custom asset
not a good choice for old mods tho
unless you like breaking every previously released pack for your mod
I'm not sure what you mean, Id do it that way to not break them
oh more so just a side conversation, not commenting on your specifics here
Another feature of custom models that aren't a "ContentPackFor" is that any mod can do whatever they want with them. Which can be a benefit for some things. I'm planning to use that benefit to make sort of plugins for my mod.
In Expanded Storage case, all of the data it needs are just CustomFields, but I can have other mods reuse the custom fields to provide additional features that aren't in scope for Expanded Storage.
If u r switching to custom assets though
Going back to the effiecency, if its slightly faster to use the slash delimitted format in my code and I'm storing the creature data anyway, why not convert assets which use the model back into the string model to be stored?
You can just tell people to make edits to Data/Objects but tagged with a custom field you determine
To add their bugs or whatever
i wasnt here for that efficiency discussion but it sounds like you're spending cpu cycles on the conversion instead there
Then you don't have to deal with any of that yourself, only the spawning conditionals
unless you need to store it as a string somewhere
Also, you can automatically port from slash delimited to the new format by still loading the old and then recreating them as the new
The thing is that I'm not 100 convinced on premise that "string deliminated data is faster than data model class"
Having the data in a native format has to be faster.... right? You avoid the overhead of parsing the string out.
I guess in either case something has to json deserialize somewhere
like not terrible but not great
or maybe im thinking of string comparisons that have some optimizations and string parsing is just Sucks all around
Anyway, whatever fractions of a microsecond difference it makes is negligible in the grand scheme of things
if you use yaml, then there is no json deserialize :P
Maybe if nitv is doing some fancy read only span nonsense
I'm going to create a framework that reads it's data in sqlite format
Content packs must be written as sqlite databases
Sqlite Assets
Even fancy ros doesn't beat not having to parse
Sqlassets
1-2 ms feels like bad caching
I think it's a balance between memory storage and performance. Data models are much faster for performance, but they usually need more memory to store compared to plain strings. So if you have a large amount of data that you parse rarely (e.g. dialogue lines), it makes sense to keep them as strings and pay the parsing cost when you need them; but for data that's frequently loaded I would keep them in data models instead of continuously parsing them.
In particular, 1-2 ms is how much a cold hit on game1.content is
The thing about performance is, you can never truly know what is causing the slowdown unless you profile it.
You never truly know what is causing "THE" slowdown, but you can definitely rule out are unlikely to be the cause
It might be the filesystem that's being slow
You can profile stardew right from Visual Studio
What I mean is, I doubt any mod in existence had their slowdown be that they're splitting a string and then they switch to a data model
Micro-optimizations are nice, but it's not really something most people should be overly concerned about
Hey guys, I have been away from modding for a bit, noticed one of my mods is now broken...
Has something changed with the latest update?
Trying to decipher my log...
[14:30:43 WARN game] Machine (BC)Drewdus42.CPManureIndustries_SpeedGroBin has invalid item output method 'CompostBins.ModEntry, CompostBins: GetResourceOutput': failed to bind method 'CompostBins.ModEntry, CompostBins: GetResourceOutput': it didn't match the expected signature StardewValley.Item method(StardewValley.Object machine, StardewValley.Item inputItem, System.Boolean probe, StardewValley.GameData.Machines.MachineItemOutput outputData, StardewValley.Farmer player, System.Nullable`1[System.Int32]& overrideMinutesUntilReady)
oh, you're using a custom machine output method it looks like, you should take a look at the 1.6.9 migration page
just need to add one parameter, shouldnt be a difficult fix
this wasnt the latest update though this is from november
no way! show me!
I wonder if u can write whatever you did as an item query
!decompile
If you want to make SMAPI mods with C#, one important resource is decompiling the game to read the game code. Here's how to do it: https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#How_do_I_decompile_the_game_code.3F
im surprised you wrote a C# mod without decompiling
I used Content patcher for assets, but the functionality was all a custom C# code
Ohhh, i actually found an old text file of it!
You'd be surprised by how much is possible using only CP nowadays, especially when it comes to machines.
I shouldn't need to decompile now, lol
Everything has been turned into a data model, including the machine input/output rules.
good memory
C# could possibly be a custom token
should probably change the Object constructor to ItemRegistry.Create
I suppose, instead of outputmethod, you could opt to make some custom GSQ to check animals in house
if you need C# anyway then you might as well use the features available to you
and custom output methods is a feature available to you
I check a lot of things actually. I also check the building its in, I check the farming skill level of any player playing... the recipes they have unlocked, etc
The one advantage to doing not output method is that LA will be able to parse and show ur rule
LA?
It might not be that helpful if it's a lot of complicated conditions though
For machines, I believe they'll get the location and farmer as inputs to their GSQ
So maybe a custom GSQ could handle all the necessary logic
Make mod cus coding fun
There will always be a space for mods, but it's still worth it to be familiar with all the new things that 1.6 brings
Thinking of random micro improvements is part of fun
I was kinda sad that item queries don't get like an inputitem in the context though
In Data/Machines, OutputMethod C# methods now get the player interacting with the machine too (if any). Unfortunately this is a breaking change for C# mods which have custom OutputMethod methods.
If they did i coulda eliminated by own use of custom output method
this applies to me, trying to find easy fix
just add the parameter
!decompile
If you want to make SMAPI mods with C#, one important resource is decompiling the game to read the game code. Here's how to do it: https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#How_do_I_decompile_the_game_code.3F
public static Item GetResourceOutput(StardewValley.Object machine, Item inputItem, bool probe, MachineItemOutput outputData, out int? overrideMinutesUntilReady)
// change that to this:
public static Item GetResourceOutput(StardewValley.Object machine, Item inputItem, bool probe, MachineItemOutput outputData, Farmer player, out int? overrideMinutesUntilReady)
Simple fix should just be to match the new signature
I recommend checking the decompile for things like this
yeah so just handle the player value
got it
you can use it if you want but its not gonna check that you did
the only player interaction is taking the output... but i check all players for recipes known to see which level product to give
the machine process once a day, when put down or at start of new day
I'd bet this can almost follow the same model as the worm bin, but outputting fertilizer of course. Since I'm pretty sure worm bin is daily.
for that I'd probably have to decompile to see, no?
That's just from unpacked assets
Data/Machines
I'm still learning GSQ stuff too, but I do know it can handle conditions like the players skill levels
Again, not required for your mod to work. You can get by on the minimal changes.
I'm just trying to think through how much of this is possible using vanilla code
For machines now, they use queries to determine what items to output:
https://stardewvalleywiki.com/Modding:Game_state_queries
Content patcher was pretty close, but there was too much custom things I wanted to do...
if GSQs are a new thing to you then it's possible there's a lot of that custom stuff that you just didn't know could be done
oooh, yeah GSQ looks handy
Game State Query
nvm, i assumed it was a new framework or something i know about that type of GSQ
Every query knows the location of the machine, the player collecting output, player stats, what items was put into the machine, etc.
im too used to coming back after a hiatus and people throwing half a dozen new framework abbreviations at me like i'm supposed to know what they are ^.^;
Wait, these queries look familiar... I think I looked through this to see if I could do the stuff I wanted to, I think it's missing some of it...
GSQs are a vanilla feature that have only been around since 1.6 was released
Remind me in 3 hours to update the abbreviations wiki page
For you? Of course, tiakall (#6501920) (3h | <t:1738191942>)
Looks expanded maybe, like I think I see everything I would need in there now...
There's an abbreviation wiki?
There's a page on the modding wiki, though it might be called acronyms
Don't think it's updated for 1.6 yet tho
so these GSQs would make it so I did'nt have to write custom C#, I can just do it all with CP?
I don't know if everything is possible
I think all the conditions are there that i want
I used them in my island farm, I used triggers on each base game bundle completed to increment a new stat, and trigger changes based on that number hitting values so i could have certain changes happen in a certain order as you did bundles. in Islands Farm's case, Unlocking islands based on the number of bundles completed, utelizing mapedits.
You can have it only produce in a barn/coop, but it can't use the number of animals as a parameter
ah yep
The GSQ knows the location, but nothing additional about that location other than it's type (without a C# component)
The suggestion was to write ur own GSQ yea
thats a big one, kind of the whole point of the mod...
But you can register a GSQ that is basically "count number of animals" and then have that as a dependency
oh, interesting
The benefit is that 99% of the mod is vanilla, so it'll integrate more nicely with other mods
While using vanilla stuff for output items and such
well dang... that sounds like the solution then...
Only if u want to obviously, since the current thing work if u just updated the signature
trying to find out where the info is on creating my own GSQ for number of animals at location
That's kind of the beauty of mod updates after coming back to a new version. There are a dozen different ways to do things, and not any one of them is necessarily right or wrong.
Basically a GSQ is a method you write that takes the player, location and stuff context as a parameter which includes the player, location and stuff
And you just need to return true or false depending on whether it passes or not
Well I need to return the count
Think of it another way
in that case you do want arguments for min and max
You pass the required count as a condition, and return true or false if it matches
So the Machine rule is like, "produce this item only if animals is between 1 and 5" for example
the count is the number I need to determine how many items to produce..
Yeah, there are stack modifiers that can use GSQ to determine how many items to produce
I need to pass in the location and return the number of animals inside...
I dont need a min max or retrun a bool
CUSTOM_ANIMAL_COUNT Here 5 10
this for example can take the two arguments, 5 and 10 and check if you have between 5 and 10 animals in the current location. If you do, return true
min 1 max (max number of animals allowed at location )
that doesn't seem helpful then...
"do I have at least 1 animal here?" "Yes" "okay, then create this item as the output"
But thats not how I want the mod to work, I want it to give you as many as there are animals inside...
whole point of the mod basically
Quantity Modifier allows you to increase the stack size depending on a GSQ
So you have a GSQ that says, "make the stack size X if there are Y animals"
but if the GSQ only returns bool... ?
Anyone know how SVE Farm Maps (or any Farm Map for that matter) gets the dog pen house texture from?
I'm using Frontier Farm with Medieval Valley, but the dog house is the only building that's not being retextured.
I'm digging through the files to try to locate it but not luck so far.
And the map itself also doesn't add the dog house directly. I don't even know how it's added.
"are there 5 animals?" "Yes" "okay, then output 5 items"
Repeat for 6 and 7 and 8 or whatever
You'd need an entry for each number of animals as part of the data model. So a bit repetitive, but it would work.
so a GSQ for all numbers 1 through max number of animals in a deluxe farm building?
ooof
The modifiers get evaluated from top to bottom, and applies to the first matching item
It's just copy paste. The point is it needs no C# for the machine rule itself
So as soon as it reaches a condition that passes, i.e. "does this location have 5 animals" then that one would be what applies.
Quantity modifiers don't stop when they find a matching one I thought
Since you can set how they stack
big if true
So you'd want it from 0 to max if you're using set
It gives me an idea, what if the new CP Import/local token thingy could do some kind of iteration import, like a range.
The dog house is a furniture item
That was discussed as a desire to do a foreach style loop over local tokens but it was out of scope at the time
vanilla
damn I cant believe I never tried to pick it up
Dang, I'd be willing to PR that change like populate a local token for values from A to B and import
i imagine it's open to a PR
thanks Selph
Pathos iirc specifically would want a separate field for tokens to iterate over
If I wasn't on mobile I'd find it
Yeah I'm curious what previous discussion was had, if I could do it in a way that satisfies the scope requirements, then I'd be happy to take a stab at it
Damn, It's been so long I forgot how to setup IDE for Stardew...
!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.
#making-mods-general message
i feel like there was another brief discussion about it somewhere but I was unable to find it, but this is one of the ones I was remembering. not much in terms of like, requirements here though, just an idea and proof that pathos isn't totally against it 
could probably be reworked into using a list of strings (such as a range) for the iteration
Remind me in 4 hours this
mmmmmmmmmmmmmmmmmmmmmaybe (#6501950) (4h | <t:1738197043>)
if you do try to pr it I would say it'd be nice if it handled non numerical iterating too e.g. ForEach one, hat, club
So that each of those strings would replace a placeholder in the local token
OMG my old source file is in here!!!
during their iteration
last i remember this code didnt have any issues...
that function got replaced
with a field that does the same thing so you can just swap in
GameLocation.ParentBuilding The building which contains this location, if applicable. This replaces the former GetContainingBuilding() method, to avoid iterating the parent location's building list each time.
hey nice
Docs are great
What I'm envisioning is far simpler than this previous discussion seems to be trying to solve for, but my main goal would be to essentially have "compile time" iteration. I.e. it just simply repeats the same include based on the iteration and that's all.
i think with a little work both that discussion and that idea can be equivalent, though
bc you'd need some way t o increment something over those iterations, right? no point in just repeating the exact same code over and over
Because I wouldn't want to handle, for example, something that repeats 5 times, and more than one variable can change
All you'd get is the current item for whatever the iteration is defined to handle. That can be based on a split string, or a number, or whatever
yeah i suppose it cant handle two variables, i was only thinking about reusing one variable for multiple things
what if you made Foreach a list of foreachdatas
each one replacing a different placeholder
based off like, the key of the foreachdata in the list
I just think if you want that amount of flexibility, then you're probably better off just hardcoding each of the imports
what if i dont know the number of imports i need bc i get it from a token?
I'll just make a mod that is a Content Patcher superset. I'll call it Content Patcher Plus, or CPP for short
like {{Range:1,{{SomeCustomToken}}}}
You make a CPP content pack which just dynamically creates a CP content pack
yeah that sounds much simpler
Cpp...
It'll be like the TypeScript of Content Patcher
InvalidCastException: The content data of type System.Collections.Generic.List`1[[StardewValley.GameData.TriggerActionData, StardewValley.GameData, Version=1.6.15.24356, Culture=neutral, PublicKeyToken=null]] can't be converted to the requested System.Collections.Generic.IDictionary`2[[System.String, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[StardewValley.GameData.TriggerActionData, StardewValley.GameData, Version=1.6.15.24356, Culture=neutral, PublicKeyToken=null]].
at StardewModdingAPI.Framework.Content.AssetDataForObject.GetData[TData]() in /home/pathoschild/git/SMAPI/src/SMAPI/Framework/Content/AssetDataForObject.cs:line 66
at StardewModdingAPI.Framework.Content.AssetDataForObject.AsDictionary[TKey,TValue]() in /home/pathoschild/git/SMAPI/src/SMAPI/Framework/Content/AssetDataForObject.cs:line 47
at MonsterHutch.MonsterIncubator.<>c.<AddIncubatorAssetChanges>b__4_2(IAssetData asset) in C:\Users\princ\SV Modding\StardewValleyMods\MonsterHutch\MonsterIncubator.cs:line 64
at StardewModdingAPI.Framework.ContentManagers.GameContentManager.ApplyEditors[T](IAssetInfo info, IAssetData asset, List`1 editOperations)```
Looks like it's doing a key-value-pair when it's expecting a list of objects
how do i edit the TriggerActionData correctly? not AsDictionary I'm guessing
{
e.Edit((asset) =>
{
var data = asset.AsDictionary<string, TriggerActionData>().Data;
if (data != null)
{
var newTrigger = new TriggerActionData
{
Id = MailTriggerId,
Trigger = "DayEnding",
Condition = "PLAYER_HEARTS Current Wizard 6",
Action = $"AddMail Current {mailID}",
};
data[MailTriggerId] = newTrigger;
}
});
}```
this is what i was trying which is obviously wrong
all other examples for editing asset data I've found edit them as dictionaries though
it's not a dict
it's a list
yeah TriggerActions is an odd one
yes most others are dict, not this one though
CP lets u edit lists as if they are dict sometimes
C# will yell at you if you do that
i just don't have the knowledge to figure out how to correctly implement that though
But u don't get this kind of training wheels in C#
but yeah there arent any examples of editing lists with C#
I think u just append to it
Yes
triggers.Add(new() {...});
its ok chu take your time
perfect! thanks this is what i was looking for
You can also slacc and just package cp with yer mod
No shame in that
And i guess u can also just have dayending addmail
In fact, the ModBuildConfig allows you to do that more easily now
i would feel a tiny bit of shame if i did 99% C# and the only thing i had in CP was a trigger action addition /lh
if you already plan on having a mix tho no shame
I'm doing that for Crystalline Junimo Chests, I have a CP mod bundled in that I could have easily done in C# alone using the Content API
But, it's just like... easier to bundle the CP mod
i feel the opposite tbh id find it more effort personally to bundle A CP mod for just one thing
i do literally mean one thing though
i actually already have a CP component in my mod but i want the trigger to be conditional on config options and i'm not sure how to make the config options work for both
In that case what if you just do Game1.addMail
getting config from the CP part to the C# part is trickier
That is, assuming you need C# component at all
presumably if they already have other config options that cant be used in CP they already have other C# components
or that arent generated in CP*
What's that mod that everyone uses now for CP mods to read each other's tokens/config? Does that have a C# api?
never heard of it
But it is worth a shot to ask right 
(its CMCT i made it)
Comquat
Cross-Mod Compatibility Tokens
Lol
didn't even think of that lol
i'm still pretty novice modder
Just in case whatever they did in C# is perfectly doable
i briefly floated the idea of a C# API includin out loud in this channel and the consensus including myself was generally "not that useful when you can just reflect"
Without C#
if someone did actually want to make a C# mod but still use CMCT for getting the values i would add an API for it
Hiring button to break into people's houses on your behalf
but so far its not come up bc anyone who would has reflected
If it is like a cp + c# mod deal
There's tokens n mailflags to deal with things
Not really the situation cmct is for i feel
I might consider refactoring parts of Iconic Framework to depend on CMCT for some of its built in mod integrations if it was being provided by an API
mailflag configs, assuming you do it the way that lets t hings be uninstalled (i.e. like Cornucopia) arent perfect though
Particularly the hotkey integration where I make it user-configurable, but I could just ask what the mod's using
that was also the other snag with the API is what to return
since tokens are easy, everything is turned into a string
a config token for a C# mod though can be anything
As long as it's SButton parseable or Keybind list, then it wouldn't be a problem for me
i believe matt has a like. radial menu type mod?
I'd basically substitute the "tell me what hotkey to simulate" into "tell me what config option has the hotkey to simulate"
so its not changing the hotkey
Radial Menu is focustense mod, but Iconic Framework adds icons for integrations with other mods
so it still is up to the other mod
But there weren't keys involved in that api so im confused
i couldnt think of what to call it besides "icon framework" but i didnt think thatd be helpful when i didnt know if chu knew what it was 
so i settled for the vague "type mod"
by parseable do you mean like if i just hand you an object that you're able to cast it
sweet, no issues with my other mod, this one might be CP only, good to go
or hm maybe a GetConfig<Type> instead of just giving generic objects
ill ponder it
for now i gotta bounce tho
Got it working ^-^. Custom asset loading creatures wonderfully from a separate CP mod while managing to keep everything that the older packs relied on the same
@blissful panther Sorry to bug you, when do you plan to upload the json?
I mean it could be a string so it's still applicable in the context of tokens
Since the mod in it's current form only gets a string anyway
It'd probably help if I shared an example https://github.com/LeFauxMatt/IconicFramework/blob/19e820e8f19c90d623babf836c756f8ed5d524fa/IconicFramework/Utilities/IntegrationHelper.cs#L28
Content packs just pass along the string hotkey which Iconic Framework parses for the keybind to simulate
Only had time to do a little bit on it today, but it's about 80% done. Should be able to get it to you tomorrow!
Keybind is from the mod's content pack format which is really only used internally for a bundled content pack and as an example
Example: <https://github.com/LeFauxMatt/IconicFramework/blob/main/IconicFramework/[CP] Toolbar Icons/data/ResetTerrainFeatures.json>
I don't know how to linkify brackets
Swinging back to the lovely world of driving yourself insane on optimization
Anytime I need ideas for optimization, I'll just visit atras repo and search for the word unsafe /s
Soon the Detailing work for the Surface map will be done. 
I'm interested in this at least at a conceptual level as well. If mods had an ability to register performable "actions" of some kind without having to depend explicitly on the mod that would consume them, it would open up better options for a lot of different controller and UI mods.
The best options we have right now are either faking a keybind, or hardcoding reflection stuff, and both are kind of bad. Kind of really bad.
My example is strictly scoped for sending hotkey overrides to target mods, but I think Iconic Framework would continue to do it's reflection-based calling of methods unless something came along that could handle that as well
Yeah, well the hotkey stuff I hack GMCM to do, although that's hardly ideal either (not every mod actually uses GMCM, and of the ones that do, not all of them have coherent keybind options in it).
maybe im just uncreative but i cant see what another mod to handle calling other methods would offer that isnt just the same reflection but in another assembly and with an added dependency tbh
Because for reflection, every UI mod has to hardcode the behavior for every target mod.
im not sure what is meant by registering performable actions tho do you think you could elaborate on that
Iconic Framework generically handles method reflection, but only if it's parameterless and I think available from it's ModEntry
I agree that there's a problem if every single mod which performs an action has to register another dependency. It would be useful if those mods could just add some data somewhere, and only the UI mods would need the dependency.
Are you thinking that mods would "opt-in" by registering their data, or content packs could opt them in externally?
Probably the former, though I guess there's nothing preventing the latter.
what i mean is like, if you asked another mod to handle this that could handle more than just modentry parameterless functions, and it can search an entire assembly for the correct method... why not do that yourself? or is the main benefit here just that it would be a central source mod that does it, rather than every mod reimplementing it as needed? (which im not against ftr, just curious what the motivation is)
I know that Iconic has a config, but that's up to every individual user to set up properly.
It's not supposed to search anything, it's supposed to be an intermediary for the producer and consumer mods.
All I was interested in was the ability for your mod to share another mod's config generically. I could just bring the same code into Iconic Framework, but it's like you do the heavy lifting. And I think focus is expanding that definition for methods as well.
oh, i think i understand better now
Although if it could proxy methods, then those probably could get converted into TriggerActions that content packs would be able to use.
Yeah I guess... the "reflection" part is more interesting to me since I've already got the keybinds covered, mostly, although I think it's not necessarily even "reflection" anymore if mods actually declare their actions.
I think my ideas could technically fall within the current scope of the mod since content patcher packs could continue to benefit from them
yeah, thats why i was misunderstandin at first, bc i was thinking of CMCT as just a mod to bridge things together like that without one of them needing to specifically integrate, unlike registering actions
not that thats all it ever should be, just why i was initially misinterpreting
To be clear, registering doesn't necessarily imply a dependency or an API that those mods have to use. There's the Lookup Anything style where the mods just tack some property/method onto their entry point (technically a menu in the case of LA, would probably be ModEntry in this case).
I mean registering actions could even be entirely opportunistic, as in it only does it if a mod attempts to use it
But also, to be clear, I wasn't saying that CMCT should be the thing to do it, just stating my interest since Button put out the hypothetical "if anyone cared" sort of thing.
Like a content packs or mod could be like "Hey can you try calling Lookup Anythings search method" and at that point in time it creates the appropriate action.
@teal bridge is your idea based around mods opting in somehow or would that extend to reflection that handles the usecase regardless as long as it knows where to look?
I think both ways are possible. You can have some of it work the way Iconic already does, with specific methods for specific mods hardcoded or put in a config. But I think that's prone to drift/breakage over time. So it's better if you have something like, ModEntry declares an IEnumerable<Something> where Something is some metadata for performing an action and can also specify basic info like a name/description for the action.
The reason I ask is couldn't mods already do this in a vanilla-friendly way if they just assigned those functions to Trigger Actions, and then any mod could use Trigger Actions as possible integrations?
Can i mark my actions as "this opens a ui' tho



