#making-mods-general

1 messages ยท Page 109 of 1

uncut viper
#

also npc quest reaction dialogue just loads dialogue the same way it loads any other so there shouldnt be any portrait forcing

wheat finch
#

Even on a fresh save I still had the action listed in the dialogue and I have triple checked that I have the updated file in the mods folder.

uncut viper
#

then unfortunately i do not know the issue

wheat finch
#

Gonna test a theory.

jolly bane
#

thank you for those who helped me earlier, with your help I got the error sorted! Now I'm trying to follow this wiki page (https://stardewvalleywiki.com/Modding:Game_state_queries) but the example they give with "PLAYER_FRIENDSHIP_POINTS Current Abigail 750" just shows an error stating "the When field is invalid: 'PLAYER_FRIENDSHIP_POINTS Current Abigail 750' can't be used as a token because that token could not be found". Is it because I'm placing it inside a "When: { here }" ? thank you ๐Ÿ™‚

Stardew Valley Wiki

โ† Index

uncut viper
#

you cannot use game styate queries in when conditions

#

(without another mod that lets you do that)

#

When conditions are a Content Patcher only feature

#

Game State Queries are a vanilla feature that typically go in Condition fields

#

there is a content patcher token for player friendship though that will work in a When condition

brittle pasture
uncut viper
#

750 is 3 hearts right? in that case you can use

"When": {
  "Hearts:NPCName": "3"
}
#

(or more likely you want 3+ if you want it to stay after 3 hearts i.e. "3, 4, 5, etc"

rancid temple
#

I believe it's 3

#

Could use Range

uncut viper
#

(you can also use the {{Range}} token instead of listing individual heart numbers)

jolly bane
uncut viper
#

i gota go thru my script line by line roku!

jolly bane
#

thanks so much guys ๐Ÿ™‚

uncut viper
wheat finch
#

Dinner and movie break from modding. This mod is gonna make me rip out all my hair.

drowsy pewter
#

thats not good

wheat finch
#

Eh it's nothing new for me and modding. Especially when I'm so rusty with everything modding.

azure ether
#

I originally was only gonna add a โ€œfewโ€ mods now Iโ€™m at 266 ๐Ÿซ 

uncut viper
azure ether
#

Ooops my bad I thought I switched SDVpufferwaaah

hard fern
#

i originally was only going to make one npc, and now i'm thinking about 6 SDVpufferflat

lucid iron
#

rmbr to always ship a mod before imagining more mods

#

if u r worry about test rmbr no test only ship

hard fern
#

I've put my ideas in the idea list

#

:/ now i gotta test this event i was working on to see if i screwed it up or not

#

(i probably did)

wheat finch
#

ROFL. I found the issue.

teal bridge
#

Two interesting perf discoveries:

  1. The game's/SMAPI's asset loader does not have any idea when you're requesting an asset already in Game1 - that is, doing GameContent.Load("LooseSprites/Cursors") will cause the entire Cursors image to be loaded and decoded again even though it's already there in Game1.mouseCursors. And:

  2. It takes > 10 ms on a very fast machine with an SSD to load a fairly small JSON file through the content API. I cannot even imagine the kind of slowdown when you have hundreds of content patcher mods installed, it must take forever to start the game.

lucid iron
#

yea apparently logo's mod list takes 4min to start

uncut viper
#

ive played with modlists before where ive had enough time to go make coffee and finish a decent amount of it before it finished launching

lucid iron
#

from save load to game

#

u could use it as a ramen timer

uncut viper
#

this is why im pretty sure there used to be a mod (probably still is) that will pause the game for you when you first load into your save

#

so you can walk away and come back later

#

and not have missed half the day

hard fern
#

SDVpuffersweats at least my game isn't that slow to load in

teal bridge
#

Unlike Textures, JSON files do not have to be loaded on the main thread, even if SMAPI wants to. I think there's a way to work around that, although I'm debating whether or not it's really worth it to shave off another 20-30 ms on my end. (The technique is somewhat generalizable but the implementation is not)

brittle pasture
#

SDV does the load, jumps into game, notices it isn't the main window and pauses

#

as least it works on my scuffed Linux WM, results may vary on other platforms

uncut viper
#

ive never trusted the game to keep loading if i do that since it will pause everything else if i tab out while its doing things

#

but ive never tried

#

like if i tab out immediately after clicking my save game, it'll pause mid-fade to black, so i dunno if it does that during the loading too

#

for now though my mod list is very slim so it doesnt matter for me anyway

brittle pasture
#

So the trick is you have to wait for the anim to finish

#

and for the screen to go black

wheat finch
#

IT WORKS

uncut viper
#

ive just never bothered to check if it would indeed keep loading after the fade to black bc there wouldnt be a way to tell besides waiting. its not that i dont know i could check that, im just lazy

brittle pasture
#

I guess that's cue to add more mods then, for testing

uncut viper
#

thats even less incentive to test that!

teal bridge
#

Welp, getting a 275ms load time down to 110ms is pretty good for a day's work. Still room for improvement, but passable.

lucid iron
teal bridge
#

In general yeah, I think with Content Patcher it would be a matter of parallelism for dealing with huge numbers of files. Although I'm sure a not-insignificant amount of load time is due to actually applying the patches.

#

In my case, it's more the fact that the view system is able to respond to asset updates, so the JSON could be stubbed (instead of blocking) on the first cache miss, and then the UI updated again once it's loaded with real data. I don't know if something similar could be applied to CP or other JSON data in other mods.

rain basalt
#

so making a custom map farmhouse is empty have to add the map properties to load the clutter >.> do i add them to the farmhouse map or the farm map properties for custom?

lucid iron
#

hm that would result in the data being blank for a few ticks right think

wheat finch
#

Weird. Uploaded the newest version of my mod's file, did all the right saves but the file is still uploading. Guess nexus is having issues.

lucid iron
#

still even with patches all on 1 thread, it'd still be load improvements and big impact given it is content patcher

quaint moss
#

If I have a mod with A) an event without when conditions, and B) an alternate version of this event with the same ID and with conditions, and I want to null them in a separate mod, will null'ing A cause B to also be null'd, or do I have to also null B separately?

uncut viper
#

the conditions are part of the key, right?

#

if so you'll need to null them both

quaint moss
#

Conditions in this case refer to the CP when field, not preconditions

uncut viper
#

oh

#

then if they have the same event key then you just need to null the same key and make sure the nulling happens after both

quaint moss
#

I see, thank you

teal bridge
lucid iron
#

yea i can see how this is fine for ui, but it seems dangerous for things like npc schedules or machine data

teal bridge
#

I would say that a lot of mods and game mechanics that load JSON could load asynchronously if they wanted to. Just don't start the operation until the data is loaded. To use your example of an NPC schedule, they just won't start their schedule until a few frames later; machines run idle for a few frames, etc. The effect is really very insignificant.

#

Of course in vanilla, the real issue is that the game just isn't designed around it and it could easily take months or years to adapt such a thing. But mods could do it for their own data pretty easily.

brittle pasture
#

dang focustense is making No More Lag Except It Works

lucid iron
#

alas i outsource all my data loading to content patcher kyuuchan_run

teal bridge
#

Haha, if only I were that good. Even if I could somehow async-ify all the vanilla asset loading through insane-troll transpiler trickery, that's just the tip of the iceberg when it comes to what we think of as lag in SDV.

lucid iron
#

well sdv's got its own monogame fork right

#

make texture load async and make draw less cursed Dokkan

tiny zealot
#

just reimplement the game engine, but faster. simple as

drowsy pewter
#

Two inches away from publishing a mod update that says "Changelog: Nothing changed except the update date because mod users are easily fooled."

uncut viper
#

"Adjusted the manifest."

uncut viper
#

they wont know the difference

velvet narwhal
#

i do have to check some code but iirc i fixed it

#

but i just got back from a 5 1/2h training shift and me back hurts, so i'mma quick glance, see if it works proper and give it a good ol' "doesn't need fixing"

lucid iron
#

changelog: added a 2nd olive oil identical to original olive oil including id

teal bridge
tender bloom
#

changelog: "added bugs. is this a new animal in the game, or did I mean errors? you find out!"

teal bridge
#

This is draw. See that big honkin' Label.Draw slice? That's pretty much just SpriteBatch.DrawString, 6.5 ms long, which is 1/3 of the entire frame budget for one label. But it's only the first time that text is rendered, afterward it's short.

drowsy pewter
#

Added an easter egg that crashes your game if you say my mod doesnt work

rain basalt
#

sounds like an epic easter egg lol

uncut viper
#

if you implement that but it has a bug in it, should i say it doesnt work?

teal bridge
#

(There's a bug in your bug)

hard fern
#

changelog: absolutely nothing changed, but I added a knock knock joke to the content.json

rancid temple
#

Changelog: Added Easter Egg ;)

velvet narwhal
rancid temple
#

The cruelest joke, because they'll never guess it was just in the code

calm nebula
#

The first time feels like font loading

teal bridge
#

I'd be surprised if it's font loading, the font would definitely have to already be loaded by that point.

#

Maybe it's the nebulous category of "font metrics", with MonoGame doing some sort of lazy-loading on the font assets and not calculating everything it needs until later.

calm nebula
#

Oh right

#

Fonts are part of LoadContent

#

I'm just surprised because I rarely see a draw in vanilla greater than 5ms (on my phone)

teal bridge
#

It's not doing that every frame, of course, only the first time.

#

So that is in keeping with "rarely" - it is indeed, very rare, and most frames are sub-millisecond.

#

It's reliably reproducible, mind you, but still rare in relative terms.

#

Anyway, I'm not really too worried about the draw; by far the biggest sources of pain are from MakeGenericType and MakeGenericMethod.

tiny zealot
calm nebula
#

Ichor, does it do that for vanilla alone?

teal bridge
#

Indeed, it's an almost identical situation (but I got it down to just over 100 ms today).

calm nebula
#

Afaik it doesn't

teal bridge
#

It's pretty darn slow in vanilla.

