#making-mods-general
1 messages ยท Page 109 of 1
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.
then unfortunately i do not know the issue
Gonna test a theory.
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 ๐
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
you can check this link for the CP conditions you can use in When fields: https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide/tokens.md
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"
(you can also use the {{Range}} token instead of listing individual heart numbers)
oh wow this is exactly what I needed!
i gota go thru my script line by line roku!
thanks so much guys ๐

Dinner and movie break from modding. This mod is gonna make me rip out all my hair.
thats not good
Eh it's nothing new for me and modding. Especially when I'm so rusty with everything modding.
I originally was only gonna add a โfewโ mods now Iโm at 266 ๐ซ
(i think you wanna share that with #modded-stardew not here)
Ooops my bad I thought I switched 
i originally was only going to make one npc, and now i'm thinking about 6 
rmbr to always ship a mod before imagining more mods
if u r worry about test rmbr no test only ship
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)
ROFL. I found the issue.
Two interesting perf discoveries:
-
The game's/SMAPI's asset loader does not have any idea when you're requesting an asset already in
Game1- that is, doingGameContent.Load("LooseSprites/Cursors")will cause the entire Cursors image to be loaded and decoded again even though it's already there inGame1.mouseCursors. And: -
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.
yea apparently logo's mod list takes 4min to start
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
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
at least my game isn't that slow to load in
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)
I think switching windows (as long as you don't have "pause if not active window" disabled) should work
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
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
So the trick is you have to wait for the anim to finish
and for the screen to go black
IT WORKS
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
I guess that's cue to add more mods then, for testing
thats even less incentive to test that!
Welp, getting a 275ms load time down to 110ms is pretty good for a day's work. Still room for improvement, but passable.
would you get the jsons into memory in threads and then apply the patches in order on main thread
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.
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?
hm that would result in the data being blank for a few ticks right 
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.
still even with patches all on 1 thread, it'd still be load improvements and big impact given it is content patcher
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?
Conditions in this case refer to the CP when field, not preconditions
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
I see, thank you
Yes. Which tends to be less noticeable than the game completely locking up for several frames. In the case of data describing images, it just means some images would load late and likely most users wouldn't even notice.
yea i can see how this is fine for ui, but it seems dangerous for things like npc schedules or machine data
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.
dang focustense is making No More Lag Except It Works
alas i outsource all my data loading to content patcher 
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.
well sdv's got its own monogame fork right
make texture load async and make draw less cursed 
just reimplement the game engine, but faster. simple as
Two inches away from publishing a mod update that says "Changelog: Nothing changed except the update date because mod users are easily fooled."
"Adjusted the manifest."
this is just me fr
they wont know the difference
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"
changelog: added a 2nd olive oil identical to original olive oil including id
Drawing itself is usually not the problem, although text layout is horribly slow. The problem is how much other crap is being done in what is technically called "draw".
changelog: "added bugs. is this a new animal in the game, or did I mean errors? you find out!"
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.
Added an easter egg that crashes your game if you say my mod doesnt work
sounds like an epic easter egg lol
if you implement that but it has a bug in it, should i say it doesnt work?
(There's a bug in your bug)
changelog: absolutely nothing changed, but I added a knock knock joke to the content.json
Changelog: Added Easter Egg ;)
me @ mothman changelog
The cruelest joke, because they'll never guess it was just in the code
Hmmm
The first time feels like font loading
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.
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)
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.
i am reminded of the ~250ms asset crunching delay when opening the pause menu for the first time after game launch
Ichor, does it do that for vanilla alone?
Indeed, it's an almost identical situation (but I got it down to just over 100 ms today).
Afaik it doesn't
It's pretty darn slow in vanilla.
The debug command /tto shows frame timing
vanilla did it last time i checked, but that was about 1.6.2 so
...huh
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.
Interesting
where does one input this? chat box?
better crafting causes the lag spike for me immediately upon pausing, because the submenu is created as soon as that initial menu is opened
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
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.
(more accurately, every one of the pause menu's submenus are created when the initial menu is opened)
I really don't think that's the case. Individual submenus have individual lag.
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
checked just now and vanilla 1.6.14 does it
It doesn't for me. Must be something unusual about your configuration.
i use out of the box Better Crafting
I get the [Better Crafting] [RecipeManager] Loaded X cooking categories and Y crafting categories. message only after clicking on the crafting tab.
since its only in my debug testing profile anyway to make sure i didnt break anything with it when working on SPU
Interesting. Now I have to check if vanilla mobile does it 
speaking only for myself, my collections tab is loaded immediately when i press E to open the menu
Are they hiding optimizations from the rest of us?
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.
i actually extremely expect it to have that
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.
I get the same behavior of Better Crafting without Clear Glasses. Still only logs its message when I hit the hammer icon.
i just tested SPU again in 1.6.14 and my constructor does indeed run as soon as i pause
I added Program.enableCheats = true; to my personal mod lmao
Same behavior for me
(It's also in Events Tester)
(tho i havent tested BC again yet since its not in this profile yet and i need to download it)
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.
But I haven't played the PC version since before 1.6 dropped so
Who the hell knows what a PC is anymore haha
Pretty sure those are those things that torment you at work
Lol
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
did u check if the lag is vanilla too
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
i can't get my npc to load in for whatever reason? they're just gone
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.
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
What did you change since the last time they worked?
I added an event, movie reactions, and a "has seen event" flag to make them romanceable
I don't think i touched anything else ...
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
In their disposition, I assume? I'd put it into the json parser and make sure you didn't miss a comma somewhere.
that last one sounds relevant. make sure you drilled down correctly and/or used "Fields" or you may have overwritten their entire Data/Characters entry by mistake
if you used git you could've made a commit when your npc was at some milestone, and just checked the changelist since then 
Also that
@ ichor
See the thing is
I didn't touch their disposition
So idk
It was working fine before
How did you change their romanceable status without touching their disposition?
I found 1 hard to believe since I thought Helper.GameContent just pulled from Game1.content, but each mod actually has their own content manager with their own cache... what????
Real men use svn
svn is dead to me. long live git
wait this is opposite of what i was told b4 i also thought Game1.content is just secretly Helper.GameContent 
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
Oh hold on
maybe i misinterpreted something
spacecore can do this for you
it has custom warp totem support
(comes with the warp animation and the dwoom, too)
Thank you! :> I'll go read the guide kwkw
I definitely recall @ivory plume saying otherwise
But yeah. I recall concluding from an admittedly brief look at the code that every mod had is own game content cache
(also i forgot i can literally just look at the constructor for GameMenu. it does create every submenu in its constructor)
Yay I fixed it.
(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)
At one point of my life I wanted to make that menu lazy loading but now I don't
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
i meant during the games development
So it wasn't really worth it for something most players won't notice
like when CA was first writing the GameMenu
interesting....is Game1.waveBank1_4 not used at all?
unless there is magic going on
there is likely magic going on
i still kind of want to make a mod that creates and throws away a GameMenu during save load, just to move the big crunch to a spot where it is less noticeable. maybe i will one of these days
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?
Do you mean the two spots where vanilla NPCs sell? No, you can add modded NPCs to the pool
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.
i wonder if u could add more slots
Last time I had desert festival, Blanche had a shop, so you could look at her code
like 4 shops a day, 6 even
Oh hooray! I misread you and thought you were saying custom NPCs can't be added. Now to noodle on what they could sell!
{
"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
Oh, sorry! I meant no, they're not hardcoded 
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
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.
Thank you for the explanation!
but if i am use Game1.content.load wouldnt i be the person poisoning the cache 
well, i hope not but u know what if i do a bad
Yep, so don't call Game1.content.Load<object>. (For example, No More Lag sometimes breaks Content Patcher by doing that.)
I'm so sorry ๐ซ
would it be worthwhile to call Monogame's EnsureUIThread or whateves
All mod code runs on the UI thread by default (unless you're doing async background tasks).
ooh since when was that one public
(No More Lag also attempts async background tasks.)
(It also causes errors that way.)
luckily (?) most of the time it ...does nothing, it's calling load on items already cached
can i set No More Lag as an anti-dependency for my mod
I've seen some oddball errors
you can do the thing where you deliberately crash or return to title if it's installed, but that will get you blocklisted by SMAPI so i don't recommend it
that imply it somehow managed to try to load a spritesheet on a background thread...somehow
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?
yeah im generally not a fan of the more malware-adjacent methods that some modders in some communities employ
got it.
ig the more relevant q is like, what r good reasons to go out of my way to use helper.GameContent
you could disable your own mod if it's installed, that wouldn't be blocklist worthy I don't think?
i could but i think SMAPI should do it for me ๐
please also [popup] [another popup] [popups opening faster than you can close them.]
(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.)
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
would helper.GameContent be better for custom assets perhaps, where i only got a small set of things to cache
I used to sometimes use the other Game1 content manager for shit like that
Game1.temporaryContentManager or smth
the use case here would be the various content using framework mods
that one gets unloaded every time a player moves maps
but I recall issues with asset propagation and that one.
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?
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."
THAT'S what my 3/10 failures was! 
I have never once used Helper.GameContent - I use Game1.content exclusively
@ivory plume Gonna bug you since you're here and would know the answer. Then I'll go away for like another year I promise. ๐
oh yea thats just Condition in the item spawn field
Both of those should be possible, yes. Take a look at VMV's shops since I believe it does both
hang on a second
Nope, graylisting would only be for deliberate player hostility. Accidental crashes could result in that mod version being added to the compatibility blacklist if it affects many players though (e.g. some Harmony mods were compatibility-blacklisted due to crashes in 1.6.9).
u can use these in Condition https://stardewvalleywiki.com/Modding:Game_state_queries
It'll work if (a) it's already loaded, or (b) possibly if nothing else tries to access it in a way that needs valid type info.
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?
hmmm
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
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.)
Got it, thank you 
if i can't get this npc to load i give up
what does your patch summary say
i'll need to do a patch summary first >.>
wait no I definitely use this with atracore's equips model, which is lazy loaded. Maybe because it's set to a specific type in LoadFrom?
Yep, that would probably affect it. In that case it's bypassing the low-level XNA content pipeline, and injecting the data you provide directly into the cache.
upload the log and share so we can see it.
X.X I'm already in the middle of fixing it
For reference this ended up being my solution: https://github.com/focustense/StardewUI/blob/dev/Framework/Api/AssetRegistry.cs#L36
I won't say I'm proud of it, but it does work.
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?
It's just a big dictionary of asset names to Game1 assets.
it doesnt do anything. it errors
Thanks, good to know
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.
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
Looks like an included file
game refuses to pick up on it? for whatever reason
Isn't being applied, but my experience with patch summary is usually that lmao
Probably need to see the various jsons
yeah applied only matters when uhhhh the npc is being talked to iirc
๐
well, npc still won't show up so that's problem #1
can't talk to them if they dont exist
ik you said you changed the canberomanced but is your unlockcondition also behind a gsq
wdym
in the data/character
"UnlockConditions": "PLAYER_HAS_MAIL Current EdelweissWarp any", //game state query-able about whether the npc has an unlock condidion before seen
i dont have any?
painful options: throw each of your included + content.json into the validator n we can help parse which one is probably the culprit
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
}
},
``` 
this is truly a painful option
@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?
So what if a farmhand sees the event but not the host? Is this NPC meant to only be romanced by the host?
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
Right, sync I wasn't that worried, more so just intention
separate datability is a spacecore thing afaik
well. separate datability that doesnt produce weird results, i imagine
I can add that feature in the next emc release
the ability to specify the mulplier count
That would be great! It's also what I had in mind. Thanks!
and i still can't figure out why my npc says no to loading into the game
Without those jsons, can't really say
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
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
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
oh portraits + sprites too i thinks
here's content.json https://smapi.io/json/content-patcher/97ffcf0b4bda4666bc21919a67452be0
character data https://smapi.io/json/content-patcher/ee71fdf2d8b8462c94a9e0f0b5c1c7b0
schefules https://smapi.io/json/content-patcher/a14f831bb9e74bb0bcb19f41e5f8b427
gift tastes https://smapi.io/json/content-patcher/f3110d7dba7a40a88cdc422fe4fc9cf1
๐
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)
i think that's fine then since it didn't scream at you about xnb, you have your targets correct
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
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)
Should be the town square ish area
Do you know why your Location isn't loading? Do you not have a tmx for it?
seems like a fileclimbing issue
or this?
or that
I'm just not sure why it's saying that lmao
looks like there's a typo in the location name?
like if you had ModId}}_WaitingRoom instead of {{ModId}}_WaitingRoom
The only thing of note I'm seeing is that the Map is being Loaded after the Location is created
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
Yeah, that's certainly a problem for the Home, I don't have an NPC I can mess with to test this lol
i've never tried to have an invalid home 
maybe i can tweak with mothman, pulls up vs
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
i could give you mothman
Mothman!
whroosp
i'll eventually test if scale up 2 works with character sprites 
oh right but it made krobus hueg
explodes i'll test after i fixed the weird home ID
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
It even works with tiles, apparently, so theoretically you can make HD Stardew Valley with it.
Just gotta patch every tile individually 
hmm

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
Good to know
my absolute nemesis is bonking things 
earlier i was staring at my event for like an hour
bc i kept missing a {
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
https://smapi.io/log/111a299827af4fad867b7802690da0a0 yeah, weird, it probably needs a deeply internal thing if the home returns an error
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.
great now i fucked up the schedule and they won't move
But at least they spawn lmao
You don't have a spring_mon and your spring schedule is just them standing in one spot
it's tuesday
Did you fix your map loading?
Are they?
What kind of warps did you make?
There's like 4 different kinds of warps
hmm i never tried it
but
๐ค should anything have even changed?
so i wonder if i messed up the schedule somewhere... one sec
Do they have a way to warp back into the waiting room?
๐ค is that necessary?
Yeah, otherwise the pathfinder can't get in there and create a path
Hm, at least that's my understanding, but I can obviously be wrong
Did you have SpaceCore before?
....i did
SpaceCore changes the overarching pathfinder
i'll add it back and see if it's fixed
i'll just stick spacecore dependency on my mod i guess >.>
hmmm macro pathfinding in spacecore my beloved
(if that's what bonked it)
My SpaceCore issues sense is tingling
more like an issue SpaceCore fixes
Which is to say, the games wonky map pathfinding
(Can't remember what it's actually called)
i still don't understand this home data parsing when the location doesn't exist
The weird thing it was doing with the broken token?
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
Hm, maybe just a lack of an exception
hm, nope npc still hangs out in the void
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
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
you can just shove spring at the bottom
oh
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
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
(that also goes for any other dictionary)
Unfortunate
(Technically dictionaries can be ordered, they just shouldn't be.)
imagine having to MoveEntries for every entry you wanted to add to anything
brain fried, english no work good
I think it's just unfortunate because it makes it hard to memorize what order it's checked in
(it's too late in the hotfixes, but home Id/Location has no validation
)
so i can throw any ol' location invalid name and it'll make my npc get thanos snapped
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 
so my npc just wont leave the house for...reasons.
problem is, i have no idea where to report that
there is
!officialbug for report
If you've checked that it's not a mod bug:
- Report gameplay bugs to the Stardew Valley developers here: https://forums.stardewvalley.net/forums/12/ (do a quick search first so you don't report something they're already looking into).
- Report typos or translation errors here: https://forums.stardewvalley.net/forums/32/
Alternatively, you can emailsupport@stardewvalley.net
well it pertains specifically to modded, so is that still valid?
i'm reading the forum posts on what to report
Where does your NPC exit that map?
That said this is the kind of thing to maybe just stick a validation in
Or where would it
In smapi
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
hhh at the bottom of the map.. there's nothing being blocked
Where does it come out?
bus stop
i go ask in the support channel
adding that into the NPC tutorial troubleshooting section
Bus stop should be fine for pathing, you're sure the tile they exit on is walkable?
Have you tried making them path from anywhere else?
like, having them spawn elsewhere? or
Yeah like someone else's house and walk from there or something
So reading up above, did I accidentally dodge a bullet by making the Satoru Gojo NPC use a home location? xD
hmm i'll try
yes
As long as you made him use a valid location lol
uhh... ๐ marnie i'm borrowing your house?
tbf i think it had a valid home location though didn't it?
Yep, I made him use the AdventureGuild as a home location, so it's valid. xD
I mean, you're also borrowing abigail's face so a house is probably less of an ask 
if it wasn't there, he would've just been bing chilling in the town square until he had to move to the adventureguild
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
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
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

yeah no npc refuses to go places
Do you have a proper schedule with 2 points for that day?
Well, that's progress, at least it's not the house lmao
And have you slept if you changed the schedule and reloaded the patch?
"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
New save?
just in case it matters, make spring_tue spring_Tue?
i don't remember the finickiness of schedules, but i did have to sleep a solid like 2-3 days after changing mothman 
Oh yeah, those could very well be case sensitive
Still worth a try
Well unless the wiki is wrong, they shouldn't be
ok
Did you do a new save?
is there anything at all in the log?
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.
ah, gendered pathing errors xD
Oh right, SpaceCore doesn't like the no gender thing
Not actually sure what causes that
well i think some of those was because i didn't change the normal spring schedule
but changed spring tuesday schedule
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
yep
well the map likely isnt the issue so i'll put it back
Yeah, likely fine
need a warp in and out for anything that's a destination.
hmm..
can just make a NPC warp from the bus stop to get them an "in" if you don't already.
(does a warp room count as a destination if it's not a 0 schedule)
(such as a 610)
(I'm using destination to mean anything that appears in a schedule command at all)
๐ what did i do wrong ... it was working fine earlier
Unless you have any backups to compare it to, impossible to know for sure
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
Is Gojo just all 0 schedules? lol
i'll try removing the 610 bc they already spawn in there (?)
nope, Gojo has no 0 or 610 schedule destination, he starts at home and doesn't move until 700
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
(on a side note, wow my game runs so fast...)
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
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
@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)
Thank you very much for quick update! 
thank you very much
๐ค so all of these "fall objects" things i can get rid of?
Assuming your map is not intended to be outdoors and use seasonal tilesheets, yep
I'm actually not sure if those _Objects things matter
Two things
Map patches don't take map properties to the patched map
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 ๐
And if you're just patching a warp onto the bus stop you can just use Action EditMap
^ yes, that
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
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
I don't think so, 1.6.9 was extremely light on CP changes
huh
bc all of this worked fine in 1.6.8 without needing a warp back in
....aaand i borked something
SMAPI got a little stricter about checking some arguments, I think, but nothing else should have changed much?
that was just for skill recipe requirements wasnt it
i18n key mismatch.
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)
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?
You could make a mod to do it but it'd require people to install it
The crop destroyer could just not install lol
there no way my client isnt made award of player actions i see it happen on my screen...
Most things aren't handled in a typical host client fashion
SDV isn't built for multiplayer, that was tacked on after the fact
a lot of it also doesnt say "a player did this!" just "oh theres not a crop here anymore btw"
It gets sync'd yes, but accessing who did it is pretty annoying
and to add to this, even the multiplayer when it was added was not made with non-trustworthy multiplayer in mind
Not really sure if net fields have such info 
Pretty sure you would have to force the players to report what they've done with a patch to a bunch of methods
I wonder why the recentish wave of multiplayer anti trust mods lol
Are ppl trying to coop modded with mobile or something
People need to stop playing with baddies
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
Releasing an update on a bunch of consoles also means more players in general
ya thats a bot that hosts the game
Well ig if u make it part of the headless server mod somehow it might work
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
Like server refuse to connect u without X mod installed, slightly harder to lie
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?
this is fine
could even be another mod doing it on their behalf that you also have installed
SOME debug msg realted to player actions would be gold
well, thats not fine if you want to know that someone intentionally did something
Well feel free to try and make the mod then
You're gonna be jumping down a rabbit hole for this though. Observing the netcode internals.
if the whole crop field is dead and the log show X player was doing something there.... ya thats enoght
This mod is good ref for detecting damage
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"
It's specifically weeds tho (and nothing to do with multiplayer besides being compatible)
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.
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
(Though I hope someone making something like that would run their logic on the host only purely for efficiency.)
i get that its not full proof but its good enoght
if thats good enough for you then the answer to your question then is "sure, if you make the mod"
Install the "I trust my friends who trust me" mod instead 
but "sure its possible" is not "sure its easy"
ok so i would have to make a mod that logs all incoming msgs from all clients
theyre not sent as messages per se
probably not that hard
right ofc its a bit more techincal
its not as easy as "listen for messages"
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
you'd wanna hook into all the relevant netfields too, i imagine
and like, thats just for the singular action of monitoring crops
Crop is terrain feature > hoe dirt > crop
(I imagine you could get by just with hooks into a netroot maybe, but I haven't dug into the netcode much.)
i would just log every single thing thats "syncing" with other clients and filter the log as needed to see who did what
things are being synced all the time, though
That's going to be a lot of data
Or object > garden pot > hoe dirt > crop
thats ok...
Be mindful of not lagging everyone the hell out 
and i dont even know how you would tell what client/player caused a netfield to sync
or which one caused the change
Disk write is the slowest thing besides network connection :v
theres also some things that arent synced, too, or at least not until later on
like farmhand stats
Yeah not like sdv need graphics
Yep, just attach your toaster and you're good
(Fun SMAPI log with every mod marked compatible on the SMAPI mod compatibility list.)
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
1713 
im curious what the load time on that was
wait i forgot the trace has timestamps too. much better than i expected tbh
About 7 minutes 39 seconds, from launching the game until it failed to load the save and returned to the title screen.
1.6.15 beta
spoilers
(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.)
Special mention to that mod that failed to load because it was expecting F# support for .NET 8.
you can with FF!
At least I think that's what that error was.
Aw one of my mods r borked (probably because it's confused about inventory size)
Yeah I could see patch conflicts if you try to load every single mod @.@
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
is there a modding page for achievements???
Yep, Modding:Achievement data. You can also search the index page to find any modding page.
(Loaded into the game! Or at least loaded into the popups.)
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
(Loaded into the popup slideshow!)
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
)
I see you have met a python dictionary
most dictionaries are ordered. alphabetically, usually
it really saves on the time complexity of a lookup
My dictionary is ordered alphabetical in reverse letter order, sorted
(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.)
oh no they aren't even arranged alphabetically XD
oh, it's just the update portion that isn't, that's better
man the standards are high to get on the compatibility list these days
one hell of a final exam 
please pathos, there's a reason I changed that entry (except for the accident!)
the C# part, of which I am the sole author, is not the same as the CP one (which is Redrawn)
all it does is register tokens, unless you change the workings of that in CP it will likely never break
(by feeding SMAPI a non-existing subkey I can at least postpone the version update until something actually needs updating)
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
not the case here, there is no update, it's just picking the version from a different mod component
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
which was an oversight on my end because I had to rewrite that mod from my old one and forgot to update the version
Was profiler in that list of 236, or was there a different reason for being a disabled mod?
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
what do you guys use to make mods?
!software
Here's a list of software for pixel art and JSON text editors we recommend: https://gist.github.com/ishanjalan/c8efb21afa21f74a052293176db107f7
For making SMAPI (C#) mods, see the Requirements section here for which IDE to install https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#Get_started.
what do they use?
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):
- 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?
- 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.
too many lines
Sorry :)
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
(i don't think it's too many lines, but it's a lot of thing)
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
use the token as a GSQ condition as long as it has a true/false result
@near harbor pinging so you see this
like just write the token name? (it does have true/false options)
{{mytoken}}
let me grab an example
"Condition": "{{HasMod |contains=Lumisteria.SereneMeadow}}, SYNCED_RANDOM day lumisteria.astershop_flowersandcropseeds 0.6",
Just write the token name, CP resolves it into true or false before the game sees it
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
thanks, i'll try that
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?
ok! note that mods can have several folders in them, and most big mods do. My suggestion would be : use CP for all the "basic" (npcs, dialogue, maps) which is already a pretty solid base, and C# for all the extra stuff that no framework do
Good idea! Thanks again.
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)
blargh
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?
if you are adding to a vanilla maps when they arent already
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?
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
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,) .
some mods use the CP tokens to make convenient load of several things
like targetwithoutpath
look at CP docs
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
what is the intended result? to change sprites and portraits at the same time?
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`
heyy, how do i set priorities for dynamic tokens?
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
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
what do you mean by 'set priorities'?
youre right. seems like its the only convenient option to do afaik 
i get an error saying both tokens have the priority "exclusive" so none of them get applied
i was wondering if there is a command setting a priority low or high
I would need to see your content code to understand what it means. there is nothing like priority in a dynamic token
'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.
Ah this ain't dynamic tokens
huh
You have multiple Load
With same target
Need to change one of them to EditData
Even with priority only 1 Load applies
that makes a lot of more sense
xD oh
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
I thought you'd do an 'Include' on schedules.json instead of Load?
Include adds lines to the original file, don't?
if you want to fully change it with another you made, Load works well
include is to split your content.json up for organisation
so laod is correct
Thank you so much.
hmm EditData can't be used
by what I got from your content, you are trying to change a schedule when another mod changes the same schedule, that's right?
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
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 ?
https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide/action-load.md
Priority might be right thing after all
Make the mod dependent load higher priority
i am not sure there's a solution. I think selph mod for animals allows stuff like them going in winter but you can't really check where the animal house is to have that conditionnaly
ah yes nice, is it just "Priority": low
like this?
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.
i figured as much. but now i asked so i feel better โค๏ธ hehe ty lumi !
ill just let folks know thats a limitation in the mod description
"Priority": "Late"
"Priority" : "Low"
or whichever is the level xd
the priorities are "Early", "Default" and "Late". Late will usually apply your changes after everything else.
hm nothng in the C# code indicates that this should be the case
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
in this case I can't see why Lou was having issues with their Load. they are not trying to Load over the same file twice.
their content though checks for another mod that seems to change the schedule and applies their changes if said mod is loaded
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
I understood that's what is causing the double call and innitial problem
how the season overriding is done? it may be applied after Elle's checked for the season
yea hm not even the SeasonOffset works 
in tiled the way that its done for GI
as a map property i mean
wait 
if Elle's check for {{season}} it will be taking the global season variable
they did come out
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
but its snowing 
THEY DID??
interesting...
weather changes is real
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
some chickens like snow heheeheh
ok i shall test some things then ty all! this gives me ideas at least
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
this is not check for current location so SeasonOffset on buildings are use main season rather than per location 
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;
}
aaaa thank you so much!! ive been very excited to bring it to life and im ALMOST there hehehe
and i think content patcher {{Season}} token was never locational
that makes sense its never needed to be really
im just over here being difficult lol
I love this 
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
I think I like the idea of seasoned greenhouses better. But the maps are awesome
very lovely
i wonder if there are any farm building mods that cover all of vanilla and properly use SeasonOverride 
chu that emoji kills me everytime i see it XD
I don't understand the emotional state behind that one, so I just get confused
mb xd i was looking at the action-load page. (backreading)
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
Content Patcher (https://www.nexusmods.com/stardewvalley/mods/1915) is a mod which loads content packs to change the game's images and data without replacing XNB files. If you want to make mods using Content Patcher, start at https://stardewvalleywiki.com/Modding:Content_Patcher.
the second link walks you through setting up
Thank you very much bro
@drowsy pewter I can write you privately for more questions of course if you don't mind of course
Don't worry, thanks a lot for the help anyway.
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
Just CP? Probably not
Spacecore might let you
I'm starting to believe Spacecore can do anything...
Hi atra
(Note that when I say "might" I very much do not know details anymore.)
You beat me to a dumb joke so I erased mine ๐
I know S&S adds it's own dungeon, but no idea if it's their C# component or something else
I wanted to include a dungeon that's about 50 floors deep for one of the main quests of my mod.
It was either that or "do open enrollment for me."
Khloe, why do my teeth and eyes need separate insurance
Why does the insurance suck
if it comes down to it I can just not do the random floors thing
Hi Esca!
search for "Spawnables -" and "Dungeons -" here
https://github.com/spacechase0/StardewValleyMods/tree/develop/SpaceCore/docs
Long time no see
yeah, been distracted for a while again, but still peeking in occasionally 
Takkkkeee careeeee!!!!!!
I made a sweater
Well. 80% of a sweater
thank you
(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.
spend multiple days doing argument mini-games to maybe get some of your money back
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.)
(I've been avoiding both of those for a couple years, I should probably do it soon
)
My glasses are five years old so
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 
๐ซ
is Pathos still doing fixes in the game itself? I'm tempted to ask about making the location GSQs mine-safe
Do I have esd sheaths
Bugfixes yes
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
Oh lol
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
nexusfield 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
}}
(The standards to be on the C# compatibility list are just "be a C# mod".)
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
What about f#
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.
or b flat?
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.
Someone did! Someone made a mod to switch out outfits in fashion sense automatically with f#
@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)
Oh, well that's not intended.
That looks tricky to refactor, so might be too late to change in 1.6.x now. Can you report it in the official forums?
Will do, thanks
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:
- Its initial value is used in the measurement for the tooltip's width;
- If the tooltip references an edible object, its value is replaced with the object's energy recovery (but the width is not updated);
- It is then used as a check for whether or not to draw the health/energy recover sections, but...
- 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 - The only time it is used again is adjusting the vertical position of money display.
What is going on with this??
on the last two edits I should have only deleted double entries that were created in the first one (I can't be sure, the page crashes every time I press a button)
please undo if it broke everything again, I can't even load up the history
it did finally load, and that is exactly what was changed
Yeah, currently trying to view the changes too. I'll see if the wiki people can do anything to improve the performance.
It might be time to just write a dedicated system for the mod listing.
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)
location is MineShaft || location is VolcanoDungeon
thx
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
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?
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
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
Context.IsPlayerFree is usually preferred.
For the actual mines segment of skullcavern it counts as mineshaft with mineLevel > 120. level 77377 is for the quarry mine.
Just moving it into a .json file on GitHub would be easy (and actually easier for me to maintain), but the main benefit of the wiki approach is that anyone can edit the mod info. Once the wiki is eventually updated, it'll let us have a .json file on the wiki which (a) gets displayed on the wiki compatibility page and (b) can be used by tools like the SMAPI.io page.
I know that it's level 120, that's why I wrote is MineShaft, just wasn't sure if the SkullCave entrance counted as a floor. Was pretty sure it's not a MineShaft but the vanilla logic is a little confusing, it might only be in the maps. Thanks for clarifying the quarry mine level though.
The game has some helper methods for that:
if (MineShaft.IsGeneratedLevel(location) || VolcanoDungeon.IsGeneratedLevel(location))
...
SkullCave is not counted as mineshaft, nor is the Mine entrance
Since the entries on wiki work by templates they don't have to all be on 1 page right
You can check them independently
Could help a lot if we just partition page into 2 or 3 pages, by some alphabet range
Pathos's answer is probably better. Stardew has so many helpers, it's impossible to keep track of them all.
nice!
i assume i can use those in the Player.Warped Event as well? (using that event handler to check after each warp if the player is inside a mine to set a flag for the rest of the code to use)
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.
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.
Oh pathos there is bug with SeasonOffset on maps with SeasonOverride
alright, only check i need for the level is the 77377 one for the quarry mine
This Game1.seasonIndex should use the location version
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?
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.
Its alright to hope for a way to further optimize it tbf, but yeah warped is the best youre gonna get here
i mean, i don't have to, but i always code by the motto that if something can be optimized without too much extra effort it should be
Warped doesn't need optimization though, it happens on the scale of seconds, or minutes.
Premature optimization yadda yadda.
That'll be fixed in the upcoming 1.6.15. Thanks for reporting it!
i know it doesn't need some, but if there was a better event that i could drop in replace it, there would be 0 reason to not do that
If you want to do something when entering a mine level, Warped with an IsGeneratedLevel check is the most specific event available.
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?
Huh? IsPlayerFree is just a property you read, it doesn't delay anything.
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
.
Oh, you mean you want to actually buffer the action and run it as soon as the player is free?
(IsPlayerFree is really a method that checks multiple things, though it should still be pretty fast.)
yes, running another action as soon as the player is free again
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.
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).
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.
overall i am trying to make a (cheat) mod that automizes the mines as a TAS-like tool for live games
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.
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.
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.
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 ๐ )
Yeah, it depends a lot on what you're trying to do
Feel free to describe the project! Some mod authors may be hesitant to offer themselves for an open-ended project when they don't know what's involved yet.
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
Yeah that would be helpful lmao ๐