#making-mods-general

1 messages Β· Page 190 of 1

latent mauve
#

I got to learn more about Machines today, if anything. πŸ˜„

patent lanceBOT
calm nebula
#

Xmas in the mines

uncut viper
rancid temple
#

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 SMCKekLmaoDog

rigid musk
#

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)

rancid temple
#

Did you sleep?

rigid musk
#

doesnt it have one of those little star things -sssssssoh

rancid temple
#

Sometimes achievements don't pop until you sleep

rigid musk
#

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

rancid temple
#

Lemme know if you have any issues with it, I did some testing but being thorough with something like this is difficult lol

rigid musk
#

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

lucid iron
#

how did you do the perfection tweaking roku

rancid temple
#

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

lucid iron
#

i guess the easiest LA integration would be setting player.craftingRecipes

rancid temple
#

I honestly didn't even know that LA would tell you if you needed something for perfection still lol

calm nebula
lucid iron
#

but it gets messy cus i think that is also unlocking stuff

sleek flint
#

Does anyone know the answer to this?

rancid temple
calm nebula
#

Tbh roku there is a workaround typically anyways so

rancid temple
#

For recipes?

calm nebula
#

Yup

lucid iron
#

here's where it do the check and make field

rancid temple
#

What is it? I've seen people ask how to exclude recipes from perfection a lot and nobody has ever mentioned a way lol

calm nebula
#

You patch in the recipe only when you want it unlocked

#

You put it as a default unlock

rancid temple
#

So you'd still have to craft it though

tiny zealot
# sleek flint Does anyone know the answer to this?

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

lucid iron
#

selph do u want homework

sleek flint
#

Thank you Selph πŸ₯Ή

lucid iron
#

for when ur not touching grass

sleek flint
#

I love you SDVpufferheart

rancid temple
#

Or do you mean only patch it in when you open the crafting window and remove it when you close it?

uncut viper
#

also like. what if i want my recipe to be purchaseable anytime but excluded from perfection

brittle pasture
uncut viper
#

have u heard of Clothing selph

rancid temple
#

You make it sound like Selph is a nudist

lucid iron
#

tl dr make clothes n stuff valid drop in

brittle pasture
#

yeppp just backread and saw fireredlily's DM from hours ago

lucid iron
#

wow so the homework had already been assigned

calm nebula
#

Is there a way to increment that from a trigger action

rancid temple
#

Which that?

uncut viper
#

increment what

tiny zealot
#

increment clothes

latent mauve
#

❀️ 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

brittle pasture
#

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

latent mauve
#

Sounds good, my only thought was 'it becomes cloth and nothing else' if that simplifies things at all

lucid iron
#

i look forward to shirt honey

latent mauve
#

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. >_>

lucid iron
#

i remember flavored object can only have flavors from object though

latent mauve
#

(I will 100% make a custom item for dyes to go in via CP for this)

lucid iron
#

since it use preservesheetindex to store flavor iirc

uncut viper
#

just make a new "query" called FLAVORED_SOMETIMES_NOT_OBJECT

latent mauve
#

alternatively, drop a blueberry and a dyeable shirt in to get a blue shirt. Oops, you stained it. xD

lucid iron
#

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

latent mauve
#

I mean for the dyeing machine, it'd definitely be better to limit it to dyeable clothing

lucid iron
#

unsure how much point given sewing machine

latent mauve
#

that's true

#

I always forget about dyeing clothes in the sewing machine, honestly.

drowsy pewter
#

do my eyes deceive me? pathos making actual mods? for fun???????

#

I'm so happy I could cry

uncut viper
#

he never confirmed it was for fun /j

drowsy pewter
#

pathos, if you're being held hostage, blink twice

ivory plume
#

(It is kind of fun, working on the Central Station map content currently.)

uncut viper
#

kind of...

rigid musk
#

does anyone know where the event where Mr.Qi t-poses you off of the side of a cliff is

rancid temple
drowsy pewter
rigid musk
#

It's not in the temp files from what i can see and there's no summit map loaded pondering

latent mauve
#

I kind of want to build a bunch of shops now for that rotation, LOL

#

sounds more fun than my character sprites right now >_>

uncut viper
#

im happy to see that Central Station will continue the tradition of ridiculously overcharging for food and drink

#

as all transit centers do

rigid musk
#

it feels like a legal obligation for them to do it at this point

latent mauve
#

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)

drowsy pewter
#

as a loyal customer of joja donuts, you are unfortunately not able to redeem your joja points for rewards at this location

fervent horizon
#

Is it Duty free though

uncut viper
#

hey Pathos, you're looking for even more scope creep right? let me buy weekly or monthly bus passes for discounted rides SDVpuffersmile

rigid musk
#

Joja donuts...

fervent horizon
#

Book stand, with random books

sleek flint
uncut viper
#

dont forget to run a trigger action when you enter Central Station that removes all drinks from your inventory

latent mauve
#

Also Totally unnecessary travel maps

ivory plume
#

(I'm fully scope creeped for 1.0.0, but it'll be easy to extend in future versions!)

drowsy pewter
#

Pathos, if you need spritework, feel free to hit me up!

brittle pasture
#

that's only if you're boarding planes

sleek flint
uncut viper
#

eventually Central Station will handle planes tho

latent mauve
#

(honestly, a trigger that temporarily steals your cooked dishes in the movie theatre would have been so on-brand)

uncut viper
#

wouldnt be too difficult to do really

rigid musk
#

I want to look at the data for the event

rancid temple
#

Do you mean the Summit event if you cheat up there?

rigid musk
#

Yeah that one

rancid temple
#

It's hardcoded

latent mauve
#