calm nebula
#

The debug command /tto shows frame timing

tiny zealot
#

vanilla did it last time i checked, but that was about 1.6.2 so

calm nebula
#

...huh

teal bridge
#

Better Crafting and such doesn't come into play until you actually hit that submenu, and I don't have many mods affecting the inventory menu.

calm nebula
#

Interesting

tiny zealot
uncut viper
calm nebula
#

You have to have cheats enabled (edit the save to <allowChatCheats>true)

#

But yes. Chat box

#

Note that that wraps the vanilla update and draw methods

teal bridge
#

I run SinZ's profiler and it only shows big loops for BC when I enter that tab. Though I guess there could be other factors at play.

uncut viper
teal bridge
#

I really don't think that's the case. Individual submenus have individual lag.

uncut viper
#

better crafting literally logs it to the console when you pause

#

i have to replace the individual tab menu for the powers tab once you pause for SPU

tiny zealot
teal bridge
uncut viper
#

i use out of the box Better Crafting

teal bridge
#

I get the [Better Crafting] [RecipeManager] Loaded X cooking categories and Y crafting categories. message only after clicking on the crafting tab.

uncut viper
#

since its only in my debug testing profile anyway to make sure i didnt break anything with it when working on SPU

calm nebula
tiny zealot
#

speaking only for myself, my collections tab is loaded immediately when i press E to open the menu

calm nebula
#

Are they hiding optimizations from the rest of us?

teal bridge
#

Only thing I can think of is maybe Clear Glasses, I do notice that the pause menu actually loads slower without that mod. But I can't imagine it having some fancy logic to force lazy loading on tabs.

tiny zealot
#

i actually extremely expect it to have that

wheat finch
#

https://smapi.io/json/content-patcher/de9e7e027f194755bcc9e00ebc50027f Everything works great except for when it adds the recipe to my player, it's not got the right name. It's "Null". The mail data page says to use underscores if the recipe name has spaces so I did that. I thought this one would be an easy one to nail the conversion but alas. I'm staring at it (but also distracted because a movie is on) and can't figure out the issue. No errors in log.

teal bridge
#

I get the same behavior of Better Crafting without Clear Glasses. Still only logs its message when I hit the hammer icon.

uncut viper
#

i just tested SPU again in 1.6.14 and my constructor does indeed run as soon as i pause

rancid temple
#

I added Program.enableCheats = true; to my personal mod lmao

calm nebula
#

