#making-mods-general

1 messages · Page 305 of 1

rigid oriole
#

the [CP] folder gets duplicated but only one is functional. I wonder if it's the fact that it starts with brackets or something?

blissful panther
#

Oh, that one might be unavoidable! Can you show your csproj? Mine is very similar/probably the same bug internally, but...

#

If I need, for example:

<ItemGroup>
    <SMAPIDependency Include="spacechase0.SpaceCore" Version="1.10" Reference="true" />
    <SMAPIDependency Include="spacechase0.GenericModConfigMenu" Version="1.9" Required="false" />
</ItemGroup>

I get this.

rancid musk
#

Thank you Rider, very cool

rigid oriole
#

Yes omg mine is also in an item group

blissful panther
#

They do need to be in an item group, but that should be fine...

rigid oriole
#

But I wonder if it being in an item group is part of the bug

#

not that I can do anything about it but i wonder

blissful panther
#
<ItemGroup Condition="'$(Configuration)' == 'Debug' ">
    <ContentPacks Include="test-pack/TilePropertyMod" Version="$(Version)" />
</ItemGroup>
#

Lemme just... change it to [CP] to see if it does the same thing. It shouldn't, but...

rigid oriole
#

I removed the item group from my .csproj and the visual bug went away

blissful panther
#

Aha, found the problem!

#
<ItemGroup Condition="'$(Configuration)' == 'Debug' ">
    <ContentPacks Include="test-pack/TilePropertyMod" Version="$(Version)" />
</ItemGroup>

That = fine.

#
<ItemGroup Condition="'$(Configuration)' == 'Debug' ">
    <ContentPacks Include="test-pack" Version="$(Version)" />
</ItemGroup>

That = not fine.

#

So if you move that pack one folder deeper, it seems like the dumb visual bug will... go away?

rigid oriole
#

That's so odd

blissful panther
calm nebula
#

Both exist. The first one that fires is the one that fires

noble prairie
#

Hi all, sorry if this has been asked, but I didn't see an answer in any of the pinned posts in this channel.

Is there a baby/beginner mod tutorial anywhere that folks suggest for people who want to get into stardew modding?

pine elbow
#

!startmodding

gaunt orbit
#

!startmodding

ocean sailBOT
#

Making mods can be broadly divided into two categories:

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

#

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.

pine elbow
#

Oop

noble prairie
#

Haha thanks both 💜

brave plinth
#

Does anyone know how to code an if that checks if food is a drink? I know there's bool IsDrink field, but I don't know how to access it for a check

lucid iron
#

What's the context

brave plinth
# lucid iron What's the context

Have this mess currently, i need an if to check if player consumed food is a drink somehow, instead of janky using context tags

internal static void UpdateFoodConsumption(SObject foodObject)
{
    if (foodObject.HasContextTag("drink_item") || foodObject.HasContextTag("coffee_item") || foodObject.HasContextTag("alcohol_item"))
    {
        ApplyDrinkFull(foodObject);
        return;
    }

    ApplyFoodFull(foodObject);
}
#

I was surprised object categories and context tags dont have a universal thing for a drink, now idk how to do it

lucid iron
#

Ah u just need to do GetData to obtain the ObjectData then

#

The IsDrink field is on there

#

Game1.objectData.TryGetValue(base.ItemId, out var data)

brave plinth
#

Eventho idk how to do what i want with it im really bad at this 😭

#

at least i have a lead now how to access the data

lucid iron
#

You can tell us about the goal if u want

trim sand
#

This is almost certainly a silly question. But does stuff break if you have multiple buildings upgrade from the same "base" building.
Had a whole idea for "profession" themed big shed alternatives that enhance certain machines inside them somehow.
But that hinges on not totally breaking the building upgrade system by having a brewery building and creamery upgrading from the basic shed.

lucid iron
#

Nah u fine

#

Building upgrades are well formed on their own and can branch like that if u want

trim sand
#

Okay. That's good to know. I've had a few ideas lately that rely on it, that I've not started over lack of assets and that potential problem of it just not working

hallow prism
#

the only "issue" is that players can't really downgrade a building if they change their mind

#

but well

#

idon't think this should prevent modders making cool stuff

old edge
#

I am using unlockable bundles anyone have expertise in this subject matter?

hallow prism
#

maybe just something to keep in mind

#

depends, gloom, a bit

old edge
#

oh actually it's trigger actions I need help with...```json

{
"Action": "EditData",
"When": {
"HasMod": "DLX.Bundles"
},
"Target": "Data/TriggerActions",
"Entries": {
"{{ModId}}_greenRainTriggerRepeat":
{
"Id": "{{ModId}}_greenRainTriggerRepeat",
"Trigger": "LocationChanged",
"Condition": "PLAYER_HAS_SEEN_EVENT Current orb_hint_mossy, PLAYER_HAS_RUN_TRIGGER_ACTION Current {{ModId}}_greenRainTrigger, PLAYER_STAT CurrentPlayer weedsEliminated 10",
"Actions": [
"UB_PlaceBundle Cape.SecretOrb.Repeat",
"MarkActionApplied Current {{ModId}}_greenRainTriggerRepeat false"
]
}
}
}``` is my condition correct?

brave plinth
# lucid iron You can tell us about the goal if u want

So u see I have
if ( ) {ApplyDrinkFull(foodObject); return;}
ApplyFoodFull(foodObject);
ApplyDrinkFull applies a status effect quenched, ApplyFoodFull applies a status effect full
so i just need that if ( ) to return true if Object is a drink and false if its not

trim sand
hallow prism
#

otherwise it sounds ok at first glance

old edge
#

ok i was confused if it was possible to list multiple game state queries in the condition field there are no examples in the wiki page/

brittle pasture
#

you are doing that

#

multiple queries separated by commas

#

they'll be AND (only true if all are true)

hallow prism
#

there are examples in several places

old edge
#

hmm i feel like when i put LocationChanged as the trigger it doesn't work

hallow prism
#

however, in the wiki, you find things only when you know they exist

old edge
#

I have to save a day then it works

hallow prism
#

trigger action don't care about CP update rate

#

they care about trigger

#

ah yes sorry i misread

#

hmm

lucid iron
hallow prism
#

i haven't used the location changed trigger, so i can't tell which restrictions it may have

#

possibly one of your condition wasn't true before sleeping, but now is

old edge
#

oh yeah that makes sense

#

oh i see what I did

brave plinth
old edge
#

when referencing players I need to follow the wiki here```json
Target player
Some conditions have a <player> argument. This can be one of...

Any - At least one player must match the condition, regardless of whether they're online.
All - Every player must match the condition, regardless of whether they're online.
Current - The local player.
Host - The main player.

#

is a the Player_Stat weedsEliminated condition of 2000 too much to unlock a green rain summon?

brittle pasture
#

you should first check that the stat is used in the first place

#