I think the Qi summit event was hardcoded?

sleek flint
#

If you know the name, you can search for it in whatever file explorer you are using.

rancid temple
#

Both events are hardcoded

lucid iron
rigid musk
#

of course it is SCGpain

latent mauve
#

You might be able to find individual strings somewhere? If anything.

rancid temple
#

Nope, they're set in C#

latent mauve
#

oof

rancid temple
#

Summit.showQiCheatingEvent

rigid musk
#

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)

rancid temple
#

And they're even private derpmask just to make things extra good

ivory plume
# lucid iron pathos can i put arbitrary tile data for the shops?

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.

rancid temple
#

Oh actually, looks like his dialogue is in Strings/1_6_Strings:QiSummitCheat

latent mauve
#

I love the idea of a pop-up store location for rotations, honestly. ❀️

ivory plume
#

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.

rancid temple
#

So you can at least see what he calls you

lucid iron
#

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)

rancid temple
#

The background effect setup is funny SMCKekLmaoDog

latent mauve
#

background.cursed=true

#

Perfect, no notes

brittle pasture
slender badger
#

(and an outdoor area in future scope-creep, yes? SDVkrobusgiggle )

rancid temple
#

They cost 10x as much as normal

latent mauve
#

Arcade prize counter time xD

ivory plume
#

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": "..."
}
faint ingot
#

What does "%noturn" do in this bit of Pam dialogue (green rain)? "It's a sign from the Almighty... We're doomed...%noturn$s"

rigid musk
lucid iron
#

yea wew

slender badger
lucid iron
#

although hm, i hope no one uses the npc rect features in here

ivory plume
#

(Maybe I could support a map patch instead of a texture, so mods could do stuff like animated shop tiles.)

latent mauve
#

Future scope-creep: NPC locations guide for placing custom NPCs in the Central Station. We could beat SVE to the new area. xD

ivory plume
#

(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.

lucid iron
#

t r a i n

calm nebula
#

This is amazing

#

Entirely amazing

tiny zealot
#

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ℒ️

calm nebula
#

Happy Lunar New Year, guys!

drowsy pewter
#

:SDVpufferchicklunar:

tough crater
#

I'm curious, are there any flags for when the player buys their first cows/ducks/ etc.?

tender bloom
#

there is a conversation topic

#

maybe other things?

slender badger
#

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

wanton pebble
#

Has Pathos fallen into scope creep content hell? SDVpuffersquee

calm nebula
#

(that conversation topic only works in English, btw)

uncut viper
#

why?

calm nebula
#

because. for reasons unknown

#

purchasedAnimal_[displayType]

#

not internal type

#

DISPLAY TYPE

#

anyways

calm nebula
#

happy lunar new year, everyone

brave fable
#

on my way to display favouritism by creating some purchasedAnimal_poulet conversation topics

slender badger
#

Happy Lunar New Year, Atra! SDVpufferheart 🐍

brave fable
#

really though that feels like a bug that ought to be fixable in any minor version update

uncut viper
#

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

winter dust
#

They're not, maybe one or two languages share those words with English, but that's it.

uncut viper
#

french stardew players have never seen Demetriums excitedly talk to them about a dinosaur SDVpufferpensive

winter dust
#

I was about to ask if dinosaue was french for dinosaur.

#

But yeah.

lusty elm
#

no, scientifically its a new fruit.

calm nebula
#

jesus

ivory plume
#

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.)

uncut viper
#

are you open to the idea of including maybe a CP Token that returns which shop ID was chosen that day?

ivory plume
#

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.

tiny zealot
#

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

uncut viper
#

NPC dialogue/schedules mostly yeah

ivory plume
#

I can change it to Condition for consistency.

uncut viper
#

maybe a GSQ to check what shop is there if thats easier and a token is not feasible?

lucid iron
#

is there weights

ivory plume
# uncut viper maybe a GSQ to check what shop is there if thats easier and a token is not feasi...

Yep, but that runs into the same race condition. For example, we might end up with:

  1. A content pack checks which shop will appear today, and sets its NPC dialogue for the day.
  2. Central Station selects its shop.
  3. The shop's Condition returns 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).

lucid iron
#

like what if i want to make a rare once a year shop

#

is the only option to gib date bolbthinking

uncut viper
#

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

ivory plume
uncut viper
#

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)

latent mauve
#

(I might be turning another Google Sheet into a shop builder template in preparation for pop-up shops)

calm nebula
ivory plume
#

(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.)

versed wyvern
#

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

slender badger
#

Best practice is for all players to have exactly the same mods installed, yep

versed wyvern
#

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

slender badger
#

I think most modders don't bother with MP compat, to be honest πŸ˜† MP bugs are hard to troubleshoot

calm nebula
#

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

versed wyvern
#

Okay, so if I avoid those then the farmhand shouldn't crash out at least, thank you ThinkO_O

uncut viper
#

(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)

calm nebula
#