(It's also in Events Tester)

uncut viper
#

(tho i havent tested BC again yet since its not in this profile yet and i need to download it)

teal bridge
#

Obviously I don't deny that you're seeing what you're seeing, but I don't have a really huge mod list and most if not all tabs seem to lazy load. Maybe your code is running early because that's how your code is written, i.e. it tries to respond to the menu being opened instead of responding to the tab being activated.

calm nebula
#

But I haven't played the PC version since before 1.6 dropped so

#

Who the hell knows what a PC is anymore haha

rancid temple
#

Pretty sure those are those things that torment you at work

calm nebula
#

Lol

uncut viper
#

okay, this time BC didnt log it right when i paused. so i suppose something changed at some point?

#

im 100% sure it used to lag spike me as soon as i paused

lucid iron
#

did u check if the lag is vanilla too

uncut viper
#

no bc i dont actually care about the lag or whether its vanilla or not i just cared about the lifecycle of the pause menu

hard fern
#

SDVpuffersweats i can't get my npc to load in for whatever reason? they're just gone

wheat finch
#

Ooooh, I just found the issue. Which means the issue exists in a mod I already updated so now I need to upload a new version of the other as well.

brave fable
#

im pretty sure gamemenu submenus are setup as soon as the menu opens, since my special powers data changes are applied as soon as i press E

brittle ledge
hard fern
#

I added an event, movie reactions, and a "has seen event" flag to make them romanceable

#

I don't think i touched anything else ...

uncut viper
#

i actually could not get the postfix i put on the vanilla powers tab to fire upon pressing E. though strangely it did fire twice as soon as i opened the GMCM menu lol

brittle ledge
tiny zealot
brave fable
#

if you used git you could've made a commit when your npc was at some milestone, and just checked the changelist since then SDVdemetriums

brittle ledge
#

Also that SDVpuffersquee @ ichor

hard fern
#

See the thing is

#

I didn't touch their disposition

#

So idk

#

It was working fine before

brittle ledge
#

How did you change their romanceable status without touching their disposition?

next plaza
brave fable
#

svn is dead to me. long live git

lucid iron
silver pelican
#

Hello. Is it possible to add an Action from the Data/TriggerActions where when item is consumed, the player gets warped to customLocation X Y? Similar to totems

hard fern
#

Oh hold on

lucid iron
#

maybe i misinterpreted something

uncut viper
#

it has custom warp totem support

velvet narwhal
#

(comes with the warp animation and the dwoom, too)

silver pelican
#

Thank you! :> I'll go read the guide kwkw

calm nebula
#

But yeah. I recall concluding from an admittedly brief look at the code that every mod had is own game content cache

uncut viper
#

(also i forgot i can literally just look at the constructor for GameMenu. it does create every submenu in its constructor)

wheat finch
#

Yay I fixed it.

uncut viper
#

(which also means i dont know why my postfix wasnt logging every time i re-opened the menu but whatever im not fussed about it)

calm nebula
uncut viper
#

whats silly is that it doesnt even seem like it'd be that hard

#

just add the tabs and if they click one and the page isnt there yet just create it

calm nebula
#

Yes but

#

But mods expect them to be there

uncut viper
#

i meant during the games development

calm nebula
#

So it wasn't really worth it for something most players won't notice

uncut viper
#

like when CA was first writing the GameMenu

calm nebula
#

interesting....is Game1.waveBank1_4 not used at all?

#

unless there is magic going on

#

there is likely magic going on

tiny zealot
wheat finch
#

Oh question that just popped into my head looking at the modding page for custom shops. Are NPC shops for the desert festival hard-coded so I couldn't have a custom NPC have a shop there?

brittle ledge
#

Do you mean the two spots where vanilla NPCs sell? No, you can add modded NPCs to the pool

wheat finch
#

Yeah that's what I meant. TY. I have a mod in progress that has two NPCs added to the game (with their own shop) so it popped into my head to ask.

lucid iron
#

i wonder if u could add more slots

brittle ledge
#

Last time I had desert festival, Blanche had a shop, so you could look at her code

lucid iron
#

like 4 shops a day, 6 even

wheat finch
#

Oh hooray! I misread you and thought you were saying custom NPCs can't be added. Now to noodle on what they could sell!

silver pelican
#
{
        "LogName": "Sunnyfield Warp Totem",
        "Action": "EditData",
        "Target": "spacechase0.SpaceCore/ObjectExtensionData",
        // "TargetField": ["614", "ContextTags"],
        "Entries": {
            "nova.sunnymap_warpTotem": {
                "Name":"nova.sunnymap_warpTotem",
                "DisplayName":"{{i18n:sunnyfield.totem}}",
                "Description":"{{i18n:sunnyfield.totem_desc}}",
                "Type":"Crafting",
                // "Category":"",
                "Price":"20",
                "Texture":"Mods/{{ModId}}/SunnyfieldTotem",
                "ContextTags":["not_placeable","totem_item"],
                "SpriteIndex":0,
                "TotemWarp": {
                    "Location": "novaphene.sunnymap_Sunnyfield",
                    "Position": "20, 20",
                    "Color": { "R": 0, "G": 0, "B": 255, "A": 255 },
                }
                // "":"",
            } 
        }
    },
    
    {
        "Action": "EditData",
        "Target": "Data/CraftingRecipes",
        "Entries": {
            "Sunnyfield Totem": "709 1 767 1/1/{{ModId}}.sunnyfieldTotem/false/none/{{i18n:sunnyfield.totem}}"
        }
    },
    {
        "Action": "Load",
        "Target": "Mods/{{ModId}}/SunnyfieldTotem",
        "FromFile": "assets/Maps/{{TargetWithoutPath}}.png"
    }

ive not used spacecore before. im not quite sure. is this right?

Edit: I got it. I just separated the fields for Data/Objects and made another block for spacechase0.SpaceCore/ObjectExtensionData target. yippie

brittle ledge
#

Oh, sorry! I meant no, they're not hardcoded SDVpuffersquee

uncut viper
#

you can actually specify a custom C# method to run to set up the desert festival so you can likely do whatever you want

#

like, in the data model i mean

ivory plume
# calm nebula I definitely recall <@226803198218731520> saying otherwise

SMAPI sets Game1.content to a GameContentManager, which may be what you're thinking of.

Each mod has its own GameContentManager with its own cache. That's not very efficient, but it's a necessary tradeoff for stability since XNA content managers are very vulnerable to cache poisoning. For example, sharing a cache would mean...

  • If a mod loads an asset with a different type, that type would be saved to the content pipeline metadata (e.g. imagine Content Patcher breaking every time any mod does helper.GameContent.Load<object>).
  • If a mod loads an asset and then edits its for its own purposes (outside the normal content pipeline), those edits would affect some other mods which load the asset too (depending on when/how they load it). That would sometimes affect the game and sometimes not.

To balance that tradeoff, the game pre-loads the most commonly accessed assets like Data/Locations in Game1.locationsData so you don't need to reload them. SMAPI has built-in support for updating those cached fields when the assets are reloaded by a mod.

calm nebula
#

Thank you for the explanation!

lucid iron
#

but if i am use Game1.content.load wouldnt i be the person poisoning the cache bolbpopcornhat

#

well, i hope not but u know what if i do a bad

calm nebula
#

if you poison the cache I will hunt you down

#

and place legos on your floor

ivory plume
#

Yep, so don't call Game1.content.Load<object>. (For example, No More Lag sometimes breaks Content Patcher by doing that.)

calm nebula
#

I'm so sorry ๐Ÿซ‚

calm nebula
ivory plume
#

All mod code runs on the UI thread by default (unless you're doing async background tasks).

calm nebula
#

ooh since when was that one public

#

(No More Lag also attempts async background tasks.)

ivory plume
#

(It also causes errors that way.)

calm nebula
#

luckily (?) most of the time it ...does nothing, it's calling load on items already cached

uncut viper
#

can i set No More Lag as an anti-dependency for my mod

calm nebula
#

I've seen some oddball errors

tiny zealot
calm nebula
#

that imply it somehow managed to try to load a spritesheet on a background thread...somehow

wheat finch
#

Before I run myself ragged, if I want to use CP to add a vanilla item that can't be purchased with coin to a vanilla shop so it can be purchased (as I do in my No Desert Trader Required mod among others), but only available in the shop when a certain condition is reached, is that possible?

uncut viper
lucid iron
#

ig the more relevant q is like, what r good reasons to go out of my way to use helper.GameContent

calm nebula
#

Please donate $9.99 if you want to continue using this mod

#

here's a splash screen.

brittle ledge
#

you could disable your own mod if it's installed, that wouldn't be blocklist worthy I don't think?

uncut viper
#

i could but i think SMAPI should do it for me ๐Ÿ˜Œ

calm nebula
#

please also [popup] [another popup] [popups opening faster than you can close them.]

ivory plume
#

(You can disable your own mod when you detect another mod, if you really want to. But crashing the game, breaking other mods, or other overtly player-hostile actions would result in adding a graylist feature to SMAPI.)

uncut viper
#

im glad you specified "breaking other mods" too, i guess i can finally shelve my No More Lag 2 mod idea that just called harmony.UnpatchAll

lucid iron
#

would helper.GameContent be better for custom assets perhaps, where i only got a small set of things to cache

calm nebula
#

I used to sometimes use the other Game1 content manager for shit like that

#

Game1.temporaryContentManager or smth

lucid iron
#

the use case here would be the various content using framework mods

calm nebula
#

that one gets unloaded every time a player moves maps

#

but I recall issues with asset propagation and that one.

brittle ledge
#

I assume though if a mod is only accidentally crashing the game/other mods and not deliberately doing so that that's not graylist worthy?

calm nebula
#

eventually just went with "you know what, it's not like people run out of RAM playing stardew, and if they do, it's fucking xtile's fault anyways."

velvet narwhal
next plaza
#

SDVpufferlurk I have never once used Helper.GameContent - I use Game1.content exclusively

wheat finch
lucid iron
brittle ledge
calm nebula
#

hang on a second

lucid iron
ivory plume
lucid iron
ivory plume
cinder thorn
#

Our VPR mod has a C# component without nexus update key (1.0.0-c) and it works fine until today where smapi went ahead to tell the player to update the mod to 2.0.1 (mixed up with its CP latest version)? How do I stop smapi update check for our c# one? Should I just change the c# component version to match its CP version?

calm nebula
#

I think (b) is what's working here, since no vanilla game assets hit that block.

#

either that or I've never hit something not (a) and never noticed

ivory plume
# cinder thorn Our VPR mod has a C# component without nexus update key (1.0.0-c) and it works f...

Two options:

  • If both mods are in the same download, I suggest keeping the versions in sync. That also lets players self-diagnose issues if they accidentally update one part of the mod but not the other.
  • If they're in separate downloads, you can use update subkeys.

(The reason update alerts may have started working today is because the SMAPI compatibility list was updated for new mods today, and SMAPI crossreferences mods on that list.)

cinder thorn
#

Got it, thank you puffer_thumbs_up

hard fern
#

SDVpufferflat if i can't get this npc to load i give up

velvet narwhal
#

what does your patch summary say

hard fern
#

i'll need to do a patch summary first >.>

calm nebula
hard fern
#

my patch summary is saying,,, things.

ivory plume
brittle ledge
hard fern
#

X.X I'm already in the middle of fixing it

teal bridge
quaint moss
#

What happens if a trigger action runs into a custom modded GSQ from a mod that's not installed? Does it return true or false for the missing query?

teal bridge
#

It's just a big dictionary of asset names to Game1 assets.

uncut viper
quaint moss
#

Thanks, good to know

ocean sailBOT
#

Log Info: SMAPI 4.1.7 with SDV 1.6.14 build 24317 on Microsoft Windows 11 Home, with 3 C# mods and 1 content packs.

velvet narwhal
#

i'm not seeing a character/schedules edit

#

but i am also exhausted, so squinting is probably one of the things i shouldn't be doing

rancid temple
#

Looks like an included file

hard fern
#

game refuses to pick up on it? for whatever reason

rancid temple
#

Isn't being applied, but my experience with patch summary is usually that lmao

#

Probably need to see the various jsons

velvet narwhal
#

yeah applied only matters when uhhhh the npc is being talked to iirc

hard fern
#

๐Ÿ˜“

#

well, npc still won't show up so that's problem #1

#

can't talk to them if they dont exist

velvet narwhal
#

ik you said you changed the canberomanced but is your unlockcondition also behind a gsq

hard fern
#

wdym

velvet narwhal
#

in the data/character

hard fern
#

...

#

i dont get it :-;

velvet narwhal
#

"UnlockConditions": "PLAYER_HAS_MAIL Current EdelweissWarp any", //game state query-able about whether the npc has an unlock condidion before seen

hard fern
#

i dont have any?

velvet narwhal
#

painful options: throw each of your included + content.json into the validator n we can help parse which one is probably the culprit

hard fern
#

this is how it looks rn

            "LogName": "Romance conditions",
            "Action": "EditData",
            "Target": "Data/Characters",
            "Fields": 
            {
                "{{Lys}}": 
                {
                    "CanBeRomanced": true
                }
            },
            "When": {
                "HasSeenEvent: hostPlayer |contains= {{ModId}}_Lys8no2": true
            }
        },
``` ![SDVpuffersweats](https://cdn.discordapp.com/emojis/585590140806758401.webp?size=128 "SDVpuffersweats")
icy viper
#

@brittle pasture Hey, sorry for the ping. I got a question. One of my machine logic looks like this:

                            "Id": "Default_CopperBar",
                            "Triggers": [
                                {    
                                "Id": "ItemPlacedInMachine",
                                "Trigger": "ItemPlacedInMachine",
                                "RequiredItemID": "378",
                                "RequiredCount": 5,
                                "Condition": "{{G256.IR.Code/UseOres}}"
                                }
                            ],
                            "OutputItem": [
                                {
                                "ItemID": "(O)334", //Copper Bar
                                "StackModifiers": [
                                        {
                                        "Modification": "Divide",
                                        "RandomAmount": [2.5,2.0833,1.667]
                                        }
                                    ],
                                "CustomData": {
                                    "selph.ExtraMachineConfig.RequiredCountMax": 25
                                    }
                                }
                            ],
                            "MinutesUntilReady": 10
                        },

So, can I make the machine only take inputs item at a multiplier of 5? At the moment the machine will take any amount between 5 and 25, I want it to take only 5, 10, 15, 20, 25, etc. Is it possible?

rancid temple
uncut viper
#

if both players have the mod installed and both have CP checking the host theyll be in sync

#

theyll still both be able to romance them as long as the host sees the event

rancid temple
#

Right, sync I wasn't that worried, more so just intention

uncut viper
#

separate datability is a spacecore thing afaik

#

well. separate datability that doesnt produce weird results, i imagine

brittle pasture
#

the ability to specify the mulplier count

icy viper
#

That would be great! It's also what I had in mind. Thanks!

hard fern
#

SDVpuffersweats and i still can't figure out why my npc says no to loading into the game

rancid temple
#

Without those jsons, can't really say

hard fern
#

ah right

#

so.. ALL of them?

rancid temple
#

With them, it's still a task, but without them it's literally impossible lmao

#

I mean, all of them is best, especially without knowing where the problem really lies

#

Probably start at content and spread out to likely suspects

#

Maybe content and then schedule since that doesn't seem to be loading

velvet narwhal
#

content + data/characters + schedule + gifttastes, i think everything else won't... care... if you don't have it

#

don't quote me on that though, i can't remember

rancid temple
#

There's a handful of things that have to be present to spawn the NPC

#

From there, they will just stand around and do nothing if stuff is wrong or not present

velvet narwhal
#

oh portraits + sprites too i thinks

velvet narwhal
#

if you named your npc internally as Forsy.NPCLys_Lys your .png needs to do that as well (i forget the other way to do it)

hard fern
#

o

#

hm, but it worked the last time

velvet narwhal
#

i think that's fine then since it didn't scream at you about xnb, you have your targets correct

uncut viper
#

your .png only ever needs to match anything if you're using the {{TargetWithoutPath}} or similar tokens

#

otherwise it doesnt matter what the name is

velvet narwhal
#

what happens if you comment out the home, do they spawn in the default town spot (i don't remember what the default town spot is)

rancid temple
#

Should be the town square ish area

#

Do you know why your Location isn't loading? Do you not have a tmx for it?

velvet narwhal
#

seems like a fileclimbing issue

brittle ledge
#

or this?

velvet narwhal
#

or that

rancid temple
#

I'm just not sure why it's saying that lmao

brittle ledge
#

looks like there's a typo in the location name?

#

like if you had ModId}}_WaitingRoom instead of {{ModId}}_WaitingRoom

rancid temple
#

The only thing of note I'm seeing is that the Map is being Loaded after the Location is created

velvet narwhal
#

i think because the home is set to

#

Forsy.NPCLys_Lys_WaitingRoom and not Forsy.NPCLys_WaitingRoom

#

but again, i don't know if the home breaking is the reason why the npc is breaking

rancid temple
#

Yeah, that's certainly a problem for the Home, I don't have an NPC I can mess with to test this lol

velvet narwhal
#

i've never tried to have an invalid home KEK

#

maybe i can tweak with mothman, pulls up vs

rancid temple
#

I just gotta finish the crane game mod and ask Pau for a simple but cute test NPC that I can tort- er perform scientific tests with

velvet narwhal
#

i could give you mothman

rancid temple
#

Mothman!

hard fern
#

whroosp

velvet narwhal
#

i'll eventually test if scale up 2 works with character sprites SDVpufferflat

rancid temple
#

It should

#

I was using the example for a bit and it worked on Krobus

velvet narwhal
#

oh right but it made krobus hueg

hard fern
#

explodes i'll test after i fixed the weird home ID

rancid temple
#

Yeah, his scaled up sprite has bobble head energy

#

It also messes up where he's standing, I think that's just kind of a side effect

#

It's only a few pixels but very noticeable because his shadow doesn't move lol

devout otter
#

It even works with tiles, apparently, so theoretically you can make HD Stardew Valley with it.

rancid temple
#

Just gotta patch every tile individually SDVpuffersweats

velvet narwhal
#

hmm

hard fern
velvet narwhal
#

it does, in fact, screw with the NPC if the home is borked

#

there's just no error for it, and my event loaded just fine

rancid temple
#

Good to know

hard fern
#

my absolute nemesis is bonking things SDVpufferflat

#

earlier i was staring at my event for like an hour

#

bc i kept missing a {

velvet narwhal
rancid temple
#

Inside the string?

#

Events can be multilined

#

If you're using VSC you can set the language to jsonl to get it to shut up

#

Makes it a little easier to read when you have a big event

velvet narwhal
ocean sailBOT
#

Log Info: SMAPI 4.1.7 with SDV 1.6.14 build 24317 on Microsoft Windows 10 Home, with 6 C# mods and 2 content packs.

hard fern
#

SDVpuffersweats great now i fucked up the schedule and they won't move

rancid temple
#

But at least they spawn lmao

hard fern
#

true

#

npc lives

rancid temple
#

You don't have a spring_mon and your spring schedule is just them standing in one spot

hard fern
#

it's tuesday

rancid temple
#

Did you fix your map loading?

hard fern
#

yeah

#

the map exists

#

im standing in it

rancid temple
#

Are they?

hard fern
#

yeah

#

i can walk out of it too

rancid temple
#

What kind of warps did you make?

hard fern
#

regular ol warps

#

i didn't change anything from the last test

rancid temple
#

There's like 4 different kinds of warps

hard fern
#

they were able to leave their house

#

map property warp

rancid temple
#

Mk

#

Hm... Can they move around in their map if you give them points in there?

hard fern
#

hmm i never tried it

#

but

#

๐Ÿค” should anything have even changed?

#

so i wonder if i messed up the schedule somewhere... one sec

rancid temple
#

Do they have a way to warp back into the waiting room?

hard fern
#

๐Ÿค” is that necessary?

rancid temple
#

Yeah, otherwise the pathfinder can't get in there and create a path

hard fern
#

oh

#

huh.

#

๐Ÿค”

#

weird

#

game didn't have a problem before with that...

rancid temple
#

Hm, at least that's my understanding, but I can obviously be wrong

#

Did you have SpaceCore before?

hard fern
#

....i did

rancid temple
#

SpaceCore changes the overarching pathfinder

hard fern
#

i'll add it back and see if it's fixed

#

i'll just stick spacecore dependency on my mod i guess >.>

velvet narwhal
#

hmmm macro pathfinding in spacecore my beloved

hard fern
#

(if that's what bonked it)

next plaza
#

My SpaceCore issues sense is tingling

rancid temple
#

catkek more like an issue SpaceCore fixes

#

Which is to say, the games wonky map pathfinding

#

(Can't remember what it's actually called)

velvet narwhal
#

i still don't understand this home data parsing when the location doesn't exist

rancid temple
#

The weird thing it was doing with the broken token?

velvet narwhal
#

no just, i don't load a map at all called Aviroen.MM_Town, but it assumes it's valid

#

so then the npc just disappears

rancid temple
#

Hm, maybe just a lack of an exception

hard fern
#

hm, nope npc still hangs out in the void

rancid temple
#

Maybe try adding an NPCWarp from anywhere to that map

#

Not really sure why it would have worked before unless there did happen to be one that just ended up getting cleaned up

hard fern
#

there shouldn't have been one

#

at all

#

hm

velvet narwhal
#

i don't remember if schedules follows order of operations

#

Each schedule has a key which is used to decide when it applies. The key must be one of the exact formats below (it's not dynamic). If multiple schedules apply, the first match in the order listed here is used.

#

it does

#

so it'll only ever grab your spring schedule cause it's the first valid one it sees

hard fern
#

๐Ÿ’€

#

i'll change it to spring_mon

velvet narwhal
#

you can just shove spring at the bottom

hard fern
#

oh

rancid temple
#

Oh, lmao

#

You always need a spring, btw

#

It's used for things other than just pathing on days you don't have a schedule for

#

Just leave it at the bottom as the fallback

tiny zealot
#

just for clarity, the order that the keys are given in the schedule doesn't matter, so spring doesn't need to be at the bottom

#

the order in the wiki table is the order that they are checked

uncut viper
#

(that also goes for any other dictionary)

rancid temple
#

Unfortunate

uncut viper
#

on the contrary that is very fortunate and the benefit of dictionaries

#

one of

ivory plume
#

(Technically dictionaries can be ordered, they just shouldn't be.)

uncut viper
#

imagine having to MoveEntries for every entry you wanted to add to anything

velvet narwhal
#

brain fried, english no work good

rancid temple
#

I think it's just unfortunate because it makes it hard to memorize what order it's checked in

velvet narwhal
#

(it's too late in the hotfixes, but home Id/Location has no validation SMCSobs )

#

so i can throw any ol' location invalid name and it'll make my npc get thanos snapped

rancid temple
#

Id is probably fine, but when Location is null it doesn't reset the Home to Town and just breaks the NPC lol

#

Probably a good thing to add to the wiki for now, maybe fix in 1.7 SDVkrobusgiggle

hard fern
#

so my npc just wont leave the house for...reasons.

velvet narwhal
lucid iron
#

Going on strike

#

Isn't there a npc page

hard fern
#

there is

lucid iron
#

!officialbug for report

ocean sailBOT
velvet narwhal
#

well it pertains specifically to modded, so is that still valid?

#

i'm reading the forum posts on what to report

lucid iron
#

Eh why not

#

What's with all these divorce bug reports

rancid temple
lucid iron
#

That said this is the kind of thing to maybe just stick a validation in

rancid temple
#

Or where would it

lucid iron
#

In smapi

rancid temple
#

Might be better really, since it's not enough to just check for null, it kind of needs to check if the location exists at all

hard fern
#

hhh at the bottom of the map.. there's nothing being blocked

rancid temple
#

Where does it come out?

hard fern
#

bus stop

velvet narwhal
#

i go ask in the support channel

brittle ledge
#

adding that into the NPC tutorial troubleshooting section

hard fern
#

:3

rancid temple
#

Bus stop should be fine for pathing, you're sure the tile they exit on is walkable?

hard fern
#

it should be

rancid temple
#

Have you tried making them path from anywhere else?

hard fern
#

like, having them spawn elsewhere? or

rancid temple
#

Yeah like someone else's house and walk from there or something

latent mauve
#

So reading up above, did I accidentally dodge a bullet by making the Satoru Gojo NPC use a home location? xD

hard fern
#

hmm i'll try

rancid temple
#

As long as you made him use a valid location lol

hard fern
#

uhh... ๐Ÿ˜… marnie i'm borrowing your house?

velvet narwhal
#

tbf i think it had a valid home location though didn't it?

latent mauve
#

Yep, I made him use the AdventureGuild as a home location, so it's valid. xD

brittle ledge
#

I mean, you're also borrowing abigail's face so a house is probably less of an ask SDVpuffersquee

velvet narwhal
#

if it wasn't there, he would've just been bing chilling in the town square until he had to move to the adventureguild

latent mauve
#

He didn't have a "Home" he had a schedule start point, since he was pre 1.6

#

I just made that his official home in my 1.6 update

rancid temple
#

Well if you had also neglected to add a Home it would have defaulted to Town

#

It's just when you set an invalid Home that it dies

latent mauve
#

ah, I see

#

As a side note, I've received exactly 1 bug report, and it's from someone who didn't read the changelog where I said that he doesn't attend the Stardew Valley Fair, saying they couldn't find him at the Stardew Valley Fair. xD

rancid temple
hard fern
#

yeah no npc refuses to go places

latent mauve
#

Do you have a proper schedule with 2 points for that day?

rancid temple
#

Well, that's progress, at least it's not the house lmao

latent mauve
#

And have you slept if you changed the schedule and reloaded the patch?

hard fern
#

"spring_tue": "610 AnimalShop 11 16 2/1100 Hospital 14 18 1/a1600 Saloon 1 18 3/2200 BusStop 26 20 1",

#

i just loaded up the game fresh

rancid temple
#

New save?

latent mauve
#

just in case it matters, make spring_tue spring_Tue?

velvet narwhal
#

i don't remember the finickiness of schedules, but i did have to sleep a solid like 2-3 days after changing mothman think_eyes

latent mauve
#

Some keys care about cases

#

I forget if schedule is one

rancid temple
#

Oh yeah, those could very well be case sensitive

hard fern
#

i dont think it does?

#

maybe it does

latent mauve
#

Still worth a try

rancid temple
#

Well unless the wiki is wrong, they shouldn't be

hard fern
#

shakes fist

#

no dice

#

still stuck in place

latent mauve
#

ok

rancid temple
#

Did you do a new save?

latent mauve
#

is there anything at all in the log?

hard fern
#

๐Ÿ’€

#

omg

ocean sailBOT
#

Log Info: SMAPI 4.1.7 with SDV 1.6.14 build 24317 on Microsoft Windows 11 Home, with 9 C# mods and 1 content packs.

latent mauve
#

ah, gendered pathing errors xD

rancid temple
#

Oh right, SpaceCore doesn't like the no gender thing

#

Not actually sure what causes that

hard fern
#

well i think some of those was because i didn't change the normal spring schedule

#

but changed spring tuesday schedule

rancid temple
#

Also, you should remove waiting room from the schedule if you're gonna start outside of it

#

Since you didn't put a warp into it

latent mauve
#

yep

hard fern
#

well the map likely isnt the issue so i'll put it back

rancid temple
#

Yeah, likely fine

latent mauve
#

need a warp in and out for anything that's a destination.

hard fern
#

hmm..

latent mauve
#

can just make a NPC warp from the bus stop to get them an "in" if you don't already.

rancid temple
#

thonk (does a warp room count as a destination if it's not a 0 schedule)

#

(such as a 610)

latent mauve
#

(I'm using destination to mean anything that appears in a schedule command at all)

hard fern
#

๐Ÿ˜” what did i do wrong ... it was working fine earlier

rancid temple
#

Unless you have any backups to compare it to, impossible to know for sure

latent mauve
#

I honestly just used a home location to be able to avoid ever having to use 610 because I didn't want to fight with it

rancid temple
#

Is Gojo just all 0 schedules? lol

hard fern
#

i'll try removing the 610 bc they already spawn in there (?)

latent mauve
#

nope, Gojo has no 0 or 610 schedule destination, he starts at home and doesn't move until 700

rancid temple
#

Yeah, you shouldn't need to give them a 610 in there unless you want them to move around in that location

#

Or any schedule points in there really

hard fern
#

(on a side note, wow my game runs so fast...)

rancid temple
#

No mods == speed

#

Except the slow moving menus and animations lmao

hard fern
#

removing the 610 didnt do anything, so i'll try adding an npc warp to a random corner of the bus stop map XD

#

๐Ÿค” also something i was wondering about, do i have to manually add animated tiles to a new map ? when i just pull the tilesheet in there's no animation at all in the water and stuff

rancid temple
#

You can export the tilesets from other maps to avoid redoing the animations

#

Generally the suggestions is to start with a vanilla map, clone it and then make changes to the copy

brittle pasture
#

@indigo yoke @icy viper latest version of Extra Machine Config was uploaded, which contains the feature you were asking for (machines that produce X times before needing a reload and variable input count that must be divisible by a certain number)

#

(pinging both of you for efficiency lmao)

icy viper
#

Thank you very much for quick update! SDVpufferheart

indigo yoke
#

thank you very much

hard fern
#

๐Ÿค” so all of these "fall objects" things i can get rid of?

rancid temple
#

Assuming your map is not intended to be outdoors and use seasonal tilesheets, yep

hard fern
#

oh

#

no im patching the bus stop XD

#

i'll leave these

rancid temple
#

I'm actually not sure if those _Objects things matter

#

Two things

#

Map patches don't take map properties to the patched map

latent mauve
#

If all you are attempting is to add the NPC Warp, you don't actually have to edit the Map file itself and can simply add the Tile Property ๐Ÿ™‚

rancid temple
#

And if you're just patching a warp onto the bus stop you can just use Action EditMap

latent mauve
#

^ yes, that

hard fern
#

oh fr?

#

๐Ÿ˜… as you can see i am not well versed in maps

latent mauve
#

take a look at the second example in this section. ๐Ÿ™‚

#

you don't need to use the tokens, but that shows adding a Tile Properties / Action object to an existing map

hard fern
#

YAHOOO

#

it works

#

map patch saves the day

#

i guess (??) something must have changed between 1.6.8 and 1.6.9+

#

in regards to npc scheduling, that i just happened to miss

rancid temple
#

I don't think so, 1.6.9 was extremely light on CP changes

hard fern
#

huh

#

bc all of this worked fine in 1.6.8 without needing a warp back in

#

....aaand i borked something

latent mauve
#

SMAPI got a little stricter about checking some arguments, I think, but nothing else should have changed much?

uncut viper
#

that was just for skill recipe requirements wasnt it

brittle ledge
hard fern
#

weirrd

#

i mustve typod ๐Ÿ˜”

#

typo corrected!

#

and i immediately screwed up the event XD

#

(my farmer, perpetually walking into a wall. NPC got placed outside the map.)

#

(I mistook 13, 9 as 3, 19)

tawdry hinge
#

anyone know if their is a way to produces a log, showing actions taken by players in a multiplayer game? like if someone destorys all the corps i can check a log and see who did it?

lucid iron
#

You could make a mod to do it but it'd require people to install it

#

The crop destroyer could just not install lol

tawdry hinge
#

there no way my client isnt made award of player actions i see it happen on my screen...

rancid temple
#

Most things aren't handled in a typical host client fashion

#

SDV isn't built for multiplayer, that was tacked on after the fact

uncut viper
#

a lot of it also doesnt say "a player did this!" just "oh theres not a crop here anymore btw"

lucid iron
#

It gets sync'd yes, but accessing who did it is pretty annoying

uncut viper
lucid iron
#

Not really sure if net fields have such info Thqnkqng

rancid temple
#

Pretty sure you would have to force the players to report what they've done with a patch to a bunch of methods

lucid iron
#

I wonder why the recentish wave of multiplayer anti trust mods lol

#

Are ppl trying to coop modded with mobile or something

rancid musk
#

People need to stop playing with baddies

uncut viper
#

someone did just release a headless server type mod, so maybe thats got something to do with it

#

which is a continuation of an older one that i assume was abandoned

rancid temple
#

Releasing an update on a bunch of consoles also means more players in general

tawdry hinge
lucid iron
#

Well ig if u make it part of the headless server mod somehow it might work

uncut viper
#

i dont think anyone else actually needs to install that mod

#

like kick says im pretty sure it just opens a server and you let it run

lucid iron
#

Like server refuse to connect u without X mod installed, slightly harder to lie

rancid musk
#

At best you can determine which client ran the code that removed a crop, but you don't necessarily know why the crop was removed. Was it a player action? Was it a side effect of something?

uncut viper
#

could even be another mod doing it on their behalf that you also have installed

tawdry hinge
#

SOME debug msg realted to player actions would be gold

uncut viper
#

well, thats not fine if you want to know that someone intentionally did something

lucid iron
#

Well feel free to try and make the mod then

rancid musk
#

You're gonna be jumping down a rabbit hole for this though. Observing the netcode internals.

lucid iron
tawdry hinge
lucid iron
#

This mod is good ref for detecting damage

uncut viper
#

Khloe can correct me if im wrong but i assume she meant more like "yes client A is the one that removed a crop but it might not have been the player that did it, just the client ran a function that did something"

lucid iron
#

It's specifically weeds tho (and nothing to do with multiplayer besides being compatible)

rancid musk
#

Weed growth is always host side afaik

#

And yeah, that's what I mean Button

#

Say someone triggers an event and that event does something? All of that event's side effects get sent from the client to the server so you see them as coming from that player.

#

Even though it isn't something they did directly.

uncut viper
#

like, for example if you have a mod installed that makes crops die when it reaches 7pm or something. the players client might make that happen, but they didnt kill the crops

rancid musk
#

(Though I hope someone making something like that would run their logic on the host only purely for efficiency.)

tawdry hinge
uncut viper
#

if thats good enough for you then the answer to your question then is "sure, if you make the mod"

lucid iron
#

Install the "I trust my friends who trust me" mod instead SDVpufferthumbsup

uncut viper
#

but "sure its possible" is not "sure its easy"

tawdry hinge
#

ok so i would have to make a mod that logs all incoming msgs from all clients

uncut viper
#

theyre not sent as messages per se

tawdry hinge
#

probably not that hard

uncut viper
#

not all of them

#

like technically yes but

tawdry hinge
#

right ofc its a bit more techincal

uncut viper
#

its not as easy as "listen for messages"

rancid musk
#

You'd want to specifically watch for changes hitting a GameLocation to watch for crop changes, I expect

#

Which would narrow things down a good amount

uncut viper
#

you'd wanna hook into all the relevant netfields too, i imagine

#

and like, thats just for the singular action of monitoring crops

lucid iron
#

Crop is terrain feature > hoe dirt > crop

rancid musk
#

(I imagine you could get by just with hooks into a netroot maybe, but I haven't dug into the netcode much.)

tawdry hinge
#

i would just log every single thing thats "syncing" with other clients and filter the log as needed to see who did what

uncut viper
#

things are being synced all the time, though

rancid musk
#

That's going to be a lot of data

lucid iron
#

Or object > garden pot > hoe dirt > crop

tawdry hinge
rancid musk
#

But hey, go for it if you've got the space.

#

Good luck

lucid iron
#

Be mindful of not lagging everyone the hell out blobcatgooglyblep

uncut viper
#

and i dont even know how you would tell what client/player caused a netfield to sync

#

or which one caused the change

tawdry hinge
#

writing to disk isnt a big deal..

#

okok ill put it on my todo list ๐Ÿ˜„

lucid iron
#

Disk write is the slowest thing besides network connection :v

rancid temple
#

Just get a $2000 computer and you're golden

#

Put half of that into just an SSD

uncut viper
#

theres also some things that arent synced, too, or at least not until later on

#

like farmhand stats

lucid iron
#

Yeah not like sdv need graphics

rancid temple
#

Yep, just attach your toaster and you're good

hard fern
#

SDVpuffersweats the fact that my npc still has abby's face bothers me

#

i should fix that..

ivory plume
#

(Fun SMAPI log with every mod marked compatible on the SMAPI mod compatibility list.)

ocean sailBOT
#

Log Info: SMAPI 4.1.7 with SDV 1.6.15 'beta' build 24320 on Microsoft Windows 11 Home, with 1713 C# mods and 46 content packs.
Suggested fixes: One or more mods are out of date, consider updating them

uncut viper
#

1713 SDVpuffersweats

#

im curious what the load time on that was

#

wait i forgot the trace has timestamps too. much better than i expected tbh

ivory plume
#

About 7 minutes 39 seconds, from launching the game until it failed to load the save and returned to the title screen.

uncut viper
#

oh

#

thats more in line with what i expected

rancid temple
#

SDVpufferpain 1.6.15 beta

uncut viper
#

spoilers

ivory plume
#

(Next step is to temporarily remove all mods that logged errors, try it again, and repeat until all the mods load into the save. Then those are all tentatively compatible, and I can start sifting through the ones that had errors to see which ones are due to mod conflicts, missing submods, etc.)

#

(And then add any missing rewriters where possible.)

rancid musk
#

Special mention to that mod that failed to load because it was expecting F# support for .NET 8.

woeful lintel
#

you can with FF!

rancid musk
#

At least I think that's what that error was.

lucid iron
#

Aw one of my mods r borked (probably because it's confused about inventory size)

indigo yoke
lucid iron
#

I'm surprised that both of the backpack mods (bigger backpack/return of backpack framework) loaded tho

#

Thought for sure they would conflict, but perhaps it's only once u get either pack

heady crest
#

is there a modding page for achievements???

ivory plume
ivory plume
#

(Loaded into the game! Or at least loaded into the popups.)

proud wyvern
#

FPS: 2

#

Honestly Iโ€™m not sure you can call it loading into the game. At 2 FPS itโ€™s not much of a game, more of a slideshow

ivory plume
#

(Loaded into the popup slideshow!)

velvet narwhal
#

Oh no my crimes are in that list aren't they

#

i will someday fix my prefix skip to properly assess any postfixes on the same method, but since it needs to be activated with a customfield, that is one of the last things i care about (at least until i've settled into my job KEK )

calm nebula
brave fable
#

most dictionaries are ordered. alphabetically, usually

#

it really saves on the time complexity of a lookup

calm nebula
#

My dictionary is ordered alphabetical in reverse letter order, sorted

ivory plume
#

(The game runs at 4 FPS, but here's the main batch of mods which can at least reach the farm in 1.6.14 without a crash or serious error! Tomorrow I'll sift through the 236 remaining mods that caused issues.)

dusty scarab
#

oh no they aren't even arranged alphabetically XD

#

oh, it's just the update portion that isn't, that's better

brave fable
#

man the standards are high to get on the compatibility list these days

#

one hell of a final exam SDVpufferchicksweatsip

woeful lintel
#

there's no way FF made the cut

#

against all odds, it did!

stable grotto
#

(by feeding SMAPI a non-existing subkey I can at least postpone the version update until something actually needs updating)

uncut viper
#

i will say as a user (and a mod author too, but as a user here), i much prefer every component of the mods i download to have their versions in sync with one another, regardless of whether or not anything in either version actually changed from one manifest to the next

stable grotto
#

not the case here, there is no update, it's just picking the version from a different mod component

uncut viper
#

im talking about in regards to keeping the C# component version in sync with the CP version. as in, i would prefer if the C# version also said 2.0.1 to match

stable grotto
#

which was an oversight on my end because I had to rewrite that mod from my old one and forgot to update the version

lucid mulch
#

also its way more fun doing that with all the content packs and sit back and watch as it takes like a minute for all the mods fighting over Cursors to resolve

#

based on the earlier log where it ran fine, assuming it was just to reduce log clutter figuring out what mods worked or not

pine elbow
#

what do you guys use to make mods?

iron ridge
#

!software

ocean sailBOT
pine elbow
#

i finally have a pc and im interested in making one

#

YEOWCH

#

c#....

#

time to learn

drowsy pewter
#

It depends on the mod you want to make

#

most modders don't use C#

pine elbow
#

what do they use?

near harbor
#

Hi friends, I hope I've come to the right place.... I apologize if I didn't understand something in the SMAPI documentation and I searched several times for answers to my questions, but if I found something similar to what I was looking for, in the end the answer wasn't precise enough for me to be sure of what I read.
So I have two questions (hoping for your help and thank you very much in advance):

  1. The documentation indicated two types of mods, content packs and mods that can change the fundamental mechanics of the game, but there's something I don't understand at all. In my plans I have a rather large mod, which will be created in stages. From the simplest to the most complex. Actually there is a desire and as I understand the need to mod at once to do straight independent and serious, not a piece of Content Patcher. Approximately in the plans: to make a lot of new dialogs, add character reactions (or expand them) to various events in the game, add new dialogs to the events that are repeated in the next years, add more detailed mechanics of the relationship with each character, add new events and maybe something else. Progress is actually in order. So to the question: can I make things as for content packs, but immediately in a full-fledged mod in C#? The logical answer would be - I can, but here is the difficulty. The documentation regarding this question is very much directed to the use of content patcher, so there are no specifics about the possibilities or examples of creating such content without using it. Again, the question is: can I do this without the content patcher and if so, where can I find out how? And if not, can I combine content created in content patcher and my separate C# mod?
#
  1. How much knowledge of C# do I need? Yes, some information about it was mentioned in the documentation, but looking at the examples of creating a preset for a mod, I got the feeling that you need to know a bit more than was mentioned before. Just to be clear: I just started learning C# a week ago and I intend to learn it completely. And actually as a first practical experience and just an extremely pleasant pastime for myself and my family I decided to make a mod for Stardew Valley. That's why everything seems incomprehensible, complicated and strange to me now. It would also be great to know in more detail how exactly to interact with the development of mods. Maybe somewhere there is a collection of existing classes or variables used in the game (and so on) with explanations? That would be cool.
    I apologize for the length of this. Just wanted to make it clear.
pine elbow
#

too many lines

near harbor
#

Sorry :)

unique sigil
#

is there a way to add a CP "When" condition to minecart networks? my custom farm cave has a minecart that links to the farm's minecart network, but the farm cave itself is toggleable for compatibility purposes. i want to make sure that when the custom farm cave is disabled, the minecart in there is disabled as well so players don't teleport into the void or something

hallow prism
#

are english not your native language? I dont get what you mean by "Actually there is a desire and as I understand the need to mod at once to do straight independent and serious, not a piece of Content Patcher. " A content pack mod can be serious

#

about 1
Yes, you can do everything CP can do in C# BUT you are on your own. The lack on documentation will still be an obstacle you'll have to overcome mainly on your own. Independance for the tools has a cost and this is the cost. I suggest really weighting if independance is worth reinventing the wheel : using CP will be easier and you'll have more help. Using C# will be longer and you'll have less help and you'll struggle more. The "independance" is not real, as CP is pretty much as stable as smapi in the big picture

#

2 : i have no idea, i don't do C# mods

hallow prism
hallow prism
unique sigil
hallow prism
#

{{mytoken}}

#

let me grab an example

#

"Condition": "{{HasMod |contains=Lumisteria.SereneMeadow}}, SYNCED_RANDOM day lumisteria.astershop_flowersandcropseeds 0.6",

drowsy pewter
#

Just write the token name, CP resolves it into true or false before the game sees it

hallow prism
#

but you can also have a when if you want as long as you target the right stuff

#

        {
            "Action": "EditData",
            "Target": "Data/Minecarts",
            "TargetField": [
                "Default",
                "Destinations"
            ],
            "Entries": {
                "Railroad": {
                    "Id": "Railroad",
                    "DisplayName": "[LocationName Railroad]",
                    "Condition": "LOCATION_ACCESSIBLE Railroad, {{RailroadMinecart}}",
                    "TargetLocation": "Railroad",
                    "TargetTile": {
                        "X": 16,
                        "Y": 39
                    },
                    "TargetDirection": "down",
                },
            },
        },```
here, found my GSQ example with minecart
unique sigil
#

thanks, i'll try that

near harbor
# hallow prism <@418623793230118912> pinging so you see this

Hi, thanks for the reply.
Yes, English is not my native language, and I don't know it perfectly, but I know it as well as I can.
I was not trying to belittle or hurt anyone by saying that mods created through Content Patcher are โ€œnot seriousโ€. I meant that my plans include quite global tasks (not from the first listed of course, but later, but not the point) and in this case content patcher will not be enough for me. I got my answer in general, maybe it will be hard work.... And maybe I'll really try to do something through CP first, who knows?

hallow prism
hallow prism
#

sure ๐Ÿ™‚ good luck with the project

#

(and take a look at existing expansion mods if you want so you can see how a project like this could look)

cyan marsh
#

blargh

devout otter
#

So I know that it's recommended to prefix a custom tileset with with z_ in Tiled. What about vanilla tileset? Should I change their names too in Tiled?

hallow prism
#

if you are adding to a vanilla maps when they arent already

devout otter
#

Yeah, I'm patching a map to the Forest. It's just that the Forest map use spring_outdoorsTileSheet and names the tileset outdoors in Tiled. If my map patch also uses spring_outdoorsTileSheet, should I also name the tileset outdoors? Or z_outdoors?

hallow prism
#

it's already here? keep the name the same then

#

what matters is keeping the order of tilesheet the same

#

so you don't want to rename stuff already here

silver pelican
#

Hello. Since I cant have multiple FromFile (i think), is there a way to reference the png files for the portraits and sprites without having to make a separate block for each of them?
I do have this currently.
For Sprites.

{
      "LogName": "NPC Sprites",
      "Action": "Load",
      "Target": "Characters/{{ModId}}_Duke, ",
      "FromFile": "assets/Characters/Duke.png"
    },

and I wanted to add the other NPCs in the Target field (Characters/{{ModId}}_Claes,) .

hallow prism
#

some mods use the CP tokens to make convenient load of several things

#

like targetwithoutpath

#

look at CP docs

blissful saddle
#

CP is made in C# and is an awesome framework to edit and substitute the game content on the fly (aka without changing the game content files). It has lots of functionalities that helps content creators and modders to put their creations in the game with little to no incompatibilities with the code and without touching it.

C# will let you go into the game mechanics, changing, addiding and even removing some things from how the game originally works.

To do what CP do through C# you would need to recreate CP funcionalities internally on your code and, as Lumina pointed out, would be like recreating the wheel. But feel free to do.

That said, as someone with some coding experience, I would recommend you to divide your project into modules that can work alone but that would work together. Mods can be short of Modifications and of Modules at the same time.

Working in more modular form you can help you to slowly take a grab of how SDV modding works and see your creation take form, avoiding that frustration abyss of not knowing how to make our ideas work. You can later pack your mods as a collection that works finely together.

For C#, Utilities and SMAPI documentation will be your main source of methods to create new mechanics events. But you will need to also dwell in the game code if you intend to change mechanics.

Also check mods that does similar things that you can find in Nexus. Most modders keep their source code on github for reference, even if they don't open it for third party utilization.

Good luck

#

@near harbor

blissful saddle
silver pelican
#

I did try it but it would return and error with :
[Content Patcher] Patch error: (CP) Sunnyfield Shops > NPC Sprites (Characters/{{ModId}}_Duke) has a FromFile which matches non-existent file 'assets\Characters\novaphene.sunnymap_Duke.png'.

referring to this block

      "LogName": "NPC Sprites",
      "Action": "Load",
      "Target": "Characters/{{ModId}}_Duke, Characters/{{ModId}}_Claes,",
      "FromFile": "assets/Characters/{{TargetWithoutPath}}.png"
    },```

im thinking that if all else points to manually making separate action blocks for each of them, then i'd haveto rename my png for portraits and sprites to match what its looking for `novaphene_sunnymap_<NPCName>.png`
granite bluff
#

heyy, how do i set priorities for dynamic tokens?

silver pelican
#

I wanted it to find the path as would a {Target} or TargetWithoutPath do. Now with the {{ModId}}, it would be impossible to do the same (without me having to rename the png files)
I used to have them all as is (without the {{ModId}}
) and with {Target} for the FromFile . I like saving space XD

blissful saddle
#

yeap, to what I understood so far, {{TargetWithoutPath}} looks for a file with the name referencing the file your are hitting on. you could make the file be {{TargetWithoutPath}}_Optional.png, but the token will copy the name of the file, so your file should be named novaphene.sunnymap_Duke_Optional.png

blissful saddle
silver pelican
blissful saddle
#

I hope it works

#

I am green with CP yet

granite bluff
blissful saddle
#

I would need to see your content code to understand what it means. there is nothing like priority in a dynamic token

granite bluff
#

'Custom Wellwick' has multiple patches with the 'Exclusive' priority which load the 'Characters/schedules/Wellwick' asset at the same time (Custom Wellwick > Load Characters/schedules/Wellwick, Custom Wellwick > Wellwick Custom Schedule). None will be applied.

lucid iron
#

Ah this ain't dynamic tokens

granite bluff
#

huh

lucid iron
#

You have multiple Load

#

With same target

#

Need to change one of them to EditData

#

Even with priority only 1 Load applies

granite bluff
#

that's what the code looks like

blissful saddle
granite bluff
#

xD oh

blissful saddle
#

Load substitutes the original file for your 'FromFile' one

#

you can only do it once per CP mod because they are applied at the same time

granite bluff
#

oooh

#

i will try that thank you SDVpufferheart

silver pelican
#

I thought you'd do an 'Include' on schedules.json instead of Load?

blissful saddle
#

Include adds lines to the original file, don't?

#

if you want to fully change it with another you made, Load works well

iron ridge
#

so laod is correct

granite bluff
#

hmm EditData can't be used

blissful saddle
#

by what I got from your content, you are trying to change a schedule when another mod changes the same schedule, that's right?

granite bluff
#

aaah no i was trying to load a custom map when a specific mod loads (that works) and now i want a custom schedule to load, when this custom map loads

mellow knot
#

Hello friends! Question for yall - I have a map im working on (nearly done) thats a four seasons farm map as in there are 4 unlockable areas that are using the season override map feature to make them permanently stuck in that given season.

It works for pretty much everything like crops and trees EXCEPT animals wont go outside if its winter on the main farm, even if their building is on one of the seasonal farms like spring. Is there anything I can do about this or is this something deeper in the code that I just have to be ok with ?

hallow prism
granite bluff
#

ah yes nice, is it just "Priority": low
like this?

blissful saddle
# granite bluff aaah no i was trying to load a custom map when a specific mod loads (that works...

with Load you are substituting the file in Characters/schedules/Wellwick with your on in schedules/Wellwick.json. If Pilz.PretInt or Wolf.RomRas do the same thing, they will conflict.

To not conflict, you need to use EditData, target the file you were substituing and specifically change it with the change action, editing dictionary or list (I don't know how schedules are nested). You can't edit a file putting another file over it.

mellow knot
#

ill just let folks know thats a limitation in the mod description

blissful saddle
silver pelican
#

or whichever is the level xd

blissful saddle
#

the priorities are "Early", "Default" and "Late". Late will usually apply your changes after everything else.

lucid iron
#

hm nothng in the C# code indicates that this should be the case

blissful saddle
lucid iron
#

sorry i was speak about the animal issue

#

you can use multiple Load if you only want one to apply at a time, unconditionally

#

and no one else will load this target

#

loading alternate schedule if another mod is around is valid case of this, though edit data will be more flexible in long run

blissful saddle
lucid iron
#

i thought they were targeting the same thing

#

but i didnt see their json

blissful saddle
#

their content though checks for another mod that seems to change the schedule and applies their changes if said mod is loaded

mellow knot
# lucid iron sorry i was speak about the animal issue

I wonder if there's some kind of initial season check that it's using. I noticed as well that buildings there will use the seasonal variant even though the season isn't changing.

Example: I have Elle's seasonal buildings and it loads the winter sprite even though the area is in season override spring. I just end up using AT anyway but I'm wondering when it's checking seasons

blissful saddle
#

I understood that's what is causing the double call and innitial problem

blissful saddle
lucid iron
#

yea hm not even the SeasonOffset works bolbwaitwhat

mellow knot
#

as a map property i mean

lucid iron
blissful saddle
#

if Elle's check for {{season}} it will be taking the global season variable

lucid iron
#

they did come out

mellow knot
#

and yeah like crops work properly it will say its not the right season if you try to plant summer crops in the spring map

lucid iron
#

but its snowing bolbwaitwhat

mellow knot
#

THEY DID??

lucid iron
#

(the season override is fall)

#

this map i am map is a greenhouse tho

mellow knot
#

interesting...

blissful saddle
#

weather changes is real

mellow knot
#

i was thinking of adding another bit of unlockable bundles to make each seasonal farm be turned into a greenhouse...

#

since i have them unlocked that way in the first place

#

COULD be part of gameplay if it works that way

mellow knot
#

ok i shall test some things then ty all! this gives me ideas at least

calm nebula
#

(That is super cute!!!)

#

(Does it come with matching seasonal forage?)

mellow knot
#

atra!! hi there friend โค๏ธ it does!! holdon i can grab 2 screenies rl quick

#

spring map versus fall map

#

you start off on a small main map and then it uses unlockable bundles to give you access to warps for each of the 4 seasons

calm nebula
#

That's super adorable SDVpufferheart

#

The mushies

lucid iron
#

this is not check for current location so SeasonOffset on buildings are use main season rather than per location blobcatgooglyblep

public virtual Microsoft.Xna.Framework.Rectangle ApplySourceRectOffsets(Microsoft.Xna.Framework.Rectangle source)
{
    BuildingData data = GetData();
    if (data != null && data.SeasonOffset != Point.Zero)
    {
        int seasonIndex = Game1.seasonIndex;
        source.X += data.SeasonOffset.X * seasonIndex;
        source.Y += data.SeasonOffset.Y * seasonIndex;
    }
    return source;
}
mellow knot
#

aaaa thank you so much!! ive been very excited to bring it to life and im ALMOST there hehehe

lucid iron
#

and i think content patcher {{Season}} token was never locational

mellow knot
#

im just over here being difficult lol

calm nebula
#

I love this SDVpufferheart

mellow knot
#

if turning them into greenhouses will let the animals come out i can def move forward with my next set of bundles then and folks can choose to upgrade or not if they wish. i have all my animals just free roaming on the main map currently cuz then i dont forget to pet them XD

blissful saddle
#

I think I like the idea of seasoned greenhouses better. But the maps are awesome

#

very lovely

lucid iron
#

i wonder if there are any farm building mods that cover all of vanilla and properly use SeasonOverride blobcatgooglyblep

mellow knot
#

chu that emoji kills me everytime i see it XD

blissful saddle
#

I don't understand the emotional state behind that one, so I just get confused

silver pelican
crimson meteor
#

Does anyone know how to change the textures of weapons?

#

That is, the tools

#

Well and weapons too, I want to make some textures to change for the weapons and Minecraft Tools I feel it would be a very nice mod

drowsy pewter
#

Sure, you'll be making a content patcher mod

#

!cp

ocean sailBOT
drowsy pewter
#

the second link walks you through setting up

crimson meteor
crimson meteor
drowsy pewter
#

Sorry, I'm really busy

#

but people here will respond quickly to questions

crimson meteor
shut grove
#

is it possible to make custom "mines" or dungeons with a random selection of floor layouts?

#

like how the volcano is set up

#

specifically as a Content patcher mod

whole raptor
#

Just CP? Probably not

calm nebula
#

Spacecore might let you

whole raptor
#

I'm starting to believe Spacecore can do anything...

calm nebula
#

Hey Casey can spacecore do my soldering for me

#

Hi Khloe!

rancid musk
#

Hi atra

calm nebula
#

(Note that when I say "might" I very much do not know details anymore.)

rancid musk
#

You beat me to a dumb joke so I erased mine ๐Ÿ˜”

calm nebula
#

I know she was working on a dungeon feature

#

That's all I know

whole raptor
#

I know S&S adds it's own dungeon, but no idea if it's their C# component or something else

shut grove
#

I wanted to include a dungeon that's about 50 floors deep for one of the main quests of my mod.

calm nebula
#

Khloe, why do my teeth and eyes need separate insurance

#

Why does the insurance suck

shut grove
#

if it comes down to it I can just not do the random floors thing

calm nebula
#

Hi Esca!

royal stump
calm nebula
#

Long time no see

royal stump
#

yeah, been distracted for a while again, but still peeking in occasionally SDVkrobusgiggle

calm nebula
#

I made a sweater

#

Well. 80% of a sweater

rancid musk
# calm nebula Why does the insurance suck

(Because health insurance is a racket. I especially like how mine gets more expensive and covers less every year. But this probably isn't the place to talk about it.)

#

Mod idea: Joja Insurance Agency.

It claims to protect you from things like losing items when you pass out in the mines, or losing crops for whatever reasons.

But instead it's just an extortion racket, and they deny all your claims, and if you refuse to pay for it they send people to your farm in the night to destroy your stuff.

royal stump
#

SDVpufferwoke spend multiple days doing argument mini-games to maybe get some of your money back

calm nebula
#

God. I'm glad I'm just looking at paying for teeth work and new glasses out of pocket

#

(Both of which I can easily afford.)

royal stump
#

(I've been avoiding both of those for a couple years, I should probably do it soon SDVpufferdizzy)

calm nebula
#

My glasses are five years old so

royal stump
#

same, feb 2020 or so for mine, though I needed dentistry enough to go more recently

#

also still thinking about how stardew insurance mechanics would work, I should stop & finish some bugfixes SDVpufferdizzy

calm nebula
#

๐Ÿซ‚

royal stump
#

is Pathos still doing fixes in the game itself? I'm tempted to ask about making the location GSQs mine-safe

calm nebula
#

Do I have esd sheaths

royal stump
#

better double-check to be safe, but I'll make a note to ping him then, thanks

#

afaict, TryGetLocationArg and such just ends up calling "get location from name" for the mine levels and updates the elevator etc

calm nebula
#

Oh lol

ivory plume
# stable grotto please pathos, there's a reason I changed that entry (except for the accident!) ...

Hi! Your original changes were reverted because you accidentally removed a bunch of recent changes, so I manually merged them back into the entry after.

I tweaked the changes since:

  • The mod page is considered the 'main mod' when there are sub-mods, and the mod page and download both say Vibrant Pastoral Redrawn. If you want to treat the C# component as an explicit submod to avoid confusion, it would become "Vibrant Pastoral Redrawn โ†’ Vibrant Pastoral C#" on the compatibility list.
  • The compatibility list should reflect the actual mod info. You added notsemisu and JefGrizli as the author, but those don't appear anywhere on the mod page (grapeponta - Semisu - poohnhi) or released manifest.json (Semisu).
  • The nexus field is a Nexus mod ID, not an update key. Adding invalid values will break other tools that parse the compatibility list, not just update checks. You can override the local version used for update checks instead using the "Mod data overrides" section below the main list.

So the adjusted entry would be:

{{#invoke:SMAPI compatibility|entry
  |name    = Vibrant Pastoral Redrawn โ†’ Vibrant Pastoral C#
  |author  = Semisu
  |id      = VibrantPastoral.C
  |nexus   = 6367
  |github  = notsemisu/VibrantPastoral.C
}}
ivory plume
stable grotto
#

yeah sorry for reverting those changes, no clue how that happened might have been when the page crashed on me (that was a thing)

ah, change it in the overrides to 2.0.1 so it reads that instead of the version in the manifest, gotcha

ivory plume
#

Yeah, the wiki has been overloaded recently, and the mod compatibility list specifically is right under the maximum limits of what the wiki can display. We need a wiki update before we can rewrite the compatibility list to be more efficient.

shut grove
ivory plume
# calm nebula What about f#

I don't think I've ever seen someone actually get F# working as the main mod. It would be listed too though, the "C#" part in the section heading is just to help avoid people mistakenly adding content packs to the list.

calm nebula
royal stump
#

@ivory plume Minor bug report for SDV: when targeting UndergroundMine locations, all location GSQs seem to load the location directly, causing elevator progress to be updated. For example, this in CP unlocks mine level 120:

"Action": "EditData",
"Target": "Data/TriggerActions",
"Entries": {
    "{{ModId}}_Test": {
        "Id": "{{ModId}}_Test",
        "Trigger": "DayStarted",
        "Condition": "LOCATION_IS_INDOORS UndergroundMine120",
        "Action": "Null"
    }
}```
(It can be worked around by pack authors, but it complicates new custom queries a bit, so I figured I should mention it)
ivory plume
#

