#making-mods-general
1 messages · Page 302 of 1
ah nvm i figured
I have a problem with my pet's animaion. I basically want to define a new walk cycle and reuse one of the frames in this order:
I know that I can define the frames used for an animation, but I'm not sure how I'd do that for the walk cycle. I also know that I can define the direction of an animation.
Since "Walk" has four directions though, I assume I'd have to create four different animations for "Walk".
If I create four different "Walk" animations ("WalkLeft", "WalkDown", ...), then how woud that affect "RandomBehaviorChanges"?
That likely means I'd have to define Weights for each one of them.
If I worded that weird, please tell me that exactly is confusing.
the wiki says "randomly at the start of each frame based on the RandomBehaviorChangeChance field (RandomBehaviorChanges)"
so I guess just randomly starting to walk in another direction regardless of which frames they're in
I'm not sure if that's helpful in my case. Then again, I might just be confused.
I mean what did you want
My main concern is: How do I set up the animation of the walk cycles for all four directions?
add entries for all four directions
Like this? THis would be my first guess.
yeah that looks right
next you need to set up a way for a pet to transition between them
with the various BehaviorChanges fields
Like this?
I think UpBehavior and etc. will only match if the pet's current direction matches that
you can do something like having a Rest sitting state that has RandomizeDirection set, have all your walk behavior lead into Rest and Rest leading into walking again
Damn it, I don't think I understand quite what you're saying.
It's a little hard for me to imagine how that would actually look.
are you familiar with finite state machines
No
Screw it, I think I'll just stick to the 4 frames. My brain can't process what I could do.
basically a pet can have one active state, and it can change to any other state depending on a variety of conditions
you want to define all the states, and how that state can switch to another state yourself
Okay then...
If the pet starts with walking up it could then transition to walking into a different direction or a completely different state.
Did I get that right?
yes
If u only have 4 frames do u need any of that
to clarify what I said earlier, you can't use UpBehavior/DownBehavior/etc. when switching between walk states because if the pet is walking up it will only ever trigger UpBehavior, same with Down/etc.
I want to make the transition between these frames a bit smoother.
Ah
So when I want to define "Change to WalkUp", it would look like this?
I assume I can leave "Behavior" as "null" then.
Wait
No
I think I'd have to put "WalkUp" into "Behavior" then.
yeah, and 3 more entries for each of the other directions
Okay! I think I understand it now. I'll give it try after dinner.
I need some food to recharge my brain.
.....what is it???
That is a Scavenger from the game Rain World!
I just thought it would be neat to have a few of them run around the farm.
Oh huh! Neat! I'm looking at them on the Rain World wiki: Do you plan to add spikes to them at some point?
Probably. For now this little guy wills erve as a base for more variants.
Looking cool so far!
I wanted to edit the wiki but because it's a link, I can not with my new account.
Here's the section I wish to update on the following page: https://stardewvalleywiki.com/mediawiki/index.php?title=Modding:Modder_Guide/Get_Started
To decompile the game code...
:# First-time setup:
:## Install {{github|icsharpcode/ILSpy/releases|ILSpy}} for Windows (get the "ILSpy_binaries" file under assets), or [https://github.com/icsharpcode/AvaloniaILSpy/releases Avalonia ILSpy] for Linux and macOS. If you can't get Avalonia ILSpy to work, there's also this command line tool you can use: [https://www.nuget.org/packages/ilspycmd ilspycmd].
:## Open ILSpy.
:## Click ''View > Options'', scroll to the "Other" section at the bottom, and enable "Always qualify member references".
:# Open <samp>Stardew Valley.dll</samp> in ILSpy.
:# Make sure ''C#'' is selected in the language drop-down (not IL, IL with C#, or ReadyToRun).
:# Right-click on ''Stardew Valley'' and choose ''Save Code'' to create a decompiled project you can open in Visual Studio.
:## If you're using Avalonia ILSpy, make sure to add the <samp>.csproj</samp> file extension to the filename in the save dialog, like so: <samp>Stardew-Valley.csproj</samp> (Otherwise, the project won't decompile properly.)
This is my addition:
If you can't get Avalonia ILSpy to work, there's also this command line tool you can use: [https://www.nuget.org/packages/ilspycmd ilspycmd].
If someone else wishes to update this, feel free
What incredible exceptions I've had reported from an android user: System.InvalidProgramException: Invalid IL code in Leclair.Stardew.CloudySkies.Layers.RainLayer:Draw: IL_002c: stloc.3 System.InvalidProgramException: Invalid IL code in Leclair.Stardew.CloudySkies.Layers.RainLayer:Update: IL_001c: stloc.2
to make it even easier for someone to edit, this ws my edit note:
add ilspycmd Nuget cli tool for decompiling the game code. For Mac arm processors the Avalonia tool does not seem to work and it hasn't been well maintained, not confirmed for other processors or linux.
It seems issues with Avalonia ILSpy come up enough to warrant adding an alternative
Android modding my beloathed
I really want to know what's happening with the android version to make stloc throw invalid IL code
-# Not enough to investigate that mess, mind you
anyone know why a monster would be invisible if you teleport into the mines or volcano?
Considering it might be useful to add the commands needed. Then again it's documented pretty well on the link. Either way, if someone picks this up:
here's the install cmd:
dotnet tool install --global ilspycmd
and the command I used to decompile after navigating to the directory containing the dll to be decompiled:
ilspycmd -p -o <foldername you wish for the result> <dll to decompile>.dll
Well, it has to be that the stack is in a bad state. But yeah. Fun stuff in android land.
ilspycmd -p --nested-directories -r "$GAMEPATH" -o SDV-CSharp "${GAMEPATH}/Stardew Valley.dll" "${GAMEPATH}/StardewValley.GameData.dll" -lv CSharp10_0
If u decompile like this u can have gamedata and game in 1 folder
Wow 🤯
oh okay, thank you for clarifying
Guys do i still need a framework to make a simple quest via mail just to deliver an item?
that'd just be an edit on Data/Quests
https://stardewvalleywiki.com/Modding:Quest_data
yeah but there is no mention of an item option and stuff, how do i trigger that item was delivered ?
part of the quest data is what item to deliver, how many, and to whom
i just need to deliver like idk one strawberry
you specify ItemDelivery in the type, and what item to deliver to whom in the "completion requirements" field
is there info for that?
did you follow the link selph gave you a minute ago?
I assume this is not like a transpiler
i didnt see the last table there
But is rather like a normal bit of code
I assume they're doing some funky Cecil stuff to rewrite types and it's exploding. Or... something.
This is the IL around the stloc that exploded: ```
// loop start (head: IL_0111)
// sequence point: (line 141, col 4) to (line 141, col 29) in F:\Code\Stardew\StardewMods\CloudySkies\Layers\RainLayer.cs
IL_0020: ldarg.0
IL_0021: ldfld valuetype ['Stardew Valley']StardewValley.RainDrop[] Leclair.Stardew.CloudySkies.Layers.RainLayer::Drops
IL_0026: ldloc.2
IL_0027: ldelem ['Stardew Valley']StardewValley.RainDrop
IL_002c: stloc.3
// sequence point: (line 142, col 9) to (line 142, col 18) in F:\Code\Stardew\StardewMods\CloudySkies\Layers\RainLayer.cs
IL_002d: ldc.i4.0
IL_002e: stloc.s 4
Which is just cs for (int i = 0; i < this.Drops.Length; i++) { RainDrop drop = this.Drops[i];
It could easily be "in mobile raindrop is a reference type instead of value type"
Tbh
Hmm.
I got an invalid IL error on Android in a postfix
Let me check the android decomp
... yeah, cs public class RainDrop {
That's exactly it atra lol
hello
i have a question... Is there a way to put a house for my npc if I will like to still install very large mods like stardew valley expanded?
I added a house for my npc at the mountain map but run into an error
Thank you thank you I'm a geek and this is what I decide to do with my life
what error? having map compatibility with SVE requires extra steps but isn’t impossible
I don't mean modding. That would be productive
I'm actually not sure why I'm using the built-in RainDrop type
I mean "understanding why il does what it does"
I forgot to screenshot but something along the lines that my mod cant be loaded?
!log if you can share it via these instructions i’ll be able to help more
Important note: Your computer username may appear in the log. If your username is your full name, please be aware of this before uploading it.
Please share your SMAPI log file. To do so:
- Open this page: smapi.io/log.
- Follow the instructions at the top of the page to upload the log file. (Don't copy & paste from the console window!)
- After uploading, it will show a green box with a URL to share. Post that URL here.
Please do it even if you don't see any errors. This has useful info like what mods and versions you have, what the mods are doing, etc. If the issue didn’t occur in your last session, please load the game to the point where the issue occurs, then upload the log.
!json you can also upload your json here for us to see
JSON is a standard format for machine-readable text files that's used by Stardew Valley mods.
If you need help with a JSON file, you can upload it to smapi.io/json to see automatic validation and share the link here.
When making mods, it's recommended to edit your files in a text editor with JSON support, such as VS Code, Notepad++, or Sublime Text. These programs will check for syntax errors.
this is my maps.json file
and my disposition file - https://smapi.io/json/none/ab1db25b683642c18f7686d30b53cd99
huh... what did i do wrong. it does work but nothings happening when im giving the berrie
"1001": "ItemDelivery/Sweet Sweet Strawberry/Grow great strawberries for great Gus!/Grow and give one strawberry to Gus/Gus (O)396/-1/600/-1/true/Thank you! This strawberry is really great!$h
you’re targeting the bus stop map instead of the mountain map
you’re missing a closing "
no its okay i judt didnt select it right from the file
Craft and Build from Containers is now updated, thanks to mouahrara
https://www.nexusmods.com/stardewvalley/mods/15341
oh wait. i did change it to bus stop since i run into an error on the mountain.. but is my code correct?
what extra steps i need to do
i don’t think you’re actually patching in your building to the bus stop map. you added a warp correctly but you didn’t replace the actual tiles to show your building
you have a commented out section of code where you load the bus stop map (which i assume is where you meant to), but for compatibility you should really be using edit instead of load
oh okiee i will try it.. thank you 
np, @ me if you need more help
will do 
oh wait wrong id
yeah that was an issue
strongly recommended to give your quest a unique string id and not a plain integer, to prevent the possibility of collisions.
try "{{ModId}}_1001" if you really like using 1001 (but you can use something descriptive instead)
oh i see, okay thx
Thank you so much, both you and @half ether! 
guys how to jump to the next line in the mail? \n dosent work
use ^
it did help thx
The number of mods that do something like cs GameMenu menu = Game1.activeClickableMenu as GameMenu; only to then not actually use any properties of GameMenu is too darn high.
Most recently, I discover this. Why? Just why? This cast is literally worthless that's the only thing they do with it. ```cs
GameMenu activeMenu = (Game1.activeClickableMenu as GameMenu);
activeMenu.drawMouse(Game1.spriteBatch);
I could easily patch this mod with BGM if not for this stupid cast, but now I need to PR to this mod instead.
to be fair there's a lot of code that you don't see
code that didn't make it to the commit
maybe they did temporarily use one of its properties to test things out, or they wanted full type suggestions
there's also nothing inherently wrong with it (apart from not checking if the menu is actually GameMenu before casting)
It could be copy pasting code and a lack of understanding. I see that happen often enough until someone points it out on a PR.
Does anyone have some good documentation on how Data/animationDescriptions works?
the wiki is confusing
whats confusing about it
what is each part between the / for?
It can have numbers, and texts, what each one does
how many parts a complete string can have, separated by /
it says so on the page frames/repeat frames/leaving frames/message key/offset X Y/laying_down whereas you dont need to have laying_down but the others are needed
when it says The entry frames will play after arriving at the schedule point for example you want your npc to sit down and read a book at the spot you chose. you entry frames is you putting down the sprites of the process of sitting down, they play once in the beginning, repeat frames are as it says repeating like when they sit and do the book reading and as the wiki already states well the leaving frames will play before moving on to the next schedule point.
Let's take it one step at a time, there are 6 parts in total, right?
The first being the location X and Y where the character is?
Are these 2 numbers the location of the npc on the map?
Or are they sprite ids?
Would that be in the first part of the string then?
first part is the entry frames as i said. a set of frames that play once at the beginning of the animation
I'm building a class in python to build this animationscripts string, so I need to know all the information. Can I give the name to the variable that receives this first frameEntry value, or suggest some other name?
i cannot really say much on the coding part of things, onto the CP scripting
(Just fyi, if you're parsing these things- the documented form on the wiki works, but the actual game parser is significantly looser)
And there are special cases with the sleep animations I didn't document
So I'm making an NPC that is marriagable. She has a familiar that follows her around like 70% of the time. I want the familiar to move into the farmhouse when the player marries my NPC, but I'm not exactly sure how to do this.
Would I be able to add the farmhouse into the familiar's schedule? Making her a Custom Companion is another option I've considered, but I also want her to be friendable
But there are 6 parts in total?
Is this all there is on the wiki?
Sleep animation
When the NPC goes to bed, they'll play the looping sleep animation set via <lowercase NPC name>_sleep in Data/animationDescriptions, if it exists. For example, this content pack adds a sleep animation for an NPC named 'Pufferbob':
{
"Format": "2.6.0",
"Changes": [
{
"Action": "EditData",
"Target": "Data/animationDescriptions",
"Entries": {
"pufferbob_sleep": "50/50/50" // note: make name lowercase
}
}
]
}```
there really isn't a full explanation that I need
What I need to know is how many parts it has or can have, what each part is for, and a cool name to give them, and what type of data each part can have.
I noticed that it can be int, list[int], or str
There are additional constraints I did not document
I believe the entry frame can be only one frame, for example, or you get issues in multiplayer
Not even the game uses all the features it offers, I'm creating a python library, and I almost always find features that the vanilla game doesn't use, and they are available.
example
"penny_beach_towel": "16 17/18 18 18 18 18 18 18 18 19 19 19 19 19 19 19 19 19 19 19 19/17 16//laying_down",
This one has 5 fields divided by /
there is an unused field there
Yup, it's omitting the message key
Tbh if you're making a lib it's worth spending some time with the game's many specialized parsers
Do you know in which game class I see the use of this string? Can I see it through ilspy?
index 3 = message?
Will the last one always be laying_down when used, or could it be something like laying_up or laying_right or laying_left?
From what I understand then:
frames: list[int]
repeatframes: list[int]
leaving_frames: list[int]
message_key:str,
offset: point,
laying_down : str << this laying_ ?
If it is always laydown I can use bool, if not, I will have to use str
Would it be worth my while to adjust my sending of mail to trigger actions?
is this for ESR? if yes I don't see why not
How were you sending them before
the existing precondition mails will probably remain working indefinitely
via Data/Events, same way the game did it.
but migrating to best practices is definitely recommended
They're kinda all over the place, but I'm not sure the best way to organize it: whether to keep them on the same page as the other information for the NPCs they're linked to, or put them all into one include.
Yeah and once u do u have more options
I've done some - for my smaller mods.
an approach is to keep things relative to the root depending on the asset they're editing
ie edit Data/TriggerActions in Data/TriggerActions.json
that way you know exactly where an edit is
Technically having 1 big trigger action editdata is more performant than N number of em
you can subdivide the file into sections for more readability
So my map edit is acting like my tilesheet doesnt exist but it does. its working for a different edit I did via content patcher but for some reason its no longer working for this new edit im doing? does anyone have an idea of why it would be ignoring my tilesheet? ill send my code soon
Send the error log too
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home, with 33 C# mods and 19 content packs.
Suggested fixes: One or more mods are out of date, consider updating them
What is the actual name of the tileset in Tiled?
Are you sure?
Yes, its actually working for a different edit i did the same way
"LogName": "Glowflower 1",
"Action": "EditMap",
"Target": "Maps/{{ModId}}_AncientGraveYard",
"MapTiles": [
{
"Layer": "Buildings",
"Position": { "X": 32, "Y": 9 },
"SetIndex": 3663,
"SetTilesheet": "spring_Fellowclown_Outdoors",
},
{
"Layer": "Buildings",
"Position": { "X": 32, "Y": 10 },
"SetIndex": 3756,
"SetTilesheet": "spring_Fellowclown_Outdoors",
},
{
"Layer": "Paths",
"Position": { "X": 32, "Y": 10 },
"SetIndex": 8,
"SetTilesheet": "Paths",
},
]
},```
So for a vanilla example sometimes spring_outdoors has the name "untitled tile sheet" in the map itself
this is the other one that is working
Your patches do look right hence tmx is what i want to check next
Take screenshot of the panel with the tilesheets
i will eat my hands if thats the issue one sec
yep time to eat my hands
she lives!
mood
Yeh, I've found that when making edits to other people's mods.
also thanks for reminding me on accident to get all my trigger actions in the same place, I had some of the things scattered in mail
problem is, it's easier for me to work on things if I do each NPC at a time
no wonder I couldn't find the damn things
I'm trying to reduce my number of content patches, lol.
hey all, a couple questions! 1, I've added marriage dialogue to a custom NPC (funLeave_NPCname), but the game says it doesn't exist. Do I need to create a different dialogue file for marriage?
2, I'm adding a big temporaryAnimatedSprite to a cutscene, but I'm not sure where to load it - the Events/Temp? Or TileSheets/animations? Thank you and hopefully that makes sense
Hey does anyone mind showcasing my mod? 🙏 https://www.nexusmods.com/stardewvalley/mods/33660
Bigger Machines! - Spiritual successor to Bigger Craftables
I tried to but I probably missed some things
can farm animals spawned with MEEP be made to follow an NPC around? or do they just wander?
Bigger craftables created fake ghosts in the other spots, For bigger machines I have the one real object top left and then I tried to postfix/transpile a bunch of checks for objects. So you can grab/place into it from anywhere
I can showcase it, but you will have to pick a thumbnail
Discord cached the embed already
this text on smapi.io uses the Heart Suit emoji (♥️), not the Heart emoji (❤️)... literally unplayable
I'm particularly interested in how load and working effect behaves
does that work for a thumbnail
This a mod that lets u do proper machine stuff with furniture and it had some special handling for all that
https://www.nexusmods.com/stardewvalley/mods/31678
Yeah I've seen that, I mostly did this for fun haha
Since I'm mostly just overriding location checking/ draw code for the machine most of the machine logic should (™️ ) work
Wobble 
This is super cool
cannot for the life of me find where the game has the art for the critters like the bunnies and things... anyone know?
i've found birds and stuff but not the rabbits
Crabs r there too
there are also crabs in loosesprites 😭
I think those r movie theater birbs
wait i've never seen this lil guy
i played SOME ok 😭
guess i will need to keep playing
i restarted to do a good modded run
The opossum...
I laughter at myself
When i saw her i was scared
I have not played 1m6
But not as scare as big foot
Chue will play 1.6.16 foe me
Big foot very scare...
the bigfoot is crazy
I scared this little guy in the forest, he jumped and I jumped and I gasped out loud about it
my wife came from the other room
what a cutie
I'll be honest I don't fully remember what they were, and I did do a lot of vanilla 1.6
Unfortunately for me I have a very good memory
And have spent too long looking at 1.6's code/data files
where's that one guide to making a non-social npc?
in 1.6 that's just a regular NPC but with CanSocialize to false
ah ok
Hey everyone! I'm trying to draw over the farmhouse wood pile. This code is mostly working, but, I'm not seeing a way to set the layer to be between the player and the farmhouse itself. Currently, it draws in front of the player. If a full gist would help, please let me know. I'm thinking that I'm maybe going about this in the wrong way.
farmhouse.DrawLayers.Add(new BuildingDrawLayer()
{
Id = "Leeous.Woodpile_Empty",
Texture = Helper.ModContent.GetInternalAssetName("assets/woodpile_empty.png").Name,
SourceRect = new()
{
Width = 47,
Height = 36,
},
DrawInBackground = false,
DrawPosition = new()
{
X = 2,
Y = 78
},
});
HOORAY! IT'S BEEN PORTED TO 1.6!!!!
You probably need to tweak the SortTileOffset field
just use a draw layer
Looking into that now, thanks!! I am trying SortTileOffset now, thanks y'all. @lucid iron when you say "do it in data edit", do you mean like this?:
if (e.NameWithoutLocale.IsEquivalentTo("Data/Buildings"))
{
e.Edit(asset =>
{
var data = asset.AsDictionary<string, BuildingData>().Data;
var farmhouse = data["Farmhouse"];
// TODO: Try drawing blocks over tiles to ensure we're on the right spaces
farmhouse.DrawLayers.Add(new BuildingDrawLayer()
{
Id = "Leeous.Woodpile_Empty",
Texture = Helper.ModContent.GetInternalAssetName("assets/woodpile_empty.png").Name,
SourceRect = new()
{
Width = 48,
Height = 48,
},
SortTileOffset = (float)3,
DrawInBackground = false,
DrawPosition = new()
{
X = 0,
Y = 4 * 16
},
});
farmhouse.ActionTiles.Add(new()
{
Id = "Leeous.Woodpile_Open",
Tile = new()
{
X = 2,
Y = 2
},
Action = "Leeous.Woodpile_Open"
});
});
}
}
yea (assuming all yer fields are right, im trusting intellisense on that one)
Awesome, trying it out now, thanks as always
also u might need a load for assets/woodpile_empty.png?
No that's finw
looks like it's working (still editing the sprite, ofc that's not final haha) thanks guys
The official code for unlimited special order duration isn't released yet is it?
it will be in 1.6.16 (no date announced)
yea u should keep using current stuff
just writing some special orders from a very demanding junimo
I'm tempted to backport some of 1.6.16 via a mod, though it would run the risk of a SolidFoundations where it later changes
what did solid foundations do?
(Also east scarpe has unlimited special orders in the c# iirc)
solid foundations was a backport of the 1.6 building data model
but it was for the original proposal which changed a few times which meant migrations had to happen anyway
It does atra!
(you wrote it)
she is a demanding little critter. I love writing her.
Just coming in to drop the info I just tested that RejectItem dialogue does show even if you already gifted the NPC an item for the day, which is exactly what I was hoping for 
If I want to set a flag that lasts for X days, is setting and checking for a Conversation Topic the best way to do it? 
how come its not a custom asset then
from 1.5.6's perspective it was a custom asset
yea its convienant, another way is stats
u can do IncrementStat YourTimer -1 in a dayending trigger
this would be useful if u needed arbitrary times
you can already set topics to last an arbitrary number of days
i'm kind of torn about it, so i have avoided doing any time gates of this sort
Really? Why's that?
the stat method feels more "correct" (programmer brain, please ignore) because it doesn't use a different system that also has minor side effects.
but the CT method is easier because the code to handle it is built in so you don't have to do the trigger action parts too
(the side effects are "you can't reuse a topic because the game won't add it a second time" and "you end up filling the set of topics with all of the _memory_oneday and so on automatic follow-up topics")
i'm fairly sure there's minimal performance impact from having more topics, since they are stored in HashSets, but they bother me
Well to be fair the stats way is very easy code too
But there's no cp token for stats rn
Need to have calcifer or emp
Oh that's actually a really important side effect for me to know because I needed it repeatable 
if you want to reuse the timer, then i would recommend a stat
IncrementStat YourNameHere days to start it.
DayEnding IncrementStat YourNameHere -1
DayStarted GSQ PLAYER_STAT Current YourNameHere 0 0 to enable whatever comes after the timer expires
The 0 0 part is the range where the query is true, I presume?
yeah, min 0 max 0
you'll probably need other guards on it too but that's a starting point
I think this should work for my mischievous purposes then, thank you both 
in particular, you probably only want to decrement it if it's positive, and you probably want the zero trigger to fire only if it was previously positive (so it expired, versus simply not having been set)
Hello
so i was trying to load a house asset file to the mountain map but it wasn't showing up.. there's no error on the log and I'm warping to the correct interior house at the right spot.. what am i doing wrong with this code? https://smapi.io/json/none/fc035e381c2b499ca0a85dbb44771f26
Thank you 
you're editing an image--maps should be .tmx and you should be using EditMap
have you made the map including the exterior of your house in Tiled?
ahm. if i want it compatible with the stardew expanded does that mean i should get the tmx from it rather the one that i unpacked from the base game?
what people usually do is two different patches--one for non-SVE, and one for SVE with a When HasMod condition
i'm not sure how the mountain map for SVE differs from vanilla, but yes you can just find that map, make a copy, and then patch it the same as vanilla
okie let me search that. thank you 
if you need an example let me know, i've done it for my mod!
oh an example would be great.. you are godsend 
"Action": "EditMap",
"Target": "Maps/{{ModId}}_Lighthouse",
"FromFile": "assets/maps/Lighthouse_SVE.tmx",
"FromArea": { "X": 26, "Y": 0, "Width": 12, "Height": 5 },
"ToArea": { "X": 26, "Y": 0, "Width": 12, "Height": 5 },
"When": {
"HasMod": "FlashShifter.StardewValleyExpandedCP",
}
},```
this is for my custom map, not vanilla, but the same principle applies
okiee
thank you! 
can u negate GSQ,GSQ to make NAND
asking in case i dont actually need to add this lol
hmm i guess it's like
!ANY "GSQ,GSQ"
Any "!GSQ" "!GSQ"
So, I apologize for a very non-concrete question but... are there any common mods that mess with conversation topics? Keeping them around for longer than they should be, not letting them count down? Or is there another reason for conversation topics just not going away?
lasting conversation topic
Yeah
it does what it says on the tin
That's a mod?
Alright, thank you. I'll check if either of the bug reports I've gotten involve that one then. I have a couple of events timed by conversation topics that are failing for two people
Pathos, do you prefer xnb mods or chue making logic gates with gsqs
(Also, can I point out any set of binary logic without backloops can be broken down into the standard sum of products form)
Smh
A Karnaugh map (KM or K-map) is a diagram that can be used to simplify a Boolean algebra expression. Maurice Karnaugh introduced the technique in 1953 as a refinement of Edward W. Veitch's 1952 Veitch chart, which itself was a rediscovery of Allan Marquand's 1881 logical diagram or Marquand diagram. They are also known as Marquand–Veitch diagr...
I don't see how making logic gates out of GSQ is sinful
thank you very much.. it worked.. i just need to clear some things.. but it's now working aa 
Trying to get Sprites in Detail to work. And yet every time I enter game, my cat looks like this. I can't figure out what I'm doing wrong here. Here's the json for the modpack https://smapi.io/json/none/82f40d716ead4fd5bb5b36e37c2bff78
i didn't have to use the when code 
u need to show the npc definitions not the load
the disposition?
yea isnt there a place to define the real size
I didn't see anything like that in the description of the mod
nvm they are just given 64x128
thats pretty limiting...
so yea u need to make the cat's frames 64x128 each
if u just want a bigger npc though, poohcore is what you want
that one just fixes pathing issues with >16 footprint npcs
hmmm looks a lot easier
maybe later along the line ill try and make her sprites smaller, but till then...
success!
hello
so i 'm trying to remove the objects that are spawning surrounding the house I've put in... I saw an example of it online but I didn't know why it's not working. https://smapi.io/json/none/4fa2b26efd7840caae070d53a6b5b6b3
Tried to set the layer to backs, buildings and paths but they aren't removing the objects
i implemented the internal id field like this (default off)
also supports npcs and such
i followed the list_items format for preserve id but hm its a little hard to see
Is there a way to make a custom ingame achievement? (The gold stars on the collection tab)
yes but dont
Why’s that?
Ahh ok gotcha
what would prevent an npc from being able to get back inside their house? they can get out but can't get back in...
house is entered by a LockedDoorWarp tile property, same as the vanilla town buildings. Player character can enter just fine
Is the end point of the NPC's schedule inside the house accessible?
It's behind a door that the player cant enter unless you have sufficient hearts. and they can get out of it just fine
I meant the tile inside the house that the NPC is trying to get back to. Is there a clear path from the front door of the house to that tile?
yes
nothing on the buildings layer that would prevent access
can they not stand on a tile that has back2?
that's the only thing i can think of....
I wouldn't think that would affect it, but you could try changing their end point somewhere else just to be sure.
You slept after changing the schedule?
yeah
... frick i think i might know what it is
i had another warp tile on the map... one they couldn't get to
even though the door was closer
Oh for the same house?
yeah
Oh yeah circular pathing will probably do it
deleted the second warp and yeah, that was the issue
so how do i keep my second warp without creating a circular pathing issue?
Hm, I would've said I don't think you can unless it's player-only, but ScienceHouse has two and I don't see anything special for that to make it work.
is ticks per second constant? can i convert ticks to seconds?
oh i see it should be 60 per second
if u have a GameTime its got both Ticks and miliseconds
oh ty 🙂
(the elapsed TimeSpan actually)
helloo question! how do you figure out if a mod is active or not? 🥲
are you in content patcher or C#?
C#
meant reply to this 
ah kk
oh content patcher
in content patcher u have the HasMod token
up to 60 per second.
if a tick takes too long, there wont be 60 in the second
this is my house. i think because the second warp is blocked, that's creating the pathing issue. in the science house, the second warp isnt blocked.
"When": {
"HasMod": "otherModId"
}
ohhh! okay i think i can figure it out from there, thank youu
i think ill try making that second warp a step warp instead of a click warp
would that make a difference 
TouchAction Warp is player-only so it might stop the pathfinder trying to send an NPC through it
I would like the npc to be able to access it because she sometimes likes to spend time on the roof
Is that a 2 tile tall tiledata on that door
Don't do that
Doesn't look like it to me Atra
Just make it the bottom tile, the one the player can actually reach
Looks like 1 to me
Science house is hardcoded btw
The second warp is ignored
fun...
this doesnt work...
Ah ha, thank you. I thought there was a general "don't have two warps to the same place" rule.
im not sure i know what you mean
its a tile action actually, Action PlayEvent
https://stardewvalleywiki.com/Modding:Maps
and then u add a event that is just exit location roof 
but will my npc be able to get on the roof? thats the problem
"Reweite the pathfinder"
sigh. why do i keep coming up with ideas that need some sort of c# coding to impliment...
when i made a walkable roof i made a secret second identical map and separate location lmao
use that one BETAS thing to yeet them on roof?
idk what the schedule implications are for this
also what happens if u put a ladder so that the roof isnt a dead end
i do have a ladder, inside the house
i tried that but i hated how it looked
i am more interested in whether this makes the npc no longer confused
i still recommend duplicate map, named "Roof" or something, and have the NPC go there. it won't be visible when you're not also on the roof though, if that's a dealbreaker
Outside ladder with NPC passable tiles, 10 minute NPC animation of climbing ladder, NPC on top of roof :D
oh a follow up dum idea, to be used in conjunction with the event dum idea
use schedule anim to get them on the roof
i could have sworn there was a property or something to exclude a tile from npc pathing
That is a very neat effect, though if I remember correctly it makes the speech bubble location odd because it's still on the ground (though I was remembering that in relation to someone who sits on the jukebox in the saloon, not Nova's specific example).
yea cus secretly still on the ground
offset: hella
i havent played around with schedule animations yet. just getting them to enter and exit the house is proving to be a real pain in my backside
If you're thinking to have the warp as one that an NPC could normally use but have the tile non-passable to NPCs, I don't know if that would work (even if it's possible to set NPCPassable as false for Back tiles, which I am unsure of). The pathfinder might still see it as a viable option that it just can't reach.
yeah i dont get why they just can't use the door that's accessable and stop trying to get the one that isnt :/
like, the acessable door is literally two tiles away
The mysteries of the pathfinder
At least for those of us who don't understand pathfinding algorithms
look, see, I have a cat, and I understand this: You don't want the pathfinder to use that door, so the pathfinder wants nothing more than to use that door
I just found this bit of text in spacecore's documentation
its cus for the location level path finder doesn't consider the roof as a separate node as the outside
a smarter path finder would, because they are isolated, but its not smarter
sadly i cant find anything else on it
So if you made Spacecore a required dependency and made a map that goes between the roof and the inside map (like an attic sort of thing) you could maybe force your NPC to take the front door because the extra map would make the roof path take two warps to get to the interior of the house instead of one.
I hope you don't mind me bumping in, but I seem to have stumbled on a new issue with my custom pet.
Since I basically replaced the standard "Walk" behavior with "WalkUp", "WalkRight", etc. to change the amount of walking sprites, my pet now seems to be walking into obstacles without stopping.
Normally, pets seem to stop as soon as something gets in the way when they walk.
I'll take another look at the modding wiki page for pets, but I don't recall there being a related topic for this very specific issue.
I did that already.
Nope
I tested that
When they sprint they don't stop when something gets in their way, but when they walk normally they do stop.
I'm afraid so
yeep
Damn it
Does that mean I'd have to make custom code for a modified "Walk" in order to get what I want?
yea if i was making this i'd transpiler updateSlaveAnimation to adjust the frames
or just let scavs go where they please cus it's funny

I think I'd have commission someone, because I have no clue how I'd do that.
so i added this tile property to the side of the building. they went up it and into the house through the roof.
i wonder if i made a schedule point closer to inside door they'd go through the door instead?
a third idea is to break up the animation (how many frames?) to more pieces
while they still wont be checking collision at least they can switch directions more often?
I guees that could work, but then they'd probably change direction too much, which I think would look weird.
Where did you find this btw?
hm easier approach, prefix Pet.RunState, if _currentBehavior starts with "Walk" make it exactly "Walk", restore it in the postfix
this is in the decompile, Pet.cs
And where is the decompile? Doesn't seem to be in the uncpacked files for Stardew Valley.
!decompile
If you want to make SMAPI mods with C#, one important resource is decompiling the game to read the game code. Here's how to do it: https://stardewvalleywiki.com/Modding:Modder_Guide/Get_Started#How_do_I_decompile_the_game_code.3F
different flavor of unpacking
!harmony
Harmony is a framework for patching .NET code, allowing you to take any portion of the game's logic and insert or substitute your own. This gives you more flexibility and control than SMAPI helpers and events, at the cost of being typically more complex and difficult to use safely and correctly, and more likely to break with a future update of the game and/or SMAPI.
If you are trying to do something that isn't possible or practical with SMAPI alone, then Harmony is usually the solution.
For more information, refer to the following:
- Harmony Modder Guide - Intro, Use Cases, Initial Setup
- Tutorial: Harmony Patching - Types of patches and code examples
- Decompiling Stardew Valley - For finding methods to patch
need postfix/prefix
the only big pet mod i know of is pet overhaul but idk if it has this kind of feature
Yeah, I'll look into the things you sent me first.
I'll save that for later though, because I have o head to school soon.
I could, but I don't know what else I'd make them.
trinket tinker just lets u have 8 frames for walk if you want
Farm animals seem rather restrictive and pets have at least a base I can work with.
Huh...
I didn't think of that, actually.
If I figure out the walking issue with pets, then I could do both.
not an entity on the farm outside of ur view
trinket companions also just dont have collision in general bc they stick close to you and i didnt want to deal with pathing at the time (spiritually working on it)
screw it. im just gonna delete this roof warp and figure it out later. nothing i try seems to work
Hrmm... is it normal that portrait emotion commands don't work when dialogue is preceded by an $action command? Like my test dialogue
"AcceptGift_(O)72": "$action AddMoney 500#Thanks, here's a tip!$h",
results in the $h being read as text
The portrait works properly if the $action comes after the dialogue, but I would like the action to occur first for flavor
It's definitely come up before that putting $action before dialogue text causes wonky behavior
Does the order of the money being given actually matter if it comes after the dialogue in this case? It shouldn't require another click or anything AFAIK.
The actual thing I want to do is cause an instant Appearance change upon being offered the item using BETAS, which works swimmingly, but not being able to put the action first means I'd have to talk to them again to see the outfit change 
Oh wait a sec, as long as I'm using BETAS already maybe I can make this really stupid by using a BETAS fake dialogue box instead of actual dialogue 
Phooey, no, that doesn't work, can't use that action in a dialogue action, it seems

Well great, it also turns out RejectItem dialogue will cancel any dialogue the character has active for the day so you CAN'T talk to them again immediately to see the new outfit

Yeah, the RejectItem dialogue is a known issue, it's listed in the upcoming fixes for 1.6.16
Oh, really? That's good news at least 
I think I just stumbled into a working solution
Having an extra line of dialogue before the actions, separated by $b, causes the following line of dialogue to properly apply the portrait for some reason, like this one works fine
"RejectItem_(O)91": "Is that...?#$b#$action AddMoney 500#OHHHH BANANA$h",
So then all I need is that RejectItem bugfix slated for that nebulous 1.6.16 release for this to work without jank 
ohhh banana
@drowsy pewter do you have a list of the context tags you'll be using for Cornucopia? I want to add them to my mods if applicable for compatibility:)
Um there's a lot of tags. What is your mod again?
I mean I can give you the object data file with literally everything, but I assume you more want to know about something specific, like allergen tags, food type tags, or generic ingredient tags
Ingredients/food types.. I didn't know allergens existed 
I have a few mods (of which I can't remember off the top of my head because I'm tired and I just woke up) as well as my apple mod that I definitely 1000% started 
I just want to know if you're using them to write machine rules, if you're writing flexible spacecore cooking recipes, or if you're creating new crops and stuff that you want to add tags to for other modders to use your items, not necessarily for compat with cornucopia specifically
For example I tag every single item with itemname_item, so if I gave you every tag that'd be like 1000 of them 😂
So many tags..
It's for crops and such
I presently don't have any fancy machines that I've made.. yet
I.e. one of my mods has a celery crop, the apple one will have.. well.. a lot of apples
I also have like.. mushrooms and weird berries
Weird berries is the best way I can describe a qi berry honestly
So if its just for crops you can use the itemname_item format (such as cucumber_item) which is already used in Cornucopia More Crops so you can see that as an example. Like I'd suggest adding apple_item to all of your apple items.
Theres additional tags which I add to certain types of food ingredients to sort them into categories, which are the following:
chili_item
edible_flower_item (this is used by lumina's mods)
berry_item (however ive been informed that the berry distinction doesnt exist in every language, so this is kind of a fuzzy category thats been confusing players)
edible_mushroom (vanilla, so make sure to add this)
leafy_green_item
root_vegetable_item
grain_item
bean_item
herb_item
spice_item
Adding those tags would allow your items to be used with certain cornucopia cooking features
if you come up with something that could be useful but it's not there yet, you can also make up a tag to add
Thank you!
Context tags are words/labels assigned to an item. These tags can then be used by the game or mods. Some uses of context tags are listed on the following table.
There is no known limit on numbers of context tag an item can have. Context tags do not have significant impact on performance.
Some context...
I've used a fair few of the existing ones (like the edible mushroom one, which is why the shroom i have can be turned into dried ones) but it's good to know some others for compat :]
It's also cool you can kinda just.. make them
Heyyyy, so I just noticed that the IGameContentHelper.Load<Texture> method says;
Load content from the game folder or mod folder (if not already cached), and return it. When loading a .png file, this must be called outside the game's draw loop.
Do I have to load all textures when parsing the Furniture, and store them in a cache, and hook this cache to the assetInvalidation Event?
Long story short, I'm having an issue where the game searches for localized assets when I don't want it to do that, and I'm trying to figure out how to avoid it spitting a wall of errors every time it loads a texture
searches for localized assets
wall of errors
can you clarify?
FF works fine in most cases but if the game is not in anglish, and there is a CP "Load" patch targetting an asset from a Furniture Pack that is not actually in it, the SMAPI content pipeline will throw errors because it can't find the localized version of the asset (ending in ".png.ja-JP" for example), then find the non-localized asset loaded by CP and only then work as intended. So this will cause a bunch of errors to be logged every time the asset in question is invalidated.
Here's a snipper of log to illustrate the issue:
Edited out the log
I'm stupid, here's the log that was with the bug report: https://smapi.io/log/fc604f9e172245f69bafc47a89003b01
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 10 Home, with 34 C# mods and 18 content packs.
Did u check the name without locale
I'm not sure what you mean, I'm not checking anything here, the game is.
Oh is this not in asset requested hm
I've not looked into this much yet, but the error changes when using an "EditImage" CP patch: since there's a dummy asset in the Furniture Pack, the game has no issue asking FF to get it, but it's been reported that there's an error about a NullReferenceException when returning to title, and loading the save again crashes the game with ObjectDisposedExceptions in the drawloop.
Here's the log: https://smapi.io/log/37f80adf32d545898011d3bd469a534b
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 10 Home, with 34 C# mods and 18 content packs.
While im not sure what would you do for content pack for for this, content patcher will Load particular asset to all possible locales unless otherwise specified
This second log looks like attempt to EditImage an asset but then failed at making it a Texture2D?
would including the ".png" extension in the target be the case of "otherwise specified"?
To avoid draw crashes u should probably have an error texture
I guess, but how do I know that it was disposed before sending it into SpriteBatch.draw? Is there a method to test that?
if this means a Target, like a game asset, like it is used in CP, then including the filename extension is generally unwise
I always just made content patcher do all the data loading so this is all pretty out of my depth 
The thing about png is true but actual error is assets/RFT(Under-Room)_High.png missing (is it missing)?
One thing to note is that fundamentally the game relies on having exactly one copy of the asset in cache, and when it updates that copy, it actually just swaps out the data in the texture
I personally think this is fragile af but was probably a required thing if they didn't want to, you know, break backwards compat
in this context, the asset is required by FF with a path that looks like FF/<Furniture Pack ID>/<asset path in Pack>, with the last part including the extension.
FF has a OnAssetRequested event hook to fetch the assets in the appropriate Furniture Pack, but in the case where the first bug happens (CP Load), the asset doesn't exist in the Furniture Pack because it is supposed to be loaded by CP with a higher priority. However the game tries to load localized versions of the asset before the naked path, which are not patched by CP and therefore print "asset not found" errors
yeah, that shouldn't be an issue here from what I understand
In the case of the CP EditImage actions, I have no idea why the game trips over and gives FF a Texture2D that was disposed of, because it comes straight from the content pipeline with IGameContentHelper.Load<Texture>
I would assume that the game would make a new asset request if an asset is disposed of
It does not
yeah, I'm adding that now, should've done that earlier tho.
damn
So if I see that a texture I ask for is disposed of, do I need to request an invalidation?
Hm did u check DoesAssetExist
nope, never heard about that. Looking into it
On second thought because you are loading the default asset (why) it is probably considered always existing
Loading the default asset is probably the problem tbh
so is "Update": "OnTimeChange, OnLocationChange", really needed? I have some edits that happen after events, usually they apply after a time change, but im curious if waiting until the next day for it to apply normally through cp would better?
Well doing less work is always good
removing OnTimeChange and OnLocationChange from your patches is always recommended if you can live without them
Oh clown did people besides Scarlett report the fog problem?
yeah they did
I had hard time reproducing it
Theory is it happens after event reposition u
But passerby starts with an event...
i am too but I was thinking of removing the fog and stuff because after a while it does hurt my eyes
thinking about a trigger action that just tells CP to patch update one time
yeah but I do have to fix it still
Anyways it was probably related to how viewport changes worked, will release a maybe fix on the weekend
wdym "default asset"?
Ideally CP itself should implement this right
There's also my initial worry: is it ok to call IGameContentHelper.Load<Texture2D> during the draw loop? Its description says it's not ok, but I don't understand when I should load the texture if not during the draw loop
It's expensive
BETAS has it
no the BETAS action calls patch update console command
it is not okay to call this during the draw loop. load it during AssetRequested, i should think
Huh? how do I request the textures that I send to SpriteBatch.Draw then? The call I'm worried about is the one that triggers the AssetRequested event
if you are getting disposed textures through the asset pipeline, somethings gone very wrong
SMAPI tries very hard to preserve Texture2D references
yup, I'm trying to figure out where I fucked up.
I have an idea but it's hard to wrap my head around how to apply it
calling the Load function in the draw loop means it will be trying to load that texture again every single frame
very bad
I don't think where you be doing the load is the problem though
isn't the game caching it to not load it from file every frame?
yes, but it still has to go through the process of getting it from the cache
What I don't understand is why it only happens when going back to title
what is calling the load, what content manager is doing the load, and how is the texture used?
i have a question does "Update": "OnTimeChange, OnLocationChange",
only happen once?
or is every single time
the update rate is how frequently the patch will be reevaluated, it will only actually cause the asset to change if the patch will do different behaviour
but it would be every timechanged (600, 610, 620, etc) and warping every time
jeez so everytime the time or location changes, the game will check the entry?
In my stuff when I want a texture i ask the content pack (for cp) to do a Load, so they have the texture they want from the start. You described that you are loading some kind of placeholder for content patcher mod to EditImage so even if the editimage fails you get this possibly invalid placeholder
no wonder theres lagging happenig with my mod ill fix that
Again, it only causes the asset to change if your patch is changing
If you were not creating a different Texture2D to hand to the content pipeline everytime that could be an issue, but i didn't see ur code here
cp does other logic like what tokens you use to optimise further
yes but it checks it everytime to see if if it needs changing right?
That wouldn't directly even be a problem, it finds the original reference of the Texture2D from the "previous" load, and does CopyFromTexture the "new" version
Texture2D's during normal operations cannot be removed from a content manager cache in SMAPI, unless the content manager itself is being disposed
Here's the process as it is in the current version:
- The game wants to draw a Furniture defined through FF
- FF requests the texture with
helper.GameContent.Load<Texture2D>(path)(this is FF's mod helper) - if the texture is not cached, then there's an OnAssetRequested event
- FF finds the Pack that the asset is from (its ID is in the
pathfrom step 2) - FF calls
LoadFromon the event by passing it a method that depends on the asset type (Texture2D in this case) - When the method passed to
LoadFromis called by the asset pipeline, it checks the path of the asset and there are 3 cases:
- the asset starts with "FF/", so it should be fetched from FF itself with
helper.ModContent.Load<Texture2D>(true_path)(FF's mod helper again) - the asset starts with "Content/", so it's from the Game's file ->
helper.GameContent.Load<Texture2D>(true_path) - (else) the asset is loaded from the Furniture Pack:
IContentPack.ModContent.Load<Texture2D>(true_path)
oh, the placeholder is a texture full of transparent pixels that is loaded with the IContentPack.ModContent.Load<Texture2D>(true_path) case
and is this asset in question actually a localized image, or is it just the user in that language
just the user in that language
I think the issue is that FF calls LoadFrom on the asset requested event regardless of if the asset actually exists at the path, so I guess SMAPI goes "oh, there's a method to load this localized asset!" and runs it, but it doesn't work so it requests the un-localized asset afterwards and it works because CP can load it
is that correct?
But this would also cause errors on any asset loaded through this method, even without CP...
if you aren't doing localized assets, you should only handle the non-localized variant
smapi/stardew will try the fully localized first, then international and then the non-localized last.
but once it figures out one of those worked, it will remember for future loads/edits on that asset
Do I have to check if the asset is localized and discard it if so?
I just remembered, I should mention that I start by doing that: string name = e.NameWithoutLocale.Name;
if memory serves, checking args.NameWithoutLocale.IsEquivalentTo is the standard approach
Well, Yeah, but I can't compare the name to all potential assets in a Furniture Pack, the asset requested in question has this structure: FF/<Furniture Pack ID>/<asset path in Pack>
NameWithoutLocale.StartsWith may be of interest?
hmmm, I'll try with that
doing NameWithoutLocale would still make you handle the localized variant
actually, it doesn't help extract the asset path at the end, I still need that to pass it to the Content Pack asset loader
People could theoretically want a localized signage or something though
holy shit, I didn't actually realize that until now
Yeah okay this is an issue
So, it's fine when the asset is in the Furniture Pack because it can retrieve it for the first localized variant SMAPI asks for, but when it's not in the Furniture Pack but only loaded by CP, it tries the localized variant first and can't find it before asking the non-localized one and having CP Load it
Ok, I'll need a breakdown of why, because I don't understand that
At least the CP Load bug is solved, I just have to ignore any asset that's a localized variant
From what I understand, that snippet at the start of the asset requested event should be enough: if (!e.Name.IsEquivalentTo(e.NameWithoutLocale)) return;
Having a Stardew Valley game open on a rainy day really helps with debugging
actually, maybe it would be wiser to simply check for existence before passing an asset loader that is guaranteed to fail to LoadFrom... This way modders could still make localized assets!
I'm headed to work but tl;dr the way lifetimes are managed for assets are weird
the "Invalidate everything if its not-english when going back to titlescreen" is the extra fun part
You must provide a fresh texture instance to each Load
oh yeah if you preserved the reference in the load mechanism itself you are doomed
And you must never allow the copy in the content manager to become disposed XD
And an atra runs back to rust
because smapi is explicitly doing temporary loads for textures and copies it to the "persistent" one and disposes the temporary ones
also copying to itself would potentially also be an issue
that I'm pretty sure I do
well, it wouldn't be a problem if it was actually invalidated, because it would be loaded from scratch again. Instead it says "disposed"
hmm
the asset starts with "Content/", so it's from the Game's file -> helper.GameContent.Load<Texture2D>(true_path)
more I think about it, this seems semi scary, having multiple assets in the pipeline being linked to the same texture2d instance
Here's the method passed to LoadFrom for reference:
private static Texture2D load_texture(IModContentHelper pack_helper, string path)
{
Texture2D result;
if (path.StartsWith("FF/"))
{
result = ModEntry.get_helper().ModContent.Load<Texture2D>(path[3..]);
// Load from FF content
}
else if (path.StartsWith("Content/"))
{
string fixed_path = Path.ChangeExtension(path[8..], null);
result = ModEntry.get_helper().GameContent.Load<Texture2D>(fixed_path);
// Load from game content
}
else result = pack_helper.Load<Texture2D>(path);
// Load from Pack content
ModEntry.log($"loaded texture at {path}", LogLevel.Trace);
return result;
}
The real content managers version with a cache don't get a dispose call on them though.
the temporary content managers version which doesn't touch the cache gets disposed
passed like this:
e.LoadFrom(
() => {return load_texture(furniture_pack.ModContent, name);},
AssetLoadPriority.Low
);
and ModContentManagers dont have a cache anyway and are guarenteed to return fresh Texture2D's every time
I don't think they are linked to the same texture2d instance?
In the case we're talking about, all the textures come from the result = pack_helper.Load<Texture2D>(path); branch. If there's anything wrong with the way I juggle assets from multiple places, I'd like to know about it, but I don't think that's going to help solve my CP compatibility with localization.
@ivory plume I think the PropagateTexture flow might need some try/catches or something.
I also still can't quite figure out how the texture2d got disposed in the asset pipeline, or what the nullreferenceexception that hapened during the setdata propagation was
I can add some try..catch so an error doesn't break propagation for other assets, but that wouldn't help track down where it's getting disposed. You could maybe patch Texture2D.Dispose to log the stack trace whenever it's called.
As for the null reference exception, if you can send me a(n ideally minimal) Mods folder that reproduces the issue, I can run it with a debugger to see where that error is happening.
Thanks for the prototype! I'd probably...
- make it always visible (non-configurable) since it's generally useful;
- move it to the bottom under the less technical fields;
- still want to figure out a more player-understandable display for item IDs (e.g.
(O)348/Cornucopia_BellPepperOrangeisn't an item ID).
Ah right now it's just beneath added by mod
Bottom/less technical field would be just above datamining fields?
Yep, probably the bottom of the fields that are visible by default (but I can play around with the order before merging it to see what makes most sense).
Yeah i was unsure about the flavor display too, maybe it could be like (O)348, with flavor Cornucopia_BellPepperOrange
I'll leave the PR as is then 
(why not another field below)
Mayhaps
I have one, if this is about the issue I'm having
I'm trying to use the ChangeName command in an event to fake a the player character for events. I've gotten everything to work, except for having the player name come up properly. Using "{{PlayerName}}" or "@" just voids the event changes because of the invalid characters, whereas using {{PlayerName}}, without the quotation marks, just uses the actual token as opposed to the players name, and @ makes the name into a left pointing arrow. Is there another way to have the game pull the players name, rather than those two, during events?
Are you still doing a Load
Cannot use tokens in a Load and as for @ that only works in dialogue
The map file, in this case BusStop, is being loaded with my changes inside, not a raw event in my content file. Should it be an editdata with my event in the content file instead? I didn't realize that it would be an issue if it wasnt in my content.
The Load and Token issue, i mean.
Yeah it is a problem but fixable if u just do editdata on the same asset
You may use includes to organize your EditData patches
So that u can still have a busstop.json separate from main content.json
Gotcha. I'll try that and see if it works. Thanks, both for now and last time! Already many less errors. 😁
(i know I'm very late to this and you already found a different solution, but in case it comes up again, there is no restriction on what actions can be done inside a BETAS dialogue action. it's exactly the same as a normal dialogue box. so if it wasn't working, the issue was elsewhere)
Oh, the problem was that the game can't open a dialogue box when a dialogue is technically already going on
(Either that or something else specific to the RejectItem bug)
Quick question relating to npc schedules. If I wanted to check for the earliest schedule entry that an npc has, would it be safe to assume the earliest possible time of day could be at 600? Or should I be checking all the way to 0?
it should be possible, though may have been wonky if you were doing the very first (or only) thing being a dialogue action, i suppose, same way doing the addmoney action was being wonky when placed first
600 is the earliest time of day that you need to worry about, but due to timing problems it's recommended that 610 be the earliest time in schedules
you can also start a schedule with a zero time to change the NPC's spawn point for that day (sometimes called a "zero schedule")
are you parsing schedules or writing your own?
I'm creating a companions mod, when you dismiss the companion I want it to path back to where it should be according to todays schedule. So if for some reason you dismissed a companion at 600 I wasn't sure if that is the earliest possible schedule and it should path back to its default position, but I think you answered my question. If a "zero schedule" exists it should path back to that, meaning I should check from the current time, down to 0 to see what the last schedule was, if there was one.
Are there specific steps to cause the NullReferenceException issue? I tried loading a save and returning to title, and no error was reported (see log). If it only happens with a save containing specific items, can you send an affected save too?
It might take a whole day for the companion to go back to where they should be at
I recommend making them walk to some warp?
Companion of some sort is at 4 cakes now exciting
i have some code to warp them to where they should be based on the current time, if that would help you
perhaps unsurprisingly, it's not trivial to do https://github.com/ichortower/HatMouseLacey/blob/main/SMAPI/TriggerActions.cs#L90
The requirements are setting the language to something else than english, and having the "Dropdown Armchair (edit)" (this is the exact name that can be used in the debug fin command) Furniture loaded.
I can't provide a save right now, I'm already in bed (with my phone), I'll send one tomorrow if it's still needed.
Ichor im beginning to suspect that lacey is ur core mod
Do you think warping would be better? I should probably add that at least as a fallback if a path from the current location to the target location can't be created.
Just gonna depend on lacey for my own npc needs now
whatever lacey needs, lacey gets 🎵
My concern is more that npcs are slow relative to player
i think they're even slower (slightly) than the farmer's walk speed. ~500ms per tile
Probably should have ping replied @ivory plume for this
Even if your pathfinding works perfectly you could be in mount vapius doing stuff, dimiss Abigail, who now spends the remainder of her day slowly going home
I'm just not sure if thats an issue or not, would it cause issues if she didn't make it home by 2600?
no, it's fine for NPCs not to make it home. they'll reset during the big sleep
Not rly, but you will have to keep changing the end of your pathing thing throughout the trip according to their normal schedule
I dunno if this is worth solving vs if u just path them to some exit and warp away afterwards
The SMAPI error happens because it calls contentManager.LoadLocalized<Texture2D>("FF/leroymilo.DropdownTemplate.FF/assets/blank.png.fr-FR", language, useCache: false) and unexpectedly gets a null value. I could add eror-handling for that, but Load(Localized) returning null breaks all sorts of game/SMAPI/mod logic.
wait does SV have a mod downloader & manager ?
Stardrop is a mod manager written specifically for Stardew Valley. See the Stardrop wiki for installation and usage.
See this tutorial for connecting Stardrop to Nexus or updating mods in Stardrop.
If you have issues with Stardrop, see the issue report guide.
https://smapi.io/log/f26171ad3e6b4f7fa06cde44f01f8990 anyone able to discern what I broke, map worked fine before I edited it
Log Info: SMAPI 4.2.1 with SDV 1.6.15 build 24356 on Microsoft Windows 11 Home, with 15 C# mods and 5 content packs.
you saved the tmx when the tilesheets werent there
but.. the tilesheets are there
in the folder with the tmx, while you are editing the tmx? there are no missing tilesheet errors in tiled? bc the only two ways i know to get an invalid gid is either saving when there are errors/missing tilesheets, or using a tilesheet from vanilla that no longer exists (like removed in 1.6.9)
the other maps NeithsHome, Basement and Upper all work fine
If I'm trying to run a trigger to summon the green rain do I need to use OnDayStarted or OnDayEnding?
doesn't seem to work all the time...
Is it possible for me to create another map as an extension of the farm map and have it be recognized as a farm map by the game?
Yeah you can set a location as plantable and allowing construction
the former is in Data/Locations, the latter a map property IIRC
How do I view that map though when I go to build?
Cause doesn't building just show the farm map when you go to Robin to construct?
if you set the buildable property it will automatically be added to Robin's menu
she will ask you what location you want to build on
Trying to summon green rain while making sure not to overlap with festivals. https://gist.github.com/aronyoddity/f2e96a08b5368c24bfdd8f433060db5b
Somehow I keep getting drawn into map making when I pick this game back up during a stardew phase
this time I'm going for Perfection though so, it's gotta be a good farm to play for hours on
If you where able to evolve a monster , how would you evolve it ? what gem would you use ?
When in doubt prismatic shard 
guys can I nerd snipe some of you into brainstorming with me
say you made some kind of dynamic npc flat/hotel where rather than mod authors statically calling dibs on certain rooms (and therefore rooms being awkwardly empty for most people), they just registered their npcs as having rooms in the hotel and were dynamically allocated. How would you go about assigning rooms to NPCs (both at the start of a save and when added later on)
I feel like you wouldn’t want to move one mid-save so you would want the existing order stored in the save file, and then ig if you uninstall one their room becomes available for the next installed npc?
Why are you making central station tourists again \lh
Personally I'd fill it up by floor
well yeah, the question is how
iirc fireredlily had some sort of brainstorming here too back when the apartment was first being made
if you cared to backsearch for that
First come first serve, basically. Can keep track with a spreadsheet
I think you would want decide if it's a magic ghost hotel or just ordinary hotel
yeah, I think I was actually bouncing ideas about this back then too
personally i wouldnt care about storing the order
someone moving rooms would be no weirder than an NPC up and disappearing/appearing mid save, immersion wise
Cus if it's magic ghost hotel then yeah i expect it to expand or contract as needed
I’m talking about the option where you DON’T do it by spreadsheet but assign dynamically.
Probably even randomize it per day, for fun
-# …what if it’s a framework—
If it's an ordinary hotel i would save the order
I came in here to ask a question and I can't remember what it was
i would just assign rooms alphabetically by NPC internal name
and not care about order
Both impl still require same set of base features so
but thats me
It seems like a minor thing u can decide later
i still dont think the question of assigning rooms is even the real problem, though
yeah, I was thinking of doing that for the initial order and then add new installs later button
hmm, what would you say is the biggest issue
yeah and i was just sayin i wouldnt even bother caring about when its installed
scheduling and events
how can an NPC author write a schedule or an event if they dont know where it will be?
the idea would be to magic that part away using some hidden warps
and the hotel/building wouldn’t all be on one floor
that seems very "code the rest of the owl" to me
^
this seems very scary
as in hellish to code lol
and hellish to implement on the user side
im not sure how a hidden warp would help me write an event. where would i even load the event to. where would i center the viewport? where would i add temporary sprites
Make each map the same tmx just instanced
that scheduling part I actually had a pretty solid idea for but I need to do a lot of proofs of concept haha which is why I just handwaved it
So it's the same shape everytime
what if i want an event to start in the lobby and move to the room? or vice versa?
That's just change map isnt it
hmm, idk enough about events but theoretically I could provide tokens to content patcher to help with this?
it is, but where should i move the NPC to after exiting the room?
idk where their door is
Oh i was imagining the hallway as part of their room map
yeah, that part you could theoretically handle via mod provided tokens
and what door should i have them walk up to in order to enter the room?
to an extent
And the lobby is a unique different map
im not sure how a token would help me set up an advanced move to walk towards some point i dont know before runtime
shops can be made via contant patcher right, like custom animal shops for example if i wanted a different npc to sell them versus marnie
No u need a framework
custom animal shops no (can livestock bazaar do custom ones?), regular shops yes
darn
Either shop tile framework or livestock bazaar
aah i see
where the framework would provide tokens for route_to <npc name> that would plug a route in or something
or just… not do events in their hotel room 
a token, or an event command?
could be either one tbh, or tokens for coords and event commands for routes
limiting my NPC to only work with this specific hotel mod (bc it requires tokens or commands specific to it) would be too limiting to me as an NPC author personally, and so would being told i cant do events in or around their room, which is a rather important part of an NPC
Hey everyone, does anyone have any good recommendations for C# courses? I've found plenty but wanted to see if anyone had any specific suggestions they could give?
You can get your own marnie style dialogue to pick regular itme shop or livestock shop
!yellowbook
A good book for learning c# is https://www.robmiles.com/c-yellow-book
I get what you mean for the second part but ig I’m still interested just in case haha
(for the first part, I feel like the place where they live would obviously have to be a dependency anyway?)
Honestly i don't think this is necessarily a npc house 
where they live wouldnt need a dependency if i just made the place myself
But i support 2 caking central station and make some kinda grand bazaar mod
chu just wants to scope creep me into making a haunted hotel
Yes
or if not made myself, at least one i can know how it'll appear and route me precisely while im writing the NPC
honestly I’m not even against it
and not only when i launch the game
You can have npc go sell things like
They path to special waiting room
And this means apply their shop
sounds like a dynamic housing mod just inherently isn’t for you then 
unless you can solve the eventing and scheduling problems
Well i think one of the good things about pelican town loft is that
People can play with npc making
Without having to think too hard about map making
(tbf, i did answer the original question in good faith, its just you then asked me what i thought the actual problems would be)
Now u r making them learn weird specialized npc making...
isn’t that the job of a framework, to pretend to make things easier while secretly adding a new level of complexity
(/lh)
Poohcore is supposed to fix pathing issues with NPCs wider than 16px, correct?
that’s in a personcore mod?
ngl I kind of assume personcore mods have no inherent side effects so this is interesting
spacecore is a personcore mod
does spacecore have inherent side effects /gen
Yeah it is supposed to do that
yeah
And yes spacecore does it fixes the map level pathfinding
spacecore also does stuff with NPC pathing
Jen maybe ask clown about it
If a person was named core and made a core mod, would it be CoreCore or Core Squared? 
also has the extra dialogue stuff
there's nothing in spacecore's documentation that explains how it fixes pathing...
But im pretty sure there was 2 custom fields to set
I’m going to sue casey for making me be incorrect
im not sure a lower-level C# explanation would benefit many users!
i got that, but im not editing a vanilla npc, im adding a new one
and i did
"CustomFields": {
"poohnhi.PoohCore/WideCharacter": "true"
}```
What kinda not work did u observe 
i did that, but now she won't leave the house, just wanders off into the voice
void
Also i think jorts and jean show it's possible to fit a whole cat in 16x32
dalionheart definitely has very visible side effects, and I think it counts
(tbh that stuff could probably be folded into WOL; it's not like any other mod outside of WOL use the hopper/crop stuff?)
Is this a farmhouse?
if i cant get this to work ill smoosh into 16x32, but i was told that poohcore fixes pathing with wider characters
no its an npc house
Ik passerby uses it at least 
Whatever schedule you got definitely works fine for a 16x32 character no poohcore?
im gonna have to peek into its coding and see if there's something im missing
right
Trying to eliminate other causes here
(also poohcore has kinda graduated to spacecore's level of being a framework that originated as a personcore)
Tl;dr it fundamentally replaces the DFS of macropathing with BFS
i have no idae what that means
now i'm curious what macropathing is
probably why it doesnt explain how it fixes it 
also looking at jinx from passerby and im not seeing any additional code, so i dont know why cat won't leave house
What's SMD XD
Other than my home for code I took out of atracore
and then I follow the inverse route where I hijack a framework and turn it into selphcore
looks at the slingshot in emc /lh
i learned to have a love-hate relationship with npc pathing after my maps turned out to loop and break my npcs on a level spacecore didnt help with
loops gotta loop
@golden basin apologies for the ping! I was hoping you can help me out here.
I'm trying to make a cat npc that's 32x32, same size as Jinx from your mod. I was wondering if you ever had pathing issues with Jinx (or other similarly sized npcs) not leaving maps and if so, how did you fix? I have the poohcore coded correctly by the looks of it, so i can't figure out why my cat isnt' leaving my npc's house
Do you have Pooh core set as a dependency
yes
I'm not at my PC currently because of a injury keeping me in bed. But you're welcomed to copy my code. Also be sure your maps npc pathing entry is set to allow pathing
i wonder if maybe the map itself is the issue
hope you feel better soon and thanks for answering!
Can I see your location data
I've got ExcludeFromNpcPathfinding set to false
have you slept 1 day/more than 1 schedule point?
thats a good point ^^^
i can try
you need to sleep 1 day for schedule changes to work correctly
im almost doen making the pet version of the pillbug!! woo
holy shit im an idiot. the modding equivelent of "have you turned it off and then on again"
then im gonna make the npc one
Im gonna go look at the adoptable joltik mod to see how they have their thing set up since they make a npc joltik and a pet joltik
im gonna spend the next hour sulking in a corner for missing something obvious /lh... sorta
thanks for the help, guys! cat has left the house!
schedule stuff gets set upon save, so if you change stuff it can confuse them or they don't do anything for that day.
After copious encouragement from Airyn, skellady/max, and Dora, I updated all my mods for 1.6, available on ModDrop! 🥰
For anyone who provided translations: check out the Patch Notes. If there's a reference to new config options or wording updates, the translations will likely need updates too.
https://www.moddrop.com/stardew-valley/profile/213628/mods
My updated mod list:
- Artisan Equipment for Sale
- Easier Bee House, Oil Maker, Preserves Jar, and Lightning Rod
- Easier Farm Totem and Survival Burger
- Easier Stable
- It Takes a Village (ITAV)
- Joja Always Has Seeds
- Joja Has Extra Stock
- Joja Plans Ahead
- Pelican Town Potluck
- Pierre Plans Ahead
- Something's Rotten in the State of Ferngill
- Townies Need Artisan Goods (TNAG)
- Townies Need Food (TNF)
- Trick or Treat Event
- Unique Mobile Greetings
- Beer in Half the Time
- Immersive Krobus
nothing wrong here ...
Ngl I respect you guys.. Seriously, mod development is a cool thing.
Where's the grass /j
grass is sve
Holy cow, I just noticed Pokemons...And green Abomasnow looks nice
Yall
why my bed cursors
i mightve understood the code wrong, hm
but why cursors...
id have assumed if its the texyture i did wrong i just get the error thing
Like the wrong tilesheet. That looks like it's from Cursors
mainly because it has cursors
yeah but how, i just
What's the code look like?
Because furniture defaults to cursor if it can't read the right texture
I would like to sleep on A tonight
well, thats inch resting
proof my asset exists btw
yeah the end of that doesn't look right
one sec...
Here's mine, it's the double slashes that are off I think
You want them in all parts of the path, not just the start
I believe so
also i mightve done the false wrong too tho...i didnt want my furniture to pop up in the catalogue/shops
The false bit looks right anyway
is it false tho if i dont want it sold/in the catalogue or would that be true
Ah you're right, I think that's true.
Oh and I should point out: Make sure that path is the ASSET name, not just the texture path
hell nahhh still cursors
Yeah I think you're doing to the image path instead of the asset path
oh wait
I load mine like this, so my asset path is Mods\{{ModID}}\Furniture
Mods/{{ModID}}/vww_fishmonger_furnitureyeehaw
Woohoo! Nice bed!
thank you!
Cuteeee
now i probs gonna suffere adding the other furniture
Well, look on the bright side, you've got that part of it down, so you won't have that problem next time.
The modding journey: a series of stubbing your toes until you figure it out

if i want this :
"HasSeenEvent: anyPlayer": "Lumisteria.MtVapius_Clearing01Mariam0H",
but when false
what is the proper format again?
contains false?
I'm bashing my head D;
I am doing the color for a fruit but I can't figure out how to code the color context index to be a custom color. Do I want the hex, rgb, or hsl? And how do you code that?
contains whatever : false?
now i gotta try and understand how dif sized furniture sprite in dices or w/e work
omg finally ! btw ive spent to many days on this system
wasnt it that context tags only take specific colors
It says only for Emily's things have specific
Dang... İt's a Vaporeon huh
if
"HasSeenEvent: anyPlayer|contains=yourkey": false
You can't
That isn't a thing
it says the diff colors are grouped into the colors on the left in the table gor the dye pot not that those tags only count ofr it
That just defines dye pot & Prismatic Grange color, u have to draw the fruit itself (also artisan goods color)
It's confusing. It says for tinting it has a RGB value except Emily's dyes that use the following table
what that means is that when you make wine/jelly, the tag is used to determine the color
when you use that item to dye at Emily's dye pot, it instead uses that table to determine which pot it's eligible for
What table would be used for Artisan goods?