(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

versed wyvern
#

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 rubyslime

brittle pasture
#

Q: Is this mod safe to use by myself without syncing in MP?
A: Feel free to me know

lucid iron
uncut viper
#

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

lucid iron
#

no i specifically changed it bc it would fix some vanilla dialogue that never appear in other languages

uncut viper
#

but that does break any other mod that has been using those CTs for things like custom animals

lucid iron
#

for all the other mods, their keys previously only ever worked in english

uncut viper
#

or ones that actually translated the CT key

calm nebula
#

I can imagine that is zero mods

uncut viper
#

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

lucid iron
#

yea thats true PecoWant

uncut viper
#

i imagine that is not zero mods

brittle pasture
#

tbh I on the other hand would be very surprised if that number is higher than zero

lucid iron
#

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

uncut viper
brittle pasture
#

technically someone asked if those CTs exist

uncut viper
#

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

lucid iron
#

it might be nice to also like

uncut viper
#

when you can also just, not break it

lucid iron
#

add a mail flag tbh

#

so its easier to use in cp

#

i'd say thats enough arguments for switch to postfix Dokkan

uncut viper
#

you can do all 3 for absolutely free

lucid iron
#

i only uploaded this for like 10min so its fine if i dont bump the patch version right

uncut viper
#

if i were in your shoes i wouldnt bother bumping it if i was quick enough

mellow karma
#

Is it possible to make a specific tree only be chop downable by for example an gold axe or higher?

lucid iron
#

i think u put the big log?

mellow karma
#

I would like a regrown tree to only be doable by the iridum axe

calm nebula
#

Not without c#

#

Easy enough with c#

lucid iron
#

is there any mod that does trigger on animal adopt

#

i might as well do that one too

gentle rose
ivory plume
#

There's only one mod shop selected per day; the other two shops are permanent shops from the Central Station mod.

gentle rose
#

that would do it SDVpuffersquee

lucid iron
#

did the scope creep into having NPC yet

ivory plume
#

(Probably not in 1.0.0, but there'll be randomized non-social NPCs in the station in later versions.)

gentle rose
#

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? SDVpufferthinkblob or is the station blacklisted for npcs entirely

ivory plume
#

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.

latent mauve
#

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?

uncut viper
#

its not like theres anything stopping someone from doing a map patch to the central station itself if they really want/need to, right?

latent mauve
#

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?

ivory plume
#

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.

latent mauve
#

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

ivory plume
#

(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.)

latent mauve
#

yep, I'm just coding them right now, not working in Tiled until we have a map area.

versed wyvern
#

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 yugu

latent mauve
#

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

versed wyvern
#

Ooh, good idea, but I'd still like to know if it's necessary before I fire up the game to check for myself

royal stump
#

afaict from the code, it does count storms (and green rain too, though that might get overridden by other dialog, idk)

uncut viper
#

if its daily dialogue it'd be loaded before the tokens apply

versed wyvern
#

Mm, okay, so I should make one regular and one with a when condition for storms, thanks ironmousebongocat

uncut viper
#

i do not believe that will work bc of that

versed wyvern
royal stump
#

it happens in NPC.loadCurrentDialogue fwiw, though I'm not sure when the game actually accesses that

uncut viper
#

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"

latent mauve
#

I figured you'd still be using the rainy dialogue key and just changing what's in that key, yeah?

#

ah, I see

versed wyvern
#

Ah, okay. Yeah, I'm just editing the dialogue/rainy file

uncut viper
#

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)

royal stump
#

yeah, going by the phrasing at least, I guess CP can edit it at DayStarted OnDayStart before the caching happens, just not afterward

latent mauve
#

Woo, shops are all coded and given the 1.5x upcharge for being in a travel hub. πŸ˜›

winter dust
#

@old edge Hey, you're the person behind Cape Stardew right?

hoary scroll
#

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

hoary scroll
gentle rose
# hoary scroll

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

hoary scroll
#

I am not sure

#

how do I check?

weak pulsar
#

(silly question but where may I find crabs in the world? Not as an item but like, crabbin' around? Wanna test my Krabby sprites πŸ˜‚ )

uncut viper
#

i thought besides rock crabs they only ever existed as items

hoary scroll
#

you need to fight the fake rocks

weak pulsar
#

these crabs don't crab around? D:

uncut viper
#

maybe in aquariums?

#

im not sure though

weak pulsar
#

Hmhm--mystery crabs then. I assumed they were in the world bc they're part of the critters sprite sheet!

uncut viper
#

thinkin about it more i think they jump off the pier on the island when you leave willys boat

weak pulsar
#

...IS THAT THE ONLY TIME? wheeze cryspin

hard fern
#

Yep, they're there

#

Crabbin

uncut viper
#

i cant remember another time ive seen a crab critter but i dont have the greatest memory

#

in vanilla, anyway

weak pulsar
#

Everyone gets to see Krabby exactly once (without another mod) πŸ˜‚

Thank yall for helping me solve the mystery!!

uncut viper
#

oh i thought it was random chance when you arrive, not just the first time

weak pulsar
#

Okay, that would be much better then lol--

devout hare
hard fern
#

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

fossil osprey
royal stump
#

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 SDVkrobusgiggle

#

(okay yeah, 25% chance of 1 crab on the island, while the first time has 4 guaranteed)

hoary scroll
brittle pasture
#

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

rigid musk
#

Mmm my favorite item... -42424201...

#

Not me getting the number wrong

brittle pasture
#

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)

midnight sand
#

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

astral vortex
#

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

fossil osprey
#

Are you sure you've called your folder "asets"?
Is it in the same folder as your manifest and content files?

astral vortex
#

did i seriously misspell assets

hard fern
#

Yes

astral vortex
#

im crying thank you

#

that would be my issue

fossil osprey
astral vortex
#

ive been working on this for two days

fossil osprey
#

It's alright, you need a nap SDVpufferheart

astral vortex
#

probably do lol but thank you so much mr. duck SDVpufferheart

#

yeah definitely time for a nap

vernal crest
# astral vortex uh

What's the total size of your hay.png file? The dimensions, not the size in kb.

astral vortex
#

16x16

vernal crest
#

Then your FromArea X and Y is wrong

astral vortex
#

ohh

vernal crest
#

It should be 0 and 0

astral vortex
#

what would it be then?

#

ooh

#

thank you so much i'm so new to all of this lol

vernal crest
#

That's okay, it's quite a common thing to not quite figure out the FromArea properly

astral vortex
#

should it be 0 and 0 for all three of them then? since they're all the same size

vernal crest
#

Yep

astral vortex
#

and then the ToArea should be where the pixels on the springobject png starts?

fossil osprey
#

The X and Y are the coordinate of the top-left pixel of the box including the asset you want to use/replace

vernal crest
#

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.

astral vortex
#

thank you both so much this is so helpful

#

IT WORKED THANK YOU BOTH SO MUCH

vernal crest
#

Yay you made a mod, good work!

true coyote
#

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

ornate trellis
#

afaik itll always start at 0,0 unless stated otherwise(could be wrong tho)

true coyote
#

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..

lucid iron
#

Did you give it sprite index

true coyote
#

I didn't, another one of those things that I just didnt find when searching how to put this stuff together

acoustic lintel
#

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 πŸ€”

slender badger
#

!json Can you send your code?

ocean sailBOT
#

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.

acoustic lintel
#

The event code?

slender badger
#

Yep

acoustic lintel
#

2724222

slender badger
#

No, your code, not the event ID

acoustic lintel
#

Sorry I don’t know what it is where do I find that? πŸ₯Ί

slender badger
#

...the code? That you've been writing for the event?

#

The thing you've been creating that you're having trouble with

acoustic lintel
#

Oh right! Just a sec

slender badger
#

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 πŸ˜…

acoustic lintel
#

Because I’m not online on my laptop

blissful panther
#

(This will be much easier with Discord running on your computer, yeah.)

acoustic lintel
#

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

blissful panther
#

Ahh, perfectly fair!

hallow prism
#

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

blissful panther
#

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. SDVkrobusgiggle

acoustic lintel
#

Ohhhh thank you

hallow prism
#

(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

acoustic lintel
#

WHAAAT I thought those were the days the event happened on omg that is so DUMB πŸ˜‚

hallow prism
#

(yes, d is counterintuitive)

acoustic lintel
#

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.

hallow prism
#

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 πŸ™‚

acoustic lintel
#

Ahhh ok

#

Ok good tip thanks!

hallow prism
#

(sorry, it's the hard part, some stuff list allowed stuff, some stuff list excluded stuff)

acoustic lintel
#

No need to apologise I appreciate the advice

hallow prism
#

what is F supposed to be?

acoustic lintel
#

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

slender badger
#

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

hallow prism
#

ok i have confusing reading of the wiki

acoustic lintel
#

And the event plays out perfectly in debug without any errors in smapi so it’s just got me a bit confused

hallow prism
#

i think it was excluding in the end?

#

the new formatting is confusing me a bit

slender badger
#

debug ebi ignores all event conditions

hallow prism
#

yeah so when event plays in debug ebi but not for real it's a condition checkup that isn't fulfilled

slender badger
blissful panther
#

Wait, quick sanity check... do you have the required friendship with the NPC?

acoustic lintel
#

Right so it must be to do with the conditions then I guess

blissful panther
#

Because (I think) that's saying it's requiring 250 points?

acoustic lintel
#

Yeah I got the friendship set before hand

slender badger
#

As Lumi already said, it's because you were excluding all days of the week

hallow prism
#

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

acoustic lintel
#

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.

ivory plume
#

(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.)

blissful panther
acoustic lintel
#

Great I’ll get all that changed over as well! Thank you so much!!

hallow prism
#

it's also faster to see what is "non festival day" than "K" in a quick glance πŸ˜„

acoustic lintel
#

Yeah good point! πŸ˜†

high maple
#

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

gray bear
#

where is the code for the items?

high maple
gray bear
#

looks fine. what's your content.json looking like?

high maple
gray bear
#

you should change format to 2.5.0
also, might be a good idea to replace HeyImAmethyst.CP.ArsVenefici with {{ModId}}

high maple
#

ok! I'll try doing that

ocean sailBOT
#

@high maple You leveled up to Cowpoke. You can now speak in our voice channels and share images in all channels!

gray bear
#

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?

flint stratus
#

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.

tribal ore
rigid musk
#

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",
                        },```
gray bear
#

huh i didn't see that. nice spotting lily

rigid musk
#

your shop entry ID should also match your ID exactly

gray bear
#

doesn't the ItemId need (O) though? idk mine has it

rigid musk
#

as far as I can tell not in this case

tribal ore
#

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", ] } }, },

high maple
gray bear
#

funky
here's my shop code

                            "Id": "Sushi_Gospel",
                            "ItemId": "(O){{ModId}}_TheGospelofSushi",
                            "AvailableStockLimit": "Player",
                            "Condition": "SEASON_DAY Spring 2"
                        },```
rigid musk
#

You probably CAN and or should add it honestly

gray bear
#

the "Recipe" bit isn't needed tho

rigid musk
#

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)

gray bear
#

actually no u can keep it

#

Id can be anything

rigid musk
#

the (O) is fine

gray bear
#

dunno if putting (O) in id would cause any issues with smapi. tbh it might

gray bear
rigid musk
gray bear
#

alrighty. please don't ping me in replies

high maple
#

my game is taking its time XD

gray bear
#

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

tribal ore
#

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

rigid musk
#

only test with mods you're directly trying to see compatibilty with (or the ones that definitely wont interfere - like cjb cheats or smth)

tribal ore
#

I only have my mod on, and debug mode

rigid musk
rigid musk
tribal ore
rigid musk
#

like does it just get sent to you automatically

high maple
#

Oh I just noticed something. I put -8 instead of -7 for the category

#

-7 is the cooking one XD

rigid musk
#

Sometimes it be like that

high maple
#

I spet hours on this XD

tribal ore
rigid musk
#

Im not sure if this is actually the fix - especially if your OTHER trigger actions are working - but "Conditions" is supposed to be "Condition"

tribal ore
#

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

high maple
#

yup changing the categories fixed it

hallow prism
high maple
hallow prism
#

oh i didn't know this one, i'll keep that in my list of "weird reasons recipes aren't working"

#

πŸ˜„

brittle ledge
#

You get a badge! SDVpuffersquee

rigid musk
#

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

tiny zealot
#

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

rigid musk
#

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

tiny zealot
#

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)