Oh, well that's not intended.

royal stump
#

Will do, thanks

teal bridge
#

Has anyone used the healAmountToDisplay argument in drawTooltip/drawHoverText? I'm trying to understand what it does from the decompile, and it's just totally bizarre:

  1. Its initial value is used in the measurement for the tooltip's width;
  2. If the tooltip references an edible object, its value is replaced with the object's energy recovery (but the width is not updated);
  3. It is then used as a check for whether or not to draw the health/energy recover sections, but...
  4. Its value is never actually read when drawing those, instead that part of the code reads the stamina and health recovery directly from (Object)hoveredItem
  5. The only time it is used again is adjusting the vertical position of money display.

What is going on with this??

stable grotto
ivory plume
#

Yeah, currently trying to view the changes too. I'll see if the wiki people can do anything to improve the performance.

rancid musk
#

It might be time to just write a dedicated system for the mod listing.

narrow vault
#

heya, was just wondering, how would i check in the event handler for a Player.Warped event if the NewLocation is in the Mines/Quarry Mine/Skull Caverns/Volcano Dungeon? (any of the mine/dungeon floors, not the entry area)

teal bridge
#

location is MineShaft || location is VolcanoDungeon

teal bridge
#

I'm not sure if SkullCave counts as a MineShaft, but if so you can copy the game's own GSQ and check shaft.mineLevel != 77377

