[MOD] FreeSpec - Full Skill and Stat Respec via Respec NPCs

ChthonChthon Posts: 1,855
edited June 2015 in Mod Showcase
FreeSpec adds full skill and stat respec to the respec NPCs.
This mod is yet another excerpt from the as-yet unfinished Eternity mod.

DOWNLOAD LINK

Skill refunds are greatly simplified. You can refund all skillpoints with a single press of a button.

Stat refunds are a little more complicated. You can refund stat points from a selected stat in increments of 1, 10, or 100. The starter stats for each class are enforced. So, for example, you cannot respec an Embermage below 15 Focus. For convenience's sake, your base stats, stat bonuses from items, and total stats are displayed in the interface.

Note: Be careful about item requirements when respeccing stats. If you remove stat points so that you no longer meet an equipped item's requirements, nothing will happen immediately. However, the next time you equip or unequip any other item, or press 'W' to change between weapon sets, the item that you no longer meet the requirements for will "fall off." If you have free inventory space, it will "fall off" into your inventory; otherwise it will "fall off" to the ground!

The interface when you interact with a respec NPC now looks like this:

FreeSpecDemo.png
(If you think about it, you can deduce from which buttons are enabled/disabled that the demo character used for this picture must be an Embermage.)

FreeSpec only works with the four basic classes (Embermage, Berserker, Engineer, Outlander).
However, the following spoiler contains instructions for making modded classes work with FreeSpec:
Step 1: Clone MEDIA/SKILLS/BERSERKER/PASSIVES/RESPEC_BERSERKER.DAT and adjust the numbers in the statwatchers to reflect your class's starter stats. (You can skip this step if your class's starter stats are identical to an existing class's starter stats.)

Step 2: Clone MEDIA/AFFIXES/SKILLS/RESPEC_ZERKER.DAT and change the effectname field to the name of the cloned skill you made. (You can skip this step if your class's starter stats are identical to an existing class's starter stats.)

Step 3: Edit MEDIA/SKILLS/MONSTERS/QUESTUNITS/RESPEC_AURA.DAT by cloning one of the AFFIXES blocks and changing its target unittype to your class and the affix to the cloned affix you made. (If your class's starter stats are identical to an existing class's starter stats, just use the affix for that class.)

Step 4: Edit MEDIA/UI/MENUS/INGAMEMENUS/RESPECMENU2.LAYOUT as follows:
  • 1. Add a ISA Controller for your class to Logic/Independent Isas/
  • 2. Open the Logic Group named Logic/Stat Respec in the external window (wrench and hammer icon). Try not to panic; it's not as bad as it looks.
  • 3. Add your ISA Controller and attach its "broadcast" input to IsAnOutlander's "not" output.
  • 4. Now you will need to attach the "is a" output on your ISA Controller to the "evaluate" input on 12 of the Stat Evaluators. Which 12? Depends on your class's starter attributes. You can see that the top row of ISA Controllers is organized into 4 groups of 3: {Str5, Str10, Str15}, {Dex5, Dex10, Dex15}, {Foc5, Foc10, Foc15}, {Vit5, Vit10, Vit15}. Attach to the one element of each group that matches your class's starter attributes. Also attach to the two Stat Evaluators that are in line below that element. (For example, if you attach to Str5, also attach to Str15 Hi and Str105.) That should total 12 -- 1 from each group in the top row, and 2 below each of those.