rigid musk
#

mine looks like this

#

so its.. helpful

tiny zealot
#

that's definitely better than what i have

lucid iron
#

debug logSounds

tiny zealot
#

speaking of sounds... who can help me figure out a scheme to uniquely identify dialogue lines within an event?

lucid iron
#

DokkanStare lacey voice acting mod

tiny zealot
#

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

rigid musk
#

quick question my beloved

lucid iron
#

Hm what is the purpose here?

#

Do you need to iterate to specific dialogue

tiny zealot
lucid iron
#

Can u just use the whole command as key

#

It's not that long and if it changes well better redub that

tiny zealot
#

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

iron ridge
#

just the current event command, event requirements/id and index into the event should work?

#

unless you want it to withstand updates and reordering

tiny zealot
#

it would be ideal to withstand those. but i may have to accept not

lucid iron
#

What if you enforce i18n

#

Or actually enforce LocalizedText?

tiny zealot
#

no vanilla support if so πŸ˜”

lucid iron
#

But hm what did the thai dubbing do

rigid musk
#

make a mod that rewrites the entire game in i18n ez pz /j

lucid iron
#

Are they just fine bc the whole language is a mod to begin with

tiny zealot
#

TIL you can put a translation key instead of literal text in the speak event command

calm nebula
#

Criminally underused feature