(on mobile so can't, but lots of stats are actually unused)

#

also just noticed the typo in your original post, should be Current not CurrentPlayer
try fixing that, and if it still doesn't work check that it's actually incremented with the getstat console command

karmic jetty
#

How do I resolve Possible dereference of null without doing this:

  public override void Entry(IModHelper helper)
  {
    ...
    helper.Events.Display.MenuChanged += MenuChanged;
    ...
  }
  
  private void MenuChanged(object o, MenuChangedEventArgs? args)
  {
    if (args is not null)
    {
      if (args.NewMenu is not null)
      {
        
      }
      if (args.OldMenu is not null)
      {
        
      } 
    }
  }

I know there's got a be a better way but MS's docs aren't necessarily helping.

#

I don't think OldMenu and NewMenu could be null? But I'm guessing the editor isn't aware of that?

rigid oriole
#

you can do null forgiving args?.whatever

tawny ore
#

args shouldn't be nullable, but the sender object can be

rigid oriole
#

i'm not sure i've ever used the sender

karmic jetty
#

Ahh, okay, that makes sense

tawny ore
#

Also, if you actually did have to do something like this, early returns read nicer (to me)

if (args is null) return;
...
#

That way you don't have to keep indenting to match for a bunch of conditions

blissful panther
#

(SMAPI explicitly passes in null for the sender in MenuChanged, for what it's worth. I think it does for all of them.)

// raise event
foreach (ManagedEventHandler<TEventArgs> handler in this.GetHandlers())
{
    Context.HeuristicModsRunningCode.Push(handler.SourceMod);
    try
    {
        handler.Handler(null, args);
    }
ivory plume
#

(SMAPI has code docs you can inherit on your event handlers, which provide more info.)

/// <inheritdoc cref="IGameLoopEvents.UpdateTicked"/>
private void OnUpdateTicked(object? sender, EventArgs e)
blissful panther
#

(I also forgot about those docs! SDVkrobusgiggle)

lucid iron
#

You mean there isn't a pufferchick diligently delivering my events?

blissful panther
#

They help. They're there to handle the popping: Context.HeuristicModsRunningCode.TryPop(out _).

#

Because they're spiky.

ivory plume
calm nebula
#

Then you allllways know

#

Also your repo has 1k unresolved

valid folio
#

Hi, what size should a machine sprite be?

brittle pasture
#

always 16x32

#

they are Big Craftables

#

(there are frameworks that allow for bigger machines, but basics first)

valid folio
#

Ok Thanks

lunar gull
#

Hi there! As someone who's got minimal modmaking experience, I was wondering where the best place to start would be for making a personal set of custom Community Center bundles. I know there's a few mods to change CC bundles, but I'd like to be able to tailor them to my own mod list. Is this a feasible project for a beginner? Are there any mod dependencies I would need? Or am I biting off way more than I can chew?

I've edited some jsons for personal use, so I'm somewhat familiar with the structure of a Content Patcher mod, but I don't have enough experience to know what's doable and what isn't. Any advice would be greatly appreciated.

lucid mulch
#

With cc bundles you need to be somewhat careful, as they are only properly loaded on save creation and then stored in the save file, so editing them mid-save causes BadThings™️

gaunt orbit
#

you can do it with just CP. Bundle data can be a challenge to write correctly, and changing it midsave or writing it wrong can brick a save

#

I wouldn't say it's "easy" but I think you can do it if you try

lunar gull
#

Okay, that's good to know. So I should avoid editing bundles mid-playthrough. I'm glad to hear I can accomplish it with just CP, hopefully I can learn the proper structure, maybe I'll be able to reference other bundle-editing mods to help get it right. Thank you for the responses!

golden oar
#

I have a question about event creation:

I have an event where i want to fade to black, move some npc's around and then fade back into view. My current code looks like this:
/globalFade 0.02/viewport -1000 -1000 [STUFF] /viewport 38 5 /globalFadeToClear

But when coming out of the fade, it flashes one full frame of the new scene, back to black, then fades in. How can I get a more seamless fade-in?

vernal crest
#

Try putting the viewport 38 5 command after the globalFadeToClear one.

torpid sparrow
#

Hello, is there a way to add conversation topics without hard coding? I havent been able to find a way to add new triggers/cannot figure it out

vernal crest
torpid sparrow
#

dang okay thank u!

brittle pasture
#

(though you can go pretty far with just the vanilla triggers)

#

(Button's BETAS mod also adds a bunch)

golden oar
brittle pasture
#

(what triggers do you want?)

torpid sparrow
#

im trying to add a conversation topic for before my new npc comes to town

#

what would trigger this would be after donating 3 items to the museum

vernal crest
brittle pasture
#

that's totally possible with day started + MUSEUM_DONATIONS condition

vernal crest
#

You're after a GSQ or CP condition then, not a trigger.

#

Yup what Selph said lol

torpid sparrow
#

ohh okay awesome

#

i will go tinker with that thank u for the help!!

brittle pasture
#

unless you have a niche case where you need a trigger to happen nao!!! day started/ending + condition should suit most of your usecases

near haven
#

Hi there! I'm brand new to coding and have zero clue what I'm doing. I'm trying to recolor the blue chickens and the babies using the "Alternative Textures" mod and Content Patcher, but Content Patcher can't read my content.json file and I don't know what I'm doing wrong. Here is the SMAPI log link if that helps: https://smapi.io/log/067da5b847a748109087cf54c9217df9

ocean sailBOT
#

Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 10 Home, with 13 C# mods and 5 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

vernal crest
#

There's also LocationChanged for the trigger, plus BETAS adds a ton of new triggers. And spacecore has a time trigger.

torpid sparrow
#

Is there an example i can look at in the unpacked

#

i mean there probably is where do i find them

brittle pasture
#

Data/TriggerActions.json

vernal crest
#

For trigger actions? Data/TriggerActions

torpid sparrow
#

tyy

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.

vernal crest
#

Please use the website like the instructions say :)

near haven
#

sorry, i literally know nothing

ashen charm
#

I'm planning to making a three goth triplets sisters custom npc and I'm struggling to find a name because their current names could be belong to preexisting custom npc

brittle pasture
vernal crest
#

The FromFile fields are all wrong, too. I also don't think there's an Update field in CP?

#

Is this a mishmash of CP and AT? Or something from AI?

brittle pasture
#

ah yeah I wasn't paying attention to the syntax

#

AT and CP use different formats entirely

#

you don't use content.json when you're making an AT pack

vernal crest
#

You can't make a mod that's a CP mod and an AT mod.

#

(Oh I was wrong about Update though. I thought it was UpdateRate but it's just Update. However, there's no OnPurchase update rate.

ashen charm
brittle pasture
vernal crest
tiny zealot
lucid mulch
#

The Update field would be for stuff like 'OnLocationChanged' and 'OnTimeChanged' (and 'OnDayStart)
CP used to have FromFile but its long deprecated and format 2.6.0 wouldn't be able to use it (and was never an array)

also editing an image on purchase doesn't make sense

calm nebula
#

There was once a spreadsheet wrt to npc names

ashen charm
#

Btw their names are Lily, Maria, and Alice. I thought that was a cute name for goth triplets

calm nebula
#

My personal opinion is that tbh is fine to have npcs share names

near haven
#

idk what any of this means - i've tried using the help pages from both to build it but idk what terms to use or how this works

calm nebula
#

And also the whole thing with compat is a little overblown as long as you stick to good practices

brittle pasture
#

I highly, highly recommend adding the ModId to your internal NPC name; someone recently released a Zayne NPC, and their mod doesn't load with Ridgeside Village because they both use just Zayne for their NPCs named Zayne

calm nebula
#

Players can indeed choose between two mods and tbh installing every npc mod under the sun would be a lot

vernal crest
brittle pasture
#

but yeah I'd add my own two cents as well, and say that you should name your NPCs however you want SDVpufferheart

tiny zealot
#

i thought it was "fade in" but i don't really know tbh (insert gripe about forced true/false and not letting us use words to indicate meaning /lh)

near haven
vernal crest
lucid mulch
vernal crest
#

I recommend that you download an existing AT mod which retextures chickens and copy what it's doing.

brittle pasture
#

also at risk of confusing you further I should point out you don't need AT to add animal skins, you can use CP skins and the AT tool will work with those as well

vernal crest
#

(Yes Atra I am throwing you under the bus :P)

lucid mulch
calm nebula
#

That's the initial viewport function

#

And thanks for throwing me under the bus

brittle pasture
#

someone should install every NPC mod and take note of incompat issues like duplicate internal names or overlapping festival positions /lh

vernal crest
#

Initial viewport function?

tiny zealot
vernal crest
#

Oh there is unfreeze too. I have no idea how to read this to be able to tell what order these arguments should go in.

tiny zealot
tender bloom
#

We have the technology to stop it

#

I remember poor peaches the cat

lucid mulch
#

somethingsomething "But mods already expect our npc name to be not namespaced so it would be a compatibility issue if we changed it"

tender bloom
#

Think of peaches the cat

calm nebula
#

This means sheku has to maintain my mods now

tender bloom
#

I’m lucky it was a bus, then?

calm nebula
calm nebula
tiny zealot
tender bloom
calm nebula
#

There is likely overlap

brittle pasture
#

Baldur's Village used to have that issue as well, they didn't use ModIds and while most of their NPC names dodged incompat issues due to being wacko DnD fantasy names, one unfortunately didn't (Aurelia)

tender bloom
#

Surely not

brittle pasture
#

they seem to have fixed it though

calm nebula
tender bloom
#

Life goes on despite academia!

calm nebula
#

are you sure about that

vernal crest
#

Elizabeth are you trying to talk Atra into making you maintain their mods xD

calm nebula
#

anyways I'm off topic, I'm so sleepy

#

I'm retired, you've got tenure, etc etc

lucid mulch
#

the viewport command in 1.6.15 appears to have at least 5 main permutations of how its arguments work
viewport move <int directionX> <int directionY> <int duration>
viewport <string NPCTarget> clamp [bool shouldFade] ['unfreeze']
viewport <string NPCTarget> [bool shouldFade] ['unfreeze'] (This permutation looks like it has a bug, as shouldFade and option both read index 2)
viewport <int positionX> <int positionY> clamp [bool shouldFade] ['unfreeze']
viewport <int positionX> <int positionY> [bool shouldFade] ['unfreeze']

tiny zealot
#

oh, i didn't know about the NPC ones. cool, even more cursed than i remember

lucid mulch
#

NPCTarget can also be player

brittle pasture
#

what happens if I add an NPC with the id player

calm nebula
#

thank you, sinZ

#

plz don't selph

lucid mulch
#
position = ((!(NPCTarget == "player")) ? @event.getActorByName(NPCTarget).TilePoint : Game1.MasterPlayer.TilePoint);
brittle pasture
#

alas, poor player

lucid mulch
#

at a glance this is missing the optional actor safeguards that many other commands gained in 1.6

vernal crest
sour sleet
#

what's the best way of adding new furniture to the game?

brittle pasture
#

Data/Furniture

#

[[Modding:Furniture]]

calm nebula
#

this also exists

sour sleet
#

Do you need a framework or can it just be done with an edit?

brittle pasture
#

edit

vernal crest
#

Just CP

sour sleet
#

Awesome,thanks!

lucid mulch
#

Ah option is only used in one way, and it is unfreeze

vernal crest
#

You can use Furniture Framework if you want ~fancy~ furniture.

calm nebula
lucid mulch
#

viewport doesn't follow just sets the initial position, so having a fallback if kents not in the game yet would make some sense

calm nebula
#

ohhhh okay

#

and unfreeze makes it follow the player

#

forgot what clamp does

lucid mulch
#

clamp looks like keeping the camera inbounds of the map size

calm nebula
#

yeah

#

tl;dr have funnnn with that cmd

lucid mulch
#

also hardcoded behavior for a specific event just for the icing on top


        if (@event.id == "2146991")
        {
            Point grandpaShrinePosition = Game1.getFarm().GetGrandpaShrinePosition();
            targetTileX = grandpaShrinePosition.X;
            targetTileY = grandpaShrinePosition.Y;
        }
calm nebula
#

that's it I'm, making a new viewport command that works off map properties

vernal crest
#

I wish it was like TAS where it just has all the arguments in one long line (I pretend the end arguments of TAS don't exist for this complaint) instead of it being contextual

calm nebula
#

I joke I joke

#

when do I have the time to do anything of use anymore

uncut viper
calm nebula
#

hi Button. You do it

uncut viper
#

im still on vacation

lucid mulch
#

tbh it shouldn't be 3 commands in a trenchcoat

calm nebula
#

(I just got home....)

#

I'm soooo tired

#

I still have to do laundry

#

god help me

#

someone yell at to get up off the floor and hang up the wet clothing

tiny zealot
calm nebula
#

I love you ichor

vernal crest
#

The ones with the different first argument are easy enough to split on the wiki, I guess, but the ones with the same first argument but then different later arguments are SDVpufferpain

lucid mulch
#

I'm at least glad I'm reading the pathos 1.6 variant with ArgUtility and not whatever hell the 1.5 one would be in the giant ternary/ifchain

calm nebula
#

for this I'm making the inputs to the next function I write a BitArray

#

you set specific bits for specific functions

lucid mulch
#

bit flags are great

vernal crest
calm nebula
#

the third bit blows everything up btw

lucid mulch
#

Bitwise flag enums are the best I love them

calm nebula
#

ahhhahaha you think I have enums

vernal crest
#

I have laundry to do too. Atra, join me in leaving for laundry land.

calm nebula
#

Past atra: "oh, I'll get home super late, let me use the timer function on the washer so I'll be efficient."

#

Current atra: melted goop on the floor

lucid mulch
#

and then the clamp option in the middle offsetting everything after it

#

this is why Event Data Model™️ should happen, so event arguments aren't just a string[] and have keyed arguments instead

vernal crest
#

It's not so much about how it behaves as how to clearly explain it on the wiki that I am thinking of

#

(My washing machine is on now, I did actually leave for laundry!)

lucid mulch
#
[
    {
       "Command": "Viewport",
       "Type": "move",
       "Direction": "10, 10",
       "Duration": "1337"
    },
    {
       "Command": "Viewport",
       "NPCTarget": "Abigail",
       "Action": "clamp",
       "ShouldFade": true,
       "Option": "unfreeze"
    },
    {
       "Command": "Viewport",
       "NPCTarget": "Abigail",
       "ShouldFade": true,
       "Option": "unfreeze"
    },
    {
       "Command": "Viewport",
       "NPCTarget": "Abigail",
    },
    {
       "Command": "Viewport",
       "Position": "10, 10",
       "Action": "clamp",
       "ShouldFade": true,
       "Option": "unfreeze"
    },
    {
       "Command": "Viewport",
       "Position": "10, 10"
    }
]
gaunt orbit
#

So is it a list of dictionaries?

tiny zealot
#

i was thinking about Event Data Model and while i would probably like having it, i pufferfear at what the vanilla XML would look like

near haven
ocean sailBOT
#

Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 10 Home, with 12 C# mods and 5 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

ivory plume
#

(For what it's worth, this is the new event argument spec for the viewport command in 1.6.16.)

[EventArguments(
    "'move' -int -int int",               // viewport move <x> <y> <duration>
    "word bool? 'unfreeze'?",             // viewport <actor> [shouldFade] [unfreeze]
    "word 'clamp' bool? 'unfreeze'?",     // viewport <actor> "clamp" [shouldFade] [unfreeze]
    "-int -int bool? 'unfreeze'?",        // viewport <x> <y> [shouldFade] [unfreeze]
    "-int -int 'clamp' bool? 'unfreeze'?" // viewport <x> <y> "clamp" [shouldFade] [unfreeze]
)]
tiny zealot
lucid mulch
tender bloom
ivory plume
lucid mulch
#

probably not, only found it due to trying to figure out what valid permutations are allowed in 1.6.15

#

considering how I don't know if anyone knew the actor targetting existed, they wouldn't find that clamp is mandatory for it to not cause issues (if you also wanted one of the optional args)

vernal crest
brittle pasture
#

(if you were using AI for it, pls dont)

near haven
#

i'm not, i'm just stupid and have no idea what i'm doing. i literally only picked this up 2 days ago

#

idk wat any of this means, i just want my funky chickens lmao

vernal crest
#

Then please listen to our repeated advice that you find another mod and copy that instead of doing your own thing.

calm nebula
near haven
near haven
vernal crest
tender bloom
vernal crest
# near haven this is what i just tried to do copying a cp reskin mod

It's a start, but when I said copy I meant copy and past the entire thing exactly and then change nothing but the path in the FromFile to match your own one file (you can only specify one file in FromFile without tokens and you should get just one thing working in game before you try to explore anything like tokens, imo).

calm nebula
#

I'm now doing thr dishes

near haven
#

y'all are wizards lol

vernal crest
#

I want you to be able to have your random blue chickens. It's great to be able to have an idea and see it in game.

near haven
#

i'm sorry. i don't really know what to ask tbh, but i'll try

vernal crest
#

Basically if anyone giving you advice says something and you don't know what it means and/or what to do because of it, ask for clarification ^_^

near haven
#

ok!

#

thank y'all too omfg. ik i probably sound like a moron lmao

brittle pasture
#

so you can make it so that Animals/Blue Chicken is randomized from one of multiple images. however the problem with that approach is that every of your blue chickens will switch over to that texture.
if you want your blue chickens to choose from one of multiple textures, you would need to

  1. load multiple PNGs, each to their own Target
  2. edit the blue chicken in Data/FarmAnimals to add a skin for each of your loaded Targets. this is somewhat more advanced
#

oh, and unpack the game to see what Data/FarmAnimals look like if you haven't already

#

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

near haven
brittle pasture
#

I wouldn't recommend alternate purchase types since you'd be adding a new chicken type entirely, and have to duplicate all the fields (including produce)

#

instead, add new Skins to the Blue Chicken

steel plaza
#

how do i implement this??

#

does it work like CollisionMap?

near haven
vernal crest
brittle pasture
steel plaza
vernal crest
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!

steel plaza
vernal crest
steel plaza
#

oh wait i found it

#

thanks for the help

sour sleet
#

Ok so I have a map patch that applies when I've completed a bundle (UB) and I logged onto a save where said patch WAS applied but now it isn't and i had to do the bundle again. I'm trying to replicate it on another save to find out the problem but it won't happen again. Has anyone else had this issue?

old edge
#

finishing up my green rain summon bundle

#

one mossy seed is probably too little for the unlock..

#

green little junimo

sour sleet
#

Wait. I've replicated the error. I did debug nd in another location and the map unpatched itself but no bundle is present

old edge
#

but still my green rain summon logic doesn't trigger every time and sometime's only regular rain appears.. what could be wrong with my C# code...

sour sleet
#

Anyone here have experience with Unlockable Bundles?

old edge
#

I’m overriding the standard summer-only green rain behavior so that it can be triggered in other seasons via the summon.

#

Yes I am experienced using UB

sour sleet
#

Do you know what my problem might be? My map patch for completing a bundle is undoing when i sleep somewhere

old edge
#

you have to add a patch

#

using regular content patcher code

sour sleet
#

I have, it was applied

old edge
#

like a backup and then add a flag

#

or the unlockable bundle condition

sour sleet
#

And i used debug nd in another location and pre patch appeared

old edge
#

"When":{
"DLX.Bundles/Purchased":"MyModName.Prerequisite" //(!)
},

#

add the bundle name

#

then do ```json
"Update": "OnLocationChange", //or OnDayStart

#

also where is the map patch?

lucid mulch
#

is this in town by any chance?

sour sleet
#

And this is all in Bundles.json? My map patch is in the folder with all my custom maps

#

Nope, it's a custom location

old edge
#

well I usually just use the ShopEvent

lucid mulch
#

patch summary "<content pack ID>" and check on the status of the map patch

old edge
#

Using the ShopEvent field, you can create an event, and within the event script, the custom command UB_ApplyPatch allows you to apply the EditMap patch

sour sleet
#

But it's showing up as the pre bundle completion area

lucid mulch
#

log?

sour sleet
#

I'd rather not as I'm making an expansion and my current log has a lot of spoilers for it haha

#

It's just strange to me as the patch was applied and now it's undone, but with no bundle to click on

old edge
#

I would just make sure a flag is being set or a dynamic token and then use that as the main condition for the map patch.

#

then set a priority level for the patch

#

perhaps the query is unnecessary?

near haven
ocean sailBOT
#

Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 10 Home, with 12 C# mods and 5 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

brittle pasture
#

every opening brackets must have a matching closing bracket

#

if you're not already, I also recommend using a text editor with JSON error highlighting built in

near haven
#

oh whoops, can't believe i missed that

#

does notepad++ do that? that's what i'm using rn

brittle pasture
#

I'm not sure, sorry (I don't use it)😅 but maybe searching around can yield something

brittle ledge
near haven
near haven
steel plaza
vernal crest
near haven
#

ok another question: when smapi says "line 115, position 7", what does "position" mean? is that the number of the character that's causing the error or something else?

sour sleet
vernal crest
near haven
vernal crest
near haven
#

oh whoops, ig i didn't completely clean that up. ty!!

#

OH MY GODS IT WORKS!!!!!! thank you all so much for your help!!!!!! <3333

rigid musk
#

is there a way to make modded npcs use their sleep sprites when they go to bed in the farmhouse? pondering I could be doing something wrong I guess but his sleep sprite works normally in his regular bed

#

and all spouse schedules are supposed to end with "bed" so i cant use the "sleep" option

steel plaza
#

is this normal??

latent mauve
lucid mulch
ocean sailBOT
#

Important note: Your computer username may appear in the log. If your username is your full name, please be aware of this before uploading it.

Please share your SMAPI log file. To do so:

  1. Open this page: smapi.io/log.
  2. Follow the instructions at the top of the page to upload the log file. (Don't copy & paste from the console window!)
  3. After uploading, it will show a green box with a URL to share. Post that URL here.

Please do it even if you don't see any errors. This has useful info like what mods and versions you have, what the mods are doing, etc. If the issue didn’t occur in your last session, please load the game to the point where the issue occurs, then upload the log.

lucid mulch
#

hyper cropped screenshots obfuscate what the true problem is, but is there a Content Patcher load for Maps/LowerGarage?

steel plaza
#

i dont have that in my code tho

#

idk why its asking me for that

latent mauve
rigid musk
#

ohhh

#

huh

#

why was I told just to use sleep then

#

weird

#

I will fix this later then :) thank you

steel plaza
#

the mod works fine but it's showing this

latent mauve
steel plaza
latent mauve
#

Ah, that looks like the texture for the building isn't loaded and referenced correctly.

steel plaza
#

here it is

latent mauve
#

Anything that references a Texture or MapPath in the code needs to be loaded with an Action:Load to a Target (which is then used for the Texture or MapPath) so the game thinks its in the game files rather than just in your mod folder.

vernal crest
latent mauve
#

Is this the intended target for the lower garage? Maps/{{ModId}}_\t

#

Figured I would ask because that doesn't look quite right

vernal crest
# steel plaza gotcha thank youuu

Your texture for your garage is also wrong - it needs to be Buildings/{{ModId}}_Garage, plus you're still not using {{ModId}} everywhere that you need to be. Your IndoorMap field is wrong too, it's pointing to Garage but it needs to be {{ModId}}_UpperGarage/{{ModId}}_LowerGarage depending on which one you want the indoor map to be.

#

And like Lily said, your target for the lower garage is wrong. You had it correct earlier.

steel plaza
steel plaza
#

this the video if i can send it

#

it keeps returning me to the title screen

#

the stradewvalley.shed thing is fix now

latent mauve
#

Your TMX is missing the Buildings layer

#

!log also please use this to pull the full error log instead of using screenshots, it makes things easier to investigate

ocean sailBOT
#

Important note: Your computer username may appear in the log. If your username is your full name, please be aware of this before uploading it.

Please share your SMAPI log file. To do so:

  1. Open this page: smapi.io/log.
  2. Follow the instructions at the top of the page to upload the log file. (Don't copy & paste from the console window!)
  3. After uploading, it will show a green box with a URL to share. Post that URL here.

Please do it even if you don't see any errors. This has useful info like what mods and versions you have, what the mods are doing, etc. If the issue didn’t occur in your last session, please load the game to the point where the issue occurs, then upload the log.

brave plinth
#

Does anyone know of a way to intercept base game specific HUDMessage and edit it?

gentle rose
brave plinth
# gentle rose it depends on which one tbh. Do you have a specific one in mind?
        if (Game1.objectData.TryGetValue(o.ItemId, out var data) && data.IsDrink)
        {
            if (this.IsLocalPlayer && this.hasBuff("7") && !overrideFullness)
            {
                Game1.addHUDMessage(new HUDMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.2898")));
                return;
            }
            this.drinkAnimationEvent.Fire(o.getOne() as Object);
        }
        else if (o.Edibility != -300)
        {
            if (this.hasBuff("6") && !overrideFullness)
            {
                Game1.addHUDMessage(new HUDMessage(Game1.content.LoadString("Strings\\StringsFromCSFiles:Game1.cs.2899")));
                return;
            }
            this.eatAnimationEvent.Fire(o.getOne() as Object);
        }
#

This is in Farmer.cs

#

I want to change addHUDMessage to be showGlobalMessage instead

gentle rose
#

oh, I see. I believe you will need harmony for that

#

!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:

ashen charm
#

Would it cause error if you set an custom npcs birthday at festival days

pine elbow
steel plaza
ashen charm
pine elbow
#

Putting aside potential errors, I don't see why you'd want to do it. If it's a festival like Night Market then go for it ig but a regular festival? I just can't envision it working

north palm
#

Hello.. i want to ask about how would the portrait switching using the speak command works?

vernal crest
#

I don't think there'd be errors, you'd just make it difficult to give the NPC a birthday present.

vernal crest
#

👆 You also use portrait commands to switch portrait when they're talking in events.

brave plinth
# gentle rose oh, I see. I believe you will need harmony for that

I actually managed to do it without Harmony, kinda. Achieving the same effect, from my testing this seems to work, but now i'm worried it's performance strain on the game since it runs that thing 60 times a second (am i understanding this right?), I wonder if there's better event to put this kind of thing on that would have good timing

gentle rose
brave plinth
#

this is my first time modding stardew and first time programming in c# and first time using visual studio i dunno

#

😭

gentle rose
#

dw, most mod authors were in exactly the same position when starting

#

I definitely was

#

I wonder if there’s a performance impact to putting that RemoveHUDMessage function nested inside the UpdateHudMessage method or if the compiler optimises that away SDVpufferthinkblob

#

I assume the latter but still interesting

brave plinth
#

Is there a way to test the performance impact?

gentle rose
#

it would be negligible either way so probably not

#

ig you could make a method with a thousand nested functions in it, bind it to updateticked and see if it lags lmao

quaint horizon
#

Is this where I can ask about making a mod and finding out how hard making said mod would be? I haven't been in this server long

gentle rose
#

yup. What are you trying to make?

quaint horizon
#

So I have SVE and Sunberry village and that gave me access to plots of land im able to have animals on. In the menu like where you go to check to see if you've petted them or not I would like to somehow create a little Divider
for example
Name of farm:
Animal 1
Animal 2
etc.

Grampleton fields:
Animal 1
Animal 2
etc

Sunberry village farm:
Animal 1
Animal 2
etc

fathom hound
#

Smart

quaint horizon
#

I have alot of animals and sometimes it gets a little frustrating for me when I have like a cow on MY farm that I thought I petted but I didn't bc in the menu its kinda scrambled and it just has All my animals without any distinction on which animals I have where

vernal crest
#

Do you have any C# knowledge? That'll be a C# thing.

gentle rose
#

I thought the animal menu in 1.6 already showed if you petted animals or not (but I haven’t played 1.6 much so I could be wrong haha)

quaint horizon
vernal crest
quaint horizon
#

^^

vernal crest
#

I'm learning C# via Stardew modmaking

#

(In large part due to iro's patience in teaching me concepts SDVpufferheart )

gentle rose
#

ah, I see SDVpuffersquee it sounds interesting!

quaint horizon
#

oo
I plan to learn in the future but there are alot of irl things that need to be taken care of atm

calm nebula
#

And it's pretty spammy on the garbage collector

#

It's not something a player would notice but it's another part of the death of a thousand cuts modded game performance tends to have

#

Oh wait, hud message to global message (I thought it was refreshing a hud message) sorry

toxic sage
#

i'm opening tiled for the first time to try making a farm map and i'm not sure where to start! i've made a copy of the unpacked farm.tmx and ive got it open in the editor but i'm not sure how to. do anything else >m<

quaint wadi
toxic sage
#

ohh, sure!

#

i'll make a copy of the farmhouse tmx i guess and start there?

quaint wadi
#

yeah thats a good start

#

you'll want to take note of what is put on each layer- back is the floor, building is objects with collision, front you can walk through but will render in front of you if you're behind it, and always front will always render in front of all tiles and sprites

toxic sage
#

gotcha!

quaint wadi
#

adding tilesheets can be tricky but if you're just using town interior to start you likely wont need to yet, though if you do try it and run into trouble feel free to ask

toxic sage
#

thank you very much for your help! i'll let you know how it goes

#

we're going to ignore the fact it took me 3 business days to figure out how to open the tileset pane . SDVpufferblush

#

the buildings layer of the base farmhouse looks so odd O.o

uncut fossil
#

Hi ! I've just entered the discord server ! I wanted to know if someone could help me with modding a new datable npc in the game ! I already looked in the stardew wiki but I don't understand where should I actually start ? Like for example they say you have to write the name of the character, the gender and age... OK but WHERE ? I don't understand a lot of things actually I'm all new to modding and I've never coded before so yeah...

brittle pasture
#

!npc

ocean sailBOT
#
Creating a Custom NPC

Keep in mind that making NPCs is a complex process that requires learning many different aspects of Stardew modding.
Here are a few links that can help get you started on all that you need to know:

brittle pasture
#

you would want to make a content patcher mod to edit those data

#

!startmodding check out the guide to content patcher in general in conjunction to the resources above

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.

brittle pasture
#

(you dont need to touch C# unless you have some very specialized needs)

uncut fossil
#

yeah I downoalded the content patcher on nexus, I will see the guide you just sent me thx !

steel plaza
#

The current state of the mod I'm currently working on, the main issue right now is the the warp from the lower door to the upper door doesn't when it is setup properly, it also does not say that it can not load it when in fact with debug the location can load. If someone has any idea on what could be wrong please tell me, taking a break for now

tiny zealot
#

(C#, transpilers) looking for some help with CodeMatcher and its Repeat method.
i have a simple codematcher transpiler that looks like this:

            MethodInfo getplayer = (reflection...)
            MethodInfo countcall = (reflection...)
            CodeMatcher cm = new(instructions);
            cm.MatchStartForward(
                    new CodeMatch(OpCodes.Call, getplayer),
                    new CodeMatch(OpCodes.Ldfld),
                    new CodeMatch(OpCodes.Callvirt))
            .RemoveInstructions(3)
            .InsertAndAdvance(new CodeInstruction(OpCodes.Call, countcall));
            return cm.InstructionEnumeration();```
which works fine (the reflection boilerplate i have cut out is working correctly).
#

i'm trying to use Repeat, since there's a second match and i also want to replace that one. when i change it to say:

            CodeMatcher cm = new(instructions);
            cm.MatchStartForward(
                    new CodeMatch(OpCodes.Call, getplayer),
                    new CodeMatch(OpCodes.Ldfld),
                    new CodeMatch(OpCodes.Callvirt))
            .Repeat(matchAction: m => {
                m.RemoveInstructions(3);
                m.InsertAndAdvance(new CodeInstruction(OpCodes.Call, countcall));
            });
            return cm.InstructionEnumeration();```
... it compiles, but crashes like so when applying the patch:
```System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> ArgumentException: Bad label content in ILGenerator.
   at System.Reflection.Emit.ILGenerator.GetLabelPos(Label lbl)
   at System.Reflection.Emit.ILGenerator.BakeByteArray()
   at System.Reflection.Emit.DynamicResolver..ctor(DynamicILGenerator ilGenerator)
   at System.Reflection.Emit.DynamicILGenerator.GetCallableMethod(RuntimeModule module, DynamicMethod dm)
   at System.Reflection.Emit.DynamicMethod.GetMethodDescriptor()
   --- End of inner exception stack trace ---```
what have i overlooked?
brittle pasture
#

warping outside of a building interior will always deposit you next to the warp

#

if you wanna change that that's C#

#

oh yeah, re: second floor in an instanced building interior, that's also not supported

#

the second floor has to be on the same map

steel plaza
#

thanks for that, I thought I'm missing something lol

gaunt orbit
uncut viper
#

a now-missing label is also what i was going to suggest looking for

tiny zealot
#

ah, that would make sense. thanks!

#

i thought maybe i had missed some necessary bit of boilerplate

tawny ore
#

Try adding an empty CodeMatch in your MatchStartForward

#

That'll set the cursor after your code edits

#

That's something that helped me with a weird Repeat situation before

uncut viper
#

the cursor is already moved forward by InsertAndAdvance

tawny ore
#

I know, but that's what I had to do

uncut viper
#

otherwise itd just be a potential infinite loop, not to do with labels

tawny ore
uncut viper
#

which is a different issue and one hes already accounted for with InsertAndAdvance

#

the code theyre adding doesnt add the same calls hes matching on anyway

tawny ore
#

My original code already had InsertAndAdvance

#

I know what you're saying is correct, what I'm saying is that adding it still helped

#

Like, you're right, but in this case it didn't matter

tiny zealot
#

okay, anybody have the CodeMatcher incantation handy to move the labels from the cursor instruction to the new one i'll be putting in? 😅

tawny ore
#

This is what I would suggest trying:

            CodeMatcher cm = new(instructions);
            cm.MatchStartForward(
                    new CodeMatch(OpCodes.Call, getplayer),
                    new CodeMatch(OpCodes.Ldfld),
                    new CodeMatch(OpCodes.Callvirt),
                    new CodeMatch())
            .Repeat(matchAction: m => {
                m.RemoveInstructions(3);
                m.InsertAndAdvance(new CodeInstruction(OpCodes.Call, countcall));
            });
            return cm.InstructionEnumeration();
tiny zealot
#

Labels()/ForEach/CreateLabel?

tawny ore
#

Worst case, it doesn't work and you're back where you started. Best case it fixes the issue.

tiny zealot
#

(i found the label i missed and deleted by mistake. it's almost certainly that)

uncut viper
#

but adding a random "match on anything" codematch is not going to fix a label error

#

i think there is an extension method for grabbing the labels and moving them though?

#

on CodeInstruction. dont quote me on that

tawny ore
#

There's a function with an out label

uncut viper
#

CodeInstruction.MoveLabelsTo()

#

or alternatively CodeInstruction.MoveLabelsFrom

#

or alternatively alternatively CodeInstruction.ExtractLabels if you wanted them on their own first

tiny zealot
#

alt alt alt CodeMatcher.Labels

uncut viper
#

ive had weird issues trying to work with the labels directly before for reasons i cant remember so i just try to avoid working with them directly as much as possible personally

tiny zealot
#

i'm going with MoveLabelsFrom for now. i broke it but it's progress. thanks!

lucid iron
#

I never figured out how to move labels so i been doing it like, overwrite the original instruction, insert the original instruction later

tiny zealot
#

my repeat incantation looks like this now:

            .Repeat(matchAction: m => {
                CodeInstruction c = new(OpCodes.Call, countcall);
                c.MoveLabelsFrom(m.Instruction);
                m.RemoveInstructions(3);
                m.InsertAndAdvance(c);```
#

i'm sort of cheating because i know it's the first instruction that has the label, but also sort of not cheating because this match is one line of C# so where else would the label be

#

(the repeat also looked like that when "i broke it", but i reloaded everything and it's working, so: shrugemoji good job everyone)

#

also i am on Team CodeMatcher now. it's much nicer than doing all the stuff manually.
if i ever need to rewrite my existing transpilers i'll convert them over

uncut viper
#

codematcher my beloved

calm nebula
#

CodeMatcher my behated

#

(Of course an atra prefers their own ilhelper but I can't use it anymore unless i revive atracore which isn't happening

valid folio
#

Hi, could you help guide me? I've already designed the machine, but I need to know if this is the correct information for adding new machines. Also, would you recommend looking at a mod that integrates machines, like the Cornucopia or Wildflour Artisan Goods mods? I think those mods use special frameworks for certain functions, right? I'd also like to make the machine compatible with Automate.

https://stardewvalleywiki.com/Modding:Machines

Stardew Valley Wiki

← Index

brittle pasture
#

yea that page is correct. you can also reference vanilla machines via unpacking

#

for automate compat, you don't need to do anything

#

you only have to worry about that if you're making entirely custom behaviors in C#

torpid sparrow
#

Anyone remember the console command to reload a mod? I forgor

steel plaza
#

what does this mean?

#

is it like per pixel?

urban patrol
torpid sparrow
#

thank you

steel plaza
brittle ledge
#

!reload

ocean sailBOT
#
How do I reload my changes while I'm still in game?
  • Content Patcher pack: enter patch reload <your_mod_id> in the SMAPI console window. This will reload and reapply all your patches (but won't recalculate the ConfigSchema or DynamicToken sections if you use them).
  • Translation files: enter reload_i18n in the SMAPI console window. If it's for a Content Patcher pack, also run patch reload afterwards.
  • C#: see the Visual Studio hot reload or Rider hot reload feature.
torpid sparrow
#

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

brittle pasture
brave plinth
valid folio
lucid iron
#

PFM: pre 1.6 framework for machines, not needed anymore but still works
EMC: post 1.6 framework for extra features
Cauldron: a config mod for wildflour and hime's mods, you probably don't want that

crude plank
#

you probably don't want that
unless you're by any chance wildflour or hime, of course

lucid iron
#

I think cauldron does have some frameworky bits but it's not all that documented

valid folio
valid folio
lucid iron
#

Usually stuff like extra fuels and outputs

#

I recommend not worrying about this and getting a vanilla machine setup first

#

Then you can look at EMC features and see if you need anything

calm nebula
#

Start with simple and get fancy from thereeeee

#

Also enjoy SDVpufferheart

faint ingot
#

so I tried to create some custom boots via content patcher and have them provide extra defense when worn in a certain location... however it seems to only apply when I spawn the boots while in that location, instead of wear them at that location. Is there a way to do what I want to do or am I out of luck?

valid folio
valid folio
calm nebula
#

Maybe spacecore equipment actually

#

Not sure

#

(That's actually a case I have in atracore equips but I killed that lol)

faint ingot
#

Could I do it via a ring instead of boots since those are in data/objects?

calm nebula
#

Nope

faint ingot
#

OK thanks

lucid iron
valid folio
lucid iron
#

Custom flavored items ✅
Have a machine consume one kind of fuel ✅
Have different recipes on the same machine consume different fuel ❌ need EMC

#

To do modded flavored items you need to use PreserveId

gaunt orbit
#

okay, interesting. apparently cellars are created when a save is loaded, even if they don't have a corresponding cabin yet. they're not assigned, though, until a farmhand actually joins. after a cabin is built but before it gets taken, it actually has no cellar because it has no owner

hard fern
#

Wow that is interesting

glossy cargo
#

After over two years, I made my original meme into reality

#

And another one I've been working on

glossy cargo
#

(And yes, it does work 😄 )

uncut fossil
#

Hi so I'm creating a New NPC but I miss a point while looking the guides available on stardew modding wiki and the stardew vaalley wiki : I'm making my "content.json" file and I'm trying to do the "disposition" part. They say I should add this code Inbetween my [brackets] : // NPC Disposition - updated for 1.6
{
"LogName": "Jorts and Jean exist!",
"Action": "Include",
"FromFile": "assets/data/dispos.json"
},

#

so I guess I should write this code into the content.json file

#

but then

#

they say : Now we're going to create a new file that matches the FromFile name. I'm going to use Wren as an example here

#

with the code where you have to write the Display Name, Gender, Birthday.....

#

what I don't understand is where should I write this ? Is it still a .json file ? Why is it indicated FromFile : assets/data/dispos.json ? I don't understand because I thought that the dispos.json had to include the scheduling part

#

anyway I'm stuck I don't understand a thing about this part

#

and when I download a NCP from nexus as an exemple I don't see a file where there is everything about the gender, birthday and all

#

please I'm so lost it's my first time codding SDVpuffersob

hallow prism
#

it's ok! you learn stuff and npc CAN be overwhelming at first

#

have you unpacked vanilla files?

#

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

ornate trellis
# uncut fossil what I don't understand is where should I write this ? Is it still a .json file ...

you see what the FromFile says in the example, right? the last part is what you name your file(or the other way around, doesnt matter as long as it matches)
Technically speaking you can write everything in your content json. it will jsut be hell to find stuff in the long run if its a lot.
people therefore tend to make jsons to have more overview and sort different parts. for smapi to register those files you need to include them with that code above tho

#

when you use an npc from someone else as an example the way things are done can vary as its really personal taste on how to sort things and stuff

uncut fossil
ornate trellis
#

you dont need to but its always better to be able to see how vanilla did it

hallow prism
#

it's ok 🙂 it is very useful because you'll see how the vanilla files are done.
NOTE : the format is slightly different than CP (basically CP needs some extra context) but not too much

#

and it'll help figuring out structure of the data

uncut fossil
faint ingot
ornate trellis
#

oh yeah i mean just look at my own includes lmao, go wild

uncut fossil
#

notted ! thank you !! I'm going to see the vanilla files

#

haha I see

brittle ledge
#

You're also welcome to reference and/or borrow code from Jorts and Jean (just change the content kyuuchan_nod2 )

#

You can also look at Wren but uh I don't really recommend her for a first timer because she's got a lot going on in her tokens

uncut fossil
#

haha yes I was looking for Jorts and Jean while trying to code my NPC

brittle ledge
#

also @next quarry you're hotmodding! SDVpufferheart

sour sleet
#

Any ideas why my patch isn't applying on the days it should be? { "Action": "EditMap", "Target": "Maps/8BitAlien.Lilybrook_Park", "FromFile": "assets/Maps/ParkMTF.tmx", "PatchMode": "Replace", "When": { "DayOfWeek": "Monday, Tuesday, Friday" }, "FromArea": { "X": 0, "Y": 0, "Width": 114, "Height": 106 }, "ToArea": { "X": 113, "Y": 105, "Width": 114, "Height": 106 } },

#

It needs to be the whole map btw

latent mauve
sour sleet
#

Will do that now, thanks!

#

Ok, it's saying it's applied. Why aren't my changes showing up then lol

latent mauve
#

are there any other changes being applied to the same map?

sour sleet
#

I have a separate EditMap action for the same map but no other patches

latent mauve
#

If for some reason this patch is happening too early, then the other EditMap action might be overriding it

#

you can add "Priority": "Late" to the patch you want to load last and see if that helps.

sour sleet
#

Sadly that didn’t work:(

brittle ledge
#

people who know performance stuff: is it better to Editmap an entire large map or just load a fresh one? I seem to recall EditMap being expensive?

lucid iron
#

EditMap is expensive but largely invisible if you don't do time changed

latent mauve
sour sleet
#

No errors at all, just zero changes

lucid iron
#

and many times you can't really avoid editmap for compat reasons

latent mauve
sour sleet
#

Oh I didn’t know they were optional fields. I’ll remove em now

#

Yesssss

#

Thank you!

latent mauve
#

Yeah, it looked like your ToArea was placing your patch outside the boundaries of the original map. 😛

#

FromArea and ToArea are more commonly used when you have a TMX that's a single section of your map and is smaller than the map you are patching it on to

#

So you can have a TMX that's just a single building, for instance, and use ToArea to position it on your bigger map

uncut fossil
#

Hi (again haha) So I looked the Shiko NPC mod's files as an exemple to code my own and I don't understand why there's the target : "Target": "Data/NPCDispositions" but there's no "Data" file and no "NPCDispositions" files ???? is it normal ?

uncut viper
#

because its an old mod

#

Data/NPCDispositions doesnt exist in 1.6 and was replaced with Data/Characters

#

i would recommend looking at a newer NPC as example or using the NPC guide in the npc command

#

!npc

ocean sailBOT
#
Creating a Custom NPC

Keep in mind that making NPCs is a complex process that requires learning many different aspects of Stardew modding.
Here are a few links that can help get you started on all that you need to know:

uncut fossil
#

okk but what does it change ? do I need to create Data/Character files in my mod's folder in order to Target this location ?

#

I saw the stardew modding wiki but still struggle to understand where you're supposed to place the Data/Character

latent mauve
#

Shiko is not updated to 1.6, definitely don't use it as an example

#

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

latent mauve
#

Use that to unpack the game files and take a look at the vanilla Data/Characters.json.

uncut fossil
#

I also looked at the vanilla files but still struggle to understand 😦

lucid iron
#

Maybe look at some 1.6 npc instead

latent mauve
#

Well, with the combination of the vanilla files and the wiki [[Modding:NPC_data]] page, you should be able to figure out what you're looking at

latent mauve
#

Brand new NPCs just need their own entry added to that same JSON, which you can do with an EditData patch in Content Patcher, with Data/Characters as the target.

uncut fossil
ornate trellis
#

there is

uncut fossil
#

i found it thanks !

ornate trellis
#

tia said you can look at jean and jorts earlier, why is do i see the mention of shiko suddenly O:

latent mauve
#

Seems like a lot of people try to update Shiko themselves for personal use, it's not the first time someone's come in trying to build based off Shiko.

#

Despite Shiko being way out of date and thus, a bad example

uncut fossil
#

I have to directly add my new NPC in the character.json file of the game or I have to create a new character file ? I know it takes time for me to understand haha thank you so much for your responses

lucid iron
#

Have you read the documentation on content patcher?

ornate trellis
#

you make a json like the include example you mentioned earlier and in there you put your own filled out version for your npc

#

chu, theyre also looking at tias tutorial btw

latent mauve
ornate trellis
#

idk how to describe things well especially not as good as tia already does in that tut xD

latent mauve
#

So, your files are in your mods folder, and the actions tell Content Patcher where to add it in the base game file structure.

uncut fossil
# lucid iron Have you read the documentation on content patcher?

I downloaded Content patcher but I don't understand yet how I can use it lol Do I have to open the game while the Content patcher file is in the mood folder of the game ? I guess I will start looking at the documentation as you said, I don't know why I didn't do that earlier hahaha

pine elbow
lucid iron
uncut fossil
#

yeah but I thougt it was different with the Content Patcher

#

I'm looking through the patcher documentation it's already more clear for me lol

#

I was initially only looking at the Making a Custom NPC Tutorial on the modders wiki page without looking in details other ressources...

hard fern
#

Yeah, a lot of NPC making requires prior knowledge of how content patcher works

faint ingot
#

Is there a way to grab a custom player_stat value and put it in a content patcher token?

lucid iron
#

yes but need mod (EMP should have it)

brittle pasture
#

also consider setting a mail flag based on player_stat and use that instead

lucid iron
#

depends on what you want out of this basically, if all u need is stat > a number i vote for mailflag

faint ingot
#

OK, thank you. Actually now that I think about it I can get around the requirement.

#

what I want to do is... there is an item, and when I enter a certain location, the item is consumed. You then gain a buff based on the number of times you've ever consumed that item

#

I was hoping to do it with one trigger action or so but I think I can just create a group of them

lucid iron
#

yea so u either need the actual count to use with query

#

or u do a bunch of trigger actions and "upgrade" the buff every X number of times u ate the thing

faint ingot
#
                    "Id": "{{ModId}}_Triggers_AddGhostwoodPendantBuff",
                    "Trigger": "LocationChanged",
                    "Condition": "PLAYER_STAT current {{ModId}}_GhostwoodPendantsConsumed 1 1, LOCATION_HAS_CUSTOM_FIELD here {{ModId}}_isghostwood",
                    "Actions": [
                        "AddBuff {{ModId}}_GhostwoodPendantBuff1",
                    ],
                    "MarkActionApplied":false,
                },```
lucid iron
#

if u want to do it in 1 trigger action entry

#

you can use If

faint ingot
#

if there's a better way let me know but i don't mind creating a few of these. It's a difficult item to make so I don't anticipate having to make the ceiling very high

lucid iron
#

If PLAYER_STAT current {{ModId}}_GhostwoodPendantsConsumed 1 1, LOCATION_HAS_CUSTOM_FIELD here {{ModId}}_isghostwood ## AddBuff {{ModId}}_GhostwoodPendantBuff1

faint ingot
#

oh gotcha that does seem better

#

I'll play with that thank you

lucid iron
#

this does mean u parse all the GSQ every time tho

#

if u did it in multiple trigger actions u can use SkipPermanentlyCondition Dokkan

#

and its not that hard to do cus local tokens

uncut fossil
brittle pasture
#

just CP

uncut fossil
#

okk thx !!

cedar turtle
#

JA is dead. And I don't think you really need the others anymore either?

calm nebula
#

What is Schedule Editor anyways

lucid mulch
#

custom npc fixes was questionable if it was needed even in 1.5.6, and I also don't recognise Custom NPC Exports

brittle pasture
#

I think they meant Exclusions

lucid mulch
#

if it was exclusions, then cp can pretty much do all of it now

gaunt orbit
#

Is there an easy way to determine if a given texture is "fresh" or not? ie. detect if it's been invalidated without using the asset events

lucid mulch
#

textures never get invalidated

#

the 'replacement' load will copy its contents into the old texture2d reference

gaunt orbit
#

Aaaah interesting

calm nebula
#

(This is new to 1.6)

gaunt orbit
#

So the answer is "no, but I don't need to anyways"

calm nebula
#

It's to simplify asset propagation

lucid mulch
#

was it?

gaunt orbit
#

Yeah it makes a lot of things less complicated

calm nebula
#

Although it's kinda weird tbh because have fun if some asshole disposes a texture

calm nebula
gaunt orbit
#

So then what happens if you use InvalidateAsset on a texture? Does it immediately reload it?

lucid mulch
#

in a temporary content manager with cache disabled

calm nebula
gaunt orbit
#

Hmmmm good to keep in mind for optimization

lucid mulch
#

the corner case for it, is localization and if the image no longer exists in the asset pipeline

gaunt orbit
#

Well I asked because usually invalidating an asset does not necessarily mean it is immediately reloaded

calm nebula
#

It does mean that there is no point tracking asset invalidation for textures

lucid mulch
#

anything that is a Texture2D will get propagated and a load attempted on it

calm nebula
#

Yesh.

#

I have a lot of code to unwind tbh

lucid mulch
#

which is different from regular propagation where only vanilla stuff got propagated into a reload

gaunt orbit
#

Yeah

calm nebula
#

The other thing is that you basically cannot unload a texture from memory anymore

lucid iron
#

what is the problem you want to solve

calm nebula
#

Once it's there it is stuck

#

I ran into this when I was looking for the memory leak tbh

gaunt orbit
#

I have a custom object type and I want to cache textures on it (because duh) and I wanted to avoid event listeners for gc reasons

calm nebula
#

You don't have to but in the past I had an Asset Wrapper to do that

#

One second

gaunt orbit
#

Yeah that was going to be my approach, but it seems I don't need it!

lucid mulch
#

hmm yeah you can get ghost assets in the pipeline now if the new world didn't want to load it, the old version will just live there

calm nebula
#

This is now completely useless and don't do this

lucid mulch
calm nebula
#

Yeah I figured refactoring to add one level of indirection is a problem

#

It's hard because nothing can update the reference

#

I think if I was writing de novo I would have preferred the wrapper

gaunt orbit
#

Yeah

calm nebula
#

But understandable that too much refactor

#

Maybe for stardew 2.0 jkjk

gaunt orbit
#

I actually wrote a wrapper thing like that for a non-mod project to reduce dictionary lookups

lucid mulch
#

there's probably smarter ways within monogame to do it, but that requires actually learning xna

calm nebula
#

I doubt it tbh

gaunt orbit
#

I mean you don't have to use the pipeline

calm nebula
#

Indirection us just one extra pointer

gaunt orbit
#

You could theoretically just make your own custom asset system that bypasses it entirely

calm nebula
#

How much could one pointer cost anyways, ten dollars

lucid mulch
#

loading from mod content still doesn't cache* so you would still need to do the asset reference swapping yourself

calm nebula
#

Hi esca! Long time no see

royal stump
#

hi atra SDVpufferchickmorning been around but barely ever talking

valid folio
lucid mulch
#

it is kinda cute how many mods still refer to it as a disposition

calm nebula
#

Anyways, esca, working on anything interesting?

royal stump
#

right now somebody sent a russian i18n for Destroyable Bushes, so that SDVkrobusgiggle
other than that I've been on hiatus for ~a while~, but I still mean to add basic FTM trigger stuff eventually

calm nebula
#

Hiatus is fun!

#

That's all I do these days SDVkrobusgiggle

royal stump
#

SDVpuffersquee similar but I keep telling myself to exercise instead of that part

#

also tempted to add a GSQ tile property for whether people can cut a bush down, now that I'm staring at code again
probably a bit pointless, though

calm nebula
#

(And yes that's not a typo there are two workouts per day. One js strength, the other cardio)

royal stump
#

(more appropriate for FTM, but then I'd be adding a bunch of patches)

sour sleet
#

What is blank.json used for?

lucid mulch
#

edits only happen if a load happens, and CP loads don't get to use the rich language of tokens

sour sleet
#

What are the use cases for this? Wondering if I will need to use it

lucid mulch
#

want to have your events for a custom location be in editdata, but no one else has done a load on Data/Events/{{ModId}}_MyAwesomeLocation, you do a load on Data/Events/{{ModId}}_MyAwesomeLocation with an empty object so the editdata can insert events

sour sleet
#

By noone else, do you mean another modder or another NPC in my mod?

lucid mulch
#

no one else being no other mods (or vanilla)

sour sleet
#

Ah ok, do you think I will be ok with not loading a blank json?

lucid mulch
#

your npc's aren't sentient and aren't controlling loads in the asset pipeline

#

If you have an EditData targeting an asset like Data/Events/{{ModId}}_MyAwesomeLocation but don't have a Load for the same asset, your EditData wont happen

sour sleet
#

Ahh ok gotcha - thanks for the help SDVpufferthumbsup

vernal crest
#

If you plan to use i18n you will need to use a blank json for your dialogue too so CP can convert the i18n tokens to actual text.

sour sleet
vernal crest
# sour sleet Ohhh, thank you for telling me this. I am using i18n

Glad I mentioned it lol. Yeah anything where your data is going to contain a token of any kind (including i18n) needs to be done through an EditData patch so CP can convert the token. In cases like dialogue or schedule or an event in your custom location where the asset is specific to your character/mod and doesn't exist until you make it (as opposed to something like Data/Characters that already exists in vanilla and you just add your bit into it) you have to make sure there's an asset to edit and that's where the blank load comes in.

sour sleet
lucid mulch
#

I do want to add a LoadData action which is EditData but runs on a load instead and would remove blank.json.
but iirc last time it was brought up, it felt like it would add more complexity than it would be solving

calm nebula
#

I'll be glad when all major assets are delocalized

#

Tbh.

#

Yay delocalized events!

lucid mulch
#

delocalized events are just vanilla using the tokenized text

calm nebula
#

Yes!

#

It's wonderful

lucid mulch
#

which was already doable in 1.6 anyway iirc, but mods already ignore tokenized text where possible in favor of smapi's i18n

calm nebula
#

now will vanilla get a data model for furniture

lucid mulch
#

only time mods go near tokenized text is when values being baked into the save are present

calm nebula
#

I wish letters can use tokenizable strings SDVpufferheart

latent mauve
#

I ran into a few use cases where tokenizable strings don't work when I was testing out using localized strings for NPC names (in the case of renames of vanilla NPCs). D:

lucid mulch
#

this was my old list, though I think its out of date partially

#

ObjectContextTags I think died and got moved into Objects, but the rest I think are still correct

calm nebula
#

Sooner or later models take over

#

Exciting!

lucid mulch
#

ironically enough this list didn't have events in it, was only worrying about top level data assets

calm nebula
#

Tbh events...

#

The long standing issue was that translators would fuck up events

#

And softlock the game

#

I definitely recall finding a case of that in German

lucid mulch
#

a localized asset would fuck up events being a list or slash delimitted regardless

latent mauve
#

I also did a silly and tried to put a localized text string into Strings, which... doesn't work for what should probably be obvious reasons.

#

Tried to edit dialogue in Strings/1_6_Strings to use localized text from Strings/NPCNames, it did nothing. Presumably because they're both in Strings, based on what I was told at the time. LOL

lucid mulch
#

I personally want achievements and SecretNotes done purely so everything is either slash seperated or a model

#

those alternate character seperated assets are annoying

latent mauve
#

I'm just happy we can (AFAIK) put parts of events on new lines now to make them easier to read.

lucid mulch
#

only if you are okay with any json spec compliant editor yelling at you

latent mauve
#

It's gonna yell at me for comments anyway, let it yell

calm nebula
#

I'm hoping quests get the datamodel

#

And furniture

brave fable
#

furniture would be pretty fantastic, there's so many hardcoded rules and behaviours for each type that could be ironed out and made explicit

#

it'd be great to have rotations changed into something more generic

lucid mulch
#

past me's tier list back in 2023

  1. Item type definitions (Boots/Hats/Furniture)
  2. Monsters
  3. Recipes (CookingRecipes/CraftingRecipes)
  4. Fish/AquariumFish
  5. Bundles
  6. Achievements/SecretNotes (requires id conversion for full impact)
  7. Quests
  8. NPCGiftTastes
  9. animationDescriptions
  10. HairData (requires id conversion for full impact)
  11. ChairTiles/PaintData/ObjectContextTags (better to just be on Data/Objects)
lucid iron
#

Pls

#

I think anim desc and schedule being merged would be nice

brave fable
#

bundles...

calm nebula
#

I would love a schedule model

lucid iron
#

Clothing and hair have issues beyond just hardcoding tho

#

Their bounds r fixed

lucid mulch
#

a central Data/Schedules, thats keyed on npc and is a ordered list of data models with priority and GSQ conditions that control, that then has its tickertape of rules

latent mauve
#

I know HairData using strings instead of integers for keys got added onto the suggestions list.

#

I asked Pathos to add it to the wishlist a while back and he said yes, LOL.

lucid mulch
#

the archived 1.6 modding alpha trello has a bunch of nice stuff in it that we didn't get to

calm nebula
#

Poor pathos

#

He gives an inch, modders ask for a mile

#

I always imagine him going "what now?"

#

Insert "is it in scope" meme

vernal crest
lucid mulch
#

I do agree that if vanilla is going to have it, there needs to be a case that vanilla uses it

#

but the window of stuff that can still satisfy that requirements huge

lucid iron
#

There's a few not used by vanilla features i think

calm nebula
#

(Up to him. These days I try to avoid being annoying)

latent mauve
#

Honestly, I feel like strings for keys is a need as far as modding support, but not necessarily for vanilla.

#

Because we can work around it, it's just a "how big of a number can I do before I overlap someone else"

lucid mulch
#

vanilla still semi uses that.
stuff that would be out of scope would be new buff types to change stats that no vanilla item has

calm nebula
#

I forgot about bushes

lucid mulch
#

and 1.6 content update did make use of the string id's

lucid iron
#

MossSoup my beloved

lucid mulch
#

deduplicating _newDayAfterFade, the save creation and save load process would be a royal pain in the ass, but once its done it would be amazing

lucid iron
#

What's the problem with new day after fade?

lucid mulch
#

there are a lot of quirks with logic that runs on night vs what happens on save load

#

pretty much the code that runs when you sleep overnight and wake up, is completely different from the logic for loading the save (and to a lesser extent creating the save)

lucid iron
#

Interest

#

Does shipping bin happen when u sleep b4 save or after

royal stump
#

it's why using CP When edits to change island schedules doesn't work right without Exclusions, you get different token states & update timing based on load-vs-sleep SDVpufferdizzy

lucid mulch
#

shipping bin is before save

#

Some night logic is fine and belongs there, but there's logic that runs after the save, but before waking up

#

a vanilla example is that iirc you cant load a save into a wedding

#

iirc 1.6 partially fixes that by detecting this and postponing the wedding

rigid oriole
#

Hey that happened to me yesterday

trim sand
#

So, im running into a weird problem of a modded item's ID/fieldname for Content Patcher purposes to not match what the console refers to it as when spawning it in.
the mod doesn't use content patcher despite adding an item, all im trying to do is assign the "Fine Grapes" added by Forage Fantasy the "grape_item" context tag (private thing not intending to share.). but logs keep saying its not a valid target despite using the name as the console referred it to. i don't know a whole lot about the C# side of modding or what that looks like. just curious if anybody might have any idea whats going on. the secrets of the DLL are closed to me.

brittle pasture
#

confirm that you got the item name right with patch export Data/Objects

lucid iron
#

All objects have an id

trim sand
#

I'm aware of that much it's just weird it's not matching

lucid iron
#

You can turn on datamining fields with lookup anything to see it

#

Patch export also good as selph mentioned

trim sand
#

oh that's, actually really smart. Since it was lookup anything that I confirmed the tag was missing and the dev manually readded the grape to rasin dehydrator recipe

lucid iron
#

Another thing is that the data may not be edited in all the time

#

Though usually it's content patcher that can lead to this behavior due to how tokens work

trim sand
#

honestly i only jumped to asking here because i can't just look in the guts of what theyve done to see why im wrong

lucid iron
#

But you can yggy

#

Patch export gives u something akin to unpacking but with mods installed

trim sand
#

thats not the same thing at all. also i wasn't aware of patch export before this conversation

lucid iron
#

The mod is also open source

trim sand
#

oh huh looks like i missed that part

lucid mulch
#

{ForageFantasy.Manifest?.UniqueID}.FineGrape

tiny zealot
#

Grape Logic

trim sand
#

interesting.

#
        {
         "LogName":"Forage Fantasy fine grapes given grape context tag",
         "Action":"EditData",
         "Target":"Data/Objects",
         "TargetField":[
            "Goldenrevolver.ForageFantasy.FineGrape",
            "ContextTags"
         ],
         "Entries":{
            "GrapeItem":"grape_item",
         }
      }

because this is the patch as i have it. which matches the result of adding the manifests unique id + "FineGrape"

lucid iron
#

Hm did u need like grape_item: grape_item here

trim sand
#

i have no idea

fierce vault
#

Hey again! I have a question about map design. If I am making paths on large field with few obstructions, is worth making a pretty winding path when my npc's own pathfinding will likely not use it as intended?

Because I'm not making paths that are the most straightforward way to reach a destination, even if they look like they could make sense and feel natural.

I fear that my npc completely ignoring them will be annoying and possibly defeat their theoretical purpose. What do you all think? Is there a prefered method or solution to this?

lucid mulch
#

that would technically work, but if it already had grape_item it would have it twice, and if it had GrapeItem it would get replaced with grape_item

#

if you just want to ensure grape_item is in there (once), then the key and value should match

trim sand
#

fair enough.

#

Can't apply data patch "Vegas' Item Compatibility Patch > Item Compatibility Patch #10 > Data/WildfloursAtelierGoods.json > Forage Fantasy fine grapes given grape context tag" to Data/Objects: the field 'Goldenrevolver.ForageFantasy.FineGrape' doesn't match an existing target
not that were getting that far. ive just stuffed my stuff into something i already had and attached Forage Fantasy as a mod in its manifest. eventually need to move it to small separate content pack for simplicity.

tiny zealot
calm nebula
#

To be fair that's how paths work irl anyways

tiny zealot
#

otherwise i'd say just do what looks nice

#

(and don't make your map difficult for the player to navigate, if possible)

calm nebula
lucid mulch
fierce vault
#

Pave the cow paths?

tiny zealot
#

same as the thing sinz said. put the paths where the NPCs walk

fierce vault
#

Ah, ok

lucid mulch
#

that being said, it would be interesting to have a mod that tried to more heavily influence the micropathfinding algorithm

#

there is some preference in there for certain tile types, but its fairly weak

lucid iron
#

can u just give them really detailed schedules

trim sand
fierce vault
#

That would result in weird pauses though

tiny zealot
calm nebula
#

Sure

lucid mulch
#

oh yeah ForageFantasy is doing Late priority, so you need to also do late(er) priority to be after it

trim sand
#

oh good catch

lucid mulch
#

"Priority": "Late + 1" should get you what you need, and if you have the mod as a (optional) dependency, then just Late will do it

calm nebula
#

It would be fun if npc scheduling was more dynamic SDVkrobusnaughty

lucid mulch
#

actually I think this is a CP bug

trim sand
#

the assistance is much appreciated even if im sure this is a fairly basic issue that really didn't need it.
oh?

lucid mulch
#

CP's exposed priority system only works within other cp edits, ContentPatcher itself will always do the edit at Default priority

trim sand
#

... whar

calm nebula
#

Huh

lucid mulch
tiny zealot
#

??? CP's patch priority doesn't work? is this recent?

lucid mulch
#

when 99% of asset edits are within content patcher it works fine

lucid iron
#

oh huh

brittle pasture
#

...that explains the fish pond building edit issue

lucid mulch
#

its the few mods total that do asset editing that also play with priority which will cause issues

lucid iron
#

so i didnt need priority.late +100 then

tiny zealot
#

ohhhh, it doesn't work alongside SMAPI edit priorities? that makes more sense

#

still bad, but makes more sense

trim sand
#

truely cursed

lucid iron
#

i understand why this mod wanted Late at least

#

it is look at vanilla grape

trim sand
#

So what I'm getting at is CP edits always fire entirely before smapi edits? Or something

#

At least on the case of if the smapi edit sets a later priority

lucid mulch
#

all CP edits run at the "default" priority.
smapi early edits will run before, smapi late will run after

lucid iron
#

cp sorts edits and then gives them to smapi as Default

#

other smapi mods can give Early or Late or Default (+whatever offset)

trim sand
#

I see.
painpika

lucid mulch
#

this code should be breaking the patch groups out further to also group by priority and letting smapi run them in order

tiny zealot
#

i hate knowing this

lucid mulch
#

cp can (and needs to) still do the internal sort within the same priority to let the existing status quo of ordered patches and dependency tree etc work

trim sand
#

The number of niche bugs I keep running into would be funny if it wasn't frustrating

lucid mulch
#

PR's welcome to ContentPatcher 😛

trim sand
#

I guess we're adding this to the to-do list.

calm nebula
#

Seems fixable

#

We nerdsnipe you, sinz

lucid mulch
#

I still need to get around to finishing my asset pipeline diagram to include invalidation+propagation and how it relates to content patcher

lucid iron
#

do u think there was purpose

tiny zealot
#

it sure looks like it was intentional

lucid mulch
lucid iron
#

well its your job now we believe in you

lucid mulch
trim sand
#

Old legacy code nobody bothered to go back and fix

brittle pasture
#

issue I was referring to - Aquaponics' edits have Late priority, so it always runs after the CP patch here
I can make it run earlier, but that would break fish pondering compat. I guess we can wait for that CP fix nudge wink

lucid iron
#

i can bonk fish pondering to Default tbh LilyDerp

calm nebula
#

I enjoy how everyone is sitting in a circle trying to argue someone else into making a PR

lucid iron
#

and just make it dependent on Content Patcher

#

u could also do 2 edits selph

tiny zealot
lucid iron
#

the second one specifically for size w/ fish pondering

lucid mulch
#

I could fix it, but the bug doesn't bother me enough and isn't performance related 😛

calm nebula
#

I'm retired, remember

tiny zealot
#

hell, maybe i'll do the PR. this bug is showstopper-level from my perspective

calm nebula
#

Yesss SDVpufferheart

brittle pasture
calm nebula
#

I need to wash the chlorine out of my hair

lucid mulch
#

but yeah the fix can be quite simple, within SortAndGroupEditPatches, its already ordered by priority, just need to breakout into more groups when priority changes, and in the linked code earlier use the first patch in the groups priority instead of default

lucid iron
#

gang how bad would it be if, instead of actual custom asset, i make people encode TV bounds as a context tag

trim sand
#

I think, in think I don't wanna dive into content patcher PRs tonight. I'll just live with the fact that if I want to grow grapes for Wildflour's Atelier purposes I have to use Cornucopias White Grapes.

tender bloom
lucid iron
#

then its not a custom tv

lucid mulch
#

even if the PR was made tonight, it likely wont ship to users until later in the month

trim sand
#

This is also true

lucid mulch
#

Pathos does his mod updates in waves so he can do his day job and vanilla work

tiny zealot
#

(i'm too slow to do it tonight, so if anyone is fast feel free to cut me off)

lucid iron
#

calcifer_tv_24x-64

lucid mulch
#

any reason why a context tag and not just CustomFields?

trim sand
#

Reasonable enough.
Honestly I'm just generally upset at the issue.
But not enough to do it myself.

brittle pasture
#

hey scarecrow size is a context tag, there's precedence

lucid iron
#

its furniture do they have those

lucid mulch
#

does furniture have context tags?

lucid iron
#

yea they do

#

final field space delim

tender bloom
#

Surely _24_64 is more readable

lucid iron
#

its negative 64

tender bloom
#

Ohhh

#

Hmm

#

_24_-64?

lucid iron
#

^calcifer_tv_(-?\d+)x(-?\d+)$

#

it doesnt rly matter what the middle thing is

tender bloom
#

I just feel like x here is a bit weird

#

Since it’s a letter

#

Not the most rational feeling

calm nebula
#

But it's the classical multiplication letter

lucid iron
#

yea

tender bloom
#

Yes but I don’t like that either

calm nebula
#

Heyyyyyy

#

Compromise

tender bloom
#

It’s properly its own character

lucid iron
#

i dont want to use _ cus that isnt the only instance of it

calm nebula
#

^calcifer_tv_(-?\d+)×(-?\d+)$

tender bloom
#

X has tweedly bits in some fonts that don’t belong in multiplication

lucid mulch
#

lucid iron
#

^calcifer_tv_(-?\d+).(-?\d+)$

#

terror

lucid mulch
#

make anyone writing the context tag need to copy paste the esoteric unicode character

calm nebula
#

^calcifer_tv_(-?\d+)♤(-?\d+)$

tender bloom
#

It would make me feel better if it was _24x_-64y tbh

lucid iron
#

^calcifer_tv_x(-?\d+)y(-?\d+)$

tender bloom
#

Then at least the x is labeling an x axis

calm nebula
#

Don't forget scale which is a float

tender bloom
#

Feel free to ignore all of this, this is largely me being pedantic about multiplication signs 😛

lucid mulch
#

this should be a dot product right

calm nebula
#

No

#

That's two vectors

lucid iron
#

actually i should just let ppl put whole thing right

#

^calcifer_tv_x(-?\d+)y(-?\d+)w(-?\d+)h(-?\d+)$