(Aside: I am aware of the irony that I wrote Rapid Respec specifically because I believed that a mod that can respec stats like this simply wasn't possible. Turns out it was possible. Here it is.)
Torchlight 2 Rapid Respec - Putting the "hack" in "hack-n-slash"
StashNinja - INFINITE Stash for Torchlight 2
NullMod - Play together in the same multiplayer game with different mods!

Comments

  • PhanjamPhanjam Posts: 3,297 ✭✭✭
    Holy moley! Thanks for this Chthon, this is GREAT!

    About "fixing" custom class files to work with FreeSpec - would that pose problems for anyone who isnt using FreeSpec? I ask to know if we'd need to provide "fixed" and "unfixed" versions of the class mod.
    Torchmodders
    Torchlight 1 Class Pack (TL1CP) Mod for TL2: Steam | RGF
  • ChthonChthon Posts: 1,855
    Phanjam wrote:
    Holy moley! Thanks for this Chthon, this is GREAT!

    About "fixing" custom class files to work with FreeSpec - would that pose problems for anyone who isnt using FreeSpec? I ask to know if we'd need to provide "fixed" and "unfixed" versions of the class mod.

    I'm not sure. There's no alterations directly to the class itself. Most of the work gets done by the UI and the NPC. I've never messed with mods that reference things defined in other mods, but I think I've seen some working examples before (like Synergies' monster density add-on). Assuming that can be done, you would be able to make a modified version of FreeSpec and leave your custom class untouched. In that case, since the mod doesn't bind to the character, you could just turn it off and on.

    Even better, you might be able to get away with using NullMod. The NPC is labeled "local only" in the town's layout. If "local only" really, really means "local only," then you could run it in the same game as someone without FreeSpec. On the other hand, if "local only" still relies on the host's definitions for making the client's copy, you may end up with situations with the NPC casting a skill that the client's client thinks is undefined. I don't know if that's an error crashes or gets silently ignored. If you've got some free time, I can run it through NullMod and we can conduct an experiment. (Yay for science!)

    [edit: I realize that I put skills in the classes' "passives" directories. This was just a convenient location. The classes don't actually have those skills assigned to them in their unit files.)
    Torchlight 2 Rapid Respec - Putting the "hack" in "hack-n-slash"
    StashNinja - INFINITE Stash for Torchlight 2
    NullMod - Play together in the same multiplayer game with different mods!
  • This is a very awesome mod! I play with Unearthed Arcana, which adds 3 additional Fame levels for a maximum of 135 skill points. Seems like this mod had no problems identifying and refunding those. Which is great because I REALLY like playing with UA and I'd hate to choose between UA and having the in-game freedom to fully respec like this. Also I'm on a Mac, and your Rapid Respec is Windows-only (no biggie, I still used it a lot under Parallels which is how I've enjoyed TL2 for so long before they had a native OS X version :). This makes it easier to test things out without much hassle.

    Thanks so much Chthon! Looking forward to your Eternity mod as well! :)
  • I've been working on a possible Respec NPC addition to my own mod, and in my research, I came across this mod. Curious about the possibility of including stat respecs, I opened this beauty up in GUTs to see how you did it. It took me a while to figure out how the stat change was actually being triggered (I overlooked the Aura, thinking it was probably a cosmetic thing). It's rather ingenious.

    In the interest of simplicity, and minimalist UI... I had an idea. Perhaps you already tried this, but is it possible (with some heavy rearranging of the logic) to have one "Reset All Stats" button before the logic modules. It would check your class, and start with the appropriate stat checker to refund 100 Strength. Each stat checker set to trigger the stat refund if 'evaluated true', then loop back into itself and try again. Once it is 'evaluated false' it moves to the next smaller increment, and so on... until Strength reaches the base value. Then it moves on the next stat, etc. Do you think that could work?

    In any case, nice work. Very clever modding.
  • gytfunkegytfunke Posts: 571
    Hey LarvaLounge,

    It'd probably be easier to get a difference between the class' base for the stat and the current stat. Then save the difference as a third stat and use that stat to subtract from the character's stat and refund stat points.
  • ChthonChthon Posts: 1,855
    LarvaLounge, you certainly could do that. In fact, I strongly considered doing exactly what gytfunke suggested. However, in the end I decided that the 3 button system was more user-friendly. You've got three use cases to consider, which I'll call UseCaseA, UseCaseB, and UseCaseC. In UseCaseA, you only want to refund one or two points because you misclicked when spending your points at the last level up.In UseCaseB, you may want to refund 10s of points because you had a gear change and your item bonuses/requirements are now somewhat different. In UseCaseC, you want to totally reset because you're fundamentally changing your build to something that relies on a different attribute. UseCaseA and B are a lot more common than C. Resetting everything doesn't work so well for UseCaseA and B since you've then got to do a whole bunch of clicks to put back all the points you didn't actually want to change. The 3 button system is a compromise that handles all 3 use cases without requiring an insane number of clicks for any of them. If you go forward with this, I'd suggest replacing the "100" button with an "all" button.

    Aside: I strongly suspect that the TL2 skill/UI logic system is Turing complete, so anything should be possible within your own logic. The problem is finding handles and functions to connect up game-world entities to the input and output of your logic. (In that sense, the real trick here is that the permanent attribute point effects can take a negative parameter, which gives us the handle we need to adjust attributes freely.)
    Torchlight 2 Rapid Respec - Putting the "hack" in "hack-n-slash"
    StashNinja - INFINITE Stash for Torchlight 2
    NullMod - Play together in the same multiplayer game with different mods!
  • gytfunke wrote:
    Hey LarvaLounge,

    It'd probably be easier...

    Maybe for you, haha. I'm a bit of an amateur modder. I have been playing with Level Sets and Spawn Classes for some time now, but when I started messing with the Respec UI, I was venturing into unknown territory. I am fumbling through it, and looking at other peoples mods to see how they do things. It's tricky 'cause it seems like the 'Respec Controller' handles a bunch of stuff behind the scenes. I've got a nice looking setup now that is an even simpler variation of how lyravega did the 'Full Respec' mod. Really I couldn't figure out another way to charge gold for the full respec, and that's important to me, shrug. If I moved the 'Reset All Skills' button over to one side, there would be a perfect spot for a 'Reset All Stats' button...

    And yeah, some basic math would be the right way to do it, but I don't have the knowledge to make it happen in GUTs. At least not yet. I'll work on it. Thanks!

    @Chthon: I like having the individual skills to respec, like in Vanilla and 'Full Respec' Mod, because I'll try new skills and want to dump em far more often than I want to change a few stats. I always thought we should be able to drop the last 5, so we can try out tier 1 effects, at least. So I've got last 5 available individually, which takes up most of the page. 15 would be better, now that I think of it. I believe that window can be scrolled.
Sign In or Register to comment.