tiny zealot
#

i probably would have used it if i'd known about it

calm nebula
#

Criminally underdocumented feature

lucid iron
#

Maybe if vanilla use it in 1.7 Dokkan

tiny zealot
#

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

true coyote
#

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

rigid musk
#

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

tiny zealot
#

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

rigid musk
#

SVE uses translation keys iirc .. (im also using translation keys)

tiny zealot
#

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

rigid musk
#

There are too many terms for me to remember

hallow prism
lucid iron
#

Unless u pick the eng key as truth somehow

tiny zealot
acoustic summit
#

"ID"
"List<EventPreconditions>"
"List<EventScripts>"
Ig it'd be something like that? I don't know how much more seperated it could be

tiny zealot
#

at a minimum, yeah. even with nothing else that would still save us a bunch of string->string induced headaches

acoustic summit
#

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.

mighty quest
#

how can I debug warp into the Volcano?

#

whatever I do it doesn't work

tiny zealot
mighty quest
#
debug warp VolcanoDungeon 
[game] No location with name VolcanoDungeon

acoustic summit
#

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

mighty quest
#

that also doesn't work

debug VolcanoDungeon 0 
[game] Unknown debug command 'VolcanoDungeon'.

acoustic summit
#

hm

#

debug volcano <floor>?

mighty quest
#

debug volcano <level> worked

#

thanks

acoustic summit
#

Custom pack spawning SDVpufferparty

tiny zealot
lucid iron
acoustic summit
#

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

lucid iron
#

Is ur mod open sauce so i can look at it bolbwawawa

acoustic summit
#

I have an old version open source, I'm bad at updating it on git aha

lucid iron
#

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

acoustic summit
#

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

lucid iron
#

Then it is just, is 1~2 ms worth thinking about over the content modder experience?

#

Trade offs DokkanStare

tiny zealot
#

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

acoustic summit
#

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

lucid iron
#

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

acoustic summit
#

I'm not sure what you mean about the targets, I guess that'd be for a custom asset?

lucid iron
#

yeah the Target line in content patcher

acoustic summit
#

Right now everything is being done through content packs, like the contentpackfor method. Though I've heard recently that might be old

lucid iron
#

It's not a deprecated feature or anything

uncut viper
#

iot still works but you can g4et the same functionality through just CP

#

with the advantage of all of CPs features

lucid iron
#

There's just lots of advantages to doing things via custom assets

ivory plume
uncut viper
#

(well, the important same functionality anyway)

tawny ore
#

The downside to doing custom data model content packs via Content Patcher is you have no way of knowing the source mod.

uncut viper
#

do you think theres any mod idea that would ever be able to overthrow CP enough to make it considered deprecated and old hat

lucid iron
#

Here is some talks of how2 custom asset

acoustic summit
#

Would I still be able to use OnAssetRequested for making objects and such based on additions to my custom asset?

lucid iron
#

Yeah

uncut viper
tawny ore
#

Check out Expanded Storage and Custom Bush for two mods that have their content pack formats loaded by Content Patcher

uncut viper
#

(without copius reflection etc etc)

ivory plume
#

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.

tawny ore
#

Prefixing ids with {{ModId}} is the best practice, but people still can do whatever they want

acoustic summit
#

I guess then I could load the old format using content packs and then use a model for the custom asset

uncut viper
#

unless you enforce it! like Central Station, and my recently released mod too

acoustic summit
#

Nothing stops me from converting the old format into the model on my side anyway

lucid iron
#

Here is my 1 file example of using custom asset

uncut viper
#

not a good choice for old mods tho

#

unless you like breaking every previously released pack for your mod

acoustic summit
#

I'm not sure what you mean, Id do it that way to not break them

uncut viper
#