narrow vault
#

am i correct in assuming the Farmer.canMove bool is the correct value to check if you want to check whether the player can do any action? (e.g. mine rock with pickaxe, attack monster with sword, eat food)
or would there be a separate check for those?

rancid temple
#

I think can move just controls whether they can actively walk

#

If I'm trying to see if the player has been given control I usually check if Context.IsPlayerFree

#

It's false when menus are up or the world hasn't loaded

#

But I dunno how it works with like events and such

narrow vault
#

my main purpose would be to check if the current player can perform an action currently or if he is already in the middle of performing an action

teal bridge
acoustic summit
ivory plume
teal bridge
ivory plume
acoustic summit
#

SkullCave is not counted as mineshaft, nor is the Mine entrance

lucid iron
#

Since the entries on wiki work by templates they don't have to all be on 1 page right

acoustic summit
#

You can check them independently

lucid iron
#

Could help a lot if we just partition page into 2 or 3 pages, by some alphabet range

teal bridge
#

Pathos's answer is probably better. Stardew has so many helpers, it's impossible to keep track of them all.

narrow vault
ivory plume
#

Yep, you can use them anywhere. They can accept either a GameLocation instance or a location name, and have optional overloads if you want to get the level or layout number.

teal bridge
#

Of course, I'd be remiss if I failed to point out that MineShaft.IsGeneratedLevel is really just a check for location is MineShaft if you don't use the overloads with out params.

