#making-mods-general

1 messages · Page 16 of 1

lone ice
#

I guess I'll reinstall VS and make sure I have the right packages installed

ashen oak
#

I guess the best way to be sure of what's going on is to verify that the function is being inlined

teal bridge
#

Got it. Seems like we've ruled out everything that I've ever experienced, I'm honestly not sure why that analyzer would be loaded, and apparently able to run, but not actually run or produce any output.

ashen oak
ashen oak
frosty hull
#

on XmlSerializer 2.0.5.0 xamarin android
i see Save Game Logic it's use SaveGameSerialier.cs pregenerate logic file
so is mean "ImportClassMapping" method will not be called from certain classes, such as "Farmer" and "SaveGame"

next plaza
frosty hull
#

i test with print class type at Prefix ImportClassMapping and i find word in Console such as class "Farmer" & "SaveGame"
is not found

#

i will test with fake has Mod PyTk, one moment..

frosty hull
#

ok i create SaveGame.serializer & farmSerializer with new XmlSerialzer(baseType, extraTypes);
it's work fine, but not all some class, such as "FarmerTeam"

next plaza
#

FarmerTeam isn't serialized, I mentioned that before

frosty hull
#

i will try fix bug & update again, thanks you so much

next plaza
#

Like, the game doesn't serialize it, it isn't a spacecore bug

vestal gorge
#

Hello cool people! I'm curious, is there any way to make festival dialogue and/or resort dialog dependent on friendship level? I'm writing some "rival heart events" for my two OCs I'm modding into the game, and once the player has seen their 8 heart rival event I want them to reference their relationship at festivals/the resort, but I'm not sure if that's possible so I thought I'd ask ^^
Edit: if it's not possible via content patcher, but requires C# or whatever the coding language is, then I give up because I'm not that invested in the idea lol

vernal crest
#

Yup, it's possible to do several different ways without C#

vestal gorge
vernal crest
#

One way is this: $query PLAYER_HEARTS <player> <npc> <min hearts>#<if true>|<if false>. You'd put that inside the dialogue key itself. Another way is to replace the dialogue key entirely with a CP "When" field.

#

Replacing the dialogue key entirely could look like this:

{
    "LogName": "Add questions to Alex",
    "Action": "EditData",
    "Target": "Characters/Dialogue/Alex",
    "When": {
        "Hearts:Alex": "{{Range: 8, 14}}"
    },
    "Entries": {
        "Resort": "{{i18n: Alex.resort.8hearts}}",
    }
},
#

You could probably also use CP tokens inside the dialogue line so it formed a different i18n key depending on heart level as well.

vestal gorge
#

I really appreciate it! I took screenshots of your advice for when I get to writing that point in the mod, and if I think of other questions I'll come back here! Thanks again!

vernal crest
#

No problem :) Let me know if you would like more guidance with how to use them or anything.

spice inlet
#

did you check machine data?

grizzled rain
unreal spoke
#

If you’re making the mod for 1.6, I’d strongly recommend using CP instead of PFM. That’s what the comment was about – checking the way vanilla does things so you can replicate them with CP.

spice inlet
#

Id expect that all you'd have to do is patch the output rules of the furnace & heavy furnace for fire quartz using CP

grizzled rain
inland cedar
#

shop and shop stock in StardewValley.DataLoader.Shops(Game1.content) should be auto synced in multiplayer isn't it?

next plaza
#

No

#

There is some sort of syncing for shop stock, but the data files are not synced

#

(For shop synced stock I think you have to specifically enable it somewhere... not 100% sure though)

inland cedar
#

yeah seem like it is not for my shop

rancid temple
#

Only thing I can think of that's synced is if you set a global stock limit

lucid iron
#

i am try to build someone else's mod (OrnithologistsGuild), is it normal to include other mods like this?

<ItemGroup>
  <Reference Include="ContentPatcher" Private="False">
    <HintPath>lib\ContentPatcher.dll</HintPath>
  </Reference>
  <Reference Include="MailFrameworkMod">
    <HintPath>lib\MailFrameworkMod.dll</HintPath>
    <Private>False</Private>
  </Reference>
</ItemGroup>
next plaza
#

Most people use $(GamePath) for that, maybe they weren't aware of it

lucid iron
#

ah but it is ok to include dll reference like this right bolbthinking

#

i havent needed to do anything like this since i thought we r meant to use mod provided api via pintail and such

teal bridge
#

I do it for the radial menu with GMCM because I'm using publicizer and have to use its types directly.

#

It's not normal, though.

brittle pasture
#

references are more convenient if you're adding a hard dependency anyway

next plaza
#