oh more so just a side conversation, not commenting on your specifics here

tawny ore
#

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.

lucid iron
#

If u r switching to custom assets though

acoustic summit
#

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?

lucid iron
#

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

uncut viper
#

i wasnt here for that efficiency discussion but it sounds like you're spending cpu cycles on the conversion instead there

lucid iron
#

Then you don't have to deal with any of that yourself, only the spawning conditionals

uncut viper
#

unless you need to store it as a string somewhere

tawny ore
#

Also, you can automatically port from slash delimited to the new format by still loading the old and then recreating them as the new

lucid iron
tawny ore
#

Having the data in a native format has to be faster.... right? You avoid the overhead of parsing the string out.

uncut viper
#

yeah thats what i was gonna say

#

string parsing generally kinda sucks doesnt it

tawny ore
#

I guess in either case something has to json deserialize somewhere

uncut viper
#

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

tawny ore
#

Anyway, whatever fractions of a microsecond difference it makes is negligible in the grand scheme of things

pine ermine
#

if you use yaml, then there is no json deserialize :P

lucid iron
#

Maybe if nitv is doing some fancy read only span nonsense

tawny ore
#

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

calm nebula
#

Even fancy ros doesn't beat not having to parse

uncut viper
#

Sqlassets

calm nebula
#

1-2 ms feels like bad caching

ivory plume
#

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.

calm nebula
#

In particular, 1-2 ms is how much a cold hit on game1.content is

pine ermine
#

The thing about performance is, you can never truly know what is causing the slowdown unless you profile it.

tawny ore
#

You never truly know what is causing "THE" slowdown, but you can definitely rule out are unlikely to be the cause

pine ermine
#

It might be the filesystem that's being slow

#

You can profile stardew right from Visual Studio

tawny ore
#

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

heady aurora
#

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)

uncut viper
#

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

heady aurora
#

I also lost my source code so I have to start over anyway...

uncut viper
#

you can decompile your own old mod

#

wont be perfect but itll help tons

heady aurora
#

no way! show me!

uncut viper
#

same way you decompile the game

#

with ilspy

lucid iron
#

I wonder if u can write whatever you did as an item query

heady aurora
#

Never decompiled anything before, lol...

#

but i shall learn

uncut viper
#

!decompile

ocean sailBOT
uncut viper
#

im surprised you wrote a C# mod without decompiling

heady aurora
#

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!

tawny ore
#

You'd be surprised by how much is possible using only CP nowadays, especially when it comes to machines.

heady aurora
#

I shouldn't need to decompile now, lol

tawny ore
#

Everything has been turned into a data model, including the machine input/output rules.

lucid iron
#

This one did need C# iirc

#

It was counting how many animals u have in a house

heady aurora
#

good memory

tawny ore
#

C# could possibly be a custom token

uncut viper
#

should probably change the Object constructor to ItemRegistry.Create

lucid iron
#

I suppose, instead of outputmethod, you could opt to make some custom GSQ to check animals in house

uncut viper
#

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

lucid iron
#

Or u just add the missing arg and carry on

heady aurora
#

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

lucid iron
#

The one advantage to doing not output method is that LA will be able to parse and show ur rule

heady aurora
#

LA?

lucid iron
#

It might not be that helpful if it's a lot of complicated conditions though

uncut viper
#

Lookup Anything

#

its another mod

tawny ore
#

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

heady aurora
#

Why make mod in first place when game change so much shrugs

#

life stay simple no need fix

lucid iron
#

Make mod cus coding fun

tawny ore
#

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

lucid iron
#

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

heady aurora
#

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.

lucid iron
#

If they did i coulda eliminated by own use of custom output method

heady aurora
#

this applies to me, trying to find easy fix

uncut viper
#

just add the parameter

heady aurora
#

its the player?

#

Am i understanding that correctly?

lucid iron
#

!decompile

ocean sailBOT
uncut viper
#
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)
tawny ore
#

Simple fix should just be to match the new signature

lucid iron
#

I recommend checking the decompile for things like this

heady aurora
#

yeah so just handle the player value

uncut viper
#

you dont need to do anything with it

#

just accept it in your signature

heady aurora
#

got it

uncut viper
#

you can use it if you want but its not gonna check that you did

heady aurora
#

gotcha I understand

#

Yeah i dont need to use it

lucid iron
#

Were you using Game1.player before

#

Probably be good to change over if so

heady aurora
#

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

tawny ore
#

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.

heady aurora
#

for that I'd probably have to decompile to see, no?

tawny ore
#

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.

heady aurora
#

I've never heard of this GSQ...

tawny ore
#

I'm just trying to think through how much of this is possible using vanilla code

heady aurora
#

Content patcher was pretty close, but there was too much custom things I wanted to do...

uncut viper
#

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

heady aurora
#

oooh, yeah GSQ looks handy

lusty elm
#

What does GSQ stand for?

#

oh

tawny ore
#

Game State Query

lusty elm
#

nvm, i assumed it was a new framework or something i know about that type of GSQ

tawny ore
#

Every query knows the location of the machine, the player collecting output, player stats, what items was put into the machine, etc.

lusty elm
#

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 ^.^;

heady aurora
#

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...

tawny ore
#

GSQs are a vanilla feature that have only been around since 1.6 was released

brittle ledge
#

Remind me in 3 hours to update the abbreviations wiki page

patent lanceBOT
#