lucid iron
#

Oh pathos there is bug with SeasonOffset on maps with SeasonOverride

narrow vault
#

alright, only check i need for the level is the 77377 one for the quarry mine

lucid iron
#

This Game1.seasonIndex should use the location version

narrow vault
#

but now that you mention the game having a lot of helper stuff, is there an event that i could use to check if the player is in a mine floor that gets called less often than the Player.Warped event?

teal bridge
#

No. The SMAPI events are all clearly documented.

#

Player.Warped isn't exactly called very often so I'm not sure why you'd be worried about that.

acoustic summit
#

Its alright to hope for a way to further optimize it tbf, but yeah warped is the best youre gonna get here

narrow vault
teal bridge
#

Warped doesn't need optimization though, it happens on the scale of seconds, or minutes.

#

Premature optimization yadda yadda.

ivory plume
narrow vault
ivory plume
#

If you want to do something when entering a mine level, Warped with an IsGeneratedLevel check is the most specific event available.

narrow vault
# teal bridge `Context.IsPlayerFree` is usually preferred.

that said, regarding the player is free check, what would the preferred way to do that when i don't want delays in the game ticks, check at the start of a tick event handler? or is there some event fired when a player finishes the current action that i could listen to instead of going per tick?

teal bridge
#

Huh? IsPlayerFree is just a property you read, it doesn't delay anything.

