RELEASED [SMAPI] Skill Prestige Mod

Discussion in 'Gameplay Mechanics' started by Alphablackwolf, Oct 8, 2016.

  1. Alphablackwolf

    Alphablackwolf Void-Bound Voyager

    Latest Version: 1.2.3- Download

    SMAPI 1.15 support complete!

    The Skill Prestige Mod allows you to earn permanent profession perks beyond that which can normally be obtained in Vanilla play. By spending Prestige Point(s), earned by resetting a skill from 10 to 0, you character can buy the level 5 or 10 profession of their choice. By default, level 5 professions cost 1 Prestige Point, while Level 10 professions cost 2 Prestige Points and require their associated level 5 profession already be purchased. For example, buying the Lv5 Tiller, Lv10 Artisan, and Lv10 Agriculturalist professions would require 1+2+2=5 Prestige Points. Only Prestige Points earned from a specific skill can be used to buy that skill's professions. By default, recipes are lost when a skill is reset.

    This mod requires SMAPI 1.15, and Stardew Valley 1.2. This mod is compatible with other skill mods; native support for the Luck Skill is included, and support for the Cooking Skill is included in the download.

    Future Development Goals include:
    - New Options for Spending your 11th+ PP, i.e. efficiency or berry harvest bonuses
    - Gamepad Support
    - Stockalike Button Hover Effects

    My source code is here. There is a guide on my github wiki which explains how to make other skill mods compatible with this mod. I invite any bug reports here on nexus or on github.


    Version 2 Progress:
    Done:
    Bonus Framework
    Technical Framework (SDV Method Replacement)
    Farming Bonuses
    Menu framework for page system/navigation
    Menu Element Auto-arranger
    Menu framework for purchasing bonuses
    Farming bonuses page

    In Progress:
    A lot of testing

    Soon (in rough order):
    Bug fixing
    Adding new settings to settings window
    cosmetic tweaks and prettying
    a version checker at launch
    A lot more testing
    ask for beta testers?
    Fishing Bonuses
    Foraging Bonuses
    Mining Bonuses
    Combat Bonuses
    Testing until I start twitching
    Luck Bonuses
    Cooking Bonuses
    Testing until my eyes bleed
    bonus icons?
    luck and cooking skill profession icons?
    Even Moar Testing!
     
      Last edited: Aug 9, 2017
    • Thvar

      Thvar Void-Bound Voyager

      Hey,

      I'm trying your mod and it looks like there's a bug where you've hardcoded that the mod should be in the Stardew directory under steam instead of AppData and hardcoded that the name should be SkillPrestige (Errors in SMAPI below):


      [04:47:03.796 PM] Skill Prestige Mod: Creating new options file...
      [04:47:03.801 PM] Skill Prestige Mod: Error while attempting to create an options file.
      System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley\Mods\SkillPrestige\Options.json'.
      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
      at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
      at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
      at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
      at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
      at System.IO.File.WriteAllLines(String path, String[] contents)
      at SkillPrestige.Options.Save()
      at SkillPrestige.Options.SetupOptionsFile()
      Please file a bug report on NexusMods.
      [04:47:03.803 PM] Failed to load mod 'C:\Users\Thvar\AppData\Roaming\StardewValley\Mods\17-SkillPrestige\SkillPrestige.dll'. Exception details:
      System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Program Files (x86)\Steam\steamapps\common\Stardew Valley\Mods\SkillPrestige\Options.json'.
      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
      at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
      at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
      at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
      at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
      at System.IO.File.WriteAllLines(String path, String[] contents)
      at SkillPrestige.Options.Save()
      at SkillPrestige.Options.SetupOptionsFile()
      at SkillPrestige.Options.LoadOptions()
      at SkillPrestige.Options.get_Instance()
      at SkillPrestige.Logging.Logger.LogInformation(String message)
      at SkillPrestige.SkillPrestigeMod.Entry(Object[] objects)
      at StardewModdingAPI.Program.LoadMods() in Z:\Projects\SMAPI\src\StardewModdingAPI\Program.cs:line 337
       
      • Alphablackwolf

        Alphablackwolf Void-Bound Voyager

        It's a relative path, so the steam part isn't me. the SkillPrestige folder is hardcoded though. (private const string OptionsFilePath = @"Mods\SkillPrestige\Options.json")

        I'm not aware of any way to get the relative name of the folder where the mod is stored, if anyone knows one I can switch to that.
         
          Last edited: Oct 8, 2016
        • SarahSyna

          SarahSyna Subatomic Cosmonaut

          How do you earn prestige points?
           
          • Alphablackwolf

            Alphablackwolf Void-Bound Voyager

            get a skill to level 10 and press the prestige button on the prestige menu, after a prompt it will give you a prestige point in exchange for resetting the skill back to level 0
             
              SarahSyna likes this.
            • stephanreiken

              stephanreiken Pangalactic Porcupine

              It simply doesn't work. Crashes when you attempt to prestige a skill. I got to farming 10 and then tried to prestige it and the game just closes.
               
              • Thvar

                Thvar Void-Bound Voyager

                I'm afraid I don't really know anything about modding, so I can't help here. However, all of my other mods do work fine with different names. And I'm not sure how they make the mod work whether it's in the AppData Stardew folder or the Steam one, but both folders seem to work in other mods. I mean, it's an easy workaround for me atm, but it should definitely be possible.

                Edit: Ah, and I had the same issue as stephanreiken. Although with Foraging. It doesn't appear to work currently.

                Edit2: Tried to enable testing to see if that would spit out errors, but the log looks fine. Lemme know if there's something I should test.
                 
                  Last edited: Oct 9, 2016
                • Alphablackwolf

                  Alphablackwolf Void-Bound Voyager

                  Get the new version I posted yesterday. I had a bad merge of source code at one point and missed a '?,' it's fixed now.
                   
                  • Thvar

                    Thvar Void-Bound Voyager

                    Nice. OK, game no longer crashes, so nice work!

                    However:

                    1. I don't seem to be able to distribute prestige points I get.
                    2. Once I prestige a skill (let's say Farming), anytime I click the prestige button for ANY skill it will let me prestige Farming and only farming regardless of my farming level.
                    3. I think this is working as intended, but it seems annoying more than good to remove all the recipes you get from the skill when you prestige it. I suspect it's an extra step for you to take anyway because if memory serves the recipes are just stored somewhere in the save file? If nothing else, maybe you could introduce an option to set that keeps recipes?
                     
                    • Alphablackwolf

                      Alphablackwolf Void-Bound Voyager

                      Actually I was already debating about doing #3, I think I will make it an option setting when I get the chance. I haven't experienced 1 or 2 before, I will attempt to recreate the conditions. By 'distribute' prestige points do you mean spending them to permanently obtain professions?

                      Oh, side note, I was thinking about it and the reason my mod is different than the most others in regards to the file path is that I am actually writing the file system to create and read the options and data files for the mod. Most others don't do that. I looked deeper into the SMAPI code and found settings to get relative paths, so I should be able to change that as well.
                       
                      • charlottenoyen

                        charlottenoyen Scruffy Nerf-Herder

                        If I could keep my recipes I would be all over this in a heartbeat. This is pretty much exactly the mod I wanted!
                         
                        • Thvar

                          Thvar Void-Bound Voyager

                          Ooh, nice work with the relative paths. You may want to consider using config.json instead of Options.json for your configuration btw. This seems to be what most other mods use.

                          Yes, sorry, I mean that I can't spend them. When I click the icons, nothing happens. Let me know if there's more information I can give you to help you debug. I haven't done enough modding to know what's useful.
                           
                          • Alphablackwolf

                            Alphablackwolf Void-Bound Voyager

                            Okay, in my local stream I have the relative paths working, and I have switched from options.json to config.json. I also have created a per-save config.json that will have the setting to keep your recipes or not. my eventual goal would be to add a UI element that lets you change the setting, but for now I'm just going to put it in and you can manually adjust the setting. I'll post instructions on the mod when I get that done as well.
                             
                            • Alphablackwolf

                              Alphablackwolf Void-Bound Voyager

                              Releasing a new version in the next couple of minutes, be sure to get the latest!

                              Edit: released, with instructions on the description page, as promised.
                               
                                Last edited: Oct 10, 2016
                              • charlottenoyen

                                charlottenoyen Scruffy Nerf-Herder

                              • Alphablackwolf

                                Alphablackwolf Void-Bound Voyager

                                By that do you mean you lost the professions you chose when you first leveled them up? That is indeed by design. If you prestige your skills a few times and spend the points you'll find the level up menus start to handle it dynamically. For instance, if you take a level 5 profession through prestige, it will automatically give you the other when you level up to level 5 again. If you have both level 5 options when you get to level 10 you can use an arrow to switch between the sets of options. If you already have one level 10 option it will say 'Prestiged!' underneath it.


                                Thank you for your posts and the info, enjoy!
                                 
                                  bielz likes this.
                                • bielz

                                  bielz Void-Bound Voyager

                                  how to lucky skill and cooking skill work on 1.1 ? only works on 1.0.7 for me
                                   
                                  • SirReality

                                    SirReality Intergalactic Tourist

                                    I downloaded your mod from Nexus, v 1.0.2.5, and the game boots up fine with it, but crashes to desktop once I attempt to load a save file. I don't know how to get SMAPI to save a log, but after normally loading all the mods, it throws an error that doesn't normally occur. I've attached a screenshot below, hope that helps! Everything in red that I cut off occurred after SDV started up, in response to me PrintScreen'ing.

                                    I love the concept and believe it's a wonderfully elegant solution to a common complaint for people who wish they could unlock more! Best of luck with continuing development!

                                    EDIT: Testing by running it against a modless install (save for this and SMAPI) and it still crashed on save load, but successfully registered its commands, and didn't throw the same error as before. Strange... And I've double checked, running latest version of SMAPI, SDV, and SP.
                                     

                                      Attached Files:

                                      Last edited: Oct 10, 2016
                                    • Zaane

                                      Zaane Scruffy Nerf-Herder

                                      Neither the Cooking Skill nor the Luck Skill mod are updated to 1.1 yet ya gotta wait
                                       
                                        bielz likes this.
                                      • Alphablackwolf

                                        Alphablackwolf Void-Bound Voyager

                                        I have locally edited versions that work in 1.1, but not the official ones yet.
                                         
                                          bielz likes this.

                                        Share This Page