barteke22 / StardewMods

MIT License
3 stars 10 forks source link

incompatible with Stardew 1.6 #3

Open benny-dreamly opened 6 months ago

benny-dreamly commented 6 months ago

I love this mod so much! (Specifically Fishing Info Overlays) and was wondering if you could update it for 1.6! If not that's okay. I know you haven't made a commit to the repo in over 3 years, but I find the mod so helpful!

ER-95 commented 6 months ago

@barteke22 Are you updating your mods for 1.6? Thank you!

benny-dreamly commented 6 months ago

I think I can try converting this as it’s under an MIT license which means it’s fully open source. I have to learn c# first though………

crazy531 commented 6 months ago

I fixed it. A lot of methods don't work. There may be some minor problems

ER-95 commented 6 months ago

@crazy531 Would you be able to upload it here please? Thank you!

crazy531 commented 6 months ago

FishingInfoOverlays 1.1.6-unofficial.8.zip

ER-95 commented 6 months ago

@crazy531 Thank you! When you say "a lot of methods don't work", do you mean a lot of things were broken and had to be fixed? Or a lot of the mod still doesn't work?

benny-dreamly commented 6 months ago

@crazy531 thank you so much! I was trying to patch it myself but couldn't do it 👍

benny-dreamly commented 6 months ago

@crazy531 one small problem the lines you're using int.Parse could be replaced by an int.TryParse to avoid this mess of the log getting spammed with lots of red error messages like this: [18:27:29 ERROR Fishing Info Overlays] This mod failed in the Display.Rendered event. Technical details: FormatException: Input string was not in a correct format. at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type) at System.Int32.Parse(String s) at StardewMods.Overlay.Rendered(Object sender, RenderedEventArgs e) in C:\Users\xyr\OneDrive\game\Stardew Valley\FishingInfoOverlays\Overlay.cs:line 218 at StardewModdingAPI.Framework.Events.ManagedEvent`1.Raise(TEventArgs args) in SMAPI\Framework\Events\ManagedEvent.cs:line 101

crazy531 commented 6 months ago

@crazy531 Thank you! When you say "a lot of methods don't work", do you mean a lot of things were broken and had to be fixed? Or a lot of the mod still doesn't work? @ER-95 The fishing minigame box couldn't override the original BobberBar, couldn't find the right scale, Vector2 calculations were too difficult for me, I removed this feature myself and replaced it with another mod. I like is the top-left prediction function

crazy531 commented 6 months ago

@benny-dreamly The main change is the structure of the item, the type int of itemid has been changed to string, and the unique value is prefixed with (O). There are many places in the code that require int.TryParse conversions

crazy531 commented 6 months ago

@crazy531 one small problem the lines you're using int.Parse could be replaced by an int.TryParse to avoid this mess of the log getting spammed with lots of red error messages like this: [18:27:29 ERROR Fishing Info Overlays] This mod failed in the Display.Rendered event. Technical details: FormatException: Input string was not in a correct format. at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type) at System.Int32.Parse(String s) at StardewMods.Overlay.Rendered(Object sender, RenderedEventArgs e) in C:\Users\xyr\OneDrive\game\Stardew Valley\FishingInfoOverlays\Overlay.cs:line 218 at StardewModdingAPI.Framework.Events.ManagedEvent`1.Raise(TEventArgs args) in SMAPI\Framework\Events\ManagedEvent.cs:line 101

The error should be that the itemid of DeluxeBait is non-numeric. The updated itemid has both numbers and non-numbers, and the experience is very bad

crazy531 commented 6 months ago

fix DeluxeBait is non-numeric FishingInfoOverlays 1.1.6-unofficial.2-cyxyr.zip

barteke22 commented 5 months ago

I've ported the mod to 1.6, but won't be making an official release yet.

From a glance at 1.6, it appears the fishing has been fully redone from scratch, so the hardcoded rewards (like Nuts & bosses) might no longer be accurate / mod could lead to save mutations.

I'm also thinking of adding a performance mode that doesn't constantly simulate fishing (will miss out on fish added via weird methods), as 1.6 made it easier to just add fish via CP (so hopefully there'll be less mods hacking them in).

Here's the current 1.6 port (dunno if it works better or worse than @crazy531's): old

ER-95 commented 5 months ago

@barteke22 When you say it could lead to save mutations, would you be able to elaborate on that please? Do you mean corrupted saves or something else?

barteke22 commented 5 months ago

Unfortunately the old fishing (which likely hasn't changed much on that part) had a lot of hardcoded stuff all over the place. Like Nuts / Furniture editing specific fields directly on Game1.player instead of the passed Farmer object.

Most of the hardcoded stuff could've been bypassed by just passing a 'dummy farmer' to the function, but those specific ones had to be undone after each 'cast' instead. If any of those flags have changed, the real player might no longer be able to catch some item.

All the things I tested so far seemed to work the same, but I'll need to properly examine the code as fishing used to be (and probably still is) all over the place.

benny-dreamly commented 5 months ago

Thank you for coming back to this even after 3 years. I really appreciate it.

crazy531 commented 5 months ago

Welcome back. The latest fix code is in repo,Hope it helps you

N3rdGirl commented 5 months ago

I want to say that the mod, for some reason, causes an issue when quitting to desktop from in a save. It causes the game to hang and not close for like 4-5 min XD

barteke22 commented 5 months ago

I'm not experiencing that on my end, does your log say anything?

This might be a working version (don't have time to run splitscreen / multiplayer / thorough tests). Make sure to delete old config files.

dsf3449 commented 5 months ago

I'm experiencing the same thing, where is the log file located? I can upload it

KariArisu commented 5 months ago

Using the version you just linked, Zoom Level affects the size of the overlay. UI Scale doesn't affect it though.

Only really noticeable because I use a mod that lets me quickly change zoom level, which causes this mod's overlay to get smaller and bigger.

Also, doesn't seem to work in the mines.

barteke22 commented 5 months ago

Log instructions + link generator: https://smapi.io/log

QcMitsou commented 5 months ago

Smapi Log Shows errors with this mod and the fish/percentages overlay doesn't show up in the mines fishing levels.