#making-mods-general

1 messages · Page 407 of 1

inner harbor
#

Thanks making appropriate adjustment

#

Worked perfectly

#

And it produces Oil from the Oilmaker

#

I was tempted to make the sunflower have variant shades of blue.

hallow prism
#

if you have fun, go for it

inner harbor
#

Procrastination 🙂

gray bear
inner harbor
#

If I keep going in this direction I could become known as "That Joja Guy Person"

vital lotus
#

hail Joja

#

... not a good one ... 😬

hallow prism
#

inspiration strikes where it strikes, we can only try to have lot of inspiration rods and hope

#

apparently for you the blue one shaped like a J are the most efficient currently 😄

gray bear
#

blue is a nice color

teal crest
#

Can NPC detect going island resort that day themselves?

hallow prism
#

detect in what sense?

teal crest
#

My NPC is talking every morning "Today I go ***~" and when his schedules changed as going island, all his talking became lie.

#

Monday is fishing, tuesday chopping, as like that.

#

So, I wanted to know is it possible or not to detect his plan.

brave fable
teal crest
#

Resort key? arn't it the dialogs after arrive the island?

#

...wait a minite. why my NPC is talking ordinally morning dialog in island day at all...?

#

need to rethink its structure...

brave fable
#

the Resort keys are used for various places on the island, so it should be what you want

vernal crest
#

They are talking about before the NPC goes to the island

#

Presumably they're talking to them at the crack of dawn

brave fable
#

oh i see

vernal crest
#

And their NPC is like "I'm going fishing at the mountain today!" -toddles off to GI like a LIAR-

brave fable
#

forgot they can be interacted with before they go to the island. definitely knew that's how it works

vernal crest
#