acoustic summit
#

I get the worry of optimization though, I had to drop 3 back to back optimization focused patches on a mod after I scaled it up one time SDVpuffercry .

teal bridge
#

Oh, you mean you want to actually buffer the action and run it as soon as the player is free?

ivory plume
#

(IsPlayerFree is really a method that checks multiple things, though it should still be pretty fast.)

narrow vault
teal bridge
#

You could technically try to hook up an event to when animation ends and such, but really, I wouldn't. There are a lot of variables that could come into play, like Events (not .NET events, but game events). And menus.

ivory plume
#

It depends what you want to do. Checking IsPlayerFree on every tick works, though ideally you should only do it when needed (e.g. while waiting for them to finish an action, instead of checking all the time).

calm nebula
#

Isn't there like an in game way to do that noe

#

ActionWhenPlayerFree or smth

ivory plume
#

If you want to optimize and don't mind a slight delay, you can do e.IsMultipleOf(x) in the event handler to check every xth tick instead.

narrow vault
teal bridge
#

There is Game1.PerformActionWhenPlayerFree, though I think that's a queue, you'd want to be careful if the action isn't supposed to repeat.

ivory plume
#

Oh, yeah you could try Game1.PerformActionWhenPlayerFree. That uses the game's Farmer.IsBusyDoingSomething method, so you'd need to check that that logic matches what you expect.

teal bridge
#

If it's supposed to be a one-time buffer, then it's better to save the action, check IsPlayerFree on each update tick (if an action is queued) and run the action once.

amber adder
#

Anyone here have C# commissions open rn and would be willing to give me a quote on a project when they have free time to take on a project? (I have to adult with funds first yay ๐Ÿ˜‚ )

calm nebula
#

Yeah, it depends a lot on what you're trying to do

ivory plume
calm nebula
#

I have at least one mod that tries to queue to after a heart event if there is one up and does that just by adding myself to thr event's exit delegate if one exists

amber adder