#making-mods-general

1 messages · Page 98 of 1

hot tangle
#

is there anything I can do to fix a mod that doesn't work because it doesn't have a manifest.json?

shut grove
#

that's not the vanilla void, it's the void from Visit Mount Vapius' museum patch

hot tangle
#

no

rancid temple
#

What kind of mod is it?

lucid iron
#

Are you trying to update it?

hot tangle
# rancid temple What kind of mod is it?

it changes the farmhttps://www.nexusmods.com/stardewvalley/mods/9347?tab=description

Nexus Mods :: Stardew Valley

A Huge farm map to replace four corners (about 6x larger). This Farm Fuses all the bonuses and aspects of all the Farm types. [Also in Stardew Planner](see the mod description for further details)

hot tangle
lucid iron
#

If it's just mod u install downloading again properly fixes things, some mod managers like vortex eat files

woeful lintel
#

I'm still putting the display name modders give directly into Data/Furniture (after replacing FF tokens), so there wouldn't be any FF tokens left for the game to try to tokenize, so my only worry is if it's possible for a tokenized string to get considered as a FF token by mistake

rancid temple
#

Looks like it has a manifest to me

#

Maybe try downloading it again and verifying you get all the files

lucid iron
hot tangle
#

damn, guess it's just a bug then

#

ah ok

lucid iron
#

This chat is for making your own mod

rancid temple
#

If you're using a mod manager, don't lmao

#