I don't know of any way to detect whether they've been picked for GI attendance with just CP (tbh I don't know any way at all but it's probably possible with C#, right?)

#

Ooh I was wrong!

brave fable
#

someone will be by shortly to say 'anything is possible with c#'

vernal crest
#

There's a GSQ

#

IS_VISITING_ISLAND <name>

vernal crest
teal crest
#

C# thing?

hallow prism
#

i would say that personally i wouldn't look forward to making all my dialogues query checking for island, so i would likely mix solutions like :

  • having them only be able to visit island on some days
  • some of those days can use a query if needed in dialogue
  • and maybe make my character speak about other stuff than their schedules
teal crest
#

will try to study how query use now...

#

but thanks.

vernal crest
# teal crest will try to study how query use now...

It would look something like this:

"Mon": "$query IS_VISITING_ISLAND <your npc's internal name>#{{i18n: visiting.island.true }}|{{i18n: visiting.island.false.mon }}"

// i18n
"visiting.island.true": "I'm off to Ginger Island today? Are you coming too? We can look for starfish together!",
"visiting.island.false.mon": "Monday again. I'm getting myself an iced coffee for lunch. Always have to treat myself at the start of the work week so I can make it through!"
teal crest
#

very helpfull. I'll try to push it in mine.

inland rain
#

for extra map layers, do they have to be sequential? or if I make a Front69 will it still render?

obtuse wigeon
#

it will render ontop of everything lower than 69

inland rain
#

even if it's the only extra layer?

vernal crest
#

Yup

obtuse wigeon
#

Yep, Thats what I did for one of my mods

inland rain
#

great! ty

pine elbow
#

Hey, this is probably really basic, but when you're crating custom objects how do you tell SDV that players should not be able to pass through them?

#

Objects that you can place down on the farm, like sprinklers, scarecrows etc

hallow prism
#

usually they are by default not passable

#

i'm not even sure you can make them passable

pine elbow
#

oh cool

#

So what I've got is a bug lol

brave fable
#

evening PM

#

anything marked as a bigcraftable isn't passable

#

this is checked before any other property of the object, so there's no exceptions you can use

pine elbow
#

The Prime Minister of Vibecoding has learnt some lessons tonight

fading walrus
#

I
i hope you're not vibe-coding a mod

gray bear
#

what's vibecoding

fading walrus
#

AI-generating code, tldr

pine elbow
vernal crest
#

It's where you tell an AI to make code for you without you having any clue what you're doing.

gray bear
#

e

vital lotus
#

how is that even a thing?

gray bear
#

listen man i saw a mod with credits to chatgpt saying it's the authors best friend

#

which i mean, i don't even know what to say about that

vernal crest
#

The human brain is wired to take shortcuts where possible to conserve energy. Some people take that too far.

vital lotus
#

i feel we as society need to do better

#

Nobody's best friend should be parasocial relationship with LLM...

fading walrus
#

you'd think, but it's alarmingly easy to form a parasocial relationship with a chatbot

gray bear
#

there is a difference between shortcuts and just blindly trusting something that uses sources with no fact checking and just makes shit up

fading walrus
#

waves hand at my thesis

vital lotus
gray bear
#

i've had 0 good experinces with chatbots

fading walrus
#

so much time for modding once I'm done

gray bear
#

exciting!

fading walrus
#

gonna actually start writing dialogue for assorted projects once I'm done

vital lotus
gray bear
#

ah yes, writing dialogue

fading walrus
gray bear
#

all them npc creators do this and im here like what even are words

blissful panther
vital lotus
fading walrus
#

I haveeeeee

  • Interface
  • Indian food
  • Dutch food (which is a collab with bestie, which will be fun)
  • hi alab
  • Soda update
  • A separate soda mod
gray bear
#

me, who has zero experience in writing and doesn't spend any time around kids: yes i will just write dialouge for my stardew children

fading walrus
gray bear
#

(i wish to know too PensiveButtPuffer )

vernal crest
#

Tee hee

  • hi alab
gray bear
#

soda soda soda!!!

fading walrus
#

(once I have something to show, I'll formally tease it bea dw. I also think I mentioned it in smc a couple times?)

fading walrus
gray bear
#

2 soda for the price of one

#

soda sale

fading walrus
#

i will probably local token the new soda mod tbh

#

it's quite simple, so

gray bear
vital lotus
#

What's the use of local token?

fading walrus
#

templating!

#

so then I don't need a bajillion individual snippets for each item

#

I'm planning compat with a bunch of mods out of the box so I have a lot of items

gray bear
#

streamlines items

#

like if you have, a donut that has multiple flavors u can simply local token until u egt them all

#

[stares at gaystries]

vernal crest
#

Most useful when you want to do something with the same ID in a variety of different places, like add an object and a recipe and a shop entry

gray bear
#

there's more use cases ofc

vital lotus
fading walrus
fast plaza
#

I'm trying to add a custom machine that has a weighted random output minstack/maxstack value. I figured I could do this using conditions since game state queries has a RANDOM condition, but I'm not quite sure the setup I need to do here, anyone got any advice?

#

looking at MachineOutputRule there's OutputItem and UseFirstValidOutput, i figured I could add a RANDOM condition to the machine item outputs and just choose the first one that gets the chance, but MachineItemOutput doesn't have any conditions field in it. MachineOutputTriggerRule does have a field for conditions, but does it appropriately sync up the trigger -> output?

hallow prism
#

it depends a lot of how you want the weight to be, but i suggest to look at the stack field

#

the stack field can accept condition and it may be better suited for what you want

fast plaza
#

not entirely sure what that is ngl, but surely there must be some kind of way to make conditions work with the existing setup. If OutputItems is a list of condition-less items that will always be picked randomly from unless UseFirstValidOutput is true, then whats the purpose of UseFirstValidOutput? surely the same effect would be achievable by just having only one element in the list. I feel like I must be missing something here because it seems to be setup to allow for conditions but I can't see how

hallow prism
#

i suggest looking at what that is then!

fast plaza
#

fair enough, got any resources for where to look for that? googling "stack field stardew valley modding" doesn't come up with much, is it a more general programming term which I'm just incorrectly attributing to stardew valley?

vernal crest
#

I can't find a field just called "Stack" either

vital lotus
#

Min and max stack prolly

vernal crest
#

They look like they're int fields, not bools

drowsy pewter
#

oh

fast plaza
#

min and max stack would work but it would lose the weighted randomness that I want to keep. I was thinking of using the item query RANDOM token and making three output rules which would be selected in order via UseFirstValidOutput and just individually checked.

drowsy pewter
#

Yes you can do that

#

That was my first thought

#

Might have to do some playtesting to land on good values but its possible

fast plaza
#

ah wait I'm being an idiot

#

I forgot to check the parent class of MachineItemOutput

drowsy pewter
#

You can also use conditions in the quanitity modifiers im pretty sure

fast plaza
#

was assuming it didn't have a field for conditions but it was in the parent class GenericSpawnItemDataWithCondition

drowsy pewter
#

so instead of having three output rules you have multiple quantity modifiers that are random

#

that can be a little neater

fast plaza
#

oh that'd be good yeah

#

thanks!

drowsy pewter
#

np

hallow prism
#

"StackModifiers": null,
"StackModifierMode": "Stack",

#

"StackModifiers": [
{
"Id": "RareDouble",
"Condition": "RANDOM .1",
"Modification": "Multiply",
"Amount": 2.0,
"RandomAmount": null
}
],

neat gazelle
hallow prism
#

usually this happens because you have one warp sending you on another warp. You need to arrive one tile higher/lower than your warp

vernal crest
#

Immediate thought is that you've put your warp entry point from your map into the busstop closer to the edge of the map than the warp out of the bus stop.

hallow prism
#

and also, for fields and such, i suggest unpacking

#

!unpack

ocean sailBOT
#

Follow this guide to unpack the game's content files in order to see and explore how the game data is structured.
It's helpful when making your own mods, or just to learn about how the game works!

hallow prism
#

it's way easier to see if a field exists if looking at the proper place than a random google search

#

(of course that also requires not stopping at the first result, but that is true for google too, so... )

#

(this is related to the stack field, not the warp issue)

neat gazelle
#

from my map property: <property name="Warp" value="2 3 BusStop 43 6 2 4 BusStop 43 7"/>, from the content pack for my mod ...
{
"Action": "EditMap",
"Target": "Maps/BusStop",
"AddWarps": [
"43 6 {{ModId}}_SeedShops 1 3",
"43 7 {{ModId}}_SeedShops 1 4"
]
... and there you have it. Thanks!

hallow prism
#

yeah if you change 43 6 to another value for one of them this should be good! same for 43 7

#

the other warps look ok at first glance

neat gazelle
#

the 43 point is on the right side of the bus stop, so backing the warp to 42 on the map, and pushing the seed shops map to arrive at 3, i think? I get left and right mixed up, but I can switch if that doesn't work. :)

hallow prism
#

yeah it's pretty easy to adjust if needed!

neat gazelle
#

out of curiosity, is there some weirdness with content patcher that prevents doing an addwarps on a custom map? I tried doing the same thing for the BusStop warps for my map, but the warps wouldn't add, so I set the warps on the map's properties in Tiled.

hallow prism
#

hmm, it may be that you weren't targetting the proper map

#

i dont believe order of operation is too important but it may be a reason

neat gazelle
#

I had it as "Changes": [
{
"Action": "EditData",
"Target": "Data/Locations",
"Entries": {
"{{ModID}}_SeedShops": {
"CreateOnLoad": {
"MapPath": "Maps/KTG.SeedShopsMap"
},
"DisplayName": "{{i18n:DisplayName}}",
"DefaultArrivalTile": {
"X": 9,
"Y": 8
},
"MusicDefault": "AbigailFluteDuet"
},
}
},

vernal crest
#

Where's your EditMap patch?

#

The default arrival tile is not a warp, that just sets the tile you arrive on if you are somehow warped to the map via nonspecific means (like debug warp)

neat gazelle
#

"Changes": [
{
"Action": "EditData",
"Target": "Data/Locations",
"Entries": {
"{{ModID}}_SeedShops": {
"CreateOnLoad": {
"MapPath": "Maps/KTG.SeedShopsMap"
},
"DisplayName": "{{i18n:DisplayName}}",
"DefaultArrivalTile": {
"X": 9,
"Y": 8
},
"MusicDefault": "AbigailFluteDuet"
},
"AddWarps": [
" x y BusStop x y"
]
}
},

vernal crest
#

!codeblock By the way, you can put your code in a much more readable fashion using code blocks

ocean sailBOT
#

You can embed code in Discord using a series of three ` :
```
Your code can go here
Even if not a haiku
Just an example
```

For syntax highlighting, add the language code on the same line as the first
``` (with no space, like ```json).
The usual codes are cs (C#) and json.

vernal crest
neat gazelle
#

I'm not that great with discord

vernal crest
#

Location data and map data are different things

neat gazelle
#

Ah, okay! I'll give that a shot. I've got my map using CentralStation to prevent overlap, but I can see some folks not caring, and I haven't run across anyone going to the right out of the Bus Stop yet, but you never know

#

Which is why 'walk to the market' is a config option ... need to finish my thoughts

vernal crest
#

Ayeisha is to the right off the bus stop, so you'll conflict with her

#

(But it sounds like you've already given people an option around that)

gray bear
#

every vanilla area is kinda full of buildings but hey not everything must be compatible

hallow prism
#

config option is a great way to deal with that, yes. CS is more reliable imo than finding a free spot in vanilla maps 😄

vernal crest
#

I too am going for the "put my mod on the map but use CS as an alternative" route

gray bear
#

i have considering moving TSP to the central station but i'd need to like, make a map

#

would solve issues if i ever make another mod that adds items but like

#

making maps sad_panda

inland rain
#

idk if this has been done before, but this is indoors / outdoors, will be good for the open world!

gray bear
#

ooh that's cool

vernal crest
#

Wow that's so fancy Erin!

obtuse wigeon
#

Oh that's smooth! I'm going to have to get back into makeing vanilla stardew on the map!

blissful panther
#

Ooh, using the same core as your multi-floor house stuff from a while back I imagine?

inland rain
#

lmao no that was much harder

#

and never worked

blissful panther
#

Actually yeah, that supported SObjects and stuff, didn't it?

inland rain
#

here's the content patcher pack:

{
    "Format": "2.7.0",
    "Changes": [
        {
            "Action": "EditData",
            "Target": "aedenthorn.IndoorOutdoor/dict",
            "Entries": {
                "{{ModId}}_Example": {
                    "Location": "StardewOpenWorld",
                    "Areas": [
                        {
                            "X": 5006,
                            "Y": 5006,
                            "Width": 19,
                            "Height": 19
                        }
                    ]
                }
            }
        }
    ]
}
#

different indoors have different arrays, so if you're in one indoor area, other indoor area won't be shown

#

it just patches DrawTile so nothing too complicated

#

need to add support for drawing objects, trees, and stuff

obtuse wigeon
#

Thinking about it, secret woods could use this too!

blissful panther
#

This could be used for a pretty cool DeepWoods alternative!

hallow prism
#

it is hard to compete with deep woods imo

blissful panther
#

Yeah, I'm imagining something mines-like.

hallow prism
#

i feel set pieces would be quite useful for competition in term of interest

lucid iron
#

Personally I want to get some terrain generation

#

So it's not just all flat

brittle pasture
ocean sailBOT
#

Log Info: SMAPI 4.3.2 with SDV 1.6.15 build 24356 on Microsoft Windows NT 10.0.26100.0, with 11 C# mods and 2 content packs.

neat gazelle
#

Yes! The corrdinate changes worked, and I took the warp off the map and into content patcher! Thank you @hallow prism!

hallow prism
#

sure! it's aba that deserves credit for spotting the warp issue however 🙂

#

glad it's working! curious what the mod will be about!

neat gazelle
#

Thank you @vernal crest

#

It's my first map, and it's just a seed market

hallow prism
#

i have to leave for a bit but i have a quick question, there's nothing preventing me to append a dialogue to add a dialogue command or something, right?

brittle pasture
gray bear
#

hmm i don't think so Lumina but i'm no dialouge expert

lucid iron
brittle pasture
#

they copied the namespace name in their API too

lucid iron
#

I mean does the fact that the namespace is identical make a difference

#

I can't really think of y tho

brittle pasture
#

wacky
I can reproduce in my own mod as well, with a different namespace when importing the api

#

is something up with IFeedInfo specifically

brave fable
#

hmmmm can anyone read mandarin. not sure what this new bug report is about

obtuse wigeon
#

I think I just says not compatible doesn't it?

brittle pasture
#

nah, it’s actually complaining about the housing market in Canada

calm nebula
#

Namespace is not relevant

brave fable
#

both very possible outcomes

brittle pasture
calm nebula
#

Remind me to take a look after work on Friday if you haven't figured it out

brittle pasture
#

see, clearly about the Canadian housing market

dusky sail
#

how do i make a farmhouse mod without worrying about screwing up all the events that happen in there...

brave fable
#

without worrying is easy

#

without screwing up is hard

dusky sail
#

ok new question. if i do screw it up will it just be visual errors or will it actually break things/force people to skip events

ivory plume
#

(There's also home renovations to account for with a farmhouse map.)

dusky sail
#

the renovations are easy ive edited those before

#

ok on second thought not "easy" but i changed the rects and the costs and the text and the locations and everything so. even if i run into a roadblock i can just reference what i did last time

gray bear
stoic elbow
#

Question for bigger sprite animations. I made a sprite animation that is too big for a single sprite space. I have found that I can use spacecore to make it work, but I’m still curious as to how it works. Do I need to write this code in json.content? Where do I put the sprite animation on the sprite sheet?

#

I am big stoopid when it comes to code. What can I learn to make this process easier for me? C#? json coding? SDVpufferwaaah

#

I only know art waah

#

And I’m like too broke to hire someone to code for me

dusky sail
#

this is json yeah. id recommend not putting it in your content.json directly and instead doing an include. it helps with bug testing because itll tell you which included file has the error (at least for syntax ones... im not really an expert)

#

you dont really have to go out of your way to learn json either since stardew modding is relatively easy. you just kinda threw yourself in the deep end with making an npc

gray bear
#

you can just go ahead and copy it yeah

#

the parts after those red // are meant to help you, feel free to ask though

stoic elbow
#

What’s drawoffset?

#

Like for….the fishing rod?

#

And for the sprite sheet placement—how does this work, do I just place the sprite in two sprite spaces and leave it at that? How will the sprite be identified by the code?

gray bear
#

that i am not sure about

#

is this from spacecore?

stoic elbow
stoic elbow
dusky sail
#

well it being something youre inspired for is a strong motivator! better to learn with something you want to do than drudging through other stuff

#

ok i havent done this so take the following with a grain of salt but here's what i think is true
"sourceRectSize" should be how tall and how wide a single frame of the animation is. then "drawOffset" is how many of those it is from the top left of the sprite sheet. so like if your sourc rect were 16, 32 like a normal sprite, and you wanted the first sprite on the fourth row, then your drawoffset would be 0, 3 (since it starts counting from 0)

stoic elbow
dusky sail
#

exactly yeah!

#

so the sprite can go anywhere on the sheet theoretically. but i wouldnt overlap it with other parts like the normal walking or flower dance

stoic elbow
#

Anything between walking and flower dance would be fair game then right

dusky sail
#

the number of frames and such is probably still decided by data/animationDescriptions like a regular animation. and then this part just tells it to be big

#

i cant remember the npc spritesheet layout off the top of my head one sec

stoic elbow
#

Nah its cool I think I’m good on that part

stoic elbow
dusky sail
#

yeah! once you get something down it becomes a thing of "whoa something i made is in the game that's so cool!" and then you wanna finish it even more. at least in my experience

stoic elbow
#

Omg you’re so right. I’m so excited now

#

Now I just gotta figure out how to proof lol. Maybe I can spawn him in my house and make him play the violin and walk around a bit. I just gotta figure out how to do all that in the coding part.

#

There should be tutorial for that in the npc wiki tho, will do that tmr. I gotta go to bed

#

Tysm for clarifying things for me oclarina I really appreciate it:D

dusky sail
#

ofc! i hope im right and i didnt lead you astray also ^^;

stoic elbow
#

I’ve been recommended a mod that does smth similar for animations so I’ll check with that mod to see

drowsy pewter
#

personaly if the animation needs more than a few sprite frames, i might put it on its own image and then only use that part to animate a single frame on the npcs larger spritesheet

stoic elbow
#

I think it’s no bigger than 2, and I don’t plan on making a bigger animation than this so should be fine ish

drowsy pewter
#

mostly because if you put them on the same sheet, you'd be mixing purposes by putting spacecore animations as well as npc animations in the same spot, and separating it will make it easier to find the indexes for spacecore anims. thats my own perspective tho

#

Yeah if thats all then its fine

#

iridium recolors also does an animation for something larger than one tile

stoic elbow
stoic elbow
drowsy pewter
#

Hold on

#

I backread and I got the function entirely wrong

#

I apologize

#

I was referring to a different animation feature in spacecore, which functions differently from the npc animation feature

#

therefore none of what I said applies lol because it does have to be on the npc's spritesheet itself

stoic elbow
#

Oh okok

#

It’s cool! Thanks for coming in to help regardless :D

oblique meadow
#

Tiled update. I think something was just being stupid. I did a full uninstall and reinstall and its working again

south adder
#

hello everyone - newb here! does anyone know the feasibility of using a mod to connect to an external device (such as LED lights) via serial or BLE? wondering if this is possible or if anyone knows any examples I could reference.

tropic hare
#

Hi, I created a new map and placed some new fish in it. I used the "visible fish" mod, but there are always some fish floating out of the water onto the land and beyond the screen. I want to know if this is the reason for my map? If it is, what should I do to improve this situation?

calm nebula
#

"As feasible as doing it with c# is"

blissful panther
#

Which is to say with interfacing with C-based libraries... probably entirely!

calm nebula
#

But what if I want to interface with a rust based library instead

#

Portability might be fun

south adder
#

ha - thank you guys

lucid iron
#

You can double check and make sure you don't secretly have water on the map though

tropic hare
brittle ledge
#

I usually focus on not overlapping with NPCs I play with/like, so my NPCs will be free of overlaps with a random Chinese NPC but will overlap SVE SBVLmaoDog

hard fern
#

XD lol yeah, i get it

ornate locust
#

S A M E

#

heart events SDVpufferwaaah

brittle ledge
hard fern
#

squid moment....

ornate locust
#

oh that comment may have been a while ago... hey DIscord, why did you just... not... update until I sent a message?

brittle ledge
#

me replying to Forsy's message from 3AM

#

The squid thing is technically a bug but it amuses us so we told sheku he's not allowed to fix it SDVpuffersquee

ornate locust
#

now worrying if it was a Discord weird or my new router being weird SDVpuffersob

brittle ledge
#

nah, it's discord

#

it's Just Like That

ornate locust
#

Discord, creating awkward moments by being weird! Ah well

brittle ledge
#

@brave fable just saw you updated Raised Garden Beds SBVShookEyes Do you happen to know if it's compatible with Let's Move It? Or should I try if I ever play the game again and report back?

crude plank
#

do my eyes deceive me?? we got blueberry updates???meow_bongoderp

brittle ledge
gaunt orbit
#

hell yeah we r so back

wispy herald
hallow prism
#

because you are overlaying the aquarium sprites instead of using your own asset

#

it isn't recommanded to use the vanilla asset in this case as it is pretty bad for compat

#

"Lumisteria.MtVapius_Sturgiant": "0/fish/////Mods\Lumisteria.MtVapius\AquariumFishes",

#

this is how i specify i want to use my custom asset

#

{
"LogName": "Load images",
"Action": "Load",
"Target": "Mods/Lumisteria.MtVapius/Fishes, Mods/Lumisteria.MtVapius/AquariumFishes",
"FromFile": "assets/images/items/{{TargetWithoutPath}}.png"
},
this is how i load my files including the custom asset

lucid iron
#

I thought aquarium decor is hardcoded

#

You can have fish aquarium sprites tho?

wispy herald
#

I'm using static fish sprites for this yes

lucid iron
#

(to clarify by decor i mean coral and clay and such)

uncut viper
#

aquarium decor is just static fish innit

#

im not very familiar with aquariums

lucid iron
#

No the coral has funny randomization

#

You get different kinds of coral

#

Also hat on sea urchin (important feature)

hallow prism
#

i mean, it's worth seeing what happens with a separate asset and if it's good enough for the purpose

lucid iron
#

You can make bottom fish tho, which is perhaps close enough for your usecase

wispy herald
#

doing more testing I also realized I messed up the spritesheet locations, so thats great

#

okay I set the patch mode to replace and the sprites are all working now

hallow prism
#

is there a way to show a specific dialogue key for a character, somehow? i want to see if a dialogue change is applied properly and test it in one action rather than patch exporting

uncut viper
#

debug loaddialogue <NPC> <translation key> should do it

#

you'll have to talk to em afterwards either manually or via debug db <NPC>

hallow prism
#

what is the translation key in this case?

uncut viper
#

a standard translation key in the form of e.g. Characters/Dialogue/Haley:Resort_Leaving

hallow prism
#

ok!

#

thanks, will test that

#

it works, i don't need to talk to them manually

uncut viper
#

oh interesting, good to know. the wiki didnt say itd show and theres a separate command for showing the currently loaded dialogue so i just assumed it wouldnt

heady crescent
#

Can someone show me how to install mods? I’m so lost

hallow prism
#

yeah it's one less step, so it's great 🙂

uncut viper
ocean sailBOT
wraith bay
#

hey lumina may i dm you?

hallow prism
#

yes

heady crescent
old quartz
#

i want to rewrite the code the game uses to get marriage dialogue but i didnt see in the wiki if thats possible through smapi, would i have to use the ingame variables to work around that or can i somehow replace a method directly?

brittle pasture
#

(you can do anything in C#, but it’s useful to know your intentions lest I suggest using a chainsaw to kill a mosquito SDVpuffersquee )

old quartz
#

the game has hardcoded daysaverandom.next() numbers that i want to change (so they vary based on the number of keys that fit the criteria and etc), im aware that using random{{etc}} in the json can circumvent this but i wanted to see if i could remove that hardcoded limit. ex you can add in an entry under Outdoor_6 via EditData but it wont show up ingame because of the hardcoded daysaverandom.next(5) in NPC.cs (that i see via a decompiler)

calm nebula
#

You're in luck

#

That entire system is different in 1.6.16

brittle pasture
uncut viper
#

(or well, we will be in anywhere between 1 to n months from now)

old quartz
#

oh yay!! i do still wanna play around w this though while we're still on .15 (mostly cuz i find this interesting lol), what would i do in that case? does smapi have stuff to replace methods?

brittle pasture
#

!harmony

ocean sailBOT
#

Harmony is a framework for patching .NET code, allowing you to take any portion of the game's logic and insert or substitute your own. This gives you more flexibility and control than SMAPI helpers and events, at the cost of being typically more complex and difficult to use safely and correctly, and more likely to break with a future update of the game and/or SMAPI.

If you are trying to do something that isn't possible or practical with SMAPI alone, then Harmony is usually the solution.

For more information, refer to the following:

brittle pasture
#

there are many ways to solve this, and harmony may not always be necessary

#

for example you can simply modify the NPC’s currentMarriageDialogue field on day start/time change/entering location

old quartz
#

tysm, this is probably as close as i can get w/o directly modifying game code!! it might be easier to change the variable as you mentioned but ill take a look at harmony and see which one is easier !

gentle rose
#

what do you mean by "directly modifying game code" without harmony?

old quartz
#

like if i were to decompile the game and then change those numbers and then recompile it, which wouldnt be a sharable mod at that point ..

gentle rose
#

ah. most decompiles of the game are not recompileable without a lot of work iirc

old quartz
#

im glad that tools like harmony and smapi exist since without those i wouldve went straight into recompiling without knowing much about it 😭 all for minor dialogue changes

hot gale
#

scope creep is a bitch

limpid talon
#

hey guys! Does anyone know why this is the case? it's so specific and unrelated!

gentle rose
#

kinda just is tbh. Just some weird coding

limpid talon
#

hurm, alright

#

so when talking about a custom NPC who needs location dialogue, this block counts as gift tastes specified right?

gentle rose
#

I have no clue tbh, we'll have to wait for someone who does more content modding to confirm haha

limpid talon
#

I'll just run it and find out!

gentle rose
#

excellent point

urban patrol
limpid talon
#

yep they're all in there, thank you for making sure though!

brittle ledge
limpid talon
#

Ahh I see, good to know

hard fern
#

gift tastes seem pretty essential to making npc go

#

work

limpid talon
#

lol yeah

hallow prism
#

well antisocial npcs are a thing

#

it is important to know what does and doesn't work for them

brittle ledge
#

yeah, I'm wondering if that's how the game could "tell" an NPC was antisocial before 1.6

limpid talon
#

thank yoba i got into modding after 1.6

#

every day i find out that everything got so much easier after it

ornate locust
#

The amount of times I look up how to do something and find it on the 1.16 additions is... frequent

limpid talon
#

heheheh

hard fern
#

1.16, wow we really jumped versions huh

gentle rose
#

coming back to modding in 1.6 after starting in 1.5 and realising that parentsheetindex is dead was a wonderful moment

hard fern
#

🤔 i just watched a video of little crablets swarming the shores to hide in the forest

#

... can i add that to stardee

#

w

#

...

tender agate
patent lanceBOT
tender agate
gaunt orbit
#

Used to be how items were identified

#

It led to all kinds of horrible hackery and necessitated using either json assets or dynamic game assets to add items

#

ParentSheetIndex still exists but now it's only used for determining which part of the spritesheet to use

gentle rose
#

it was also the cause of things like staircases becoming purple shorts

gaunt orbit
#

And wallpaper incubation

hard fern
#

baby crabpocalypse

gaunt orbit
#

(incidentally this is why many older mods like pfm match against item name instead of id- it made it easier to work with JA items and reduced the number of issues with shared ids)

brittle pasture
#

parent sheet id lives on via 1.5 mods that are only minimally fixed to work in 1.6

tender agate
#

but why did it work the way it did, what was it doing in the background to be so awful

brittle pasture
#

it’s just how the game used to work
it wasn’t built with modding in mind, so “position of the item sprite on the spritesheet” was sufficient to uniquely identify an item

uncut viper
#

because an items entire identity was decided by where it was drawn on Maps/springobjects

#

(or others depending on if it was a BC or etc)

tender agate
gentle rose
gaunt orbit
calm nebula
#

Well a handful of cases the game would check the internal name

#

Often in an...interesting way

#

Anyways

lucid iron
#

There's also the old BO thingy

calm nebula
#

Yesterday I learned

lucid iron
#

I think island pedestal still use that one

gaunt orbit
#

1.6 separated the index from the id and added a bunch of code to help unify item logic, which fixed a ton of bugs and made everything easier

brittle pasture
gaunt orbit
#

Huh, til

calm nebula
hallow prism
#

and at some point you just needed to have part of the name being arecrow to behave as such, or something along those lines

brittle pasture
#

ran into it when making a custom heater upgrade; for now I abused that fact to avoid reimplementing that part of the code

#

it surely won’t explode in my face in subtle ways later

uncut viper
#

atra why is your screenshot aged

gaunt orbit
#

Put it in a cask, duh

calm nebula
#

Wdym aged

uncut viper
#

its got a certain crisp to it

#

but not the good kind

calm nebula
#

I downloaded it from discord and re-upload it

brave fable
#

maybe i un-update the mod

#

more seriously though i have no idea and ive never used lets move it or any other wii fit games about losing weight

calm nebula
#

Bluebs, is raised garden beds compatible with remove greenhouse shadow

brittle ledge
#

No worries, I'll try it out and report back... eventually

brave fable
#

ok well the update itself was about a year and a half late so the time scale here is very accommodating

lucid iron
#

Blubs is raised garden bed compatible with the sunken garden beds i dig in me field /j

brave fable
#

leave a note in your obituary and ill add it to the mod page faqs

patent lanceBOT
wispy herald
calm nebula
#

You should be able to add a new sheet

#

There is a field for that

brittle pasture
#

Why not load your own- yes

wispy herald
#

I did, it then loaded the sprites for the fish underneath my sprites

brave fable
brittle pasture
#

that wasnt loading a new sheet

#

or if you did you didnt point to that sheet in your data

uncut viper
#

lonelysheepling they mean you can make the game not reference the vanilla sheet whatsoever. a custom sheet would need not concern itself with arranging "around" the vanilla ones

wispy herald
#

No guides on adding aquarium fish with existing vanilla ids showed me how to do that, this is the solution that worked for me

tender agate
#

I'm no expert but I imagine adding things to the vanilla sheets is going to run into compatibility issues pretty fast

wispy herald
#

Yeah when the 1.6 update came out some sprites overlapped with the new fish

uncut viper
#

it will be compatible with other mods that touch the sheet, too, not just game updates

#

incompatible*

brittle pasture
#

vanilla/modded ids shouldn't matter, what matters is the texture field in the aquarium data which you can set to whatevs

uncut viper
#

if its just for personal use and it works for you then you can ofc decide for yourself what its worth to you

vital lotus
wispy herald
#

that is what I did

uncut viper
#

thats not what you did

#

by setting the 6th field on the AquariumData you can make it use a texture that is not "LooseSprites/AquariumFish"

#

you're still just using the default vanilla spritesheet

#

and just editing the spritesheet itself, and not the data in the aquarium

brittle pasture
void aspen
#

Anybody knows what will happen if host has some mods that other players don't have

vital lotus
uncut viper
#

no, bc the answer depends on the mods

#

the host and the farmhands should always match modlists

void aspen
#

Like bigger greenhouse mod

#

For example

ocean sailBOT
#

You can mod your multiplayer games, but to avoid any hiccups, all players' mod lists need to match. If players have mismatched mods, you will experience bugs in your game - even if the mods were working fine earlier, there is no guarantee that they will stay that way, and strange things may start occurring.

There are few exceptions to this. The main mod page often includes information on whether or not they work in multiplayer.

See the wiki page for more details on how mods work in multiplayer!

Multiplayer Mod Checker is an easy way to determine if host/farmhand mods match.

uncut viper
#

yeah, dont mix and match that mod

brittle pasture
#

map mods are definitely in the "this will kaboom your save if not synced" category

void aspen
#

Ohhh fair enough, well thanks then

wispy herald
#

if I'm editing this line to add textures "388": "93/static", //Wood

#

would I just add two slashes and then the asset name after the static?

brittle pasture
#

more than two, but yes

uncut viper
#

5 slashes

vital lotus
#

Have u opened the link?

wispy herald
#

yes

uncut viper
#

make sure when writing the asset name you use backslashes \, which you'll always need to write two of \\ to escape them properly

#

so if your custom spritesheet is loaded to {{ModId}}/MySprites you would write {{ModId}}\\MySprites

wispy herald
#

ty

uncut viper
#

SMAPI will handle the slashes for asset names no matter which way they are written, but bc aquarium data splits its sections based off forward slashes, you need to use backslashes here

hallow prism
#

I also provided an example earlier from vmv

urban patrol
#

off the top of their head, does anyone know of any mods that send HUD messages when you go to bed? or, even better, where i would find related methods in the decompile?

hallow prism
#

Spacecore can send hud message when a trigger action is triggered

#

No idea how that would work on day ended, but it can be done on day started

#

So maybe it can help as a starting point

urban patrol
#

i'm looking specifically to expand my C# knowledge, but thank you SDVpuffersquee

#

unless you mean reference its code, which could be helpful

hallow prism
#

Yes looking at the code

uncut viper
#

in this case its easy though: Game1.addHudMessage()

brittle pasture
#

it's weird that Dictionary<string, string> works though. probably should have used IDictionary the entire time, but ehh too late to change for those existing functions probably

uncut viper
#

oh i also ran into that with CMCT at one point i think when i was still working on 2.0

#

probably bc strings are types shared by every assembly

calm nebula
#

Yup

#

If both assemblies have access to the type, it's not proxied at all

#

The dictionary thing makes sense iirc too

#

Because you can emit a concrete class for an interface

tired matrix
#

I wonder if there’s any list with all tags we can use for dialogues (even extra or hidden ones), is there any?

tired matrix
uncut viper
#

there are no hidden ones, theyre all on the wiki

brittle pasture
#

mods can add their own CTs though (which I'm not sure if that's what you meant)

tired matrix
uncut viper
#

wdym randomly generated ones

tired matrix
uncut viper
#

those are controlled by different strings and i believe hardcoded until 1.6.16 is out

hard fern
#

i also know there's some things in stringsfromCSfiles or something

uncut viper
#

(dont quote me on that 1.6.16 part)

hard fern
patent lanceBOT
hard fern
#

youve been quoted, unfortunately

brave fable
#

oh what i wanted to use a fake quote bubble reaction

#

as if the bot knows them both

tired matrix
#

Are these custom keys?

uncut viper
#

no

#

as said they are hardcoded

brave fable
#

they're from the base game if that's what you mean

#

non-customisable

uncut viper
#

you can conditionally change them when your NPC is the one married to, i suppose, though that wouldnt handle polyamoury

tired matrix
#

Ah dammit better leave it the way it is then i guess

#

Thank you guysSDVpufferheart

brave fable
#

it's fine for now i'm sure, all characters use the same ones, so you're not an outlier

uncut viper
#

you can half quote me on it now

patent lanceBOT
brave fable
lucid iron
#

That's 1.0 of a quote

#

Not 0.5

patent lanceBOT
lucid iron
#

I'm glad you are doing well atra

uncut viper
#

sorry Tracked not Watched

tender agate
#

how can I get smapi or stardew to give me the save id?

hard fern
#

I forget to track mods so sometimes I'll have no clue there's an update, and ill like.. never know bc they forgot the update key

brave fable
#

do you mean a farmer's unique multiplayer ID?

hard fern
#

Or do you just mean the save name(?)

tender agate
#

sure
I just want the number here

#

save name

brave fable
#

i'm pretty sure the number is simply from player.uniqueMultiplayerID, for the master player

uncut viper
#

thatd be a pretty short unique id, no?

#

i thought they were longer

brave fable
#

i did think that after sending

#

alas i'm at work so no codebase

uncut viper
#

either way, SMAPI has Constants.GetSaveFolderName()

brave fable
#

out of interest, why do you need the save folder specifically

tender agate
#

I just want to use it as a seed for rand

uncut viper
#

Game1.uniqueIDForThisGame is much easier then

tender agate
#

to keep things consistent

#

oh awesome thanks

uncut viper
#

thats just the number part and not the save name

brave fable
#

the short id mystery solved

#

still short tho

lucid iron
#

A seed for rand bolbthinking

#

Game itself usually uses no of day played if that matters

brave fable
#

i mean the game usually uses whatever it wants

uncut viper
#

also, be aware that the save ID can be seeded by the player

brave fable
#

Utility.GetDaySaveRandom() (?) is pretty common as a mix of both

uncut viper
#

as in, its literally just the save seed they put in the save creation screen

#

this may or may not be a downside to you

tender agate
lucid iron
#

Yep go for it AquaThumbsup

urban patrol
#

i think i have a lack of understanding how classes work, perhaps. how do i tell it the message that i want to send? it doesn't accept a string, even though public string message exists in the HUDMessage class

#

i've tried to declare a HUDMessage object in several different ways, all of which threw errors

brave fable
#

yeah you've crossed a couple wires hahah

#

a couple notes here

lucid iron
#

nic my advice for classes in modding is dw about it oop is lame anyways kyuuchan_run

urban patrol
#

good bc OOP is why i dropped my java class lmao

lucid iron
#

The straight forward kind of behavior of code in a video game is <something> happened, and therefore <mything> should happen

calm nebula
#

What do you do if you dont oop

lucid iron
#

the whole game loop can be thought of as events Bolb

urban patrol
lucid iron
#

In your case you have a day ending event, and inside there you can construct a HUDMessage to do what you want

lucid iron
#

It doesn't need to persist beyond this event

tender agate
#

Is there a trigger action for like when my mod is run for the first time on a save?

calm nebula
#

No

tender agate
#

wack okay

brave fable
#
  1. objects are generally created either through a constructor (new myfunnytype()) or through a method that happens to return a new object for you.
  2. referencing members of a type, not an instance, is static behaviour. these members are instances on the type itself, not on any instance of that type created with new, and all usages will reference that same single instance.
  3. by calling HUDMessage.message you're trying to access message statically because you don't have an instance of HUDMessage, but it's an instance member of HUDMessage so you'd need to create an instance first if you wanted to do it this way
  4. to define a string message, you want to use string message = "hello", var message = "hello", or define a lambda function to reevaluate it whenever referenced with var message = () => "hello". you've instead tried to define and assign to a static method and a bunch of other things at once, so it'll need rewriting.
lucid iron
#

Data/TriggerActions have that built-in kinda

#

They get marked as apply

calm nebula
#

Er, but also DayStarted that doesnt repeat would be lole that

lucid iron
#

But that's not an individual Action thing

brave fable
#

if you just want to have a string always be the same, you could use private const string MyWeddingMessage = "hello" or private static string MyWeddingMessage = "hello" if you preferred/required static behaviour, which can be accessed with this.MyWeddingMessage or ModEntry.MyWeddingMessage respectively

#

if you wanted to load translated text from i18n, you could use a lambda like so```cs
private string MyWeddingMessage = () => this.Helper.Translation.Get("my.i18n.key");

which will ask the i18n helper to get the translated string each time it's called
#

think that's the right syntax anyway, discord isn't a helpful ide

urban patrol
#

how does it know to reference a specific json file? is that baked into Helper.Translation?

#

i have so many other questions but that's the only one i can clearly articulate right now

brave fable
#

more on lambdas here, but essentially it's private because we don't want or expect anyone else to use it, it's not static because it has to reference our mod instance with this (remember static members don't have an instance reference, only the type), it's of type string because we're implicitly returning a string value, it defines an empty list of parameters () , forms a lambda with => syntax, and then runs the line of code afterwards (or a {} scope that returns the expected type, if needed)

#

the translation helper does all the magic of picking the relevant translation for you, you just need to use the same structure as CP by having an i18n folder with the expected files inside

signal radish
#

Late reply but nope, I didn't add a sword swing animation (I don't know how to either). Apologies!

#

You could probably accomplish a similar effect with a temporaryAnimatedSprite, though. I'll have to mess around with it.

urban patrol
#

how can i fix this error? what am i not understanding

brave fable
#

all this is to say that if you're not reusing the MyWeddingMessage behaviour elsewhere you're ofc free to just call Game1.addHUDMessage(this.Helper.Translation.Get("my.i18n.key")); inline when needed, or however else you'd get your message

urban patrol
#

oh let me try that, i don't need to reuse it

uncut viper
#

(AddHUDMessage doesnt take a string)

brave fable
#

oh i see, it wants a HUDMessage instance, not the text for the hudmessage, which means you've got to create one yourself

urban patrol
#

yeah that's what i was originally trying with the first screenshot (badly)

brave fable
#

which should be simple, iirc all you need to do is use new HUDMessage(this.Helper.Translation.Get("...")) to create a new one with your translated text

urban patrol
#

is new built into C#, and is all it does call the method and return the object?

calm nebula
#

Yeah, it's a Constructor

brave fable
#

it calls a constructor, one of however many are defined on the class, and whichever one matches the types of the params you provide in the parentheses

urban patrol
#

okay and i'm providing that i want a string by telling it to Get it from i18n?

brave fable
#

the HUDMessage constructor wants the string, *you *have to do what it wants

#

but yes, you're fulfilling the param by getting a string from Helper.Translation.Get()

urban patrol
#

is this a constructor?

brave fable
#

yes! an unnamed method that returns the containing type is a constructor

#

in this case, that constructor first runs the HUDMessage (this) constructor with the params string, float (fulfilled by message, 3500f)

#

and then runs whatever's contained in its own {} method scope

urban patrol
#

how does it know which constructor that i want? there are 4 or 5 in HUDMessage

brave fable
#

these can chain endlessly from constructor to constructor, including to the superclass (inherited, parent, base, ..)

#

that's for you to decide depending on your use case

#

in this case though it looks like there's helpful xml docs on each that describe why you'd use each

urban patrol
#

so if i wanted the second, i would pass the params string, int and it would know to look for that one?

calm nebula
#

Yes

#

(The exact concept is "overload resolution")

brave fable
#

(where multiple methods with different parameters and with the same name, or multiple constructors, are considered overloads)

lucid iron
#

It would be cute if the icon is the mermaid pendant

urban patrol
brave fable
#

pretty sure you'd just use Game1.addHUDMessageForItem() or somesuch, maybe editing the text of that message afterwards if you can't set it as a param

urban patrol
#

i think the next question i have is: how do i make it yes/no like the "go to bed" question? i searched for bed and nothing useful came up

brave fable
#

you'd search for "Sleep" instead

#

in the code that is, not the content

urban patrol
#

aha

brave fable
#

question dialogues will joyfully introduce you to the concept of delegates and callbacks since it's a mess

urban patrol
#

uh oh

brave fable
#

you'd also need to probably need to use harmony to replace the usual Sleep behaviour with your own

#

which is probably a transpiler since it's not its own exclusive method

#

which means learning IL

urban patrol
#

uhhh then maybe i'll stick to sending mail about it SDVpuffersquee

uncut viper
#

i would just do the reminder when they enter the farmhouse

#

or maybe when they leave in the morning

brave fable
#

i mean the hudmessage works too, you'd probably just want to show it on day started on the morning before the wedding, instead of on day ending on the night before the morning before the wedding

#

since otherwise it'll immediately be slapped with the EndOfNightMenu and save screen and never appear when the save is next loaded since you're no longer on the night before anymore

urban patrol
#

i've been operating under the assumption that the wedding starts immediately the morning of the wedding, before you even step outside--is that not true

brave fable
#

i mean the morning before the wedding, not the morning of the wedding

urban patrol
#

gotcha

brave fable
#

but if you want it before you go to bed that night

#

probably use button's suggestion

urban patrol
#

how could i tell if they're entering the farmhouse at 9am because they forgot their keys, vs at 9pm to go to bed?

brave fable
#

add a new event handler to helper.Events.Player.Warped or whatever it is, check if e.NewLocation is FarmHouse house && house.owner == Game1.player.uniqueMultiplayerId or however it is, then show your message

uncut viper
#

you probably dont really need to if you just do it every time

#

if you wanted to get fancier you could check when the player enters a rectangle around the bed

urban patrol
brave fable
#

you don't know when the player wants to go to bed, they might do it first thing in the morning to skip to the wedding

uncut viper
#

i would call it desired behaviour if the mod page said its what itd do

#

modding life hack

urban patrol
#

lol

#

on that note, it wouldn't work if someone slept for three days straight to get to their wedding... since they would never warp back in

brave fable
#

depends if the Warped event fires on each day i suppose

uncut viper
#

you can do it both on warped and on day started

brave fable
#

you'll find a lot of these questions can only be answered by trial and error

#

or if you prefer, by reading the code thoroughly to get a good idea of how it'll work

#

but that's lame

urban patrol
brave fable
#

just as a quick aside about events since now you're looking at adding more than one, you can register as many handlers to as many events as you like, and you can register the same handler to the same event as many times as you like (usually you would like only once)

#

add handlers with += operator, and remove them with -= if you need to

urban patrol
#

and an event handler is a method that references one of the game-defined events?

brave fable
#

handlers are added by named reference, but not by call, e.g. Warped += OnWarped; instead of Warped += OnWarped();

#

sure, an event handler isn't a specific construct, it's just a name for whatever method (or lambda) with matching parameters for the event

urban patrol
#

got it

uncut viper
#

also itd be a SMAPI-defined event

#

you can find them in your IModHelper given to you

brave fable
#

well it can be any event so long as it's defined

#

feel free to send mail when lightning hits the farm because that has its own event

uncut viper
#

(i just didnt want nic to go looking for Warped or DayStarted events in the decompile)

urban patrol
#

yeah i def wouldn't have known the difference lol

#

did i get GameLoop_DayEnding from somewhere (in the code, not from blueberry lol), or did i make that up (and could have called it anything?)

#

i tried changing it to DayStarted on both sides and it liked it on the left but not on the right

lucid iron
#

Green underline...

urban patrol
#

no i have no idea what that warning means

lucid iron
#

Idk either tbh, but if u mouse over it'll probably say something more useful

brave fable
#

if you go to your GameLoop_DayEnding method you'll notice it has specific parameters for the DayEnding event

#

chances are Intellisense(tm) created that method for you when you went to write up that line

lucid iron
#

Oh u need object?

brave fable
#

if you change the left-hand-side reference to the DayStarted event, you'll also want to change the parameters of your right-hand-side method to match the ones it wants

#

if you hover DayStarted it'll tell you the expected types

#

and yes, you can call your methods anything, so long as it's not a reserved word, doesn't start with a number, doesn't contain illegal characters, terms and conditions apply, etc

urban patrol
#

are there no expected types?

brave fable
#

press F2 with the caret on a name to try and rename all references in the project

#

or like shift-alt-f12 or something unholy if you use jetbrains products

#

try using the params (object sender, DayStartedEventArgs e)

urban patrol
#

it has that

#

well, had. then i backspaced it and it autofilled GameTime gametime

brave fable
#

wat

urban patrol
brave fable
#

it's disappointing that convention calls for the phrase reserved words instead of words of power

urban patrol
#

how can i find out what params this method wants? like how did you know it wanted (object sender, DayStartedEventArgs e)

brave fable
#

why, it tells you right there in your image

#

`No overload for (your method) matches delegate EventHandler<WarpedEventArgs>'

urban patrol
#

ohhhh inside the <> ?

brave fable
#

so your parameters are object, WarpedEventArgs

urban patrol
#

oh inside the ' '

brave fable
#

(object is implicit and usually null and zero people in history have referenced it)

urban patrol
#

EventHandler is object, <WarpedEventArgs> is...

#

oh i see

#

and can i write whatever instead of e in my method, or does it have meaning?

brave fable
#

here i should mention that <> denotes that EventHandler<T> is a generic class, or a particular member of a generic class, where one may be created based on any type T , and you'll want to read up on generics somewhere else entirely because i'm not paid to write on discord

uncut viper
#

are you paid to write anywhere else?

brave fable
#

the parameter name doesn't need to match, just the types

#

well yes, in my ide. at my job. in my office. that i'm in

uncut viper
#

you dont seem to be doing much writing there

urban patrol
#

does this logic look correct? i copied the day started method and i think i implemented the checks correctly according to what you said, blueberry

#

it would be checking if you warped into a farmhouse and then checking if it belongs to you

brave fable
#

at a glance it looks good SDVpufferthumbsup i'm sure you're familiar already with test saves and debug commands so you'll know how to do a test run

urban patrol
#

yep, i just have to make a manifest and compile i think

#

and an i18n file

#

i'm still only halfway through the button push test lol

lucid iron
#

instead of i18n if u use Game1.content.LoadString then ppl can edit it Dokkan

#

advanced topic for the second semister

brave fable
#

if you wanted you could separate the whole contents of DayStarted into its own TrySendWeddingMessage() method to reduce code reduplication, but for now give it a test, see if it works, and setup git for your project so you can make a commit milestone here for easy changes with a safety net of your saved code

urban patrol
lucid iron
#

yea its just a C# mod reading from content, which content patcher edits

brave fable
#

all content is equal, whether it's mods/spacechase0.spacecore/myfunnydict or data/objects

rocky copper
#

Say, can I use whether the player has a specific Mastery as a condition? I'm not seeing a condition on the wiki that seems to match Masteries, unless it's maybe a Base Skill Level at 11 or something

uncut viper
#

they each get a stat, i dont remember it off hand but you can check Data/Powers

rocky copper
#

Cool, thank you

uncut viper
#

since they use it to show which masteries you have in the powers tab

tiny zealot
#

the masteries are in the powers tab so there should be something there for it, yeah

uncut viper
#

so you;'d use PLAYER_STAT with it

rocky copper
#

PLAYER_STAT Current mastery_0 1
Perfect, thank you

urban patrol
#

how do i make VS recognize my manifest? i tried file>new but that didn't seem to put it in the project

#

the tutorial just says add your manifest then build

tender agate
#

are you sure you clicked the right place when you right clicked to add file

urban patrol
#

not at all

#

where should i click?

tender agate
#

probably weddingreminder

#

current file might be in dependencies or something

lucid iron
#

where did u save the file

urban patrol
lucid iron
#

move it into WeedingReminder

tender agate
#

move it in

lucid iron
#

*Wedding

urban patrol
#

well. duh. thank you

#

yay it built!

brave fable
#

"you're getting married tomorrow, but a growing number of weeds have damaged the farm. you may need to evaluate your priorities"

urban patrol
#

my second C# mod--

tender agate
#

your spouse may have signed up for life or death but they didn't sign up for weeds

brave fable
#

since you mentioned 'place project in solution folder' the other day, i'll note that the manifest should be on the project level, so if you'd checked that box then the manifest would be where it is in the image above

urban patrol
#

ah that's probably why then

round dock
lucid iron
brave fable
#

but since you didn't, it goes into the project folder

tender agate
urban patrol
#

she hates me 😔

#

(the perils of speedrunning a relationship)

brave fable
#

did you upgrade your house. broke ass

tender agate
#

day 1. bro she should be running away already

urban patrol
#

lmaooo i'm not good enough for her i see i see

#

it works! i got no translation because i forgot to make i18n but it works!

#

do i need to rebuild after adding i18n?

#

or can i do that in notepad++ and file explorer like normal

uncut viper
#

not in this case

#

this is C# territory where if the string aint in the i18n, its in the C#

#

you'll need to rebuild after adding your i18n

round dock
#

Ah, I thought this was CP, apologies SBVMoonPlead

#

(ignore me aSDVpufferhide)

urban patrol
#

no worries, i didn't clarify!

uncut viper
#

i will not ignore you bc i think you have a lovely presence

#

however i will gently inform when the presence is incorrect on some small things

round dock
#

and it is always appreciated and warranted, thank you Button e_heart

lucid iron
#

@brave fable say can i add new raised garden beds

brave fable
#

of course, just patch the data asset

lucid iron
#

wow it comes with a recipe model

inland rain
#

Using tile properties to allow tiles to show both when indoors and outdoors (the leaf border in AlwaysFront)

brave fable
#

i actually made the rgb 1.6 compat commit like half a year ago i have no idea why half of this is written the way it is

uncut viper
#

can i get the mod without the added rgb, i prefer a simpler style without all the colourful lights

tiny zealot
tiny zealot
#

(C#) anyone know a convenient incantation to determine whether an NPC is
a. standing still at a schedule stop, or
b. en route to their next stop?

#

performance is a factor, so iteration should be avoided. i'm hoping somebody knows a useful combination of NPC/Character properties that has not yet revealed itself to me during code inspection

inland rain
#

doesn't isAtEndPoint do that?

tiny zealot
#

does it? (NPC.controller?.isAtEndPoint()?)

lucid mulch
#

NPC.controller.pathToEndPoint would be empty I think when at the schedule stop, but taking a quick glance not sure a good way to check if it is empty or not

#

the pathfind controller 'eats' points from the path/stack as the npc is walking as part of the schedule, and there is a stack per time section of the schedule

tiny zealot
#

hmm, ok. thanks!

lucid mulch
#

isAtEndPoint doesn't look bulletproof as the stack can contain points from multiple locations (and the pathfind controller doesn't really know which point belongs to which map) so can have a false positive

urban patrol
#

does everything you load using C# have to be a string/string dictionary (barring maps/images)?

lucid mulch
#

no

lucid iron
#

Naw any type is fine

#

string string is a lil special because LoadString specifically wants it

urban patrol
#

oh that's actually good

#

i was trying to load just a string and it was having issues

lucid iron
#

when you use a framework that says "edit my custom asset"

#

there is usually some class behind it

urban patrol
#

this is my method to store a default HUD message. people would target my path in CP to edit it, right?

#

also, i found the C# side of the wiki and you can tell lol

lucid iron
#

you don't have to do this tbh kyuuchan_run

#

as in, not actually needed to init the dict from C# side

#

loading blank json from cp side also works so up to u basically

#

but putting aside details this is correct for doing equiv of this

urban patrol
#

would doing it through CP be two mods/manifests?

#

i'll def do that for more involved stuff, but not sure about doing it for literally one string lmao

lucid iron
#
{
  "Action": "Load",
  "Target": "yourassetname/HUDMessage",
  "FromFile": "mystery.json"
}

where mystery.json is

{
  "Default": "etc."
}
#

but what i actually meant is

#

you can use a string string asset like this for specific spouses

urban patrol
#

oh so like someone could edit in "You're marrying Morris tomorrow!" ?

#

to "Morris": instead of "Default": ?

lucid iron
#

yea

#

LoadStringReturnNullIfNotFound is helpful cus you can detect whether you actually got a string Bolb

#

but yes second semister thing™ just do this with Default for now, maybe even source Default from yer i18n lol

urban patrol
#

and just to be clear: if i add this through C#, does it prevent people from adding their Morris key?

brave fable
#

if you use the AssetRequested etc. events provided from SMAPI Content Events then you're running them through the same content pipeline as any other assets

#

so no, you won't prevent them unless you load from your mod assets directly

urban patrol
#

ok i think i get it. in this specific case i feel like it's easier to add it through C# then since it's literally only one string and i don't see downsides to doing it this way (correct me if i'm wrong, and it's good to know i can do it through CP instead if i want)

brave fable
#

the downside is it's ugly

#

the bottomless pit side is that you don't get to use all of the conveniences offered by content patcher

lucid iron
#

the upside is that u can stop yearning for the foreach (cus you have it :))

brave fable
#

true, you do get the loops

urban patrol
#

are you both talking in general, or in this specific instance? i'm not trying to be obtuse i promise

#

i'll take you at your word i just want to be sure

brave fable
#

conveniently this also highlights how you can load an asset containing data of complex types to a class instance

twilit quest
#

I thought someone said that one can use tokens in the i18n default file, but it is very much not working for me

brave fable
twilit quest
ornate locust
#

if you end up using many passthroughs, you can end up setting them all up in ONE passthrough token from hell

#

good times

urban patrol
ocean sailBOT
#

Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Pro, with 22 C# mods and 3 content packs.
Suggested fixes: One or more mods are out of date, consider updating them, SMAPI is out of date, consider updating it

urban patrol
#

i feel like the issue is inside of LoadString...how does it know what string to load out of the whole dictionary? i must need to tell it to look for a specific one, but i'm not sure how

royal stump
#

as an example, Game1.content.LoadString("Strings\\Buildings:UnderConstruction") means check the asset Strings/Buildings for an entry with the key "UnderConstruction"

#

so you'd want a colon followed by the specific key you're loading

urban patrol
#

just like i18n then, that makes sense. thank you!

#

C# can't use CP tokens like {{Spouse}} i'm assuming

#

but i could use a loop...

royal stump
#

iirc there's a field on Farmer (i.e. on Game1.player) to check their spouse, poly mods aside

#

but in general no, those tokens are used by CP, so it has to pass through CP to get converted to anything

#

also there are tokenized strings, but I've never used those personally

urban patrol
#

if i think about poly compat my head will explode, so no need to worry about that right now haha

lucid iron
#

oh it should actually be pretty easy

#

the marriage is tracked per Friendship

royal stump
#

(also ftr while I'm here)
a minor update to EMP is out:

  • Esca.EMP/PlayerStat is case-insensitive now (and slightly faster because it uses the cache properly) (thanks chu & button)
  • Esca.EMP_IS_TIME_PASSING GSQ added to check whether the game is paused; not guaranteed to work on Android or certain niche cases, though
uncut viper
#

i didnt do anything but im very happy to see this SDVpufferparty

royal stump
#

I would've ignored my "todo: cache better" comment a lot longer if you two didn't discuss it SDVkrobusgiggle

vale lily
#

confusing

urban patrol
#

string SpouseSpecificHUDMessage = Game1.content.LoadString("handwrittenhello.weddingReminder/HUDMessage:" + Game1.player.spouse); why is this returning the literal path and not the value of the dictionary

vale lily
#

im not sure

lucid iron
#

Do u have the key in ur dict

urban patrol
#

this is my i18n

#

i'm getting this:

#

oh hang on it must be a mismatch with i18n

#

lord i need to get a rubber duck and stop bothering you all

lucid iron
#

Patch export your asset

#

That's more important usually

#

And dw i SMCbadge_rubberduck this channel all the time

vale lily
#

i rubber duck this channel too

urban patrol
#

i only added it to my i18n and not in my actual content.json like a rookie

vale lily
#

im a rookie

uncut viper
#

@ivory plume just to double check, is it intended that something like this does not work:

"Action": "Load",
"Target": "{{DynamicTokenList}}",
"FromFile": "assets/Portraits/{{TargetWithoutPath}}.png"

where {{DynamicTokenList}} is something like Portraits/Abigail, Portraits/Haley literally as its value and i have an Abigail.png and a Haley.png in my assets folder
i ask cuz looking at Content Patcher's source, it seems clear enough to me why it doesnt work (PatchManager.SplitPatches() is called before/without token parsing, and they arent even ready by then anyway i believe) but what confused me at first was that it didnt give me a non-existent FromFile error, but it did if i used {{Target}} or {{TargetPathOnly}} instead. i assume System.Path just looks for the last / for {{TargetWithoutPath}} and thats why, but it still threw me for a loop for a bit wondering why one Target* token "worked" and the others didnt, which is why i wanted to ask if this is intended behaviour and/or if this was a hard technical limitation that meant using a token for a Target like this will never be feasibly possible

vale lily
#

woah

hard fern
#

what does a duck do

uncut viper
#

is that a serious question

#

(/gen idk if ur asking jokingly or dont know what rubber duck debugging is genuinely)

vale lily
#

duck good

urban patrol
#

i can't add constants to the HUDMessage class, right? i'm trying to implement one last thing, which is displaying an icon with the message, but it takes an int and there are only a limited number of consts declared

uncut viper
#

you cannot change the members of a game class

urban patrol
#

okay makes sense, thanks

brave fable
#

even with harmony you can only add, remove, or change behaviours in or around methods of a game class, you can't actually add, remove, or change the members themselves

#

and previous proposals for solutions to this have been rejected because it's infernal

uncut viper
#

wasnt the outcome of the cecil mods PR to simply put a pin in it?

brave fable
#

anyway you are in fact able to change the icon of the hudmessage, but i couldn't tell you how atm

#

the answer also depends on what exactly you want to use as the icon

urban patrol
#

i was thinking easy mode = the mermaid pendant, hard mode = your spouse's sprite upper half

brave fable
#

.SDVcharabigail

kind smelt
#

I'd love to get into modding a bit more, tho I couldnt find any good guides, does anyone have some tips? I can code Java, Python, js etc. tho never really touched C# kinda having a hard time with the library management and stuff, it just feels really weird. Also I kinda dont get the modding part itself even tho I've modded other games like Minecraft etc. So I'd really appreciate some links or just tips

brave fable
#

easy mode and hard mode are actually the same, but hard mode involves adding a dummy item that uses spouse texture name as the texture field 😌

urban patrol
brave fable
#

!startmodding is the usual reference

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.

vale lily
#

^

kind smelt
tame burrow
brave fable
#

what is the function of a rubber duck SDVdemetriums

gentle rose
#

debugging

vernal crest
#

Squeaking

round timber
brave fable
#

which in boring syntax might look like this:```cs
var hudmessage = new HUDMessage("Your wedding is today!!!");
hudmessage.messageSubject = ItemRegistry.Create("(O)460");
Game1.addHUDMessage(hudmessage);

or in cool c# syntax ![SDViconskaterboi](https://cdn.discordapp.com/emojis/982135164551434281.webp?size=128 "SDViconskaterboi") ```cs
Game1.addHUDMessage(new("Your wedding is today!!!") { messageSubject = ItemRegistry.Create("(O)460") });
#

this is 'simplified object initialisation', which is just shorthand for you to assign accessible non-readonly fields and properties immediately after running the constructor by adding a {} block after the new() call. in this case, we're just making a basic hudmessage and then assigning the item to show, which wonderfully requires no extra effort to get working.

#

you already know about qualified item IDs so i won't go into that

#

i'll leave it at a mention that pretty much all of your item creation should be run through the ItemRegistry

#

and as an added note on scope and lifespan, since we aren't actually giving this new item to anything in the game world, just our hudmessage, it will cease to exist as soon as the hudmessage expires. no need to worry about spawning items and having them appear anywhere

#

(but yeah given the extremely convenient item messagesubject draw behaviour, if you want a spouse portrait you're gonna have to make a new dummy item that's just their face. like with weird abby above)

#

(unless you use harmony ofc)

gray bear
#

that's so cool blueberry

obtuse wigeon
#

Is the error item texture replacable using content patcher? or is it hard coded to display the circle with line?

gray bear
#

well there's one for buildings, makes u wonder

obtuse wigeon
#

Ahhh I never noticed that there was a buildings one, good spotting, thank you

gray bear
#

dun see one for items tho thonk

uncut viper
#

its just the one in cursors

gray bear
#

cusors 1
bea 0

obtuse wigeon
#

thank you!

fossil osprey
gray bear
#

actually could something be in the game tilesheets and still be hardcoded?

uncut viper
#

its hardcoded to use that texture when its an error item. doesnt mean you cant change the texture

#

the texture has to come from somewhere

#

as far as i know there isnt anywhere that the game constructs a Texture2D from scratch for anything substantial

gray bear
#

ah, that makes sense. thank you Button SDVpufferheart

gray bear
obtuse wigeon
#

~~I'm always in everyones game SDVkrobusnaughty ~~

unreal spoke
#

Actually only in mobile players’ games.

uncut viper
#

the file is still there on PC though

unreal spoke
#

Wait, it is? Oh god, since when?

gray bear
#

forever i think

#

all the files are there whatever u use i think

merry rampart
#

is there a debug command to trigger trash bear?

hallow prism
#

your best bet may just to get a random save (or create one) that is in y3

#

if it's to test the changes after trash bear, you may search if you can find the related worldstate stuff and set it to the value you need with a debug action command or something

#

(or find a save that is past this point)

merry rampart
#

yeah i think cheesing a y3 save is my best bet

#

i did just that and it turns out my patch wasnt applying correctly. which was an easy enough fix

hallow prism
#

glad you made progress 🙂

iron ridge
crude plank
hallow prism
#

Yes but im on phone so if i forget to answer give me a reminder tomorrow

dire spindle
#

How can I make a mod that displays an image on the screen when I press a key (and I can press like the arrow keys to switch between images)

#

I tried making one but I kept having errors and then when smapi finally didn’t display an error in the game the image didn’t load and instead there were brown rectangles covering the number of each item I had

#

So I might aswell just restart

brave fable
#

the best place to start would be the ButtonPressed tutorial for a simple C# mod, and then add your image-draw code to a new helper.Events.Display.Rendered event after the ButtonPressed event, where pressing a button will set the image

#

given you say other sprites onscreen started to get mangled, it sounds like you were messing with the wrong methods for creating a texture

#

to keep it simple, you can just use Game1.mouseCursors to draw all the game's miscellaneous sprites at once

#

no need to create a new texture just for a quick test:```cs
e.SpriteBatch.Draw(
texture: Game1.mouseCursors,
position: new Vector2(Game1.viewport.Width, Game1.viewport.Height) / 2,
color: Color.White);

#

you can also load any image assets available to the game:```cs
e.SpriteBatch.Draw(
texture: Game1.content.Load<Texture2D>("LooseSprites/Cursors"),
position: new Microsoft.Xna.Framework.Vector2(Game1.viewport.Width, Game1.viewport.Height) / 2,
color: Microsoft.Xna.Framework.Color.White);

#

maybe your ButtonPressed event will load the texture, and your Rendered event will draw it if it's been loaded

inland rain
#

Does anyone know why my resource clump shadows aren't drawing with transparency? I'm not drawing them manually

brave fable
#

the obvious question is 'is your current spritebatch using an alpha blend state'

#

the REAL question is 'how many logs are on that tile'

inland rain
#

maybe I'm adding it in two places

gray bear
#

are they always cut off like that

nimble marlin
#

Hi @brave fable! Just wondering if the plate texture is ready yet so I can update my code and release the mod. Thanks, and sorry for the inconvenience! ^^

gray bear
#

is this a path?

brave fable
inland rain
#

oh I think I'm not removing it when moving chunks lol ty

gray bear
#

how do resource clump work

lucid iron
#

They are ResourceClump and have approximately 1000 if to check if you can remove them with a given tool

gray bear
#

this isn't a tiled thing is it?

iron ridge
#

no theyre, if placed in tiled, a paths item iirc

nimble marlin
iron ridge
#

how would one create a mod project from a terminal?

#

oh i think i got it nvm

gentle rose
#

chu does dotnet crimes iirc if you do need cli compilation help

crude plank
iron ridge
gentle rose
#

why are you refusing to use an ide

iron ridge
#

and for some reason doesnt let me run them

#

(i dont want to have to deal with jetbrains on linux, intellij was painful enough)

gentle rose
#

rider on linux actually works really well

#

that's what I used to use pre this windows pc

iron ridge
blissful panther
#

The toolbox program is actually super useful for grabbing... any of their things.

iron ridge
#

tbf it is

gentle rose
#

iirc rider has a native linux version

iron ridge
#

so did intellij it's just hidden away

blissful panther
#

All (well, most) of their things do, yeah.

gentle rose
#

either that or it was on the aur SBVLmaoDog

iron ridge
#

sort of unrelated, what horrors am i doing here to get an invalid program from CLR

harmony.Patch(
                original: AccessTools.Constructor(typeof(TemporaryAnimatedSprite), new Type[] { typeof(string), typeof(Rectangle), typeof(float), typeof(int), typeof(int), typeof(Vector2), typeof(bool), typeof(bool), typeof(float), typeof(float), typeof(Color), typeof(float), typeof(float), typeof(float), typeof(float), typeof(bool) }),
                postfix: new HarmonyMethod(typeof(ModEntry), nameof(ModEntry.TemporaryAnimatedSprite_Constructor_Postfix))
            );

the types should be right, given public TemporaryAnimatedSprite(string textureName, Rectangle sourceRect, float animationInterval, int animationLength, int numberOfLoops, Vector2 position, bool flicker, bool flipped, float layerDepth, float alphaFade, Color color, float scale, float scaleChange, float rotation, float rotationChange, bool local = false)

gray bear
#

2 random fence tops in secret woods

gray bear
#

i fight leaf,. leaf win. PensiveButtPuffer how to make more natural

iron ridge
#

add more bounce

#

make it not straight lines

gray bear
#

there isn't many tiles, i will try

ivory plume
gray bear
supple niche
#

It doesn't look so bad

gray bear
#

but def bad

oblique meadow
#

ok Bea. So if im correct, this was the example you gave in the other chat. I recreated it really quickly

gray bear
#

yes

oblique meadow
#

honestly the only thing you really need is a bit more depth on your second layer in. Your edges and shape are perfect

gray bear
#

thingy

#

more depth?

oblique meadow
#

So i did this real quickly. But using the interior pieces to add a bit of flair to the edges

gray bear
#

ah, i see, lemme, do a thing

#

expand the leadf

oblique meadow
#

That looks fantastic

gray bear
#

i want this one to be more of a slope but when it did it looks too damn straight

oblique meadow
#

Then, and this is a personal choice for me, I like to add a bit to the empty green space

gray bear
#

oooh that's pretty

oblique meadow
#

Slopes with trees are hard

gray bear
#

i suppose tree just don't slope

oblique meadow
#

That's why you'll see edges like this a lot:

#

to avoid the straight look

obtuse wigeon
#

I think you are one with the forest spirits because you make good canopies, I'm jelous

gray bear
#

forest confusing