Hard references aren't unusual for features that don't go through the API (like SpaceCore's Skill system which predated Pintail)

teal bridge
#

Yeah, you normally should go through the API because the API is ideally fairly stable across versions, while nothing else in the assembly is guaranteed to be. But not every situation is the same.

#

<Private>false</Private> means the dependent assembly doesn't get deployed with the mod, which is key, so that SMAPI doesn't try to load multiple versions of it.

lucid iron
#

atm i only know that not having birb mod makes the special order work again

#

nop not that one think

calm nebula
#

Agh partial classessss

#

Hate them

#

But seriously why all these patches when you can just set QuestItem or SpecialItem smh

lucid iron
#

do you think it's 1.5 thing?

calm nebula
#

So I personally tested every single special order in 1.6

#

So I'm 50% sure it's not a base game bug

lucid iron
#

oh yes it is definitely some mod that is exploding the populate context tag thing

calm nebula
#

Can you harmony summary to check for patches on context tag generation

lucid iron
#

yea i did, it's only selph's and that one is fine

#

im 100% sure about ornithologist guild causing the problem, since as soon as i remove it the donate works as expected

#

and it is one of the object patches in there

#

ok so it seems to be the maximumStackSize_Postfix patch

lucid iron
#

there is prob a C# equiv of traceback but i just make the postfix throw exception when it cant find the tag LilyDerp

#

i guess QuestContainerMenu casted it to Item so it missed out on Object._PopulateContextTags

#

normally this doesn't happen cus vanilla never call Item.HasContextTag and thus trigger generation of context tag here

#

what's a better way to achieve cannot stack for Object, besides making it a Tool

next plaza
brittle pasture
next plaza
lucid iron
#

i guess it's kind of a vanilla bug? if vanilla were to use context tag to determine max stack size the behavior would be the same

#

but its prob specific to QuestContainerMenu too blobcatgooglyblep

calm nebula
#

I would say that is an harmony issue

lucid iron
#

oh but it is work if i yeet the max stack check based on context tags

#

while keeping the patch

#

this IsBinoculars extension

public static bool IsBinoculars(this Object maybeBinoculars) => maybeBinoculars.HasContextTag(BinocularsProperties.CONTEXT_TAG);
calm nebula
#

This is the weirdest

brittle pasture
#

if I'm not in such a comfy bed I'd try looking into this too lol, this bug is wack

#

but kudos to chue for finding it! I have remembered complaints about the potato juice quest not working in the past before, and this might be the cause

calm nebula
lucid iron
#

do you think it'd work if it was a transpiler KasumiDerp

teal bridge
#

Is the issue that the context tag really is not there, or it is there but the extension is failing to find it?

#

I don't even see where the context tag is supposed to get added. I guess as part of the CP side of the mod?

calm nebula
#

Remind me in 36 hours to poke this

patent lanceBOT
#

for a moment there I was gonna say no, absolutely not. but atravita? yeah, yeah i will. (#6211354) (36h | <t:1725100855>)

teal bridge
#

Looking at the trace I wonder if there's an ordering issue. Does maxStackSize() need to get called before CP/game has a chance to populate the context tags?

#

GetOneCopyFrom does not copy context tags, either.

#

Wait, never mind that, you already were looking in PopulateContextTags. But where are the CP context tags supposed to get added in?

lucid iron
#

the context tag being checked for is preserve_sheet_index_192, it's generated by Object._PopulateContextTags

teal bridge
#

Eh? No it's not, it's "Ivy_OrnithologistsGuild_Binoculars"

lucid iron
#

for whatever reason checking (and thus triggering populate) in this max stack size check cause it to not call Object._PopulateContextTags, only Item._PopulateContextTags

lucid iron
#

checking for the binocular tag is just what leads to tags being populated wrong

#

when the quest is bugged, you can put in the juice once but it won't complete quest

#

after taking the juice out from the chest it can no longer be put inside again, since it doesn't have required preserve_sheet_index_192 anymore

teal bridge
#

So you put in a breakpoint and saw that none of the object context tags are there? Nor the one that the mod's CP is supposed to add?

lucid iron
#

this isnt item from ornithologist's guild, it's just potato juice

teal bridge
#

I know, but I'm wondering what happens if you spawn the OG item, does it have OG's context tags like it's supposed to?

lucid iron
#

yea spawning it is fine

#

after making the item (spawn or keg)

id_(o)350, id_o_350, color_green, drink_item, juice_item, use_reverse_name_for_sorting, item_juice, item_type_basic, category_artisan_goods, quality_none, preserve_sheet_index_192
teal bridge
#

I'm trying to discern if this is really breaking Object or if it is breaking something more subtle.

#

What if you just create the item and set its stack directly?

#

Take the quest/menu out of the equation.

lucid iron
#

after goin in and back out of the quest chest
id_(o)350, id_o_350, color_green, drink_item, juice_item, use_reverse_name_for_sorting, item_juice, item_type_basic, category_artisan_goods, quality_none

calm nebula
#

Oh

#

Can you do me a favor chu/e

#

Check getonecopyfrom on Sobject

teal bridge
#

I'm looking at that one right now, it does copy preservedParentSheetIndex and such.

lucid iron
#
protected override void GetOneCopyFrom(Item source)
{
    base.GetOneCopyFrom(source);
    if (source is Object fromObj)
    {
        Scale = fromObj.scale;
        IsSpawnedObject = fromObj.isSpawnedObject.Value;
        Price = fromObj.price.Value;
        Edibility = fromObj.edibility.Value;
        name = fromObj.name;
        displayNameFormat = fromObj.displayNameFormat;
        TileLocation = fromObj.TileLocation;
        uses.Value = fromObj.uses.Value;
        questItem.Value = fromObj.questItem;
        questId.Value = fromObj.questId;
        preserve.Value = fromObj.preserve.Value;
        preservedParentSheetIndex.Value = fromObj.preservedParentSheetIndex.Value;
        orderData.Value = fromObj.orderData.Value;
        owner.Value = fromObj.owner.Value;
    }
}
#

just doesnt copy context tags blobcatgooglyblep

teal bridge
#

Yeah, but I think it's not supposed to since those are lazily initialized anyway.

#

GetContextTags calls _PopulateContextTags so it will get called, and should check preservedParentSheetIndex etc.

lucid iron
#

For birb mod specifically I think the author should just turn their items into tools tbh

teal bridge
#

But, again, there might be an ordering issue, if something is forcing _PopulateContextTags to be called too early.

lucid iron
#

And not do all these patches

teal bridge
#

Actually...

#

Item.GetOneCopyFrom sets Stack.

#

Object.GetOneCopyFrom calls Item.GetOneCopyFrom before it sets the preserve data.

#

That's the bug, I think. It is ordering.

#

Context tags are lazily initialized, so this Harmony patch forces them to be initialized before some of the properties they depend on.

#

If so, you can work around it using MarkContextTagsDirty(). (But probably better to just not using context tags in that way)

calm nebula
#

PreserveType

teal bridge
#

That's the preserve field. It's not missing.

#

It's like I said above, the problem is in ordering. Item.GetOneCopyFrom, the base method, sets Stack, and doesn't expect setting Stack to force-init the context tags.

calm nebula
#

Oh, hmm

teal bridge
#

I am 100% positive that this is the issue and that it will go away if you update the postfix to MarkContextTagsDirty() after doing its binoculars check, but really that's making a wonky system even wonkier and it's better to just use the item ID for such a simple check.

lucid iron
#

Yeah they can use CustomFields instead which don't get regenerated Bolb

#

The reason for context tag is bc mod adds multiple binocular items

teal bridge
#

Still, the mod controls all those items, it could just check for any of 3 item IDs.

#

If they're trying to design it so that other mods can add their own binoculars... well, that's lovely and all, but I'd call it overengineering.

#

Maybe this is sort of a holdover from 1.5 when item IDs were more precarious, and you only had the sheet index?

pine ermine
#

Is there any example content.json file that uses every single kind of content patch?

rancid temple
#

Probably not, that's a lot of patches

pine ermine
#

I mean not every single possible patch, just every kind.

lucid iron
#

Maybe u can make one using the schema

rancid temple
#

Closest would probably be an expansion mod, though some things will get offloaded to C# instead in those typically

lucid iron
#

Which tells u what actions are available

teal bridge
#

Kind as in "Load" vs. "EditData" differences?

pine ermine
#

Yeah

brittle ledge
#

most any NPC will use load and editdata both, along with include

pine ermine
#

I just need a simple "example" file that covers most of the bases

teal bridge
#

Yeah, I think there are only those few kinds. But I don't speak CP.

brittle ledge
#

Not sure how useful that'd be since they're loading and editing a number of different things - there really isn't that much difference between a load and an edit

teal bridge
#

^ oh yes there is. How many support posts have we had just in the past week of people mistaking load for edit?

rancid temple
#

CP is generally pretty specific, general examples I don't find to be very useful

lucid iron
#

NPC usually have EditMap too

brittle ledge
#

linkoid, if you're looking for an example, your best bet is to look at a mod doing something similar to what you want to do. The patches are going to look wildly different.

lucid iron
#

Is this for unit testing?

pine ermine
#

Yes

#

XD

brittle ledge
teal bridge
#

Right, yes. It's either "replace all of this JSON" or "replace part of this JSON".

#

That's... pretty much it. Plus maps, I guess.

pine ermine
#

Kinda surprised that Content Patcher doesn't have it's own test content.json

vernal crest
#

Or images

teal bridge
#

Are images special or are they just like any other binary asset?

brittle ledge
#

They're the same in that you can replace part or whole, yeah

#

like edits to cursors usually replace part, portraits replace a whole

lucid iron
#

You can paste images onto targeted area yeah

teal bridge
pine ermine
#

I'll just copy and paste them all into one file

teal bridge
#

There's a grand total of 5 so it doesn't seem hard to write one.

pine ermine
#

Yeah, I guess

#

If there was a "golden example" though, I would want to use that.

teal bridge
#

Content Patcher's tests seem rather... limited.

pine ermine
#

Well, yeah, that's the most you can really do with normal Unit Test Frameworks

teal bridge
#

That's probably why there's no golden. No way to test it anyway.

#

You're breaking exciting new ground!

pine ermine
#

Most of it requires it to run in the game, but all the big unit test frameworks require running in their own process.

#

(which is why I made SmiteUnit and ValleyUnit in the first place)

#
{
 "Format": "2.3.0",
 "Changes": [
  {
   "Action": "Load",
   "Target": "Portraits/Abigail",
   "FromFile": "assets/abigail.png"
  },
  {
   "Action": "EditData",
   "Target": "Data/Objects",
   "Fields": {
    "MossSoup": {
     "Price": 80
    }
   }
  },
  {
   "Action": "EditImage",
   "Target": "Maps/springobjects",
   "FromFile": "assets/fish-object.png",
   "ToArea": {
    "X": 160,
    "Y": 80,
    "Width": 16,
    "Height": 16
   }
  },
  {
   "Action": "EditMap",
   "Target": "Maps/Town",
   "FromFile": "assets/town.tmx",
   "ToArea": {
    "X": 22,
    "Y": 61,
    "Width": 16,
    "Height": 13
   }
  },
  {
   "Action": "Include",
   "FromFile": "assets/john_{{season}}.json"
  }
 ]
}
teal bridge
#

I suppose the question is exactly what it is that you want to test, and in what depth. Like, if you're writing tests for CP itself and want to test every possible token, you are going to be at it for a very long time.

pine ermine
#

Well, this is good enough for now

---
Format: 2.3.0
Changes:
- Action: Load
  Target: Portraits/Abigail
  FromFile: assets/abigail.png
- Action: EditData
  Target: Data/Objects
  Fields:
    MossSoup:
      Price: 80
- Action: EditImage
  Target: Maps/springobjects
  FromFile: assets/fish-object.png
  ToArea:
    X: 160
    Y: 80
    Width: 16
    Height: 16
- Action: EditMap
  Target: Maps/Town
  FromFile: assets/town.tmx
  ToArea:
    X: 22
    Y: 61
    Width: 16
    Height: 13
- Action: Include
  FromFile: assets/john_{{season}}.json
teal bridge
#

OTOH if the goal is just something along the lines of "have some way to write assertions on a particular CP mod" and this is just an example mod to test your test framework with, then yeah I'm sure that's fine.

pine ermine
#

I just needed something to test YetAnotherContentPatcher

teal bridge
#

Ah, so you really did go down the YAML rabbit hole.

#

Good, hope it works out and leads to fewer "missing brace" threads.

lucid iron
#

How do you pronounce YACP

uncut viper
#

no matter what linkoids answer for that is im gonna say yasp

next plaza
#

Yac-P

lucid iron
#

YASP: Yet Another Stardew Patcher

uncut viper
#

unrelated, but does someone here know exactly when content patcher updates its tokens/patches after a new day? like when in the cycle of fade to black,, save the game, unfade and whatnot

pine ermine
#

Yakipee?

next plaza
#

It does use ondaystarted

uncut viper
#

well dang

next plaza
#

Or whatever the helper event is called

#

The stuff relating to a save loading is a little more complex though

#

It uses the specialized load stage events

uncut viper
#

i just ask bc im tryin to have a trigger action update the fields (e.g. Price) on existing items when a content patcher patch changes
ive got a patch set to change the price of parsnips when the season is summer and the trigger action runs daystarted on summer 1. the action itself spawns a new item to copy the fields from
but even though newly spawned parsnips on summer 1 will have the new price and the trigger action does run, it doesnt seem to be getting the updated values unless ran on summer 2

lucid iron
#

If you put content patcher as false dependency, would your day started handler go after content patcher's?

uncut viper
#

im not using the smapi handler, im using the games trigger action manager event DayStarted

lucid iron
#

Ah nvm then

#

I guess people can use spacecore's on time of day trigger (forget if that's the name)

#

Update the stuff on 6:10

pine ermine
#

Oh great

uncut viper
#

if a delay wasnt a problem they could get by with locationchanged. but delayed actions... not seamless SDVpufferpensive

pine ermine
#

There's a try-catch in ContentPatcher that is throwing away my stack trace. SDVpufferyikes

uncut viper
#

i might justtry adding the niche trigger of "after the fade to black is over when you wake up" lmao

tiny zealot
#

you can set a priority on your SMAPI event handlers (via attributes) to try to run them before or after other mods. maybe that could help?

uncut viper
#

smapi is not running these actions

#

the vanilla game code is choosing when to run these actions

tiny zealot
#

oh, sorry. i thought you were using SMAPI's daystarted event. my bad

uncut viper
#

vanilla's DayStarted event just seems to be very slightly too early to get the updates from SMAPI's OnDayStarted so i think my only choice is to just manually delay it with either a different trigger or using a DelayedAction

#

(the former being preferable to me bc trying to guess how many milliseconds you need to wait with a DelayedAction seems... unreliable)

#

(not that i think you could really get it wrong since things happen so quickly. but it feels too "pick a number at random" to me)

tiny zealot
#

yeah using DelayedAction for this feels real bad

uncut viper
#

i might add a DelayedAction Action just in general for other things as long as im thinking about it though.why not

lucid iron
#

If things r all on one thread then wouldn't any amount of timer be ok?

#

I am make assumption that they gotta finish all events b4 handling your delayed action

uncut viper
#

i have no idea how delayedactions are handled. id assume any amount would okay but thats where it just feels weird to be using DelayedAction for it then

#

"wrong tool for the job" sorta vibes

#

even if the tool would still work

lucid iron
#

Adding your own daystarted with priority to fire this new trigger then?

uncut viper
#

i just postfixed doMorningStuff() instead and it works fine

lucid iron
uncut viper
#

postfixed it to raise a MorningStarted trigger i mean

#

something something not a bug just a new feature

#

now i can add +1 new trigger to the patch notes

tiny zealot
#

this reminds me that for Nightshade, i had to postfix Game1.ExitToTitle instead of using GameLoop.ReturnedToTitle, since the SMAPI event wouldn't fire until either one frame too late or after the first frame shipped (no discernible difference), so you'd get one frame of the wrong colors before the correct profile could take over

uncut viper
#

that one frame would bother the hell out of me so i Understand completely

lucid iron
#

I would never know if you didn't tell me ukimasu2

uncut viper
#

like the flash of a website before it remembers whether you wanted dark mode or light mode

tiny zealot
#

just a mini flashbang, as a treat

lucid iron
#

Say button do u have a asset invalidated trigger

#

I was thinking that the feature you described (update items) should actually run after Data/Object invalidate

uncut viper
#

what if its not an object, though

#

it could be a BigCraftable
or a Furniture

#

(also you might not actually WANT it to always update)

#

the action also asks you to specify which specific fields you want to update

#

(there arent many that really matter, but still)

pine ermine
#

Are the field names case sensitive in ContentPather?

#

Like "Format": and "Changes": ?

lucid iron
#

even if they arent i think you should make it all case sensitive

#

content patcher isnt very consistent about it atm

pine ermine
#

I not sure I could make it case insensitive actually

uncut viper
#

neither smapi nor content patcher yelled at me for making my "Changes" into "changes" just now fwiw

velvet narwhal
#

SDVpufferthink time to figure out how i got the viewport to clamp onto the player

teal bridge
#

Did it work, though? It may not have errored, but it may also have ignored the field.

uncut viper
#

all my changes within changes did still get loaded and work yeah

lucid iron
#

is newtonsoft json case sensitive

teal bridge
#

That's pretty unusual for a JSON deserializer, but there it is.

pine ermine
#

What version of Newtonsoft does SMAPI use?

lucid iron
#

man 2016

#

Newtonsoft.Json 13.0.3

teal bridge
#

That's the latest version according to their GitHub.

#

Where did you get 2016 from?

lucid iron
teal bridge
#

When an issue's that old and unresolved, I take it to mean that they're simply not interested (i.e. WAI) but are apparently shy about straight up closing it.

pine ermine
#

YamlDotNet doesn't support readonly fields, and ContentPatcher uses them everywhere.

teal bridge
#

And Json.Net does support them? I didn't think that was possible at a framework level.

pine ermine
#

It supports them as long as there is also a constructor that takes every readonly field as an argument

#

You can imagine what kind of black magic has to be done for that to be a thing.

uncut viper
#

alright so i meant to reply earlier but the "making sure it works properly" part took a lil longer than expected BUT it works now so ive added a new trigger and trigger action to my mod which you can find here:
https://www.nexusmods.com/stardewvalley/mods/27100
if you set my mod as a dependency to make sure people download it too you can use the new stuff in my mod and in this case to update the prices of your parsnips you'll wanna use my ReloadItemField action hooked up to a trigger action
idk if you're familiar with trigger actions but if you're not you can look here: https://stardewvalleywiki.com/Modding:Trigger_actions
the documentation for my mod is linked on the nexuspage but the specific documentation you'll need for this is on two pages
the ReloadItemField action: https://stardew.button.gay/docs/betas/actions
the MorningStarted trigger: https://stardew.button.gay/docs/betas/triggers#MorningStarted
the second link will take you straight to the Trigger you'll need and if you're not on mobile (or a tiny screen) you can click the button next to it to view an example that will update the prices of all existing parsnips on the first of every month SDVpufferthumbsup

velvet narwhal
#

time for stardrop to yell at me to update

latent mauve
#

So I finally got to play with my new bathroom renovation mod on my multiplayer run today, and we ran into a weird issue that I was hoping y'all might be able to shed some insight on?

When the custom renovation gets added, for some reason, the path to the cellar disappears, and the spouse room goes empty.

#

The area added by the renovation is nowhere near the cellar itself, so I'm not even sure where to begin troubleshooting that.

calm nebula
#

Do you have a conditional map patch at all on farmhouse

latent mauve
#

There's a When for when a config option is on, yes

#

And the config determines if the renovation data is loaded or if it's loaded as just a map area patch

calm nebula
#

Hmm

#

That should be okay

#

Tbh farmhouse is spooky

lucid iron
#

is it fixed if you take out the When

latent mauve
#

I'm fine DMing or dropping the content file somewhere if someone thinks I missed something, but I can't really check it again without the When right now, because my multiplayer group's stopped for the week.

#

And it only happens in multiplayer, I didn't run into this issue in single player at all

lucid iron
#

oh u can test it locally

#

man i can never remember the wiki page or command

#

basically you start 2 smapi instances and join yourself via LAN with no ip entered

latent mauve
teal bridge
# pine ermine It supports them as long as there is also a constructor that takes every readonl...

It's not the most well-documented library ever, but I think you could implement a custom type converter to handle it:
https://github.com/aaubry/YamlDotNet/blob/8808c6f7272a4416ce3de2aa6076f59d465ab501/YamlDotNet/Serialization/ObjectGraphTraversalStrategies/RoundtripObjectGraphTraversalStrategy.cs#L49

They don't seem terribly complicated to write: https://github.com/aaubry/YamlDotNet/blob/master/YamlDotNet/Serialization/Converters/GuidConverter.cs

Obviously yours would be more complicated, but you have access to the YAML stream and can specify whatever types you want to support.

pine ermine
#

I just made proxy objects to deserialize with the fields changed to be non-readonly

#

I consider this a success. Errors are only there because I didn't feel like making those files.

[22:50:21 ERROR Content Patcher] Patch error: Yet Another Content Patcher Tests Content > Load Portraits/Abigail has a FromFile which matches non-existent file 'assets\abigail.png'.
[22:50:21 TRACE Content Patcher] Requested cache invalidation for all assets matching a predicate.
[22:50:21 WARN  Content Patcher] Can't apply image patch "Yet Another Content Patcher Tests Content > EditImage Maps/springobjects" to Maps/springobjects: the FromFile file 'assets\fish-object.png' doesn't exist.
[22:50:21 TRACE SMAPI] Content Patcher edited Maps/springobjects (for the 'Yet Another Content Patcher Tests Content' content pack).
[22:50:21 TRACE SMAPI] Content Patcher edited Data/Objects (for the 'Yet Another Content Patcher Tests Content' content pack).
lucid iron
#

Is it a PR to content patcher or a separate thing?

pine ermine
#

A seperate thing

#

If there's enough demand for it, I might make a PR

velvet narwhal
#

this was the YAML thing, right?

lucid iron
#

Ah so it is a extension for now right Bolb

pine ermine
pine ermine
#

You can use an online JSON 2 YAML converter to test if it works with your own content.json files

latent mauve
uncut viper
latent mauve
#

Previously it showed the remove option before they bought the renovation, which didn't make sense

uncut viper
#

just having a string added to Strings/1_6_Strings wouldnt do that though, that just means the wrong string is being shown when it shouldnt be

latent mauve
#

It's not doing it now though, after removing "HasFlag":"Fireredlily_renovation_bathroom_open" from the When, so maybe it was a one-off

uncut viper
#

you mightve had your Requirements and RenoveAction mailflags reversed, but thats just a guess

latent mauve
#

very possible!

uncut viper
#

(i know very little about renovations)

latent mauve
#

There was a lot of trial and error with making this work, it's totally possible that I had a separate issue at the same time that was causing the weirdness

#

Also, I can reproduce the empty spouse rooms by running a patch reload on my mod, if that helps at all with figuring out the first issue

#

(spouse room fixes itself on leaving the save and loading it again from title)

pine ermine
#

Bro, I went to look at the YAML 1.1 spec, and it's making my head hurt.

vestal gorge
#

Hi! I have a question that is probably silly: My npc that I'm adding in is starting the day on a coordinate I do not want her in, but when I use the (very old) "Miss Coriel's position tool" to get the coordinates of the tile I do want my npc to start on, it says I put the coords in the disposition as they should be. the blue tile in picture 1 is what I want the start to be (my npc is instead spawning in the void up and to the right). pic 2 is the disposition with the coords. pic 3 is the output of the position tool. did stardew change something with the coord system and render the old resources inaccurate? am I missing something obvious?

uncut viper
#

i dont know too much about NPC data and whatnot, but it might be something to do with the fact that NPCDispositions does not exist anymore in 1.6 and the Coriel stuff is outdated and Content Patcher just might not be migrating it right if you're using the outdated NPCDispositions with a newer CP format or something

vestal gorge
#

ahhhhhhhhh thank you. that must be it. a lot of the internet resources are quite old, so I'm running into a handful of issues here and there.

#

thanks for the resource! i will look at that

uncut viper
#

this Migration page in general has all the changes (or links to pages that have the changes) so if a resource is older than march 17th or whatever it was then id check here first

velvet narwhal
lucid iron
#

(u should tell people to use {{ModId}}_<NPCNAME>)

velvet narwhal
#

annoys tia with another edit
annoys tia with ANOTHER, ANOTHER edit

#

all done

pine ermine
#

I'm messing around with the YAML thing and I've noticed that I can copy and paste significant portions of standard JSON and paste it into a .yaml file and it will still be valid.

tiny zealot
#

i find it very helpful in CP to set up a dynamic token with your NPC's internal name, so that writing events (in particular) is less painful.
e.g. Lacey is {{ModId}}_Lacey which expands to ichortower.HatMouseLacey_Lacey, so i set up a token that's just {{Lacey}} for events

gaunt orbit
#

Isn't yaml a superset of json?

teal bridge
#

As long as the JSON you're copying doesn't have any braces...

#

Like, if it's just the indented part of an object with no nested objects, then yeah, it's sorta valid YAML.

pine ermine
#

YAML accepts braces

teal bridge
#

wat... since when?

#

Huh, looks like you're right, apparently there's a "flow style" alternative to the normal "block style" that is generally used.

pine ermine
#

The only issue I've found so far is this:

- Name: john_{{season}} # Valid
- Name: "{{ModId}}_AbigailCloset" # Valid
- Name: {{ModId}}_AbigailCloset # Invalid
teal bridge
#

As I read it, flow style is meant to be used for single lines.

gaunt orbit
#

I think if it starts with braces it's interpreted as an object

teal bridge
#

Oh, yeah, double braces have always been a bit weird in YAML.

pine ermine
#

Yeah

gaunt orbit
#

Hence why it works with double quotes or when they are later in the string

lucid iron
#

would you consider changing the token syntax then

#

${ModId} perhaps

pine ermine
#

If it wasn't deeply nested into content patcher I would

gaunt orbit
#

Couldn't you use a regex find-and-replace?

teal bridge
#

I'm inclined to say it should be no big deal to just quote it in the YAML, but then again the idea is to lessen the number of footguns we see with JSON, so it's probably worth trying to fix.

#

I think some of these tokens need to make it all the way into the game data, don't they?

pine ermine
teal bridge
#

Not ModId of course, but season might be one.

gaunt orbit
#

You could also use backticks or something

lucid iron
#

oh true, gotta pick something else blobcatgooglyblep

gaunt orbit
#

Although those might count as quote marks in yaml, I'm not sure

pine ermine
#

Backticks are reserved in the YAML spec

gaunt orbit
#

Damn

lucid iron
#

regardless of syntax i thought you just change this

gaunt orbit
#

Maybe you could use pipe characters?

#

I don't think those are used for anything else

teal bridge
#

< > might also be OK.

#

The idea is to make things clearer for non-programmers and braces really are not that intuitive to non-programmers anyway, so substituting something else for braces could be the way to go.

gaunt orbit
#

Tilde maybe as well?

teal bridge
#

(OTOH, all of CP's documentation refers to braces, so... hm)

#

You could even use something like underscores, _ModId_ or _season_ are things that should not appear in normal dialogue, conditions, data, etc. (as far as I can imagine, anyway).

pine ermine
#

I think ${{ModId}} would work best

teal bridge
#

The less "unusual" punctuation is involved, the less trouble content modders are likely to have. Underscores have a good "fill in the blanks" feel.

lucid iron
#

_ is established to be thing that can be part of strings such as item id though

teal bridge
#

Well, I have no skin in the game anyway, so take what I say with a grain of salt, but I feel like a ${{ModId}} type syntax, while being unambiguous from an implementation point of view, is going to throw a lot of people for a loop.

teal bridge
tiny zealot
#

context tags also use _ as a word separator

pine ermine
#

There's also <<ModId>>

teal bridge
#

Good point about the context tags.

lucid iron
#

whereas {{ do currently pop

#

if using _ then ig u do \__ModId__ snakey

velvet narwhal
#

(some weirdos might have ${{#}} as a form of emote token me, i used to have them)

teal bridge
#

Well, if I try to think in terms of what non-programmers would find intuitive, as opposed to what I personally would use, then <ModId>, <season>, etc. seems best. Or double them if you want. Either way, they're unambiguous, they stand out, and they're characters that are more or less familiar to everyone who's typed (as opposed to braces which are never used outside programming).

lucid iron
#

yea i like < >

teal bridge
#

The only reason I didn't suggest multiple underscores is that depending on your font, it can be hard to see that there are two of them.

uncut viper
#

just use guillemets SDVpuffercoolest

pine ermine
#

I think I'll double them so that it it's less likely to conflict with something else\

teal bridge
#

"Step 1: Install random VSCode extension that allows you to type these special characters"

uncut viper
#

just have a french keyboard

lucid iron
#

『ModId』

uncut viper
#

tetris syntax

lucid iron
#

《ModId》

pine ermine
#

<ModId>

#

《ModId》

#

Install a the Japanese Keyboard

teal bridge
#

Hey I know, you could use emojis!
👏ModId👏
🍀Season🍀
etc.

lucid iron
#

oh but < and > are operators in query tokens

#

need to make sure lexer deal with that

pine ermine
#

I might be able to force the YAML deserializer to interpret {{ as a string

vestal gorge
velvet narwhal
round dock
#

(Avi u got a comprehensive events guide pleethSBVSob )

velvet narwhal
#

uh, n-not really?

#

lemme dig

teal bridge
#

Incidentally, how is YACP getting designed, as its own tool that does the same things CP does or as a kind of frontend for CP?

uncut viper
#

events are thylak territory in my mind so i just searched for messages from them SDVpuffersquee

pine ermine
#

Hold up, I think we have a false alarm with the {{ModId}} breaking. Since the object it's getting deserialized into is expecting a string, I thing the deserializer ignores the error and just interprets it as a string. SDVpufferdizzy

teal bridge
#

I'm just curious if this is greenfield or, essentially, a kind of transpiler.

velvet narwhal
#

thylak only pays attention when i post actual event code

#

oh wait i had my own comprehensive guide i'll throw that into my thread

pine ermine
teal bridge
#

So, one thing, even if YDN somehow fails its way to success on those strings, the syntax highlighters don't.

#

If I put - Name: {{ModId}}_AbigailCloset into VS I get the red underline.

pine ermine
#

Yeah

teal bridge
#

I'd say if you want this to be as painless to use as possible, have an alternative for the double braces. You could still accept double braces in the situations where they work well.

pine ermine
#

But VS also does that with missing commas, and that doesn't stop people.

lucid iron
#

Perils of optional quotes blobcatgooglyblep

teal bridge
#

Right, there are always going to be those who write their mods in notepad and are completely oblivious to syntax in general.

#

But, for the ones who actually do use VSCode or whatever, you don't want to make it worse for them!

lucid iron
#

I ignore yellow for trailing commas ez

pine ermine
#

Then they can just add quotes

lucid iron
#

But I don't think I can ignore red

pine ermine
#

Is it wrong to assume that the type of person who would be bothered by a red underline is also capable of wrapping it in quotes?

teal bridge
#

"Just add quotes" is of course the obvious answer, but if the spec was a little confusing to you, think how confusing it will be to the ones who refer to JSON as code.

teal bridge
#

I mean, as a programmer, I get it, this is absolutely trivial stuff, quoting a string. But the question isn't whether it is intuitive to us.

velvet narwhal
#

iirc link was making this to make it easier for noncoders because the removal of { } and my sandwich analogy only works so well

lucid iron
#

Do you think target audience of this is ppl immersed in programming? Or more for ppl intimidated by json

teal bridge
#

Take it for what it's worth, but I have spent many years working on many user-facing products and it is almost impossible to underestimate the average user's level of comprehension.

teal bridge
uncut viper
#

if the target audience is people intimidated by json i agree with focustense here, esp bc they might not even know that just wrapping it in quotes in the first place would fix it. theyd be bothered by the error and not know what to do

teal bridge
#

The workflow of the average user is not going to include "read the YAML spec including parts about string quoting". It's going to be:

  • Look up an example of a content.yaml
  • Copy and paste
  • Change bits and pieces, including inserting content tokens into strings that didn't previously have them, or maybe moving a token to the beginning of a string.

So I think they absolutely will run into this issue, not know how to fix it, and ping you/report a bug/give up and go back to JSON.

#

(and to be fair, this is quite literally what we tell them to do with JSON today!)

pine ermine
#

I think we should stop and ask ourselves if YAML really is preferable to JSON.

uncut viper
#

(and if they dont ping you, theyll probably ask in here, where a lot of people might not know how to answer YAML questions and might just say "iunno just use content patcher" and lead to the user being frustrated at your tool for being difficult or confusing, which is probably not what you want)

teal bridge
#

I maintain that YAML is a lot easier for regular humans to parse than JSON. But I also didn't expect you or anyone to actually go do it, was just throwing ideas around.

pine ermine
#

The more of the examples I add to this file, the more complicated it starts to look.

Format: 2.3.0

### Player Config ###
ConfigSchema:
  "EnableJohn":
    AllowValues: true, false
    Default: true

### Aliases ###
AliasTokenNames:
  "ItemID": spacechase0.jsonAssets/ObjectId
  "ItemSprite": spacechase0.jsonAssets/ObjectSpriteSheetIndex

### Custom Locations ###
CustomLocations: 
  # add the in-game location
- Name: "{{ModId}}_AbigailCloset"
  FromMapFile: assets/abigail-closet.tmx
  MigrateLegacyNames: [ "Custom_AbbyRoom" ]

### Changes ###
Changes:
- Action: Load
  Target: Portraits/Abigail
  FromFile: assets/abigail.png
- Action: EditData
  Target: Data/Objects
  Fields:
    # Block Mapping
    MossSoup: { Price: 80 } # Flow Mapping Inside a Block Mapping
- Action: EditData
  Target: Data/NPCGiftTastes
  TextOperations:
  - Operation: Append
    Target: [Entries, Universal_Love]
    Value: "127"
    Delimiter: " "
- Action: EditImage
  Target: Maps/springobjects
  FromFile: assets/fish-object.png
  ToArea: &FISH_OBJECT_AREA
    # Block Mapping
    X: 160
    Y: 80
    Width: 16
    Height: 16
- Action: EditMap
  Target: Maps/Town
  FromFile: assets/town.tmx
  ToArea: { 
    X: 22, 
    Y: 61, 
    Width: 16, 
    Height: 13 
  } # Flow Mapping
- Action: EditImage
  Target: Maps/springobjects
  FromFile: assets/fish-object.png
  ToArea: *FISH_OBJECT_AREA # Includes the contents of tagged node &FISH_OBJECT_AREA
- Action: EditMap
  Target: Maps/Town
  FromFile: assets/town.tmx
  ToArea: { 
    X: 22, 
    Y: 61, 
    Width: 16, 
    Height: 13 
  } # Flow Mapping
- Action: Include
  FromFile: assets/john_{{season}}.json
teal bridge
#

You really want something ironclad and idiotproof, it's gotta be an editor with a GUI and built-in validation. But if we can improve things a little, then why not, right?

#

Is it complicated because YAML, or is it complicated because you've just added a lot of stuff to the file?

pine ermine
#

Who knows?

teal bridge
#

I would strip out the flow mapping stuff, that's an "advanced" use case for YAML and generally unnecessary.

pine ermine
#

YAML has some black magic with tags though

uncut viper
#

i think at a certain number of lines both json and yaml are going to look similarly incomprehensible and complicated at a glance but thats what Includes are for

pine ermine
#

I'm not sure if we want to allow something like that

lucid iron
#

(btw custom location is deprecated)

rancid temple
#

Deprecated but still works

teal bridge
#

Sure, it's long and maybe hard to follow all at once. But the issue was never about grokking the entire content patch as one entity, it was around repetitive questions re: misplaced braces and people generally struggling with invalid JSON syntax.

rancid temple
#

And unfortunately I still see quite a few people using it when they bring problems lol

velvet narwhal
#

i think because it's still on the main content patcher page?

uncut viper
#

(tbh i think the page for it on the docs should make the deprecation warning bigger, i also missed it after 1.6 came o ut when i first looked there)

pine ermine
#

What if we just make the standard to use quotes?

#

I feel like that's the best solution

#

Use quotes in all the examples to build the expectation that there should be quotes

teal bridge
#

Does the parser accept it when integers and other non-string types are quoted? If it's consistent everywhere, then it's not too bad, although IMO it's negating a lot of the best parts of YAML for a minor edge case.

velvet narwhal
#

tbh this would make me even more into the "splitting everything into an include" because i'd get lost where my actions were

lucid iron
#

But then ppl gonna have mismatched quotes blobcatgooglyblep

uncut viper
#

seems similar enough to json content patcher already so i dont see why not

pine ermine
rancid temple
#

Technically not everything

#

There are bools and ints in certain places

pine ermine
#

huh

teal bridge
#

I think your example YAML is a good one for illustrating everything that's technically possible, however, you should also have a minimalistic/simple example representing what you'd actually expect people to write.

rancid temple
#

I've never tried to make a model accept floats and can't think of anything in base CP that takes them

teal bridge
#

That would be a better frame of reference for comparison to JSON.

velvet narwhal
#

i'm just trying to parse how crazy event code would look in YAML

uncut viper
pine ermine
lucid iron
#

But it's often in a condition string

rancid temple
#

Just trying to think if I've ever seen something like that that wasn't a string that's converted later

uncut viper
#

PetData has SleepOnBed/NearBed/OnRug chances that are just floats

#

thats just off the top of my head

velvet narwhal
#

if we're backtracking onto where floats are actually used, event code uses it for [layer depth]

teal bridge
#

What's the concern over using an alternative token syntax like <<ModId>>? Just that it is different from CP JSON? Or difficulty of implementation?

uncut viper
#

i think weights on things are usually floats too

#

(like appearances or pet gifts)

#

((okay not appearances but in pet behaviours they are. strange))

rancid temple
#

Event code is just a big string though

#

But I do see the pet stuff now, so there's at least that lol

teal bridge
#

YAML has multiline strings, could actually be a big improvement for things like events in particular.

velvet narwhal
#

i have no context for why yaml for event coding, unless you meant the c# event of the tea leaves

lucid iron
#

Does "23, 34" still work for vectors

pine ermine
#

Vectors?

uncut viper
#

(Crops and Weapons also use floats SDVpufferthumbsup )

teal bridge
#

List/array would be [1, 2] syntax... unless it's just a string that's parsed in the game.

lucid iron
#

I forget if rectangle took "23, 34, 16, 16"

pine ermine
uncut viper
#

("UpgradeSignHeight: The Pixel height of the upgrade sign when Robin is building an upgrade" why the hell is this a float?)

rancid temple
#

Lmao, that's a good question

velvet narwhal
#

link said sleep like 2 hours ago

teal bridge
#

Ah, yeah, well custom converters are always nice, rectangles work well as ((x, y), (w, h)) or sometimes [(x, y), (w, h)] but those are in the "crazy ideas" bucket.

ocean sailBOT
#

@teal bridge You leveled up to Shepherd. Wow, you've been talking a lot! Have a prettier, slightly more brag worthy, shade of blue.

lucid iron
#

These r forms that content patcher (or perhaps just newtonsoft.json?) accepted for Vector2 I think

teal bridge
#

Pff, jokes on you Guv'nah, I'm already cheeto.

#

Anyhoo, I'll add that I didn't expect to actually see it implemented so whether you decide to tidy the syntax, keep it as-is, or abandon it entirely, I totally respect that you put in all that effort already. Usability features are really underrated.

pine ermine
#

Here is a "Simple" example

Format: 2.3.0

### Player Config ###
ConfigSchema:
  EnableJohn:
    AllowValues: "true, false"
    Default: "true"

### Aliases ###
AliasTokenNames:
  ItemID: "spacechase0.jsonAssets/ObjectId"
  ItemSprite: "spacechase0.jsonAssets/ObjectSpriteSheetIndex"

### Custom Locations ###
CustomLocations: 
  # add the in-game location
- Name: "{{ModId}}_AbigailCloset"
  FromMapFile: "assets/abigail-closet.tmx"
  MigrateLegacyNames: [ "Custom_AbbyRoom" ]

### Changes ###
Changes:
  ### Load ###
- Action: Load
  Target: "Portraits/Abigail"
  FromFile: "assets/abigail.png"
  ### Edit Data ###
- Action: EditData
  Target: "Data/Objects"
  Fields:
    MossSoup: { Price: 80 }
- Action: EditData
  Target: "Data/NPCGiftTastes"
  TextOperations:
  - Operation: Append
    Target: ["Entries", "Universal_Love"]
    Value: "127"
    Delimiter: " "
  ### Edit Image ###
- Action: EditImage
  Target: "Maps/springobjects"
  FromFile: "assets/fish-object.png"
  ToArea: 
    X: "160"
    Y: "80"
    Width: "16"
    Height: "16"
  ### Edit Map ###
- Action: EditMap
  Target: "Maps/Town"
  FromFile: "assets/town.tmx"
  ToArea:
    X: 22
    Y: 61
    Width: 16
    Height: 13
  ### Include ###
- Action: Include
  FromFile: "assets/john_{{season}}.json"
velvet narwhal
#

i contemplate an extension for vs22 to yell at me for differences between two selected .jsons

teal bridge
#

I imagine it would work with the YAML transpiler thingy if it gets translated to the JSON verbatim as a string.

pine ermine
#

It's not a transpilier 😛

#

Didn't need to resort to that (yet)

teal bridge
#

It's not a Harmony transpiler, but it is transpiling YAML to JSON, no?

pine ermine
#

No

teal bridge
#

I suppose if we're being technically correct, neither YAML nor JSON are code so call it what... a "converter"?

pine ermine
#

It never becomes JSON

#

It's loaded straight into the ConfigModels CP deserializes JSON into.

#

@velvet narwhal Here's an example that include an event

Format: 2.3.0

### Player Config ###
ConfigSchema:
  EnableJohn:
    AllowValues: "true, false"
    Default: "true"

### Aliases ###
AliasTokenNames:
  ItemID: "spacechase0.jsonAssets/ObjectId"
  ItemSprite: "spacechase0.jsonAssets/ObjectSpriteSheetIndex"

### Custom Locations ###
CustomLocations: 
  # add the in-game location
- Name: "{{ModId}}_AbigailCloset"
  FromMapFile: "assets/abigail-closet.tmx"
  MigrateLegacyNames: [ "Custom_AbbyRoom" ]

### Changes ###
Changes:
  ### Load ###
- Action: Load
  Target: "Portraits/Abigail"
  FromFile: "assets/abigail.png"
  ### Edit Data ###
- Action: EditData
  Target: "Data/Objects"
  Fields:
    MossSoup: { Price: 80 }
  ### Edit Data: Events ###
- Action: EditData
  Target: "Data/Events/Beach"
  Entries:
    LeaveMaddie: >
      pause 1000
      /move farmer 0 -1 1
      /faceDirection Maddie 1
      /move farmer 3 0 1
      /speak Maddie "{{i18n:event-75160138.LeaveMaddie.01}}"
      /end
  ### Edit Data: Text Operations ###
- Action: EditData
  Target: "Data/NPCGiftTastes"
  TextOperations:
  - Operation: Append
    Target: ["Entries", "Universal_Love"]
    Value: "127"
    Delimiter: " "
  ### Edit Image ###
- Action: EditImage
  Target: "Maps/springobjects"
  FromFile: "assets/fish-object.png"
  ToArea: 
    X: "160"
    Y: "80"
    Width: "16"
    Height: "16"
  ### Edit Map ###
- Action: EditMap
  Target: "Maps/Town"
  FromFile: "assets/town.tmx"
  ToArea:
    X: 22
    Y: 61
    Width: 16
    Height: 13
  ### Include ###
- Action: Include
  FromFile: "assets/john_{{season}}.json"
velvet narwhal
pine ermine
#

Yeah, the pipe is how you do "multi-line strings" in YAML

teal bridge
#

I see, for some reason I thought you said it was doing conversion.

Looking at the latest examples, personally, I do think it's cleaner for non-coders (and would be even more so without the quotes). But, as I said, would totally respect the decision to shelve it if you don't think it's worth the effort.

pine ermine
#

I mean as far as I'm concerned, it's done until I start getting bug reports

velvet narwhal
#

i assume you can just throw the "LogName" anywhere below the action for smapi to have something specific to yell at the user for?

teal bridge
#

(I think multiline strings are more common as > if you don't want to preserve newlines, which you generally wouldn't for this; https://yaml-multiline.info/; but I'm sure they both work for this)

lucid mulch
#

that specific example would survive either way preserving or not preserving line endings

pine ermine
#

I'll change it in the file since the game doesn't include newline in it's events.

lucid mulch
#

the game didnt support newlines until 1.6 and pathos didnt feel the need to cause yet more breaking changes

velvet narwhal
#

actual modpocalypse

pine ermine
#

XD

velvet narwhal
#

i would test how this works but uh, i don't think i bothered to install yaml on vs22

pine ermine
#

I think it comes with it

real kiln
#

How do I unpack the xnb files?

rancid temple
#

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

real kiln
#

❤️ thanks rokugin always saving me

pine ermine
velvet narwhal
#

i assume i can't have this current project open then

teal bridge
#

I'm interested to see how this pans out. Looking at the code, you've used YAML wrappers for all the different CP objects, so supporting different token formats shouldn't be too hard, I might put in a PR at some point.

#

But first we should probably see if people start using it.

pine ermine
#

Yeah

teal bridge
#

Are you skipping the Nexus release for this one?

pine ermine
#

Yeah

velvet narwhal
#

i think first bar is, my dumb brain can't figure out how to create a yaml

lucid mulch
#

main one for me would be checking if the migrations are working correctly, as it all works on newtonsoft semantics which this wont map

rancid temple
#

Make a text file and rename it .yaml?

teal bridge
#

Which migrations?

pine ermine
lucid mulch
#

It wont be viable to merge with CP and would be a breaking change when 2.4 comes out

pine ermine
#

There's nothing to be backwards compatible anyways.

lucid mulch
#

migrations also ensure forwards compatibility

pine ermine
#

A bridge to cross in the future

teal bridge
#

Does CP often make changes to the schema that are incompatible with previous versions and require on the fly migration?

lucid mulch
#

its less changes to the schema and the semantics

#

a format 2.0 content pack cannot use a token added in 2.3

velvet narwhal
rancid temple
#

That's how you make json's too?

#

I mean that's how I make them

velvet narwhal
#

i just select "json" when i add something new

teal bridge
#

I don't think I'm following... tokens are just inside the strings and format is also specified in the file itself so there's no difference between the yaml vs. json, is there?

rancid temple
#

I don't have a context option for creating jsons lol

pine ermine
#

I might be able to hack some kind of IObjectFactory that can create readonly classesand completely do away with the the YamlConfigModel wrappers. (that won't be fun though) That will make it so it doesn't need updated with each CP update.

lucid mulch
#

the biggest migration is the 2.0 one, which had to deal with all the mess of stardew 1.6

teal bridge
#

And CP handles that in the parsing of a JSON, rather than after it receives the raw model?

#

That's a bit surprising if it is the case...

lucid mulch
#

but that one does a mix of runtime migrations as well as pure json semantics migrations

#

it doesn't do it in parsing of the json, but it runs operating on Newtonsofts primitives to be able to make changes to the document more transparent to the rest of the codebase

#

runtime migrations however dont see the json at all

teal bridge
#

Seems like a lot of migrations would work as-is, with only a few edge cases being trouble. Definitely something to worry about in a 2.0 version (imo).

wise berry
#

I was testing my mod at the initial semi-public release of the 1.6.9 beta and noted that I should change my gift taste dialogues to accommodate this highlighted change ("All gift dialogues based on context tags are now restricted to matching gift tastes.") as I was getting some generic lines. When I tested today, though, I didn't have the issue; did this change get reverted?

lucid mulch
#

but means you aren't getting a PR merged into content patcher to optionally support yaml unless it meets pathos's backwards/forwards compatibility requirements.

and content packs using it in yaml would have a mandatory dependency for this yaml mod

teal bridge
#

I'd imagine users of content packs are accustomed to installing multiple dependencies... CP, SpaceCore, FF, now BETAs, etc.

pine ermine
#

Realistically, right now all I would really make a PR for myself is to convert all the readonly fields in the ConfigModels to be init-only fields.

lucid mulch
#

more dependencies is more friction, and there is a balance of value gain, which imo yaml format doesn't add much of

pine ermine
#

I don't see much value in merging YetAnotherContentPatcher into ContentPatcher either.

lucid mulch
#

also from what I saw, YACP doesn't allow include patches to load yaml

teal bridge
#

I guess we'll see, won't we? Though people have to know it exists first.

pine ermine
#

But then again, I only started this 12 hours ago.

velvet narwhal
#

tbh it's great from a mod author perspective in regards to baby modders or the art-only modders, might also be useful for non-english
if it were ironed to become a pr to content patcher that'd probably be the end-all-be-all for whenever someone can't understand parsing json/gets lost in the brackets

pine ermine
#

I'm of the opinion that missing braces / commas will just become whitespace/ missing hyphen errors in yaml.

velvet narwhal
#

i mean i think that's why content patcher ignores whitespace, because sometimes people just wanna only use notepad

pine ermine
#

It's JSON that ignores whitespace.

velvet narwhal
#

oh that

#

SDVpufferthink i'm thinking of event code again

lucid mulch
#

cp does trim inside the string values, but between stuff is json just not caring

real kiln
#

Where on github is the actual zip for the XNB from pathoschild? I cant locate it to download

teal bridge
pine ermine
#

I mean, we'd never know unless we tried?

real kiln
#

nvm foubnd it!

velvet narwhal
#

linkoid does enjoy the spicy ideas

pine ermine
#

And also I'd much rather make events in yaml than in JSON.

#

I will 100% be using it myself

proud wyvern
#

i still can't take YAML seriously after i've learned about the NOrway incident

lucid mulch
#

I'd prefer to work in events as an array of commands rather than a string, but thats just me

#

casey's experiments recently look interesting

velvet narwhal
#

i'm trying to find that video

velvet narwhal
#

this got me to sit up

teal bridge
#

That seems like a python problem, not a YAML problem?

#

AFAIK there's no "no" in YAML.

pine ermine
#

Actually, it is a thing

#

those are all booleans

teal bridge
#

Blog post says "this is intended behavior in YAML 1.2 spec" but neglects to link to a specific section. Searching for "no" turns up a zillion results. I tried searching for "yes", though, and it's not anywhere in the spec.

#

Strange. It is not in the spec.

pine ermine
#

Oh, if it's in the 1.2 spec, then it's not a problem

#

YamlDotNet only supports YAML 1.1

teal bridge
real kiln
#

Anyone know the file for the train once you unpack the .xnb?

teal bridge
#

Train is in cursors. Everything is in cursors.

velvet narwhal
#

any weirdly shaped thing, probably cursors

rancid temple
#

Thank fuck that not everything is actually in there though

real kiln
#

LOL damn

teal bridge
#

lol, yeah it just feels like everything.

#

Do we have a !cursors command?

velvet narwhal
#

someday we need to make one

rancid temple
#

Doesn't look like it

velvet narwhal
rancid temple
#

Which is funny because we do have !springobjects

teal bridge
#

I'm half-joking but also half-want to actually make it.

real kiln
#

is cursors just random stuff?

velvet narwhal
#

i wasn't kidding when i said any weirdly shaped thing, addendum, that moves*

lucid mulch
rancid temple
#

Cursors is primarily menu stuff, but also a lot of things that are like temporary end up in them

teal bridge
#

"Did you check cursors" is like our "did you try rebooting"

real kiln
#

LOL

#

I dont see the joja train in there though

#

wait am i special? maybe the youtuber i watched edited the effin train hahahaha

velvet narwhal
#

joja train? sounds modded

lucid mulch
teal bridge
#

Joja train is a unique sprite or just a joja logo on a regular train?

rancid temple
teal bridge
#

I've seen the trains maybe twice across half a dozen playthroughs so I don't remember if it exists or what it looks like.

uncut viper
#

the Joja train just gets that lil Joja sign drawn over it

velvet narwhal
#

oh a tiny sign

teal bridge
#

Ok, yeah, I think that is a regular train witha bit of tinting and an extra sprite on top.

rancid temple
#

Looks like the whole train gets colored dark and gets a little sign

#

So that's gonna all be in C#

uncut viper
#

all the stuff directly below the trains in cursors are the various graffitis and whatnot

teal bridge
#

Yes, and the graffitis are also in cursors!

velvet narwhal
#

i forgot the cursed graffiti, i'm closing out of cursors

real kiln
#

Jeez, even just to try and switch the train up is gonna be difficult hahahaha

rancid temple
#

The train is at least partially hardcoded

uncut viper
#

what did you want to change the train to?

lucid mulch
# teal bridge It's _not_ in the 1.2 spec, that's the thing. <https://yaml.org/spec/1.2.2/#1021...

oh I should have just read the opening paragraph of the 1.2.0 spec

An expected source of incompatibility with prior versions of YAML, especially the syck implementation, is the change in implicit typing rules. We have removed unique implicit typing rules and have updated these rules to align them with JSON's productions. In this version of YAML, boolean values may be serialized as “true” or “false”

real kiln
#

I just wanted to try and mod it up a bit, see if I could get the player to enter it or stop it so player can enter. but seems difficult

#

kind of like the bus

uncut viper
#

you'd have better luck making a map patch where the train is just there sometimes

real kiln
#

HAHAHAHA damn eh

#

actually thats a smart idea

uncut viper
#

the train as it is in vanilla is nothing but a sprite that moves across the screen. occasionally items pop out of the sprite. its not something you can change the functionality of really

teal bridge
#

You definitely are not going to stop the train without a lot of Harmony patching. But putting the train sprite(s) on a different map, totally doable.

velvet narwhal
#

i don't know if the train station mod bothers using the actual train

teal bridge
#

Add train sprites, slap a door on top, add a tile action/warp point and you're done.

real kiln
#

that seems fairly easy

#

maybe could even just edit the map its on and have it there perm like the bus?

teal bridge
#

I probably left something out, but as Button said, a sprite is a sprite is a sprite.

#

Editing the map and making it permanent would screw up the actual train.

real kiln
#

oh true good point

uncut viper
#

the only issue with keeping it permanently there would be stopping the actual trains from coming through

teal bridge
#

Would it stop the trains, or give some freaky train-on-train overlap action? Either way, not so good.

rancid temple
#

Probably just overlap

uncut viper
#

it wouldnt stop it, no

real kiln
#

possible to make a 'conductor' npc, that you talk to for a train ticket, (like the desert bus) and then spawns new map for a second showing you board the train sprite essentially?

#

or is that a pain in the butt too lol

teal bridge
#

NPCs are difficult. Tile actions that look like NPCs are much easier.

real kiln
#

tile actions eh, ill look into that havent used them yet.

uncut viper
#

though, hm

real kiln
#

im surprised NPC's are difficult theres like a bunch lol

teal bridge
#

Many NPCs in Stardew are not real NPCs, they are just static sprites placed on the map with (I believe) tile actions.

uncut viper
#

i wonder if you actually can check for if the train is gonna come by or not

#

and then unpatch the map if it is

teal bridge
#

You can. Or at least you used to. Khloe's Almanac had train dates.

real kiln
#

thanks for that info focus!

#

and that would be cool button

uncut viper
#

it just uses a DaySaveRandom to check if its gonna come, and i think a SYNCED_RANDOM GSQ with a Day interval would lead to the same result as that?

teal bridge
#

But I don't think you can do that check in CP, unless you plan on adding another trigger to your mod.

uncut viper
#

if you used that GSQ and it did line up, you could set mail flags on locationchange which CP can then read

real kiln
#

its crazy how fast you can think of this on spot lol

velvet narwhal
#

well button lives in triggers

real kiln
#

wish I was that far into development

teal bridge
#

Though, that's still not "stopping" the train. That's replacing the train with a stopped train, so it'll never move through and never drop any items, etc.

#

Maybe that's what he wants?

uncut viper
#

oh, i meant more for keeping the fake-stopped-train there all the time

#

and only removing it if the real train was scheduled

#

that way you wouldnt get the overlap

real kiln
#

Yeah I might try that!

teal bridge
#

Oh, that makes a lot more sense than what I was imagining.

#

Requires code though, I think. At least to add the trigger for it.

uncut viper
#

you could just use normal vanilla triggers for it though

#

just check on DayStarted

teal bridge
#

Which trigger?

uncut viper
#

or LocationChanged

teal bridge
#

Oh, you're thinking of removing the static train for the entire day.

uncut viper
#

ah yeah, i was

teal bridge
#

I was imagining removing it just for the window while the train is coming through.

real kiln
#

I mean that seems pretty doable

uncut viper
#

i dont think theres a way to predict the exact time of the train without C#

teal bridge
#

LocationChanged would be tricky because the train actually starts regardless of your location.

#

If you go to the train station a bit late, it'll already be halfway done.

uncut viper
#

since the time its scheduled is a second random roll between 9am and 6pm

real kiln
#

so wait for tile action, i could add a conductor and slap a permanenty npc on the map

uncut viper
#

though, i might just be misunderstanding how SYNCED_RANDOM works anyway

teal bridge
#

I guess maybe it doesn't matter if it's just a static train sprite and you only need to remove it when actually in the location but... feels a little on the hacky side.

real kiln
#

and stop the train this way

teal bridge
#

You cannot stop the train. For the tile action, yes, add a "conductor" that either warps you in a train or spawns a static train the next day.

uncut viper
#

hacky for sure and not 100% sure this theory is actually possible, but it would be the only way i could think of without some C# whether by dependency or otherwise

real kiln
#

Not stop sorry, but like delay it for that day?

uncut viper
#

the train that moves is an unstoppable force

real kiln
#

yes

uncut viper
#

you cannot change its trajectory. it goes where it wishes

#

nor can you delay it

#

if the train says it wants to visit that day, then you have to move your train

teal bridge
#

That's probably how I would do it if limited to CP. Add a fake conductor NPC, which spawns a static train in a new map or a map edit. Probably need some massaging to prevent it from just magically spawning right in front of you; maybe it "stops" the next day and it's just there.

latent mauve
#

I'm just imagining the train randomly turning to drive off into the sky (in response to button)

#

Train becomes Falcor

teal bridge
#

Train runs at 5 pm every day from Pelican Town to the Moon

real kiln
#

Wait, would it be easier with the conductor there, just leave train how it is, but once you talk to conductor it brings you to cut scene like pam where your riding the train out?

velvet narwhal
#

that'd probably be the easiest bet

teal bridge
#

I mean, if you want to design the cutscene, then sure. That sounds like even more work.

#

Maybe just a simple fade-out would work.

uncut viper
#

the bus driving cutscene isnt actually a cutscene iirc, its not like an event

real kiln
#

Im good more on the art side

#

oh

velvet narwhal
#

you can turn it into an event with no problems, it's just a lot of work if you have different locations

rancid temple
#

Can you repeat events?

velvet narwhal
#

yes

teal bridge
#

Events are kind of painful to write.

velvet narwhal
#

$v

teal bridge
#

More than just art.

velvet narwhal
#

they're definitely one of the most painful parts of NPC writing, i'll admit that

real kiln
#

sigh

teal bridge
#

I was going to say fading is easy, but maybe that's only in C#? Does CP have a "fade to black and then do thing" command?

velvet narwhal
#

globalfadetoclear [speed] [continue true/false] *unfade
globalfade [speed] [continue true/false]

rancid temple
#

In events lol

uncut viper
#

ftr Link you can still make it an event i was just saying its not gonna be like Pam exactly

#

assuming an event can teleport you somewhere else at the end of it?

teal bridge
#

Yeah the bus is actual animation.

uncut viper
#

(i ask tentatively to the event writers in the room)

teal bridge
#

Like 99% positive events can teleport. CC event does that.

velvet narwhal
#

you make me pull up the event wiki because i don't use that end command

real kiln
#

holy smokes some of you specifically work in certain departments of development on this lol talented

uncut viper
#

every time someone talks about the CC they talk about its strange behaviour and hardcodedness so idk if id trust that one

velvet narwhal
#

end position <x> <y> end warpOut

teal bridge
#

I'm just talking about the CC intro event, but OK, another example would be festival ending events warping you back to the farm.

velvet narwhal
#

but like i said, it's a lot of work, in regards to separate locations, asking the player which location, breaking to switch said event to end in that location

uncut viper
#

"finds the first warp out of the current location"
is this relative to the player at the start of the event, or the players position at the end of the event?

velvet narwhal
#

relative to end event

uncut viper
#

hm

#

the warp would need to be there when they got there, though, but didnt we want a conductor event specifically bc the train wasnt supposed to be there when you arrived?

velvet narwhal
#

well the npc can trigger the event

#

tiledata -> action $v

#

i say "npc" loosely, i mean a map patch with an animated sprite

real kiln
#

Yes

uncut viper
#

but you cant choose the warpOut warp, at least the way i interpret that command

#

its just the first one it finds that goes out of that location

teal bridge
#

Hypothetical flow, then is:

  • Add a fake NPC to be the conductor, brings up confirmation dialogue for "stopping" train
  • Confirmation triggers event that fades to black, spawns in static train with tile action, and then fades in again
  • Optionally add a check to remove the fake conductor on days when the train is actually coming in (using GSQ)
velvet narwhal
#

in the event you can ask the player to choose a location, force a location change in the event, but then that gets strange if you have to switch to a temp map

teal bridge
#

Don't think you need to warp in the event, but if you wanted to put the train in a custom location instead of train station then that's another option.

velvet narwhal
#

is feasible, but it is definitely painful and a lot more work

rancid temple
#

This silliness makes me glad I primarily make C# mods

uncut viper
#

i guess if you can keep the screen faded to black then it wouldnt matter since you wouldnt see it

teal bridge
#

I mean, I exclusively make C# mods, so I could be entirely wrong about what's possible in CP, just basing this on what I've picked up through osmosis.

velvet narwhal
#

roku i don't think you understand how many switchevents i had to write just because i wanted to keep compatibility with SVE's grandpa's farm

uncut viper
#

i did miss a step i think when looking at the code for synced_random and whatnot so i mightve missed an element of "wait why are we having an event in the first place again" SDVpuffersquee

velvet narwhal
#

oh i chimed in cause i saw "i wanted the bus cutscene"

rancid temple
real kiln
#

The one thing I dont understand where you guys know this. Is when you know when to do a mod in CP or use C#. Like where are you guys deceiphering whats better?

uncut viper
#

i thought that the conductor was taking you to the bus map but now i dont know if what the actual intent was for the event to just bring in the train in a non-pop-in way

rancid temple
#

Depends on how hardcoded the thing I want to do is

velvet narwhal
#

if i can get away with it, i'll do it in cp because i don't want to screw my brain over with c# jargon

teal bridge
#

CP is mostly for those who don't code, or for some mods that are 5% code and 95% content.

uncut viper
#

CP can do a lot but it cant do everything. if something can be done in CP i usually recommend someone do it in CP

teal bridge
#

There's no secret to it really, people just use whatever they're comfortable with and/or does the job.

real kiln
#

Okay thanks guys. ill try the mod out over the weekend here. and ill ask if needed help.

uncut viper
#

(mostly bc if theyre asking how to do something, odds are they would only be capable of doing it in CP. C# people are a minority here i think. not a tiny one but still)

velvet narwhal
#

depends on the time of day? i do go slack jawed when it's the c# time

teal bridge
#

I do all my mods in F#.

real kiln
#

Hm, I start a college course for it in 5 days so hopefully in the next 2 years im knowledgeable in it.

velvet narwhal
#

yaml time baeebeee

uncut viper
#

when are we getting a cobolpatcher extension?

teal bridge
velvet narwhal
#

when i do the c++/CLI conversion

real kiln
#

Wait are you guys hireable at all? like for $ obviously

teal bridge
#

I want to see a VB.NET mod, just for the lulz.

uncut viper
#

there is a commissions page on the modding wiki actually

velvet narwhal
#

!commission

uncut viper
#

!commissions

ocean sailBOT
velvet narwhal
#

oh it's an S i hate it here

uncut viper
#

obviously theres an S bc you cant stop at just one SDVkrobusgiggle

velvet narwhal
#

draws the super s in the sand SDVpufferkirby

teal bridge
#

I only do trades.

#

But yeah, comms page.

uncut viper
#

ive thought about adding myself to that commissions page but i havent enough guaranteeable free time

velvet narwhal
#

i contemplated it during the wave of "i wanna make an npc but i don't understand json"

uncut viper
#

("dont you work on BETAS a lot anyway though?" yeah but i shouldnt be. i have responsibilities im ignoring)

real kiln
#

I was gonna say I dont see you guys there on it right now, hm I guess since its commision based too the price of it depends on how big it is?

uncut viper
#

stuff like this is kinda hard to gauge beforehand for pricing sometimes

teal bridge
#

To be clear, not doing comms doesn't mean someone isn't interested in collaboration, just that they don't take financial incentives.

velvet narwhal
#

where is the bird identifier

real kiln
#

Understandable

uncut viper
#

personally if i was on there my pricing would be based on not only expected effort (how big it is basically) but also the pain factor aka "is this doable and i know how but its gonna be a royal pain in the ass anyway?"

rancid temple
#

Are any of the big chatters on that page?

uncut viper
#

depends how you define big chatter i suppose

velvet narwhal
#

is shockah even considered a big chatter?

rancid temple
#

Is he on there? lmao

uncut viper
#

i was gonna say Shockah too but i guess they speak in here kinda sparsely

gilded comet
#

omg i read that as critter

teal bridge
#

Are 6480 and Shockah "big chatters"?

real kiln
#

I havent seen a single person on that page chat in here in the last few weeks lol

gilded comet
#

not chatter

uncut viper
#

i didnt even notice 6480 was on there, id say 6480 counts

rancid temple
#

6480 for sure

velvet narwhal
#

6480 always looking for scope creep

uncut viper
#

a lot of the commissions are art based ofc

real kiln
#

I havent met them I dont think

uncut viper
#

so this specific channel is not likely to be their home base

#

since theres a different one for visual art

rancid temple
#

Ah yeah, that's true

real kiln
#

makes sense, btw rokugin I been using codeacademy, very helpful. great start for me to learn.

rancid temple
#

Yeah, I actually recognize a fair number of the names on here

#

Yeah, I liked Codecademy well enough, it's got a good set up for practicing

gilded comet
rancid temple
#

Would be nice if the extra stuff wasn't all locked away, but there are plenty of places to get extra practice

uncut viper
#

coincidentally thats how i feel about some of the functions in the SDV codebase too

real kiln
#

Yes its good start before I start c# here in college next week anyway. gets fundamentals down

velvet narwhal
#

i swear to god my uni doesn't teach c#

teal bridge
real kiln
teal bridge
#

That they're... practice for something?

uncut viper
#

that i wish some of the functions werent locked away (private/internal)

gilded comet
#

that they're locked away

velvet narwhal
#

honestly you really wanna be able to dig into stardew's brains, watch monogame tutorials

real kiln
#

my college literally teaching us AI - intro to machine learning.

uncut viper
#

i can use reflection ofc. but itd be nicer if i didnt have to

real kiln
#

Ouuu ill take a look at that

teal bridge
#

Haha, whoosh. But private/internal isn't really a problem in Harmony-land.

rancid temple
#

It's so funny because a lot of the earliest stuff I learned for coding was that you should make as much as you can private, but that really bites modders in the ass

real kiln
#

Like no idea what harmony is btw

uncut viper
#

not for patchin em, no. just that very slight extra bit of work if the function im patching also needs me to call another function that im not patching but is also private or internal

gilded comet
#

harmony is a c# patching thing

real kiln
#

lol patching thing nice!

gilded comet
#

prefix, postfix, and transpile (edit IL code)

rancid temple
#

Harmony is basically reflection, which is a way to access private methods and fields

teal bridge
#

Yeah, normal rules of access modifiers don't apply to games.

#

That's why ECS literally makes everything public to everyone.

#

(except the systems, sometimes)

real kiln
#

ah makes sense now

uncut viper
rancid temple
#

I don't know if I ever learned anything about static specifically

teal bridge
#

You were probably told that you shouldn't have mutable global state, and I think that still holds true?

rancid temple
#

My time as a non-coder definitely gave me the wrong impression about what static meant

uncut viper
#

(i wanna emphasize i didnt say i learned it, i said i was told it SDVpuffersquee)

teal bridge
#

static itself is not bad if you simply don't depend on any instance data.

real kiln
#

im pretty sure this is where i get stuck in object orientated programming, knowing when to use public/private and the rest.

gilded comet
#

i mix up static and not static a lot im going to be honest. my brain doesn't work great with objects

#

"amazingly"? im tired

rancid temple
#

Works either way lol

uncut viper
#

i feel like i also didnt understand what static stuff really meant for a long while until one day it just clicked. wish i knew what it was that made it click

gilded comet
#

like i understand the difference between static and non static. but i never think about it when writing methods and stuff until i go over it later / need it for some reason

rancid temple
#

I'm sure there's a better explanation, but basically anything public will be able to be read and written from anywhere that has access to it, whereas private can only be read and written from the local script

velvet narwhal
#

i see the word static and i'm just haunted by <static_cast>

real kiln
#

oh thanks for explanation roku

rancid temple
#

Outside of game making, it's useful to keep your stuff private when you can to avoid things being able to make changes to it when you don't intend

teal bridge
#

Semantically, the way to think about private vs. public is "can I guarantee that this class keeps working if other classes can write/call random stuff here?"

gilded comet
rancid temple
#

And then set up those thing (getters/setters) for when you do want to make changes

rancid temple
gilded comet
#

ah ok

rancid temple
#

I'm not so good with official terminology unfortunately

gilded comet
#

neither am i lol

uncut viper
#

like giving people a guided tour of your house and showing them what theyre allowed to see versus letting them roam randomly into your house

gilded comet
#

i learn largely from example and trial/error

uncut viper
#

scope is probably a good word for it

gilded comet
#

none of the online language classes have worked well for me

teal bridge
#

Scope normally refers to the scope of a block, function, etc. Probably would not use it to describe classes.

uncut viper
#

not to describe classes, no, just the limits of what can and cant access private things

teal bridge
#

Why not use the actual term for it, accessibility? As in, who can access.

velvet narwhal
uncut viper
#

i thought the explanation was bc the actual terms for it werent clicking but admittedly i wasnt paying much attention

rancid temple
gilded comet
#

i mean, it's still scope by definition at least

rancid temple
uncut viper
#

(tbh, the one term/modifier/whatever it is i still dont fully understand when i should and should not be using is internal)

gilded comet
#

yeah same

teal bridge
#

Internal is one you generally only care about when you're building libraries that other projects are going to use.

uncut viper
#

i am using it in my mods, but mostly bc i saw another mod use it and thought "well... they did it so why shouldnt i"

#

what is the difference between something thats internal and something thats just private?

#

or protected for that matter

teal bridge
#

Internal is accessible by your entire project/assembly.

#

Just not by any other project including it.

rancid temple
#

All my classes start with internal and it's kind of annoying actually

uncut viper
#

oh that makes a lot of sense actually

teal bridge
#

Internal is "public to me, private to everyone else".

#

There's also protected internal if you want to get fun.

rancid temple
#

Feels like another "if I weren't making mods, this would matter more" thing to me

teal bridge
#

Oh, and I forgot we have private protected now too.

#

Yeah, like I said, in Stardew modding internal is pretty irrelevant, it's OK to use but it's not really any different from public since the normal method of inter-mod communication is through SMAPI/Pintail.

uncut viper
#

SDVpufferthink yeah im with roku here lmao

teal bridge
#

If you're making a library that's designed to be consumed as a NuGet package, you really do not want the consumers of that library poking around your internals.

#

Let's say, for example, that you expose an internal static ModEntry - if other mods referenced your assembly directly, would you really want them screwing around with your entry point? You can't control anything about your mod if they can touch it.

velvet narwhal
#

yep, i don't remember who said it, but whoever said learning c# was gonna make me hate c++ was correct

teal bridge
#

But maybe you need it to be internal (and not private) because that's where you store the IMonitor and stuff.

#

Just an example, again you don't really use these access modifiers in Stardew mods because other mods don't reference your assembly directly, but imagine they did.

rancid temple
#

Good to know though, thanks

uncut viper
#

i am absorbing this info like a sponge and saving it for future non-modding possibilities

#

though ideally i wont end up needing them but it cant hurt to have em

velvet narwhal
#

i mean, could possibly land a job for windows services, become the govt spy

teal bridge
#

Games break a lot of normal programming rules. But you'll definitely hit them if you end up doing any non-game dev work.

rancid temple
#

Land a job as a government hacker, which is just a fancy term for the person who goes to places and restarts the government's servers

velvet narwhal
#

unfortunately i think govt hacker is c++

gilded comet
#

they've got private jets for pressing a bunch of buttons

teal bridge
#

Granted, if we are talking about anything run by the government, it's probably a 1-hour-a-week job, if that.

rancid temple
#

I can imagine, it can't be boring all the time lol

teal bridge
#

I guess that's relative. Coding can be pretty boring when I have to spend an entire week on refactoring and cleaning up various messes.

#

Being able to actually go out can be a nice change, even if the destination isn't that exciting.

warm egret
#

I have decompiled Stardew Valley.dll using ILSpy and I want to modify one of the classes. What should I do?

gilded comet
#

check out harmony! you can prefix/postfix/transpile it (different patches are ideal for different changes)

rancid temple
#

That's pretty much the only resource I really gained anything from

#

Otherwise it was looking at other people's patches and having someone show me how to use codematcher for transpiling lol

gilded comet
gilded comet
warm egret
#

thank you so much!

gilded comet
#

(thank you selph for indirectly helping me learn transpilers (i just used extra animal config as reference lol))

gilded comet
proud wyvern
#

but on a more serious note, i just don't mod Stardew nowadays

#

kinda a given that i chat less too

split ermine
wise berry
ocean sailBOT
#

Log Info: SMAPI 4.1.0-beta.1 with SDV 1.6.9 'beta' build 24243 on Microsoft Windows 10 Home, with 17 C# mods and 8 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

wise berry
#

Okay maybe I'll get a cleaner log for readability Gov

#

It's not patch updating is the problem, it's supposed to patch update

hallow prism
#

you need to provide more context of what you doing and a json

wise berry
#

Oh sorry it's C# nonsense

#

Lemme grab it

hallow prism
#

oh! i can't help with C# but someone might

wise berry
#

This thing ```c#

    /*
     * taken from ichortower who got it from Shockah, I am not smart enough to do this
     */
    public static Lazy<Action<string>> QueueConsoleCommand = new(() => {
        var sCoreType = Type.GetType(
                "StardewModdingAPI.Framework.SCore,StardewModdingAPI")!;
        var commandQueueType = Type.GetType(
                "StardewModdingAPI.Framework.CommandQueue,StardewModdingAPI")!;
        var sCoreGetter = sCoreType.GetProperty("Instance",
                BindingFlags.NonPublic | BindingFlags.Static).GetGetMethod(true);
        var rawCommandQueueField = sCoreType.GetField("RawCommandQueue",
                BindingFlags.NonPublic | BindingFlags.Instance);
        var queueAddMethod = commandQueueType.GetMethod("Add",
                BindingFlags.Public | BindingFlags.Instance);

        var method = new DynamicMethod("QueueConsoleCommand",
                null, new Type[] { typeof(string) });
        var il = method.GetILGenerator();
        il.Emit(OpCodes.Call, sCoreGetter);
        il.Emit(OpCodes.Ldfld, rawCommandQueueField);
        il.Emit(OpCodes.Ldarg_0);
        il.Emit(OpCodes.Call, queueAddMethod);
        il.Emit(OpCodes.Ret);
        return method.CreateDelegate<Action<string>>();
    });
In combination with this thing:```c#

            configMenu.Register(
                mod: this.ModManifest,
                reset: () => this.Config = new ModConfig(),
                save: () => {
                    this.Helper.WriteConfig(this.Config);
                    if (Game1.gameMode != Game1.titleScreenGameMode)
                    {
                        QueueConsoleCommand.Value("patch update");
                    }
                }
            );```
proud wyvern
#

Doesn’t look to be a problem with your (mine) code

wise berry
#

It broke with the 1.6.9 beta, and running a patch update after it still has glitchy results

#

I'll try and see about testing some more to see if it's a patch update problem I suppose

proud wyvern
#

Have you tried commenting out the patch update part, and instead trying to manually run the command to see if it’s any different?

wise berry
#

Ohhh yeah that's a good plan, I'll do that

proud wyvern
#

Also patch update? Wasn’t the command patch reload?

#

Idk that much about CP commands

wise berry
#

I don't really know the difference myself so I'll look into it too

#

Maybe patch reload can accomplish the same thing (but better)

proud wyvern
#

i guess not

#

patch update seems correct here

#

it's likely patch update is just broken then

wise berry
proud wyvern
#

yeah, i'd try it manually from the console

wise berry
#

Oh yeah, did that just now and it was no different

#

Unless I'm misunderstanding what manually from the console means

proud wyvern
#

just typing it out in the SMAPI console

wise berry
#

Okay yeah, that's what I did ahah

#

Um. Is this a "ping Pathos" type of problem then

proud wyvern
#

yeah, if that throws the same exception, then ^

proud wyvern
wise berry
#

(thanks, my nerves were getting to me ahaha)

proud wyvern
#

this particular log had it throw when hacked around with reflection, but running the commands manually via the console also results in similar exceptions

wise berry
ocean sailBOT
#

Log Info: SMAPI 4.1.0-beta.1 with SDV 1.6.9 'beta' build 24243 on Microsoft Windows 10 Home, with 17 C# mods and 8 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

hallow prism
#

i... don't believe patch update is a cp command?

#

oh

#

i am mixing stuff with the update rate

floral portal
#

Hello. I would like to ask a question to get some tips on how to create translation data for my country from distributed translation data.

#

I have already completed several data conversions from translated data to Japanese prepared by several authors and have confirmed that they are working.

#

Most of the time, the code translated by AI translation or other means is manually replaced using JSON work software. The code is then visually checked for any omissions.

#

However, the mod we are currently working on has too much translation. In making the modifications, there are so many omissions of behavior in the translation data output by the code that it is becoming difficult to visually check the data.

#

For example, this is a “,” omission. This is done using Notepad++ software, but the software does not point out the “,” omissions. Therefore, I have missed the cause of the malfunction.
Is there any good software or method?

#

The mod is composed of 1,500 lines of translated data alone and 450,000 characters. The coloring was done by me using software.
The amount of data is so large that we are feeling a little limited in our manual work...

lucid iron
#

If this is about the json format commas, you can either get the json plugin for notepad++ or switch to something like vs code

#

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

lucid iron
#

There's also validator but idk if it accept files that big

floral portal
#

I didn't know that there was a plugin for Notepad++ suitable for JSON editing, I just thought that if I used Notepad++, there would be no problem.
I'd like to give it a try first, since I found some information on plug-ins in Japanese by searching.

#

I had no idea how huge the data was until I opened the translation data, and I was surprised at the overwhelming amount of content, dozens of times more than the work I have done so far... haha!
However, I think this would be fun data if I could translate it properly, so I'll try a little harder. Thank you.

lucid iron
#

Yeah it sucks that notepad++ didn't enable it by default, good luck with translations AquaThumbsup

calm nebula
patent lanceBOT
#

😏 (#6212360) (24h | <t:1725106060>)

calm nebula
#

This is very weird, huh

#

@wise berry my assumption is that you have two assets of different sizes somewhere

split ermine
#

okay so im WAY too new to modding so my sincerest apologies before i say anything stupid, what do i put in these fields i highlighted (is that what they're called)? im just following the example from button's extra trigger action stuff so im not sure what to do

calm nebula
#

Zip up your entire mods folder and DM it to me please

lucid iron
split ermine
lucid iron
#

Including sell price right

split ermine
#

uh when it's dumped in the bin or sold to pierre yes

lucid iron
#

Yeah so the example reloads price for (O)24

split ermine
#

im not sure if its the same when the player is the one buying but if its different im gonna put that lower on the priority list

split ermine
lucid iron
#

You do that in Data/Object

split ermine
#

wait sorry im confused

lucid iron
#

So the thing button made is only for propagating the price changes

#

You have to do some edit on Price in Data/Object based on season

split ermine
#

i know this is the action for editing a price, do i put it in that 'example action' thing or do i make it separate?

lucid iron
#

Separate

#

Well I guess it can be one file, but it's 2 different Actions

#

So separate entry in Changes

lone ice
#

Hello! I am trying to figure out if my Visual Studio 2022 configuration is the reason my C# coding is working on others' computers but not mine. Can anyone tell me if this is the package they used:

split ermine
#

hmm okay so maybe something like

{ the thing for the trigger actions }

{the thing that edits the price }

?

lucid iron
lucid iron
#

You can ofc split it up into 2 files using include

split ermine
wise berry
#

Patch reload is just kinda broken in general but this error's been happening on a very specific case to be honest SDVpufferthinkblob

calm nebula
#

With a debugger

#

Easiest is to get your exact setup

#

(I know what the error means, now just to figure out what causes it.)

wise berry
#

Okay! I'll go back to my computer now and grab it ahaha (thank you lots)

whole raptor
#

Out of curiosity... what happened with the logs? Pre 1.6 I think every log had a complete trace logs with what assets were edited, but now I'm getting more and more logs without it when people ask for support SDVpufferthink

calm nebula
split ermine
lucid iron
#

You can just have 2 includes in content.json

#

Nested includes do work but I doubt u need it here

split ermine
#

okay! SDVpufferheart

lucid iron
whole raptor
#

Yeah, I mean when I turn them on, last 5 logs I got had no info on for example which mods edited specific portraits

#

Maybe they just didn't load a save before getting the log SDVpufferthinkblob

tiny zealot
#

in the full (raw) log there's always output from SMAPI when the save is loaded/day is started, so you can look for that as evidence that they did or did not load a save

#

like this: [<time> TRACE SMAPI] Context: loaded save <more stuff>

proud wyvern
wraith fox
#

ello

#

so i hear i dont need to learn c# to mod

#

i could use content patcher hmm

#

im goign to guess that is much easier

tiny zealot
#

!startmodding here are some content patcher pages to check out

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.

wraith fox
#

ohhhhh

#

ok

#

imma check this out

tiny zealot
#

SDVpufferthumbsup ask any time if you get confused. it's a lot to take in when you're new

wraith fox
#

very much#

#

the tasks im gonna need to learn is adding NPC's, animals, events, and actions