For you? Of course, tiakall (#6501920) (3h | <t:1738191942>)

heady aurora
#

Looks expanded maybe, like I think I see everything I would need in there now...

hard fern
#

There's an abbreviation wiki?

brittle ledge
#

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

heady aurora
#

so these GSQs would make it so I did'nt have to write custom C#, I can just do it all with CP?

tawny ore
#

I don't know if everything is possible

heady aurora
#

I think all the conditions are there that i want

lusty elm
#

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.

tawny ore
#

You can have it only produce in a barn/coop, but it can't use the number of animals as a parameter

heady aurora
#

ah yep

tawny ore
#

The GSQ knows the location, but nothing additional about that location other than it's type (without a C# component)

lucid iron
#

The suggestion was to write ur own GSQ yea

heady aurora
#

thats a big one, kind of the whole point of the mod...

tawny ore
#

But you can register a GSQ that is basically "count number of animals" and then have that as a dependency

heady aurora
#

oh, interesting

tawny ore
#

The benefit is that 99% of the mod is vanilla, so it'll integrate more nicely with other mods

lucid iron
#

While using vanilla stuff for output items and such

heady aurora
#

well dang... that sounds like the solution then...

lucid iron
#

Only if u want to obviously, since the current thing work if u just updated the signature

heady aurora
#

trying to find out where the info is on creating my own GSQ for number of animals at location

tawny ore
#

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.

heady aurora
#

this looks like it

tawny ore
#

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

uncut viper
#

it also takes the query arguments (and query itself)

#

in case you want to add any

heady aurora
tawny ore
#

Think of it another way

uncut viper
#

in that case you do want arguments for min and max

tawny ore
#

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

heady aurora
#

the count is the number I need to determine how many items to produce..

tawny ore
#

Yeah, there are stack modifiers that can use GSQ to determine how many items to produce

heady aurora
#

I need to pass in the location and return the number of animals inside...

#

I dont need a min max or retrun a bool

uncut viper
#

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

heady aurora
#

well I guess i need a true if > 0

#

and a false if < 0

uncut viper
#

Then you do need a min and max

#

Just set the min to 1 and max to unlimited

heady aurora
#

min 1 max (max number of animals allowed at location )

uncut viper
#

GSQs must return a bool

#

A gsq is just a yes or no question

heady aurora
#

that doesn't seem helpful then...

uncut viper
#

"do I have at least 1 animal here?" "Yes" "okay, then create this item as the output"

heady aurora
#

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

tawny ore
#

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"

heady aurora
#

but if the GSQ only returns bool... ?

mighty quest
#

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.

uncut viper
#

"are there 5 animals?" "Yes" "okay, then output 5 items"

#

Repeat for 6 and 7 and 8 or whatever

tawny ore
heady aurora
#

so a GSQ for all numbers 1 through max number of animals in a deluxe farm building?

#

ooof

tawny ore
#

The modifiers get evaluated from top to bottom, and applies to the first matching item

uncut viper
#

It's just copy paste. The point is it needs no C# for the machine rule itself

tawny ore
#

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.

heady aurora
#

haha k

#

makes sense, just goofy

uncut viper
#

Quantity modifiers don't stop when they find a matching one I thought

#

Since you can set how they stack

heady aurora
#

big if true

uncut viper
#

So you'd want it from 0 to max if you're using set

tawny ore
#

It gives me an idea, what if the new CP Import/local token thingy could do some kind of iteration import, like a range.

brittle pasture
mighty quest
#

furniture you say

#

added by SVE or vanilla?

uncut viper
brittle pasture
#

vanilla

mighty quest
#

damn I cant believe I never tried to pick it up

tawny ore
#

Dang, I'd be willing to PR that change like populate a local token for values from A to B and import

uncut viper
#

i imagine it's open to a PR

mighty quest
#

thanks Selph

uncut viper
#

Pathos iirc specifically would want a separate field for tokens to iterate over

#

If I wasn't on mobile I'd find it

tawny ore
#

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

heady aurora
#

Damn, It's been so long I forgot how to setup IDE for Stardew...

iron ridge
#

!startmodding

ocean sailBOT
#

Making mods can be broadly divided into two categories:

Usually it’s easier to start with making content packs, since you don't need to learn programming.

uncut viper
#

could probably be reworked into using a list of strings (such as a range) for the iteration

tawny ore
#

Remind me in 4 hours this

patent lanceBOT
#

mmmmmmmmmmmmmmmmmmmmmaybe (#6501950) (4h | <t:1738197043>)

uncut viper
#

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

heady aurora
#

OMG my old source file is in here!!!

uncut viper
#

during their iteration

heady aurora
#

last i remember this code didnt have any issues...

brittle pasture
#

that function got replaced

#

with a field that does the same thing so you can just swap in

heady aurora
#

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

tawny ore
uncut viper
#

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

tawny ore
#

Because I wouldn't want to handle, for example, something that repeats 5 times, and more than one variable can change

uncut viper
#

so you'd need a way to replace a placeholder with the iteration

#

ah i see

tawny ore
#

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

uncut viper
#

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

tawny ore
#

I just think if you want that amount of flexibility, then you're probably better off just hardcoding each of the imports

uncut viper
#

what if i dont know the number of imports i need bc i get it from a token?

tawny ore
#

I'll just make a mod that is a Content Patcher superset. I'll call it Content Patcher Plus, or CPP for short

uncut viper
#

like {{Range:1,{{SomeCustomToken}}}}

tawny ore
#

You make a CPP content pack which just dynamically creates a CP content pack

uncut viper
#

yeah that sounds much simpler

lucid iron
#

Cpp...

tawny ore
#

It'll be like the TypeScript of Content Patcher

ivory umbra
#
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)```
tawny ore
#

Looks like it's doing a key-value-pair when it's expecting a list of objects

ivory umbra
#

how do i edit the TriggerActionData correctly? not AsDictionary I'm guessing

ivory umbra
#
            {
                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

brittle pasture
#

it's not a dict
it's a list

uncut viper
#

yeah TriggerActions is an odd one

brittle pasture
#

yes most others are dict, not this one though

lucid iron
#

CP lets u edit lists as if they are dict sometimes

uncut viper
#

C# will yell at you if you do that

ivory umbra
#

i just don't have the knowledge to figure out how to correctly implement that though

lucid iron
#

But u don't get this kind of training wheels in C#

uncut viper
#

but yeah there arent any examples of editing lists with C#

lucid iron
#

I think u just append to it

gaunt orbit
#

Yes

heady aurora
#

Hell yeah brother

#

thanks all for the help!!!

gaunt orbit
#

triggers.Add(new() {...});

uncut viper
#

its ok chu take your time

ivory umbra
lucid iron
#

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

tawny ore
#

In fact, the ModBuildConfig allows you to do that more easily now

uncut viper
#

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

tawny ore
#

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

uncut viper
#

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

ivory umbra
#

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

lucid iron
#

In that case what if you just do Game1.addMail

uncut viper
#

getting config from the CP part to the C# part is trickier

lucid iron
#

That is, assuming you need C# component at all

uncut viper
#

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*

tawny ore
#

What's that mod that everyone uses now for CP mods to read each other's tokens/config? Does that have a C# api?

uncut viper
#

never heard of it

lucid iron
#

But it is worth a shot to ask right Dokkan

uncut viper
#

(its CMCT i made it)

lucid iron
#

Comquat

uncut viper
#

Cross-Mod Compatibility Tokens

tawny ore
#

Lol

ivory umbra
lucid iron
#

Just in case whatever they did in C# is perfectly doable

uncut viper
#

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"

lucid iron
#

Without C#

tawny ore
#

But I am lazy, I don't want to reflect /s

#

Maybe not /s, I am pretty lazy

uncut viper
#

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

lucid iron
#

Hiring button to break into people's houses on your behalf

uncut viper
#

but so far its not come up bc anyone who would has reflected

lucid iron
#

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

tawny ore
#

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

uncut viper
#

mailflag configs, assuming you do it the way that lets t hings be uninstalled (i.e. like Cornucopia) arent perfect though

tawny ore
#

Particularly the hotkey integration where I make it user-configurable, but I could just ask what the mod's using

uncut viper
#

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

tawny ore
#

As long as it's SButton parseable or Keybind list, then it wouldn't be a problem for me

lucid iron
#

Hm hotkey integration

#

Shouldn't that be up to the other mod in general

uncut viper
#

i believe matt has a like. radial menu type mod?

tawny ore
#

I'd basically substitute the "tell me what hotkey to simulate" into "tell me what config option has the hotkey to simulate"

lucid iron
#

Yeah i use it

#

I registered me menu to it too

uncut viper
#

so its not changing the hotkey

tawny ore
#

Radial Menu is focustense mod, but Iconic Framework adds icons for integrations with other mods

uncut viper
#

so it still is up to the other mod

lucid iron
#

But there weren't keys involved in that api so im confused

uncut viper
#

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 SDVpuffersquee

#

so i settled for the vague "type mod"

uncut viper
heady aurora
#

sweet, no issues with my other mod, this one might be CP only, good to go

uncut viper
#

or hm maybe a GetConfig<Type> instead of just giving generic objects

#

ill ponder it

#

for now i gotta bounce tho

acoustic summit
#

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

dusk mulch
#

@blissful panther Sorry to bug you, when do you plan to upload the json?

tawny ore
#

Since the mod in it's current form only gets a string anyway

#

Content packs just pass along the string hotkey which Iconic Framework parses for the keybind to simulate

blissful panther
tawny ore
lucid iron
#

Oh this one bolbthinking

#

You need %20 and stuff for spaces

calm nebula
#

Swinging back to the lovely world of driving yourself insane on optimization

tawny ore
#

Anytime I need ideas for optimization, I'll just visit atras repo and search for the word unsafe /s

lusty elm
#

Soon the Detailing work for the Surface map will be done. SDVpufferwoke

lusty elm
teal bridge
#

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.

tawny ore
#

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

teal bridge
#

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).

uncut viper
#

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

teal bridge
#

Because for reflection, every UI mod has to hardcode the behavior for every target mod.

uncut viper
#

im not sure what is meant by registering performable actions tho do you think you could elaborate on that

tawny ore
#

Iconic Framework generically handles method reflection, but only if it's parameterless and I think available from it's ModEntry

teal bridge
#

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.

tawny ore
#

Are you thinking that mods would "opt-in" by registering their data, or content packs could opt them in externally?

teal bridge
#

Probably the former, though I guess there's nothing preventing the latter.

uncut viper
# tawny ore This <https://github.com/LeFauxMatt/IconicFramework/blob/19e820e8f19c90d623babf8...

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)

teal bridge
#

I know that Iconic has a config, but that's up to every individual user to set up properly.

teal bridge
tawny ore
#

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.

uncut viper
#

oh, i think i understand better now

tawny ore
#

Although if it could proxy methods, then those probably could get converted into TriggerActions that content packs would be able to use.

teal bridge
#

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.

tawny ore
#

I think my ideas could technically fall within the current scope of the mod since content patcher packs could continue to benefit from them

uncut viper
#

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

teal bridge
#

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).

tawny ore
#

I mean registering actions could even be entirely opportunistic, as in it only does it if a mod attempts to use it

teal bridge
#

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.

tawny ore
#

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?

teal bridge
#

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.

tawny ore
#

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?

lucid iron
#

Can i mark my actions as "this opens a ui' tho