(it has two manifests, because it's two mods in one)

#

(this map looks like hell, it's so freakin' big)

lucid iron
#

Well if u use something entirely different then u can just dodge the issue prob LilyDerp

woeful lintel
#

After looking at the LocalizedText Strings in Data/Furniture, it looks like [[ModID]] (or its friends) would never show up by mistake, so I'll keep [[]]

lucid iron
#

£FFModId£

#

Consider the possibility DokkanStare

woeful lintel
#

what does a string using i18n looks like so I get an idea of that too?

lucid iron
#

{{i18n:key}}

#

This one is resolved really early

woeful lintel
#

lmao

lucid iron
#

You will never see it in content

rancid temple
#

It's tokens all the way down

#

Technically, you'll never see any of CP's tokens in data because they're resolved before they hit the pipeline

lucid iron
#

Yeah that too kyuuchan_run

woeful lintel
#

so if a modder wants to edit a string of FF data containing a i18n token with a CP pack, the CP mod would have to handle the translation of this token, right?

lucid iron
#

Yeah

teal bridge
#

I'm partial to the box-drawing characters, myself: ►►ModId◄◄

lucid iron
#

It's a bit of a pain point that u can't patch other people's i18n

woeful lintel
#

hmmm

lucid iron
#

(where as u could patch LocalizedText since that read from an asset)

rancid temple
#

What about with Button's mod?

lucid iron
#

Did button let u edit things

#

I thought it's just read but shrug maybe

rancid temple
#

I can't remember lol

woeful lintel
#

but FF still has to parse i18n tokens to support it right?

lucid iron
#

Naw

rancid temple
#

Ah yes, the search results of Button are Button's Books, BETAS and the 37 translation mods for the books mod

lucid iron
#

Well your FF content packs would because that's all you

rancid temple
#

Just what I was hoping for Nexus

lucid iron
#

CP would have resolved the i18n to the actual string

woeful lintel
#

considering using éModIDè to give an advantage to french modders

lucid iron
#

Incidentally a way to expose ur tokens to cp would be registering it

#

If you do this then u could do like {{ff:modid}} in cp and let cp do the token stuff

woeful lintel
rancid temple
#

(CMCT does seem to only allow reading)

lucid iron
#

Yeah see first message Bolb

#

Why did I edit instead of posting new msg blobcatgooglyblep

woeful lintel
#

ok, I think I got every info to put i18n on the TODO list, and decide whatever I'm going to put around FF tokens later

rancid musk
#

Alright. My fork and therefore my PR are now up to date for 1.6.13. \o/

woeful lintel
#

{[(ModID)]} just to be sure

rancid musk
#

(I think anyone with access to the decomp should automatically have access to my fork, also? So there's that.)

rancid temple
#

Embrace chaos make it “ModId” U+201C U+201D

lucid iron
#

Banned

sweet sphinx
#

I wish I knew how to do those codes T^T

lucid iron
#

Never too late to learn

rancid temple
#

Open wordpad, type in 201C and then push Alt + X

sweet sphinx
#

I've learned like 3 times now

rancid temple
#

I don't know where else it works, but not Discord lmao, had to copy paste those bad boys

woeful lintel
#

I like linux, I just have to do ctrl+shift+u, then type the code and it just works

#

“ModID” like this

rain basalt
#

when location data works SDVpufferwow

tender bloom
#

make sure it's not your first catch!

#

otherwise deceptive sunfish can sneak in

rain basalt
#

O.O

lucid iron
#

You can use a fish mod to check for this stuff

#

Like a fishing sea (with fish predictions) or just visible fish

rain basalt
#

should be good

next plaza
#

Some asked me to backport SpaceCore 1.26 to 1.6.8? SDVPufferThink

#

(Not gonna do it, but just odd because backport requests are pretty rare for me)

teal bridge
#

I got a similar funny request for RadialMenu, except that there's literally nothing to backport since the code didn't change.

next plaza
teal bridge
#

(users)

rancid temple
#

So basically they have no idea what they're asking for lmao

teal bridge
#

Well it was a "something broke" type of request except they were still on 1.6.8 and saying the new version didn't work. (when there was no need to update in the first place)

#

Like, they wanted to keep using game version 1.6.8, but decided to update to all the 1.6.9+ compatible mods anyway.

rancid temple
#

Would SMAPI even tell them there were updates?

lucid iron
#

what does spacecore backport to 1.6.8 mean LilyDerp

#

they can just use the 1.6.8 version??

next plaza
#

1.26 is new to 1.6.9

latent mauve
#

So nobody makes the same mistake I did, when I worked on adjusting that NPC mod the other day, I used the 2.4.0 CP format since I'm on 1.6.9+, but 1.6.8 won't recognize that because you need CP 2.3.0 on 1.6.8

rancid temple
#

I mean, there is for sure new stuff in 1.26 but like, I don't know what they could possibly think they need from it in 1.6.8

next plaza
#

I think S&S is the only mod requiring features from the new version

#

(And was why this person asked)

teal bridge
# rancid temple Would SMAPI even tell them there were updates?

Might depend on SMAPI version? I did update the required version in the manifest, so if they were still on old SMAPI then I'd think it wouldn't show a notification for a mod require a newer SMAPI version. But, given the nature of the request, for all I know they also updated SMAPI without updating SDV.

rancid temple
#

So they also want S&S for 1.6.8

next plaza
#

Though S&S won't work on 1.6.8 either due to the light changes and stuff, so...

#

Yeah, I mentioned that I don't tend to backport my mods, and that S&S requires 1.6.9 too so it wouldn't help in this case anyways

rancid temple
#

Hm, I didn't consider if you left the old version of SMAPI in the minimum required

next plaza
#

I'm bad about that

#

If only ModBuildConfig did that automatically

rancid temple
#

I updated a couple of mods that also worked on 1.6.8 still and left the old Api version because of it, but I wonder if that's gonna cause issues now lol

teal bridge
#

I have no idea if SMAPI's update check actually works that way, just wanted to make sure they didn't try to install newer mod version on old SMAPI version.

#

But for all I know it still reports an available update.

next plaza
#

So re: SMAPI updates, it's purely mod version number based. So you could have two SDV versions of the same mod, but they'd need the same mod version to not cause update checks for anyone

#

If you're on SDV 1.4 using an old spacecore, you'll still get update notifications for the 1.6.9 ones

rancid temple
#

Oof

next plaza
#

(As far as I understand, I guess I've never tested it)

teal bridge
#

Makes sense, since SMAPI would have to actually download the update and look in its manifest to know that it's not compatible with the current SMAPI version.

rancid temple
#

I wonder if setting minimum game version changes that

next plaza
#

I don't think so

#

But I could be wrogn

teal bridge
#

Probably all it looks at is the file version in the Nexus API.

rancid temple
#

Yeah, that would make the most sense

calm nebula
#

trollishly sets min game version to 2.0

teal bridge
#

In fact, I think one mod author screwed up the Nexus versioning and caused SMAPI to report an incorrect update.

#

(one that I know of, I mean; probably hundreds have done that)

next plaza
#

Incidentally, the S&S feature that uses SpaceCore 1.26.x isn't a "critical" one... but it's one that helps users a lot and will reduce questions by a large amount. (The guidebook stuff)

#

And maybe even help with the Mateo misgendering

#

(Since pronouns are listed on the about page for each NPC)

rancid temple
#

Backporting is also just annoying SDVkrobusgiggle

lucid iron
next plaza
#

It wouldn't be too bad for -> 1.6.8, but still mildly obnoxious

lucid iron
#

But it also includes a long hash

next plaza
#

It's nothing compared to 1.6 -> 1.5

teal bridge
#

You say that now, but wait until we're on the SMAPI 4.1.26 patch.

#

(Kidding, Pathos! But whoever voted for 4.1.5 in the other day's deadpool is officially out of the running.)

next plaza
#

It looks like I could even use just Update

#

I didn't know that was a field

lucid iron
#

i think its relatively new (docs says added in 2.0)

next plaza
#

adds that and minimumgameversion to common.targets

#

Oh no I'm on 2.1, minimumgameversion isn't until 2.3

#

Guess I need to change that too and hope nothing breaks

lucid iron
#

it always gives me this long version though "MinimumApiVersion": "4.1.6+09dd92a74f13a3edeccb72242015876d7b5f6463",

rancid temple
#

We just have to get all the different mod sites to add a new thing to their Api that broadcasts what version of the game the mod is for

lucid iron
#

instead of stopping at 4.1.6

lucid iron
#

with update it stops at 4.1 which is ok for 1.6.8 and 1.6.9 at least

rain basalt
#

i usualy state on each update what verson its tested on

rancid temple
#

Ah, but if people could read this problem wouldn't exist

next plaza
#

Yeah, in all my file descriptions I mark what version the release works for

#

(Important because I don't maintain proper changelogs since I'm lazy)

rancid temple
#

Or more like if people didn't have selective reading

teal bridge
#

Yeah, putting info in the mod description vs. putting it in the manifest are really for two very different audiences.

lucid iron
#

hm how would i make a custom asset that cannot be invalidated think

rancid temple
#

Make it a content pack I guess

next plaza
#

Like, couldn't you just load it with mod helper?

lucid iron
#

i can load and cache it ofc, but idk when it'd be fully populated for the first time

next plaza
#

Ah

#

Yeah, that is a dilemma with that sort of thing

lucid iron
#

if i do it in gamelaunched it's empty bc of content patcher order of ops

teal bridge
#

You could probably do what SMAPI/game itself does and just force reload it if it gets invalidated.

rancid temple
#

Yeah, I think that's part of what you're supposed to do

next plaza
#

You could cache it a few ticks after the save is loaded (to give CP and other mods a chnace to edit based on save tokens)

lucid iron
#

well the purpose is actually to avoid doing harmony patch more than once blobcatgooglyblep

teal bridge
#

Well, I think I just heard enough not to want to know more.

lucid iron
#

so that is why i am hoping to obtain complete set o data at <unknown ideal point in gameloop>

teal bridge
#

"Harmony patch" and "asset invalidation" don't belong in the same sentence.

next plaza
#

Hmm, my manifest builder isn't updating to 2.3.1

rancid temple
#

I mean, wouldn't inserting your own method that checks your data with a transpiler kind of solve that?

lucid iron
#

yea im sorry for committing sins

next plaza
#

Am I missing something <PackageReference Include="Leclair.Stardew.ModManifestBuilder" Version="2.3.1" />

lucid iron
teal bridge
#

It's not mine to forgive - that's between you and your loving bug report page.

lucid iron
#

maybe it's nuget cache?

#

the whole nuget thing is mystery to me

next plaza
#

Relevant meme (though change "twice" to "thrice" if chu is doing something new, since Button's mod and Theme Manager are what I'm thinking of with twice)

teal bridge
#

Re: the manifest builder version, there was something about that in here the other day.

next plaza
#

(I think that's button's mod)

teal bridge
#

Clearing the package cache should probably fix it.

rancid temple
#

Did you try closing and re-opening? My VS has been being really stupid about updating my nuget's lately

calm nebula
#

Do your own content packs but PR smapi to accept optional content packs

rancid temple
#

I'm glad, though wish it weren't necessary lol

lucid iron
next plaza
#

And yeah I'm getting the weird minimumapiversion too

lucid iron
#

1 is pretty straightforward ofc

#

i am investigating whether 2 is feasible

teal bridge
#

Please, for everyone's sanity, do not write code that changes its behavior based on the caller in the stack trace.

rancid temple
next plaza
#

@rancid musk Any idea why Manifest Builder would be doing this with <MinimumApiVersion_Behavior>Update</MinimumApiVersion_Behavior>? (Specifically the hash)

next plaza
teal bridge
#

And how much did you regret it?

next plaza
#

I can't recall if there was a good reason or if I just didn't want to write a transpiler

deep cypress
#

Yes, that area! 🙂 Sorry, I fell asleep!

lucid iron
#

anyways maybe i just table this half baked idea and make ModThatChangesTheShippingBinSoundsToSomethingElse for tea

next plaza
#

Yes, it's in SpaceCore. It's horrific

#

I made sure it was a method that wasn't called too often though

#

Not that it excuses it

teal bridge
# lucid iron

So I'm not exactly sure why option 2 requires adding transpiler patches in response to assets. Couldn't you add one transpiler patch globally, and have that patch check the current state of the assets?

lucid iron
#

the desired ability is to change what sound cue is called in specific context

teal bridge
#

I get that, but just separate the state from the patch.

rancid musk
#

I want to do an update soon to add support for content pack bundling version updates, so I'll see about changing the behavior then.

lucid iron
rancid musk
#

But it needs to include the prerelease if you're building against a prerelease, otherwise when you go to test it your stuff won't load because 4.1.0-beta is older than 4.1.0

lucid iron
#

simple usecase is changing StardewValley.Buildings.ShippingBin.openShippingBinLid's "doorCreak" to something else

next plaza
teal bridge
#

What does "where" mean? If "where" means "what method" then it just seems like a suboptimal and fragile way to solve the problem.

rancid musk
#

Yeah, +hash is build and it probably shouldn't ever include that. So my next update will remove it.

next plaza
#

Thanks! (That was the specifically the part I was asking about, I totally understand and agree with the prerelease thing)

teal bridge
#

You could do something similar to what AFS does for random checks, and scan all methods (or a large list of methods) for every reference to playSound, just transpile them all to do your check.

lucid iron
#

it does mean what method yea, and unfortunately there's not really any further info about the desired sound cue

rancid musk
#

Maybe I will finally figure out how to get nuget to not try to use the wrong dll version with the next update too.

#

I might ask gpt in case it can pull weird msbuild internal knowledge out of somewhere

teal bridge
#

Or transpile them individually, don't try to do the thing where content patches trigger harmony patches because it's kind of gross.

next plaza
#

@ivory plume In a manifest.json, will build info in the semantic version (ie. "MinimumApiVersion": "4.1.0-beta.5+38a2d2d90049a9ad00e11d5e7ef638380ecb380c") cause problems if the user was on the same version but it didn't match or something?

#

I wouldn't think so based on when we've discussed the build info before, but wanted to double check

teal bridge
#

Presumably you know which methods you want to change the sounds of, so just add in transpilers to those methods.

next plaza
#

I'm guessing chu wants to account for mods too

lucid iron
#

i dont know, not without another mod telling me they want to change this sound

teal bridge
#

So you're worried about adding a transpiler even if no mod has opted into changing that sound? Why?

#

The transpiler doesn't have to cost anything significant if no mod has made a change for that site.

rancid temple
#

Yeah, currently replacing sound cues is a very targeted thing, like if I know what cue I want a replacement for I can do it specifically for that, but creating a system that lets you do any on the fly is... I dunno seems impossible to me lol

#

Without rewriting a lot of the game anyways

brittle pasture
#

I think ppl will forgive you if you just roll that instead of using CP assets tbh

teal bridge
#

I wouldn't say impossible, but content patchers are either going to (a) pick from a list of known sound triggers that can be changed, or (b) point to an actual method in actual code somewhere, and personally I consider (b) to be madness, you cannot trust content pack authors to understand anything about the game code.

#

So assuming you're going with (a), just transpile all those known triggers, period, and the transpilers are no-ops if nothing has opted into that trigger.

next plaza
#

Or C - ask somebody (you most likely) every time they want to patch a specific sound instance and then also every time the game updates and breaks it for them

lucid iron
#

theres 1131 hits for game1.playsound in the decompile LilyDerp

next plaza
#

Just transpile every method in memory

#

(Or use an infix if we were on newer versions of harmony...)

rancid temple
#

Just bundle your own version of Harmony and break everyone else's Harmony mods

lucid iron
#

im begining to think inspecting stacktrace is less sinful AnnelieStare

next plaza
#

(Oh look, work stuff finally finished building)

teal bridge
#

There are a lot of sound triggers, yes. But turning that into something comprehensible is the point of a framework mod.

#

Otherwise you're just asking content patchers to do the work, and they may as well write their own transpilers in that case.

lucid iron
#

at least it'll be simple to abort

next plaza
#

(I started when I started chatting here... yes it took 30min)

rancid temple
#

What's it building on, a toaster?

next plaza
#

A pretty good work machine

#

Big project + content

teal bridge
#

Inspecting the stacktrace is a bad idea. It'll make testing/debugging a nightmare, for one. Also, it's slow - you're adding a ton of overhead to every single sound cue.

velvet narwhal
#

That's a lot of content SDVpuffersweats

teal bridge
#

It's your mod, of course, and there's all kinds of madness out there that's probably far worse, but I wouldn't write stacktrace dependent code no matter how low the stakes were.

lucid iron
#

this is why i gotta sanity check with ppl here wew

next plaza
#

hides the spacecore link I posted earlier

lucid iron
#

back to ModThatChangesTheShippingBinSoundsToSomethingElse

next plaza
#

Gotta love explaining patch names in their class name

deep cypress
#

Question I should have asked a while ago: Does the Ldarg start its count at 1 or 0?

next plaza
#

0 - for non static methods it will always be this

#

(this being the object the method was called on)

lucid iron
deep cypress
#

then 1 is the like Farmer who, Vector2 tile, etc, right?

next plaza
#

Yeah

rancid temple
next plaza
#

For static methods though things will start at 0 though

brittle pasture
#

instance methods basically have their "real" 0th parameter be this

lucid iron
#

i think Ldarg_0 is farmerrenderer in that method

#

public void drawHairAndAccesories so not static

brittle pasture
#

static methods just have 0th param actually be the 0th one in code

deep cypress
#

Thanks! 🙂 I was just making sure I wasn't totally reading everything wrong!

teal bridge
# lucid iron back to ModThatChangesTheShippingBinSoundsToSomethingElse

Why not have an internal JSON dictionary (your own mod data) with a list of the types/method names to patch, and their "friendly" trigger name? That way the code isn't doing anything obnoxious at runtime, but it still only takes a few seconds for you to incorporate a new trigger. It makes your life (pretty) easy as a maintainer without pushing the responsibility of reading the source code and getting everything right onto random content pack authors.

uncut viper
# lucid iron

i onlyh just woke up and barely followed what i was backreading but iwant you to know i will absolve you of any sins for any crimes you commit. i think you should do the weirdest and most sinful option personally

calm nebula
#

Do not rely on stack traces for release code

lucid iron
#

thank u for the vip ticket to hell button

teal bridge
#

(are you gonna take advice from someone who wakes up at 3 pm? /cheapshot)

calm nebula
#

It's not reliable in release mode

uncut viper
#

i have night shift responsibilities

calm nebula
#

Also would you take advice from someone who has a can of soda next to a roll of lead?

velvet narwhal
#

probably, i don't trust people who put canned meat inside working fridges though

lucid iron
teal bridge
#

I don't get the roll of lead reference.

lucid iron
#

so that ppl dont explod thing by editing a json

calm nebula
#

It's not a reference

#

It's reality

teal bridge
#

But yeah, not much different from a big pile o' constants.

teal bridge
velvet narwhal
#

that's atra's workspace, right now

tender bloom
#

and is the soda open or not

light jasper
#

do mods have to target net6.0? Like is it acceptable to use a higher version?

tender bloom
#

no

teal bridge
#

No, it's not.

tender bloom
#

only 6.0

#

where's that dog meme

teal bridge
#

Until MonoGame updates, you're stuck on 6.0.

rancid temple
#

You can use a higher language version, but not target a higher net version

light jasper
#

damn I wanted some of that new stuff 😦

lucid iron
#

you can use higher C# lang versions if you want

rancid temple
#

I don't even know how to find out what's different between versions lol, it all seems kind of cryptic to me

teal bridge
#

I too would like frozen dictionaries and abstract statics, but they are too fancy for Stardew.

lucid iron
#

but no go on higher than net 6 target

velvet narwhal
#

so we have button's last will and testament, and the sin absolver

hard fern
#

mmm i eat json for lunch

uncut viper
#

personally im a fan caseys idea of auto transpiling every method that calls playsound. just call your function instead with an extra param that includes the source, ez

rancid temple
#

Button needs someone to absolve her of the crimes Avi has committed with the CP Harmony stuff

uncut viper
#

i dont need absolving if i never felt guilt

velvet narwhal
#

i never committed any cp harmony crimes

#

my harmony crimes are my own aSDVpufferrise

#

(1) crime, one skip prefix, that i set to last priority SMCKekLmaoDog

iron ridge
#

i'm sure this will be fine

rancid temple
#

Why so smol Discord

next plaza
iron ridge
#

ooo it works!!

old edge
#

How do we use debug commands to alter the 2nd screen for testing. Isn't it debug screen_1?

hallow prism
#

hey everyone, someone reported that : " I keep getting "Chatacter_Toddler_Male_Light_Winter has no Alternative Textures for this season" for some reason. Anyone know what that's about? "
On my AT mod for toddlers, but they aren't supposed to have winter sprites (or portraits). I wondered if it was a known issue (like, the game auto making winter variations or something), but i asked for a full log in case it's some mod interaction

deep cypress
#

So, my transpiler did something out of the index (this is following the example I was given and the documents I was reading of how to write the transpiler)

  try
  {
      CodeMatcher matcher = new(instructions, generator);

      matcher = matcher.Start()
      .MatchStartForward(new CodeMatch[]{
      new(
          OpCodes.Call,
          AccessTools.Method(
              typeof(FarmerRenderer), nameof(FarmerRenderer.drawHairAndAccesories),
              new Type[]{
                  typeof(SpriteBatch), typeof(int), typeof(Farmer),
                  typeof(Vector2), typeof(Vector2), typeof(float), typeof(int),
                  typeof(float), typeof(Color), typeof(float)
              }
          )
      ),
      new(OpCodes.Ldarg_S, "position"),
       new(OpCodes.Ldarg_S, "origin")
      })
       .SetInstruction(new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(ModEntry), nameof(ChangeActualOrigin))));
      

      return matcher.Instructions();
  }
  catch (Exception err)
  {
      SMonitor.Log($"Error in ShirtDrawTranspiler:\n{err}", LogLevel.Error);
      return instructions;
  }```
lucid iron
#

Out of index usually means you failed to match the desired place to insert your code

deep cypress
#

I see!

lucid iron
#

I think it might be Ldarg_S not taking a string think

brittle pasture
#

also why are your param load after the func call

lucid iron
#

Give it the actual number (as an sbyte)

brittle pasture
#

unless those are params for another fn call afterwards

deep cypress
#

like ldarg_s, (sbyte)4?

deep cypress
lucid iron
#

You need to give the CodeMatch I same order they appear in IL

velvet narwhal
lucid iron
#

As it is written now you are matching for

  1. Call of FarmerRenderer.drawHairAndAccessories, the overload with that particular set of arguments
  2. Ldarg_S position
  3. Ldarg_S origin
deep cypress
#

Ok! Good, that's what I was trying to do.

lucid iron
#

I don't think those args r even correct tbh, does drawHairAndAccessories have overloads?

#

If it doesn't u can omit the list of types

#

After match u r replace the method call with ur own, presumably a method that has all the same args plus FarmerRenderer at 0, since both original and new are Call, something u can do is to set just the Operand to your method

#

the thing i am confuse about is that

#

i thought u r transpile drawHairAndAccessories

#

not transpile a method that calls drawHairAndAccessories

old edge
#

Oh it's screen=1 not screen_1...SDVpufferangery

deep cypress
#

I am trying to transpile this one:

public void drawHairAndAccesories(SpriteBatch b, int facingDirection, Farmer who, Vector2 position, Vector2 origin, float scale, int currentFrame, float rotation, Color overrideColor, float layerDepth)
    ```
#

This is the whole patch:

        [HarmonyPatch(typeof(FarmerRenderer), nameof(FarmerRenderer.drawHairAndAccesories))]
        public class FarmerRenderer_drawHairAndAccesories_Patch
        {
            public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
            {
                SMonitor.Log($"Transpiling FarmerRenderer.drawHairAndAccesories");

                try
                {
                    CodeMatcher matcher = new(instructions, generator);

                    matcher = matcher.Start()
                    .MatchStartForward(new CodeMatch[]{
                    new(
                        OpCodes.Call,
                        AccessTools.Method(
                            typeof(FarmerRenderer), nameof(FarmerRenderer.drawHairAndAccesories)  //,
                           // new Type[]{
                           //     typeof(SpriteBatch), typeof(int), typeof(Farmer),
                             //   typeof(Vector2), typeof(Vector2), typeof(float), typeof(int),
                              //  typeof(float), typeof(Color), typeof(float)
                           // }
                        )
                    ),
                    new(OpCodes.Ldarg_S, (sbyte)4),
                     new(OpCodes.Ldarg_S, (sbyte)5)
                    })
                     .SetInstruction(new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(ModEntry), nameof(ChangeActualOrigin))));
                    

                    return matcher.Instructions();
                }
                catch (Exception err)
                {
                    SMonitor.Log($"Error in ShirtDrawTranspiler:\n{err}", LogLevel.Error);
                    return instructions;
                }
}```
brittle pasture
#

what does the IL code you're trying to patch look like in ILSpy

brave fable
#

transpiling farmerrenderer 🔥SDVdemetriums

#

you must be desperate

deep cypress
#
IL_04f5: ldarg.s position
        IL_04f7: ldarg.s origin
        IL_04f9: call valuetype [MonoGame.Framework]Microsoft.Xna.Framework.Vector2 [MonoGame.Framework]Microsoft.Xna.Framework.Vector2::op_Addition(valuetype [MonoGame.Framework]Microsoft.Xna.Framework.Vector2, valuetype [MonoGame.Framework]Microsoft.Xna.Framework.Vector2)
        IL_04fe: ldarg.0```
#

I am trying to put a different vector2 in at origin (which is what the old code was doing)

lucid iron
ivory ridge
#

What's the difference between floors.png and Flooring.png? The latter seems to just be a more complete version of the former, but is the former used at all?

deep cypress
#

What would be a better way to do this?

lucid iron
#

i think you can insert instruction here

#

another Vector2::op_Addition basically

#

rn the C# is
position + origin + positionOffset + rotationAdjustment + new Vector2(16f * scale + (float)(num3 * 4), 56f * scale + (float)(num4 * 4) + (float)heightOffset.Value * scale)
the goal would be
position + origin + ModSpecialAdjustment() + positionOffset + rotationAdjustment + new Vector2(16f * scale + (float)(num3 * 4), 56f * scale + (float)(num4 * 4) + (float)heightOffset.Value * scale)

#

addition takes 2 vector2 on stack and push 1 back, so u need to find place to insert your adjustment vector2 followed by Vector2::op_Addition

#

i dont have examples of this for u but it should be doable DokkanStare

deep cypress
#

I will give it a go!

lucid iron
#

but up to you how u wanna do things

brave fable
ivory ridge
#

Yeah, I get the feeling it's an older version that just became deprecated and CA forgot to remove

brave fable
#

we've got TileSheets/Floors, TerrainFeatures/Flooring, and Maps/floors_2

deep cypress
#

I am willing to try all the directions!

brave fable
#

Flooring seems to be for placed craftable floors, and floors_2 for indoors floor-painting

#

Floors apparently no references in game code or data files

lucid iron
#

perfect blue-berry DokkanStare

brave fable
#

should we poke pathos about removing Floors for 1.6.13 lol

velvet narwhal
#

i thought 1.6.13 was already out

lucid iron
#

it'd have to be 1.6.14

brave fable
#

wow time flies. 1.6.15 then

velvet narwhal
#

i'm gonna win the bet, we're gonna land on 1.6.15

brave fable
#

(watched paprika last night but red isn't very chic 😌 )

ivory ridge
#

My mod keeps expanding in scope and I'm getting increasingly intimidated lmao

brittle pasture
#

1.6.17 - recipes now use a proper data model format, every existing clickCraftingRecipe mods simultaneously explodes

whole raptor
velvet narwhal
#

stick us back in beta, this baby needs to cook some more

blissful panther
#

I mean it certainly doesn't seem to be touched anywhere.

Nor does the vast majority of things in TileSheets, actually?

velvet narwhal
#

i was testing to see how many chaotic mods i can get away with and still load in mobile, but because the vers are so out of wack, i have given up for now

brave fable
#

your search includes /, most string references would include \\

lucid iron
#

bobbers and animation are definitely used

#

plus all the furniture

velvet narwhal
uncut viper
#

also some things likely have their tilesheet name to load constructed on the fly

velvet narwhal
#

202 references SMCKekLmaoDog

#

a lot of this is TAS crimes

brave fable
#

647 matches across all data files incl. localised for "tilesheets" 🥳

#

very used

ivory ridge
#

OH FUCK

#

I still have all my changes to furniture.png saved

#

I thought I was gonna have to redo all of it lmao

brave fable
#

remember to backup your work, save progress with source control, and work in a folder that isn't going to be removed or replaced 🥳

calm nebula
#

Lol.

teal bridge
#

My source control is my backup.

calm nebula
#

My photographic memory is my backup

teal bridge
#

Make sure to keep reminding us about that, it's hard for those of us without photographic memories to remember.

brave fable
#

focus doesn't backup his backup SDVpufferpensive

brittle pasture
#

the multiverse is my backup, if I lose my files I simply travel to another world that still has my files and kill the me that lives there

brave fable
#

couldn't you just ask him for like. a usb stick

brittle pasture
#

.... good point. Sorry Selph no 63528

blissful saddle
#

where would be the fun then?

lucid iron
#

hm are there version control for image

#

or do u just make the photoshop undo history your backup

brave fable
#

just git commit your psd? lol

teal bridge
#

Yes, it's called file1.png, file2.png, file3.png...

lucid iron
#

untitled tile sheet

teal bridge
#

Of course, you can check it into VC too (I do), you just won't get diffs.

#

I'm not kidding about the sequential version control, either; that's what you actually see with any kind of audiovisual media.

brave fable
#

friendly source control software like Fork will give you a preview comparison of flat images at least, i doubt any will preview a psd though

lucid iron
#

yea ig theres not really anything u can do about diff of binary

velvet narwhal
#

could be like my clip studio paint, force me to make a file called (backup) because my desktop didn't register the update

teal bridge
#

There are screendiffing tools, so in theory the technology exists, but I'm not sure I've ever seen it used for that purpose.

#

Clearly Adobe just needs to switch their format to XML.

brave fable
#

can you smell that? it's the smell of .psdx

brittle pasture
#

yeah screen diffs are a thing

brave fable
#

smells like defeat

lucid iron
#

they'll revive swf just for u

teal bridge
#

With .pngx and .jpgx hot on the heels.

brittle pasture
#

the world yearns for SVG

#

every bitmap image can be represented with a sufficiently large svg

brave fable
#

please mercy, i don't want to use illustrator for sprites

teal bridge
#

I haven't actually looked up reverse rasterization to see if it's a thing, but I'll bet it's a thing.

uncut viper
#

just write your svgs by hand

brave fable
#

that's worse than making tmx files by hand

uncut viper
#

which wouldnt even be that bad all things considered

brittle pasture
teal bridge
#

CorelDRAW being the first on the software list, now there's a blast from the past.

hard fern
#

Omg its so smooth

velvet narwhal
#

oh right

calm nebula
tender bloom
brave fable
#

.. you want to onion-skin binary?

#

the lead's taking effect

velvet narwhal
#

(slides in for a second, uh, am i missing more syntax on patch summary <unique id> cause i'm not getting the load of text for loaded/applied anymore, and they're for sure applied SDVpufferthink )

ocean sailBOT
#

Log Info: SMAPI 4.1.6 with SDV 1.6.13 build 24313 on Microsoft Windows 10 Home, with 8 C# mods and 2 content packs.

uncut viper
#

is your id not .ME instead of .MM

velvet narwhal
#

(i may be stupid)

#

halloween event got me screwed up doing debugging for mothman ig

calm nebula
calm nebula
tender bloom
#

HmmmMmmmmmMmmm

next plaza
#

Re: image diffs earlier, github and gitlab both will show diffs for like pngs and stuff

#

Maybe that was already mentioned

pine elbow
#

Does anyone know how I can create a class variable in C# using libharmony? Would this be possible? I need to create a NetMutex variable in the StardewValley.Objects.Furniture class. My goal is to make the furniture locked in the cabins so that other players cannot remove the player's items. Would it be possible for me to implement the same feature as BedFurniture?

#

in BedFurniture
[XmlIgnore]
public NetMutex mutex = new NetMutex();

lucid iron
#

you don't need harmony to extend a class, can just do it

brave fable
#

(they're not extending, they're adding a member to an existing class)

lucid iron
#

but in your case u can just use ConditionalWeakTable i think

brave fable
#

(which seems like cecil devilry)

lucid iron
#

ConditionalWeakTable<Furniture, NetMutex> furnitureMutexes

brave fable
#

i feel like there's easier ways of preventing other players from interacting with furniture in a cabin. a netmutex is likely not it

pine elbow
#

The idea is to implement the mutex in Furniture to block the items, just like you do with the bed.

lucid iron
#

if not mutex then u could store the owner player id in mod data

#

and patch the method that let you move furniture, return if player id mismatch

brave fable
#

i don't think you even need the moddata property, just check the cabin owner id from the location

#

it won't block players who don't have the mod, though, ofc

lucid iron
#

but if u keep it u can block ppl from moving other placed objects everywhere Bolb

uncut viper
#

you could but thats beyond their goal

next plaza
#

Yeah, you can't add member variables to a class with harmony. (Just Cecil, which Pathos refuses to supoprt SDVpuffersob ) You can use ConditionalWeakTable like mentioned before to mimic it, but that serialize it if you need to. SpaceCore has an API for registering new variables to attach during serialization though

#

(You could also just patch the xml serializer at runtime like SpaceCore does)

#

(But that's kinda scary)

pine elbow
#

I prefer to do something that only the host needs, as the idea is to protect items on vanilla servers.

next plaza
#

I don't think you can do that

#

And adding a new net field would prevent players without the mod from loading it anyways

brave fable
#

again, nailing a netmutex to an existing class sounds like overkill for blocking players from moving items in cabins not owned by them

#

to say nothing of patching the xml serialiser

uncut viper
#

stardew is a very client trusting game

next plaza
#

I don't think it's possible to prevent clients from removing the furniture without having the mod too

#

You could theoretically just re-add it when that happens, but then the client still has a new copy of the item

#

Actually...

pine elbow
#

Would it be possible to create a lock for the cabin?

next plaza
#

Hmm. Probably not. In theory you could redirect the farmer to somewhere else if they try to enter someone else's cabin with some invasive multiplayer patches, but that would probably confuse the other client a lot

pine elbow
#

I once tried to lock the inventory, but it gave me a lot of problems.

#

Block while in someone else's cabin

next plaza
#

Hmm, can't use Furniture.AllowLocalRemoval since that's not synced or saved

#

CanBeGrabbed is ignored (probably since it's an object field)

pine elbow
#

Yes, I have tried this CanBeGrabbed field several times but nothing happens and I can still grab the items.

next plaza
#

There is an incredibly hacky way to make it where nobody could move the furniture at all even without your mod (by putting a dummy entry in Furniture.sittingFarmers), but I can't think of a way to do it for everyone except the player owning the location - without the player having the mod too at least

rain basalt
#

<..< my eyes are swimming with code i have so many edits i have to do and test SDVpufferchickcry worse part is all tests seem to work smapi not even giving me yellow warning its going to well im concerned that its not gona work when i get done

#

question if i use action: include does it support when statements?

next plaza
#

Yeah

rain basalt
#

mmm from the included json not within the argument

pine elbow
#

What is this Furniture.sittingFarmers for?

#

A question about the mutex, this issue of it being initiated using [XmlIgnore]
Is this something to do with multiplayer?
Or something else?

lucid iron
#

that prevents it from being part of save serializer

rancid temple
#

XmlIgnore has to do with the save serializer, which I don't know enough about to know why you would intentionally remove stuff from it

#

Although I suppose for this I kinda get it, you wouldn't want to save with a player sitting in it and then load with one not in it but have it stuck locked

pine elbow
#

If I just created the variable normally in my class, public NetMutex mutex = new NetMutex();

And used the variable to lock the furniture, applying it to all the modifications I need to make
In the initNetFields() method
.AddField(mutex.NetFields, "mutex.NetFields");

In the DayUpdate() method
mutex.ReleaseLock();

And several other methods, like AttemptRemoval, updateWhenCurrentLocation

That have things to do with the mutex, would that make the furniture the same as the bed?

rancid temple
#

Some net types are automatically serialized aren't they?

lucid iron
#

it is kind of concerning that you are design mod that doesnt expect all players to install same version of LilyDerp

rancid temple
#

Which would piss off the serializer if you aren't registering it with SpaceCore

uncut viper
#

wouldnt the other client still need the mod in the first place to care about the new mutex anyway?

rancid temple
#

Yeah I really do wonder what would happen in this game that's seemingly not driven by host authority lol

pine elbow
#

My goal is to make an anticheat, which serves to protect players from everything, including mobile players, who unfortunately cannot use mods.

rancid temple
#

Maybe it would be fine on the side of the mod holder but break on the non-modded

lucid iron
#

could just aggressively crash game if they dont have it installed AnnelieStare

brave fable
#

i was worried that's your goal hahah

uncut viper
#

if the other player does not have the mod then i dont know where the netmutex would even sync to in the first place, im pretty sure it wont just create a new netmutex for them

lucid iron
uncut viper
#

in other words, the other client can just ignore it

lucid iron
#

this mod should serve ur purposes

rancid temple
#

I would say if you're gonna play with mobile players, don't play modded lmao

lucid iron
#

that too its just bad time all around LilyDerp

rancid temple
#

Wait the 12-34 months for Zane to decide if they're gonna actually make SMAPI mobile for 1.6.9/10/11/12/13

pine elbow
#

I managed to protect the chests using mutex, and the mode needs to be on the host only.

next plaza
#

That's a problem for any mod who adds netfields

pine elbow
#

Why wouldn't it be the same with furniture?

uncut viper
#

chests already have mutexes

#

you just cant add a completely new mutex and expect the client to somehow magically get and respect it

rancid temple
#

You can expect it, but it won't happen SDVkrobusgiggle

brave fable
#

certified SDVdemetriums message

pine elbow
#

Who knows, maybe one day Erick will implement mutex in furniture. ç.ç

lucid iron
#

!officialbug

ocean sailBOT
uncut viper
#

i dont see why he would

lucid iron
#

Worth a shot to the suggestion forums

rancid temple
#

Just make a really good case for adding new content and it might happen, despite everything a couple new things have trickled in lol

lucid iron
#

The thing casey is suggest earlier with sittingFarmer is basically, find a existing netfield that has furniture movement blocking feature, and repurpose it

#

That's prob the only viable way, even if it's big hacks

pine elbow
#

Did he not imagine that there would be certain thieving players entering our game just to troll us and remove our furniture?

uncut viper
#

no?

#

its a game you play with your friends

lucid iron
#

Sdv isn't built to be multiplayer pvp

rancid temple
#

The game didn't even have multiplayer in the first place lmao

lucid iron
#

It didn't even start with multiplayer lol

uncut viper
#

its inherently a "trust the client bc you trust your friends" setup

rancid temple
#

If your friends can't be trusted to not troll you, you've either given them the wrong impression about you or they're not your friends

calm nebula
#

(I have my doubts tbh)

#

NetMutex is fun

lucid iron
#

I think the separate money is the only pvp-ish feature in vanilla right

calm nebula
uncut viper
#

calling that pvp is a big stretch

calm nebula
#

This is such a bad idea

uncut viper
#

are you asking me this

#

asking me this is also a bad idea

lucid iron
#

Vague gestures at competition let's say DokkanStare

rancid temple
#

Separate money is PvP in the same way separate bank accounts in a relationship is PvP

uncut viper
#

yeah ive never personally used it for competitive purposes

#

mostly just "i wanna be able to buy what i want without accidentally ruining my partners financial plans too"

brave fable
#

competitive pvp is fighting for the last $20 in a shared money farm

rancid temple
#

If anything, it makes you get more money technically doesn't it?

lucid iron
#

Oh does it

rancid temple
#

Or does it evenly split?

lucid iron
#

I thought it tracked who tossed what into bin

rancid temple
#

I did multiplayer like one time and it's been a while lmao

calm nebula
#

Mismatched netfields is a terrible idea

uncut viper
#

i also thought it tracked, but ive never paid attention and only used it once

calm nebula
#

If you're lucky you just prevent clients from joining

uncut viper
#

in one playthru rather, that didnt last too long

rancid temple
#

Button was my last hope, who else even plays multiplayer lmao

calm nebula
#

If you're unlucky you randomly crash the game and get on my shit list

calm nebula
#

Tl;dr stardew not designed for assholes

lucid iron
#

Competitive parsnip growing and chicken petting

calm nebula
#

Find better friends

uncut viper
#

i thought avi played multiplayer but i might be making that up. sorry avi to be assigned multiplayuer player if not

rancid temple
#

Oh ok, so it "could" be "competitive"

calm nebula
#

I would play mp with you, Button

pine elbow
#

I really wanted a Stardew Valley MMO, each one on their own private farm, and just the community town, with item exchange and everything, it would be perfect.

uncut viper
#

anything can be competitive if you have enough of a competitive spirit

lucid iron
#

I do think it'd be qol to not accidentally ruin ur friend's interior design so I support you making this mod

uncut viper
#

yeah you would absolutely not get Stardew Valley MMO while expecting only the host to have some mods

lucid iron
#

It's just technical limits with how mod and multiplayer mix

calm nebula
#

If we had any amount of off work awake hours that overlapped

rancid temple
#

Just track every piece of furniture placed in every house/cabin and when one is broken, delete it from the players inventory and place it back down in the location

calm nebula
#

If you want a stardew mmo I suspect you start by "writing a new multiplayer backend"

uncut viper
#

i would like to say id play MP with anyone in here i personally know but also the actual likelihood of it would be "probably not but its 100% not personal"

lucid iron
#

I don't think people here play game period

uncut viper
#

unless you count "you're not my partner" as personal

#

which i guess you could

lucid iron
#

I also disliked the way sdv days interacted with scheduling a block of time for coop

#

It's not like minecraft where u can be like lemme login and see who is around

uncut viper
#

it would be a pretty big blocker for an mmo for sure too

pine elbow
#

For example, I signed up for a month at Bisect, to have a 24-hour server, then 2 days passed, and they stole everything there, chests, and furniture... people gave up playing on my farm.

uncut viper
#

stardew just straight up is not designed with that kind of server usage in mind

rancid temple
#

Time cycle in SDV is one of my least favorite features of any game like it

uncut viper
#

you will not be able to prevent those sorts of things while also supporting every other client being completely vanilla

proud wyvern
#

it's not designed with multiplayer in mind at all

uncut viper
#

there'd also not really be a way to prevent a client that isnt vanilla but modded to be able to ignore any of your safety checks from doing the same things

calm nebula
pine elbow
#

My anticheat requires the person to have the mod to enter, if that is the case, I have implemented that.

calm nebula
#

But also like

#

This is a "find better friends" tbh

uncut viper
#

if they are required to have a mod to enter, then you can implement your mutexes so long as you serialize them properly and whatnot

calm nebula
#

I could trivially make an empty mod with your unique ID lol

uncut viper
#

but that also still doesnt prevent them from having another mod alongside it that just overrides your anticheat mod

#

or yeah, faking having your mod in the first place

calm nebula
#

But also like

lucid iron
calm nebula
#

I would rather only play with people I trust, says former modder with no free time

uncut viper
#

"former"

calm nebula
#

Do you want to be when I get off work today

#

My current bet is 7pm

uncut viper
#

i thought that was a threat at first bc of that typo

lucid iron
#

6.13pm

#

What if u make like

#

Farmville for sdv where people can look at ur farm

pine elbow
#

I can build a client that automates the mod process, like Minecraft's tclient, but with security features, a websocket server that generates random IDs that will work for that player at that specific moment, so the software would obtain a secret password and connect to the websocket, which would return the IDs, and rewrite the mods' manifests, in addition to doing a checksum on the DLL, verifying that the DLL has not been modified, nor any config that is in the mod, then the game would open.

proud wyvern
#

what stops one from adding another mod that stops yours from working

rancid temple
#

Damn, why not just make your own farming game at that point

next plaza
#

Yeah, C# is way to easy too decompile to worry about that

uncut viper
#

also like, you can do whatever you want, sure. this kind of all goes way beyond just "can i add a mutex to stop an unmodded client from doing this" though

lucid iron
#

What is the target audience you have in mind here blobcatgooglyblep

next plaza
pine elbow
#

But the anticheat would block any unauthorized mod from entering

lucid iron
#

If I really want to play coop but had to do all that to join your farm

rancid temple
next plaza
#

What happens if they make it where your mod can't detect theirs

#

You can harmony patch other mods

lucid iron
next plaza
#

And even if you couldn't

#

They could decompile your mod, edit it, and recompile

proud wyvern
#

the only answer that works is proper server-side validation of things the clients do, but good luck with that hah

calm nebula
#

plays sudoku instead

next plaza
#

Yeah, too much of the game does stuff client side

calm nebula
#

Would my stupid code finish running in the next decade pleassssseeeeee

next plaza
#

Like, when you swing your pickaxe on a rock, the destruction and item spawning is handled client side

#

Unlike, say, Minecraft

pine elbow
#

In this case, it's no use, because the anticheat is made to work on the host, what it does is detect the mods that are on the clients, and compare them with the list of allowed mods and if it's different, it kicks the person, but if I put dynamic IDs in the anticheat, it would make it much more difficult.

next plaza
#

What prevents a custom smapi build which doesn't tell you all the mods installed

#

That would be very easy to do

uncut viper
#

"it's no use" is very apt here

hard fern
next plaza
#

Not saying it isn't worth making an anticheat, but someone determined could easily bypass

proud wyvern
#

custom SMAPI is probably more hassle than Harmony patching SMAPI not to report your mod

next plaza
#

True

calm nebula
#

Custom smapi is ez

next plaza
#

Yes

calm nebula
#

You just fork it and pathos is amazing and puts everything in nice to understand places

#

Unless it's in SCore

pine elbow
#

But I imagine that these "Furniture Thieves" are not mod developers, so just blocking the mutex would be enough to stop, at least most of them.

next plaza
#

But if you want to distribute it, it's easier for someone to make a mod than a custom SMAPI version

proud wyvern
#

idk about you, i already have a modding setup prepared, but don't have the SMAPI repo cloned

lucid iron
#

Say is there way to make a HarmonyMethod from a delegate that has to access some value I assign at runtime

calm nebula
#

I have the smapi repo cloned

lucid iron
#

I think i need to make that delegate static somehow Thqnkqng

proud wyvern
#

Harmony can only ever call static methods as patches

pine elbow
#

Using an obfuscator, wouldn't that leave the dll protected?

proud wyvern
#

has to do with its serialization stuff

rancid musk
#

Obfuscation is not security

lucid iron
#

I was trying to automate a bunch of similar transpilers

uncut viper
#

why not just dynamically create the method at runtime and send it to a patcher. you dont need to patch right on gamelaunched

rancid musk
#

There is no way to secure Stardew multiplayer. It's fundamentally insecure. Just don't play with people you don't trust.

next plaza
#

Obfuscation just changes methods names and stuff

lucid iron
#

I guess it's time to source gen?

next plaza
#

I've worked in obfuscated code before, it's not very insurmountable

lucid iron
#

To write these very similar transpiler static methods ahead of time

proud wyvern
#

yeah i've written a bunch of Minecraft mods back when deobfuscation wasn't a thing

rancid musk
#

I read obfuscated JavaScript for my day job. It doesn't stop me at all.

uncut viper
#

unless im misunderstanding it doesnt seem that different from what BETAS does

pine elbow
#

Isn't there some way to protect a dll?

lucid iron
#

Oh with attributes

#

DokkanStare that might work yes I'll try

uncut viper
#

i dont know what you mean by attributes in this context but good luck

calm nebula
#

Chue means decorators of course

lucid iron
#

Well I just need some way to put in 2 strings at compile time LilyDerp

uncut viper
#

i thought you said you assigned them at runtime

lucid iron
#

Yesterday I was doing CallerFilePath which I understand to be that

calm nebula
#

Nah, that is compile time

lucid iron
#

It's just some static consts

pine elbow
#

So C# is the worst language for anyone who wants to protect their code, because everything in it becomes a DLL.

uncut viper
#

(to be clear, i know what an attribute is obv, just didnt know what chu meant with regards to how they'd help what they want to do)

lucid iron
#

But like a list of strings u know

#

I don't want to write a different transpiler method per string here

calm nebula
#

You can also like, perhaps, make your transpiler call a static method

#

That takes a string as a parameter

lucid iron
#

Yeah that's the backup plan blobcatgooglyblep

uncut viper
#

what's like, the big picture goal here chu

mighty quest
#

can't you just invoke your patch method once for each string in a list?

lucid iron
#

Is the sound cue shenanigans button

rancid musk
uncut viper
#

but what're you trying to do with these transpilers

lucid iron
#

I am give up on custom asset bs for now so I have a constant list of (methodinfo, old cue, new cue)

#

I want to transpile the method at methodinfo and replace old cue with new cue

#

And in this case I just want to be able to reuse some code

#

Rather than make 1 static transpiler method per thing

mighty quest
#

i dont see why you couldnt do that in a for loop by storing the current list element in a static variable at each iteration

uncut viper
#

i think im confused on why you'd need attributes or anything then and can't just for each over your list and generate patches

lucid iron
#

Wouldn't the static variable just end up on the last thing though

calm nebula
#

You can also inject the methodbase and switch over that lol

lucid iron
#

By time HarmonyMethod is evaluated

#

Unless it is different for transpiler somehow think

#

Where they r immediately eval for some reason

#

Perhaps I am tunnel visioning here blobcatgooglyblep

uncut viper
#

to be clear when I say generate patches I mean by constructing the actual patch method itself from the ground up too, and putting your string in there

#

not just calling Harmony.Patch in a for loop and calling it a day

lucid iron
#

Yeah that is more or less what I desired to do

#

I don't know what words to use kyuuchan_run

uncut viper
#

which is easy*

#

*depends

lucid iron
#

Is it some emit IL thing button medlook

velvet narwhal
uncut viper
#

that's what I do for BETAS

#

BETAS just creates post fixes and prefixes but there's no reason you can't create transpilers

lucid iron
#

Ok I'll steal your homework DokkanStare

calm nebula
#

Huh that's cool

uncut viper
#

you do have to emit all your own il though unless there's a better way I don't know about

#

And create the method signature yourself

#

It should actually be a lot easier for transpilers though since you don't have to worry about getting the parameters correct

#

there was, of course, no documentation I could find on the Patch factory method I employed with Harmony so there very well may be a better way

lucid iron
#

So u could make functools.partial in C# this whole time yggy

uncut viper
#

i haven't the faintest what that means

lucid iron
#

It's the thing where u bind arguments to a function

teal bridge
#

Chu really likes goofy currying stuff.

lucid iron
#

And produce a new function that no longer requires the 2 arguments

uncut viper
#

i will take your word for it then

lucid iron
uncut viper
#

unless that's in response to the parameters thing in which case I just meant transpilers all typically have the same parameters that don't need to match the function you're patching

teal bridge
#

Covered by lambdas, I'd say, but sure.

lucid iron
#

The problem was need for static method in a patch

uncut viper
#

also I'm gonna put "Huh that's cool" on my resume

lucid iron
#

You have to sign it with atra's contact info

#

Quality reference in my books

velvet narwhal
#

"Volunteer Supervisor, signed off on my codework with a nod and a soda in hand contaminated by lead"

uncut viper
#

the way around the static method thing is that you still make a static method

uncut viper
#

it just returns a DynamicMethod

teal bridge
#

I see what he means though, a curry would be a lot more straightforward than ILGenerator business.

uncut viper
#

all the relevant stuff should be in my DynamicPatcher.cs I don't think I left anything in ModEntry

teal bridge
#

(Not to mention, a lot faster, but it probably only needs to run once)

uncut viper
#

feel free to copy as much or as little as you'd like

lucid iron
#

Yeah I see how it work ty bolbwawawa

uncut viper
#

Once unless someone else repatches a method, I think. Iunno

#

It's definitely probably not the most performant maybe but it's fiiiiiine

teal bridge
#

If it's only done on startup then meh. Atra has a fit over that stuff but I think no one else does.

uncut viper
#

atra said it was cool and is not allowed to take it back now

teal bridge
#

I think he meant "cool" as in "interesting" and not "copacetic".

uncut viper
#

I'll still take it

calm nebula
#

Cool code is cool.

#

Performance in stardew is ducked nine ways to Sunday already so I don't care lol

teal bridge
calm nebula
#

One day I'll break free for good

uncut viper
#

it probably does recreate all the il emit stuff every time my custom asset is invalidated and I unpatchall tho

calm nebula
#

Anyways

#

Switch 2, eh?

#

Y'all excited?

uncut viper
#

you know what a Switch is?

calm nebula
#

Thing I buy at home depot for a dollar

uncut viper
#

yeah you got it

calm nebula
#

They made a second one. I hear it controls two outlets

teal bridge
#

I thought it was a block of wood.

#

Switch 2 would be a... bigger block.

calm nebula
#

I want a curry

rancid temple
calm nebula
#

Not like a Haskell Curry

#

A curry. The type you eat

velvet narwhal
#

spicy or bust

calm nebula
#

Spicyyyyyyyy

velvet narwhal
#

love of curry, the vast variations of curry--

lucid iron
#

what regional variant of curry

calm nebula
#

Oh. Rainnnnn

velvet narwhal
#

idk what region it is, that golden curry block i get at the asian grocery store with like a solid 2 tablespoons of gochujang usually does it though, i could probably make an entire expansion on all the variations on curry think_eyes

calm nebula
#

That's Japanese curry lol

#

Anywyas

#

You modders go make a mod lol

teal bridge
#

(I am. I can do two things at once.)

uncut viper
#

im not. im retired

teal bridge
#

Since when?

velvet narwhal
#

mac has killed button

uncut viper
#

since atra changed the definition of retired

#

(but realistically, i probably am on "minimal work" mode until around mid december)

teal bridge
#

Technically, Atra's definition of retirement tracks with that of most actual retirees, except that he was never making money off it to begin with.

lucid iron
#

atra r u done with aquarium

calm nebula
#

(No)

#

Also need to PR pathos to fix the lookup for fish data for fish with special gsq

teal bridge
#

Fish with special GSQ? You're going to break my fish stuff, aren't you.

#

Is this GetFish affecting?

calm nebula
#

No, it's just that lookup anything currently displays the wrong thing in that case

#

Nothing to do with game code at all, just a lookup anything display issue

teal bridge
#

Oh, never mind then.

brave fable
#

ah, things arbitrarily not tokenising. my beloved

patent lanceBOT
#

@tardy adder: check if I broke something with pdw (22h ago)

limpid moat
#

@next plaza Hey Casey, sorry to bother you - I spotted a comment on Spacecore's Nexus that I'm not sure if you've seen, and it seemed like decent critique. I know you're taking a step back at the moment, but I wanted to make sure this didn't get swallowed by time.

calm nebula
#

Report it to pathos

rancid temple
brave fable
#

unfortunately it's a phat mod with a phatter content pack

uncut viper
brave fable
#

and im lazy

lucid iron
#

What is {{PATH}} suppose to resolve to

limpid moat
#

Not sure! Wasn't my comment, just wanted to make sure it didn't disappear! But if it's being looked at, we're all good. ¯_(ツ)_/¯

brave fable
teal bridge
#

Not to put too fine a point on it, but I think if we wanted to read Nexus comments, we'd read Nexus comments.

calm nebula
lucid iron
#

That does sound like bug yes but I remember it working fine for machine data which was also very nested

#

Tis was back in 1.6.8 though, several versions ago

calm nebula
#

Yeah I would ask you to backdate everything and test in 1.6.8 but that seems like hell

rancid temple
calm nebula
#

Join me in sock knitting while waiting for code to finish?

brittle pasture
#

IL decompiled code is a gateway to madness

#

(for context array is never used anywhere else below)

teal bridge
#

Not sure about this instance but I've found the compiler itself likes to do that a lot.

#

Like, if I declare a simple struct type and write one statement initializing a few properties, the emitted IL has two locals for that struct.

#

The last few lines assign the second local struct to the first local struct and then return the second local struct. Utterly pointless.

deep cypress
#

Just so I make sure I am understanding this correctly:

IL_04f5: ldarg.s position
IL_04f7: ldarg.s origin
IL_04f9: call valuetype [MonoGame.Framework]Microsoft.Xna.Framework.Vector2   [MonoGame.Framework]Microsoft.Xna.Framework.Vector2::op_Addition(valuetype [MonoGame.Framework]Microsoft.Xna.Framework.Vector2, valuetype [MonoGame.Framework]Microsoft.Xna.Framework.Vector2)

Call Valuetype is adding the first two together, right?

teal bridge
#

ValueType (the type) is not part of the call, it's just saying that the referenced type happens to be a value type.

#

But, yes, it's calling the static op_Addition method that is generated from the operator + definition.

deep cypress
#

So I want to insert after that one, then. And then, I add my vector2 method, and then, I do another op_addition?

teal bridge
#

Not clear to me what you're asking. You can of course chain op_Addition calls as long as you respect the stack.

deep cypress
#

here is what I did, but it breaks CLR:

    CodeMatcher matcher = new(instructions, generator);
    matcher = matcher.Start()
    .MatchStartBackwards(new CodeMatch[]{
    new(
        OpCodes.Call,
        AccessTools.Method(
            typeof(FarmerRenderer), nameof(FarmerRenderer.drawHairAndAccesories) 
        )
    ),
    new(OpCodes.Ldarg_S, (sbyte)4),
     new(OpCodes.Ldarg_S, (sbyte)5)
    })
    .Advance(1)
     .SetInstruction(new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(ModEntry), nameof(ChangeActualOrigin))))
     .SetInstruction(new CodeInstruction(OpCodes.Add));
    return matcher.Instructions();
brave fable
#

respect the stack. worship the stack. forfeit all working memory to the stack.

rancid musk
#

Jokes on you my memory doesn't work

next plaza
teal bridge
deep cypress
#

In my mind, what I was doing here was finding the match, advancing one, to get past the op_addition of the first two, then, add my method, which yields a vector2, then Add the two. I guess that's not what I did?

teal bridge
#

It would be easier to see what's going on if we could see the transpiled IL (using Harmony debug) as opposed to the original IL + transpiler code.

deep cypress
#

So, not the ILSpy code, then, generate some from VS?

teal bridge
#

You'll still get the debug output even if the IL is an invalid program.

deep cypress
#

success!!! I have made the log!

ocean sailBOT
#

Oops, couldn't parse that file. Make sure you share a valid SMAPI log.

hard fern
#

Uh oh

teal bridge
#

Yeah, so I see this:

IL_03DF: ldarg.1
IL_03E0: ldloc.s    8 (Microsoft.Xna.Framework.Graphics.Texture2D)
IL_03E2: ldarg.s    4
IL_03E4: ldarg.s    5
IL_03E6: call       static Microsoft.Xna.Framework.Vector2 Microsoft.Xna.Framework.Vector2::op_Addition(Microsoft.Xna.Framework.Vector2 value1, Microsoft.Xna.Framework.Vector2 value2)
IL_03EB: ldarg.0
IL_03EC: ldfld      Microsoft.Xna.Framework.Vector2 StardewValley.FarmerRenderer::positionOffset
IL_03F1: call       static Microsoft.Xna.Framework.Vector2 Microsoft.Xna.Framework.Vector2::op_Addition(Microsoft.Xna.Framework.Vector2 value1, Microsoft.Xna.Framework.Vector2 value2)

I'm not sure if the transpiler is even inserting into the right place, but assuming it is, there are two ldarg.s before the first op_Addition and then two more values (ldarg.0 and ldfld) before the second. Which means that (a) the result of the first addition doesn't contribute to the second addition, and (b) there's an extra argument left on the stack. (wrong, ignore; however, there is no reference to ModEntry.ChangeActualOrigin anywhere which is suspicious)

#

After a call or callvirt, the arguments are consumed, and any return value goes onto the stack in their place.

brave fable
calm nebula
#

Not expected behavior

#

@ivory plume

deep cypress
#

I took out the Advance, it no longer makes the CLR error, just a out-of-index error.

rain basalt
#

i feel dumb lol >.> but im getting smarter just gota remember when copy and pasting things to change the path data ....

teal bridge
#

Actually, I might've been hasty at identifying the problem earlier since the ldfld is going to load a field from the ldarg and therefore is probably OK. That's my mistake.

But I don't see any reference to your ChangeActualOrigin anywhere in the IL output; I'm not sure where the transpiler even is.

#

You also probably don't want SetInstruction? That's going to overwrite whatever is there. Are you trying to add new instructions, or replace the ones there?

deep cypress
#

I kind of want to replace the origin there, like (i think) the previous transpiler did

rancid musk
#

Does anyone have an example of using ModBuildConfig's new <ContentPacks> feature? I am investigating adding support for it to ModManifestBuilder.

brittle pasture
#

I believe you can also include more than one

teal bridge
#

I'm not too keen on learning FarmerRenderer myself, all I can say is that from the log that was posted earlier, there's no evidence of the transpiler having done anything at all. Maybe [HarmonyDebug] wasn't added to the right place? (It should be added to the transpiler method)

rancid musk
#

I just wanted to see someone using it in production so I know I'm setting up my test project in a sane way.

deep cypress
#

I put it at the top of the thing:

  [HarmonyDebug]
  [HarmonyPatch(typeof(FarmerRenderer), nameof(FarmerRenderer.drawHairAndAccesories))]
  public class FarmerRenderer_drawHairAndAccesories_Patch
  {
      public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
      {```
teal bridge
#

I'd try putting it on the transpiler method, though not sure it'll make a difference.

ivory plume
teal bridge
#

Another thing I see is the use of OpCodes.Add, which is simply not the same thing as calling the static op_Addition method. OpCodes.Add is for primitive arithmetic.

#

You sure this method is called ChangeActualOrigin? It's definitively not in the debug output.

deep cypress
#

I see! How does one call the op addition method?

teal bridge
#

It's a (static) method, you have to get the MethodInfo for it and call like any other method.

deep cypress
#

I see! THanks!

rancid musk
#

Hmm. I could probably just do like xml <ContentPacks Include="SomePath" Version="Update" /> since ModManifestBuilder runs before ModBuildConfig's deploy task. 🤔

#

And have it open that ContentPack's manifest and update its version.

#

I just need to test if I can then write back to Version so MBC sees the correct value and not "Update"

ivory plume
#

(Little tweak in the next 1.6.x update: entering an invalid debug command will now list similar command names.)

calm nebula
#

(Would be cool to have the git feature that automatically enters in the most likely command after n seconds 😛 )

#

I'm...mostly kidding

ivory plume
#

(Probably not a good idea, since some debug commands do fun things like clearing all your mail flags.)

vernal crest
brittle pasture
#

Machine Terrain Framework now has an item query that straight up just simulates the vanilla crab pot logic, down to professions and bait effects. now you can make higher tier crab pots if you want
https://www.nexusmods.com/stardewvalley/mods/22975
(I don't usually post minor updates for my mods here, but I took enough psychic damage looking at the crab pot code I thought I deserve it)

Nexus Mods :: Stardew Valley

A framework for adding machines that can be placed on trees, giant crops, and water. Also add water crops support.

calm nebula
#

Delete mail flags! Remoce all of networldstate!

brave fable
brittle pasture
calm nebula
#

I set it to two seconds

brave fable
vernal crest
brave fable
#

oh to mourn for those wasted keystrokes

calm nebula
#

Join the rest of us who have the game debug commands memorized lol

vernal crest
#

I can't remember them when they're so short xD

brittle pasture
calm nebula
#

I enjoy it when the compiler tells me I'm a bad programmer and should feel bad

#

Because I am a bad programmer and it's nice the compiler noticed before the code crashed over something stupid

brave fable
#

if only VS autocomplete didn't give up on backspace and ignore you until you've deleted all the way to the last operator

brittle pasture
#

compilers give advices, like friends. this command autorun takes my fingers and presses my keyboard for me, like a work adversary

brave fable
#

if only VS somehow had the same beautiful fuzzy matching as VSCode

brittle pasture
#

(for legal reasons that was a joke. I do not have an arch nemesis at work)

uncut viper
#

why not

brave fable
#

that doesn't try and complete stnr to include some obnoxious security package class type with a name longer than my file instead of realising I was trying to write 'string'

brittle pasture
#

(not any human ones anyway)

rancid temple
#

(sounds like the nemesis is in chat)

calm nebula
rancid temple
#

(I dunno if you can consider the normal animosity of cats as nemesis)

deep cypress
#

I decided to test my patch without any inserts or SetInstructions. Without anything, there are no errors. Does this then mean I have codematched poorly?

brittle pasture
#

Do you have a "throw or log if not match" clause

deep cypress
#

yes.

rancid temple
#

Could need to be more explicit with the match

deep cypress
#

It was throwing earlier the same error as the smapi was throwing (both were happing)

brave fable
#

have you walked through your transpiler with debug steps to check your indexes and methodinfos are resolving correctly?

#

if not, offer an explanation of up to 200 words
(30 mins, 5 marks)

deep cypress
#

so this is like a call valuetype [MonoGame.Framework]Microsoft.Xna.Framework.Vector2
Opcodes.call, Vector2

deep cypress
#

(I did debug earlier today, but not recently)

brave fable
#

that they return a value you want, such as a methodinfo with the correct signature

#

as in solving an equation, resolving an operation

deep cypress
#

(Also, I am an amazing writer; could give 200 word bullshit excuse easily in 5 mins! 🙂 )

rancid temple
#

Up to 200 words? "Don't wanna"

brave fable
#

0 marks

rancid temple
#

I never debug my transpilers lmao

calm nebula
#

Neither do I. Either they are perfect on the first try or I throw a fit and do something else instead

brave fable
#

you sound like my transpilers

calm nebula
#

(I actually have a very good rate of transpiker right on the first try.)

tiny zealot
#

i have just done a (narrowly tailored) skipping prefix for my current thing and i feel bad about it. but this also feels like a rare case where a transpiler would be worse

uncut viper
#

im a strong proponent of "transpilers are always the best" so i cant agree

brave fable
#

skipping prefix is better. think of all the transpilers you're preventing

tiny zealot
#

the two genders

uncut viper
#

if i ever find out someone is prefix skipping my carefully crafted, artisanally made transpiler, im unpatching all of their stuff

calm nebula
#

Lol

brave fable
#

i fully intend to skip clickCraftingRecipe for loc 2.0.
no i will not include any crafting behaviours.

rancid temple
calm nebula
#

Have you considered a nice warm soak in Epson salts

uncut viper
#

is that a loc ingredient

tiny zealot
#

no, my printer is using those rn

brave fable
#

enjoying a relaxing acid bath atm

uncut viper
#

also ichor if you're willing to expose your crimes may i ask for curiosity's sake what function you are skipping and for why

calm nebula
#

Bluebls

#

Does loc have lox and if no why not

inland cedar
#

coming back for update my mod. is SV .net 5 or 6 again?

rancid temple
#

6

brave fable
#

i'm not american and i don't intend to change that 😌

tiny zealot
uncut viper
#

?? since when is lox american

brave fable
#

i don't know anywhere else in the world that calls it that. norway maybe?

uncut viper
#

what else would you call it...

tiny zealot
#

lox is yiddish, innit

brave fable
uncut viper
#

lox is not smoked salmon, though

#

you can smoke lox. but you dont have to

#

its cured

#

the word itself does also come from yiddish yes

brave fable
tiny zealot
#

i've never heard of unsmoked lox

uncut viper
#

well, thats what lox is

#

its just cured salmon

#

a lot of times people do make smoked lox but its not the original lox and is just a different variety of it

#

definitely not american, in any case

tiny zealot
#

anyway, the important thing is skip-prefixing seemed less fraught than transpiling into Object.draw, which actually draws the item into the colored preview box

uncut viper
#

think of all the fun you're missing out writing IL though

#

who wants to write boring ol normal C# nowadays

green patrol
#

heyo random question, so like, say I'm making a mod and I want to add a recipe to a shop at the start of year 2 using content patcher. would in my shops.json file I just put

"IsRecipe": true,
"When {
"Condition: y 2": true
}

#

I know in json assets, you had the "PurchaseRequirements" field but I'm not sure how that translated over to content patcher

uncut viper
#

you can juset set the Condition field on the shop entry to "YEAR 2" (i think thats the gsq format anyway)

green patrol
#

oh pog that's even easier

uncut viper
#

yeah its YEAR 2

green patrol
#

tyvm

uncut viper
#

the Condition field takes a Game State Query which determines whether or not the item is sold

#

i didnt notice you wrote Condition inside your When though dont do that

#

just use the Condition field in the shop entry itself

rain basalt
#

Hmm what would be a better practice SDVpufferwow having custom maps dumped into my mod or already having the assets there but accessing the loads requires the mod be active?

green patrol
#

oh you don't? Is that true for conditions in other places too?

#

like gift tastes for unlockable npcs after they move to town and the like?

uncut viper
#

a Condition field is a vanilla field thaty some vanilla things have. nothing to do with content patcher

rancid temple
#

When fields go at the same level as Action

#

Condition and When are similar ideas but different fields, any CP patch can have a When but not all things have a Condition

tiny zealot
#

When is for content patcher, and determines which parts of your mod CP applies to the game content.
Condition is for the game, and determines which parts of the existing game content apply/are used.

rancid temple
#

(Conditions on that page is the basic info and the rest of the page is about the tokens you can use in CP, with many being good for When)

green patrol
#

ohhh okay

teal bridge
inland cedar
#

can we add comment in manifest file?

signal lynx
#

hi, if i made a mod where shop selling unobtained furniture statue, will it affect gameplay in the future or it's safe because its only for visual? furniture like Solid Gold Lewis, Statue Of Perfection, Soda Machine etc

brittle pasture
#

what do you mean by only visuals? are you adding furniture items that look identical to those items to the shop?

#

if you're actually adding those items to a shop to sell, then it will affect gameplay in the sense you let players access those items outside of their intended means

tiny zealot
deep cypress
#

Hello @ivory plume would it be ok to get these in FarmerRenderer made public?

private Rectangle shirtSourceRect;

private Rectangle hairstyleSourceRect;

private Rectangle hatSourceRect;

private Rectangle accessorySourceRect;

internal Vector2 rotationAdjustment;

internal Vector2 positionOffset;```
ivory plume
teal bridge
#

Mmm, publicly mutable state, and on the FarmerRenderer to boot. I too like to live dangerously.

clever sinew
#

Okay not a code question, however -- do folks have a rhyme or reason to determining how npcs feel about new objects/determing gift tastes? I'm definitely trying to base off of existing preferences, but was curious

final arch
#

ey if you install mods its your own fault UGiggle

velvet narwhal
#

tbh i base it on lore, my mushroom mod makes it so everyone except uh, demetrius, linus, and the wizard hate it SMCKekLmaoDog

final arch
#

I think wether their status(child vs adult, profession, personality) makes them like/dislike something. if not, I just leave the general gift tastes from vanilla

clever sinew
#

makes sense. I'm just trying to figure out how I want to approach different items

#

to be fair, because they're cooking recipes I feel like the stakes are a little bit lower, cause I don't think gifting is people's first inclination with cooked items

#

But ¯_(ツ)_/¯

#

Thank you both

uncut viper
#

(tbh, that is my first inclination with cooked items)

velvet narwhal
#

possibly, i did make the mistake of adding the whole artisan category to a liked/loved taste and that was a mistake

uncut viper
#

the one or two foods i will keep on me the most are the ones that are the most universally applicable for gifting

clever sinew
#

oop

long jungle
long jungle
# long jungle

Can anyone tell me the reason why Ridgeside Village's custom boots cannot be edited?

uncut viper
# long jungle

(please use the smapi uploader when posting logs or json)

clever sinew
#

Idk I will probably just extensively consult the wiki and go with my gut. E.g., Caroline doesn't especially like oranges but she loves tea and her sunroom as well as curry and tropical curry, maybe she'll love this citrusy orange scone with her tea

ocean sailBOT
#

Log Info: SMAPI 4.1.6 with SDV 1.6.13 build 24313 on Microsoft Windows 11 Home, with 29 C# mods and 12 content packs.

long jungle
uncut viper
#

are you ensuring that your mod loads after RSV?

long jungle
uncut viper
#

one of the easier ways is to just set a dependency in your manifest

long jungle
#

Thank you!

uncut viper
#

heres the format

long jungle
rancid musk
#

I think I figured out how to fix msbuild using the wrong DLL version too, when MMB updates.

stable grotto
#

is there a way to abort loading of my mod when a specified other mod is loaded?
I don't want the new VPR to be loaded if people forgot to delete old complementary mods for it
e.g. if (Helper.ModRegistry.IsLoaded("grapeponta.VibrantPastoralSVE"))

uncut viper
#

you can just stop it from doing anything and log a warning or error or something

wanton field
#

Hello all, I need a lil example how to add vanilla ocean fish to a custom map. I get only trash by fishing.

hallow prism
#

what are you trying to do currently?

wanton field
#

I'm working on a custom map. It should add a new small location with a beach. With berry bushes, a few trees and spawning items. My only problem to get fish inside this new area. I can only catch trash in the water.

velvet narwhal
#

Trash is extremely prevalent in farm maps*, did you already set the fish in your new location?

hallow prism
#

how are you adding the fishes so far?

#

!json

wanton field
#

How to do this? Do I have to change this in .tmx or in the .json?

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.

wanton field
#

I tried to add it with both. And I ended up to much confused. And I didn't found a simple example for vanilla fish's.

#

Last I tried was to load the fishponddata inside my mod folder again.

velvet narwhal
#

Mm if you did a data/location edit it's fairly simple lemme grab my example

#

My tmx for my maps are completely blank save for the dialogue actions for flavor text

wanton field
#

Thank you I will check it out!

velvet narwhal
#

[[Modding:Location_data]] right?

wanton field
#

Yes. I will start again with this fishing topic. Clearing my exploding brain and start again

woeful lintel
#

Damn, I'm trying to parse a json with comment with python, but it does not work, so I check Stack overflow, and they do not like comments in json ("that's not json, duh")

#

gonna go around the issue with a good old s = re.sub("\\/\\/.*\n", "\n")

#

ohno

#

"$schema": "https://raw.githubusercontent.com/Leroymilo/FurnitureFramework/main/doc/schemas/content.json",