I added this mod and SVE + IF2R. When entering the extra building on the farm as a farmhand, you get teleported to the greenhouse, even if it's not repaired yet. After deleting the mod, the map won't load. It gets stuck on the "Loading ..." screen. This is the Error from the SMAPI console:
[Json Assets] Loading stuff early (loading) [game] Microsoft.Xna.Framework.Content.ContentLoadException: Error loading "Buildings\Greenhouse". File not found. ---> System.IO.FileNotFoundException: Error loading "Content\Buildings\Greenhouse.xnb". File not found. at Microsoft.Xna.Framework.TitleContainer.OpenStream(String name) at Microsoft.Xna.Framework.Content.ContentManager.OpenStream(String assetName) --- End of inner exception stack trace --- at Microsoft.Xna.Framework.Content.ContentManager.OpenStream(String assetName) at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T](String assetName, Action`1 recordDisposableObject) at Microsoft.Xna.Framework.Content.ContentManager.Load[T](String assetName) at StardewValley.LocalizedContentManager.LoadBase[T](String assetName) in C:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\LocalizedContentManager.cs:line 120 at StardewModdingAPI.Framework.ContentManagers.BaseContentManager.RawLoad[T](String assetName, Boolean useCache) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\ContentManagers\BaseContentManager.cs:line 256 at StardewModdingAPI.Framework.ContentManagers.GameContentManager.RawLoad[T](String assetName, LanguageCode language, Boolean useCache) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\ContentManagers\GameContentManager.cs:line 245 at StardewModdingAPI.Framework.ContentManagers.GameContentManager.<>c__DisplayClass9_0`1.<Load>b__0() in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\ContentManagers\GameContentManager.cs:line 105 at StardewModdingAPI.Framework.Utilities.ContextHash`1.Track[TResult](T key, Func`1 action) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\Utilities\ContextHash.cs:line 53 at StardewModdingAPI.Framework.ContentManagers.GameContentManager.Load[T](String assetName, LanguageCode language, Boolean useCache) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\ContentManagers\GameContentManager.cs:line 101 at StardewModdingAPI.Framework.ContentManagers.BaseContentManager.Load[T](String assetName) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\ContentManagers\BaseContentManager.cs:line 94 at StardewValley.BluePrint..ctor(String name) in C:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\BluePrint.cs:line 98 at load_Patch1(Object ) at loadDataToLocations_Patch1(List`1 gamelocations) at StardewValley.SaveGame.<>c.<getLoadEnumerator>b__68_3() in C:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\SaveGame.cs:line 1347 at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.Execute() [SMAPI] An error occured in the overridden update loop: Microsoft.Xna.Framework.Content.ContentLoadException: Error loading "Buildings\Greenhouse". File not found. ---> System.IO.FileNotFoundException: Error loading "Content\Buildings\Greenhouse.xnb". File not found. at Microsoft.Xna.Framework.TitleContainer.OpenStream(String name) at Microsoft.Xna.Framework.Content.ContentManager.OpenStream(String assetName) --- End of inner exception stack trace --- at StardewValley.SaveGame.<getLoadEnumerator>d__68.MoveNext() in C:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\SaveGame.cs:line 1361 at Update_Patch1(Object gameTime, GameTime )
Okay so this took some jumping through hoops, but I did fix this by following this painfully long process:
1) Go to your [CP] Immersive Farm 2 Remastered folder, go into the assets, and copy the Farm.tbin
2) Go to [TMX] Immersive Farm and place the copy in the assets folder
3) Open the copy via Tiled, add in all the spritesheets (the ones with specific names you'll find in the CP file, but generic vanilla ones you can find most of em here https://www.spriters-resource.com/pc_computer/stardewvalley/ ), and crop so only the shed is visible 4) You should see a TileData square over the shed door, find the Building Layer (the pink one, not the grid one), and select the tile so that the left side panel on your screen shows Custom Properties for it. It should look like this: https://ibb.co/hM6yxCW 5) You want to delete the "Conditions" and "Fallback" properties, so right click and Remove them both. Now click on the action box, on the part that says "Game Warp etc" Delete the text (but not the property!) and replace it with this: Game Warp 9 15 FarmShed 6) Save your shed WITHOUT RENAMING. Tiled does weird things if you try to export or save as; so find the farm.tbin you just edited in your TMX assets folder and rename it there to whatever you like. Then go to the root of the TMX folder, open the content.json in a text editor, and add this: { "name": "Farm", "file": "assets/ShedName.tbin", "position": [ TileX, TileY ] }, It should go right under this part at the very top: { "mergeMaps": [ { "name": "Farm", "file": "assets/fixed_greenhouse.tbin", "sourceArea": [ 0, 0, 7, 10 ], "position": [ 41, 41 ], "conditions": "Hn ccPantry", "removeEmpty":"false" }, MAKE SURE YOU CHECK TO SEE WHICH TILE X AND TILE Y CORRESPOND TO YOUR NEW SHED'S SPOT ON THE FARM. You do this by finding the top left corner of YOUR cropped shed section on the ORIGINAL Farm.tbin. Whatever coordinates the original farm gives you at the very bottom of the screen for that tile are your TileX and TileY. 7) Save, but don't close ANYTHING, and run the game to see if your shed is in the right place and works properly. If it doesn't, manually adjust the tile location until it is.
TLDR; it's actually an issue with IFR2 that I don't understand because I'm just a baby modder, but following the above steps should make it work until whatever it is gets fixed (if it gets fixed).
As for why I didn't just edit the original .tbin file, whenever I did even the tiniest adjustment on it, it failed to load. So I worked around it.
That's true. I just wanted to publish mod as soon as I created working verison. None of my previous mods used xnb files, so that will be new experience for me :) Additionally I will have to consider, what should happen, if host have custom greenhouse map.
You could reuse the main greenhouse map (even if it's custom) for the separate greenhouses. For example: public class ModEntry : Mod, IAssetLoader { public bool CanLoad<T>(IAssetInfo asset) { return asset.AssetNameEquals("Buildings/Greenhouse") || asset.AssetNameEquals("Maps/FarmGreenHouse"); }
public T Load<T>(IAssetInfo asset) { if (asset.AssetNameEquals("Buildings/Greenhouse")) return this.Helper.Content.Load<T>("assets/building.png"); if (asset.AssetNameEquals("Maps/FarmGreenHouse")) return this.Helper.Content.Load<T>("Maps/Greenhouse", ContentSource.GameContent); throw new InvalidOperationException($"Unexpected asset '{asset.AssetName}'."); } }
Thanks for help :) Btw I use "greenhouse" blueprint. It exist, but is never used by game. And it needs this Buildings/Greenhouse texture and Maps/FarmGreenHouse map to work. I wonder what Eric Barone wanted to use this blueprint for.
12 comments
After deleting the mod, the map won't load. It gets stuck on the "Loading ..." screen.
This is the Error from the SMAPI console:
[Json Assets] Loading stuff early (loading)
[game] Microsoft.Xna.Framework.Content.ContentLoadException: Error loading "Buildings\Greenhouse". File not found. ---> System.IO.FileNotFoundException: Error loading "Content\Buildings\Greenhouse.xnb". File not found.
at Microsoft.Xna.Framework.TitleContainer.OpenStream(String name)
at Microsoft.Xna.Framework.Content.ContentManager.OpenStream(String assetName)
--- End of inner exception stack trace ---
at Microsoft.Xna.Framework.Content.ContentManager.OpenStream(String assetName)
at Microsoft.Xna.Framework.Content.ContentManager.ReadAsset[T](String assetName, Action`1 recordDisposableObject)
at Microsoft.Xna.Framework.Content.ContentManager.Load[T](String assetName)
at StardewValley.LocalizedContentManager.LoadBase[T](String assetName) in C:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\LocalizedContentManager.cs:line 120
at StardewModdingAPI.Framework.ContentManagers.BaseContentManager.RawLoad[T](String assetName, Boolean useCache) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\ContentManagers\BaseContentManager.cs:line 256
at StardewModdingAPI.Framework.ContentManagers.GameContentManager.RawLoad[T](String assetName, LanguageCode language, Boolean useCache) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\ContentManagers\GameContentManager.cs:line 245
at StardewModdingAPI.Framework.ContentManagers.GameContentManager.<>c__DisplayClass9_0`1.<Load>b__0() in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\ContentManagers\GameContentManager.cs:line 105
at StardewModdingAPI.Framework.Utilities.ContextHash`1.Track[TResult](T key, Func`1 action) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\Utilities\ContextHash.cs:line 53
at StardewModdingAPI.Framework.ContentManagers.GameContentManager.Load[T](String assetName, LanguageCode language, Boolean useCache) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\ContentManagers\GameContentManager.cs:line 101
at StardewModdingAPI.Framework.ContentManagers.BaseContentManager.Load[T](String assetName) in C:\source\_Stardew\SMAPI\src\SMAPI\Framework\ContentManagers\BaseContentManager.cs:line 94
at StardewValley.BluePrint..ctor(String name) in C:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\BluePrint.cs:line 98
at load_Patch1(Object )
at loadDataToLocations_Patch1(List`1 gamelocations)
at StardewValley.SaveGame.<>c.<getLoadEnumerator>b__68_3() in C:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\SaveGame.cs:line 1347
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
[SMAPI] An error occured in the overridden update loop: Microsoft.Xna.Framework.Content.ContentLoadException: Error loading "Buildings\Greenhouse". File not found. ---> System.IO.FileNotFoundException: Error loading "Content\Buildings\Greenhouse.xnb". File not found.
at Microsoft.Xna.Framework.TitleContainer.OpenStream(String name)
at Microsoft.Xna.Framework.Content.ContentManager.OpenStream(String assetName)
--- End of inner exception stack trace ---
at StardewValley.SaveGame.<getLoadEnumerator>d__68.MoveNext() in C:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\SaveGame.cs:line 1361
at Update_Patch1(Object gameTime, GameTime )
1) Go to your [CP] Immersive Farm 2 Remastered folder, go into the assets, and copy the Farm.tbin
2) Go to [TMX] Immersive Farm and place the copy in the assets folder
3) Open the copy via Tiled, add in all the spritesheets (the ones with specific names you'll find in the CP file, but generic vanilla ones you can find most of em here https://www.spriters-resource.com/pc_computer/stardewvalley/ ), and crop so only the shed is visible
4) You should see a TileData square over the shed door, find the Building Layer (the pink one, not the grid one), and select the tile so that the left side panel on your screen shows Custom Properties for it. It should look like this: https://ibb.co/hM6yxCW
5) You want to delete the "Conditions" and "Fallback" properties, so right click and Remove them both. Now click on the action box, on the part that says "Game Warp etc" Delete the text (but not the property!) and replace it with this: Game Warp 9 15 FarmShed
6) Save your shed WITHOUT RENAMING. Tiled does weird things if you try to export or save as; so find the farm.tbin you just edited in your TMX assets folder and rename it there to whatever you like. Then go to the root of the TMX folder, open the content.json in a text editor, and add this:
{
"name": "Farm",
"file": "assets/ShedName.tbin",
"position": [ TileX, TileY ]
},
It should go right under this part at the very top:
{
"mergeMaps": [
{
"name": "Farm",
"file": "assets/fixed_greenhouse.tbin",
"sourceArea": [ 0, 0, 7, 10 ],
"position": [ 41, 41 ],
"conditions": "Hn ccPantry",
"removeEmpty":"false"
},
MAKE SURE YOU CHECK TO SEE WHICH TILE X AND TILE Y CORRESPOND TO YOUR NEW SHED'S SPOT ON THE FARM. You do this by finding the top left corner of YOUR cropped shed section on the ORIGINAL Farm.tbin. Whatever coordinates the original farm gives you at the very bottom of the screen for that tile are your TileX and TileY.
7) Save, but don't close ANYTHING, and run the game to see if your shed is in the right place and works properly. If it doesn't, manually adjust the tile location until it is.
TLDR; it's actually an issue with IFR2 that I don't understand because I'm just a baby modder, but following the above steps should make it work until whatever it is gets fixed (if it gets fixed).
As for why I didn't just edit the original .tbin file, whenever I did even the tiniest adjustment on it, it failed to load. So I worked around it.
public class ModEntry : Mod, IAssetLoader
{
public bool CanLoad<T>(IAssetInfo asset)
{
return
asset.AssetNameEquals("Buildings/Greenhouse")
|| asset.AssetNameEquals("Maps/FarmGreenHouse");
}
public T Load<T>(IAssetInfo asset)
{
if (asset.AssetNameEquals("Buildings/Greenhouse"))
return this.Helper.Content.Load<T>("assets/building.png");
if (asset.AssetNameEquals("Maps/FarmGreenHouse"))
return this.Helper.Content.Load<T>("Maps/Greenhouse", ContentSource.GameContent);
throw new InvalidOperationException($"Unexpected asset '{asset.AssetName}'.");
}
}