BernhardScharrer
Newcomer
Hello there!
I have a little question about how to save stuff that belongs to a custom location I added into the game. I am new to modding in SDV.
What my mod does (so far):
It adds an entrance to another farmland at the west of the main Farm. I added warp points so I am able to walk to and from there. While playing everything works fine. I can plpant crops there, watch them grow and harvest them. The issue raises when I am restarting the game. After that everything has been overwritten with the map template (using tmx).
My code simple loads the tmx file and adds it to the existing locations:
I guess I have to deal with some kind of storing the locations data somewhere, but I don't know how and where to start. Would be nice if someone could help me out :)
I have a little question about how to save stuff that belongs to a custom location I added into the game. I am new to modding in SDV.
What my mod does (so far):
It adds an entrance to another farmland at the west of the main Farm. I added warp points so I am able to walk to and from there. While playing everything works fine. I can plpant crops there, watch them grow and harvest them. The issue raises when I am restarting the game. After that everything has been overwritten with the map template (using tmx).
My code simple loads the tmx file and adds it to the existing locations:
Code:
string mapAssetKey = this.Helper.Content.GetActualAssetKey("assets/SecondFarm.tmx", ContentSource.ModFolder);
GameLocation location = new GameLocation(mapAssetKey, "SecondFarm") { IsOutdoors = true, IsFarm = true };
Game1.locations.Add(location);
Last edited: