TorchModders

Mod Projects => Lord Nyriox's Playground => Topic started by: Lord Nyriox on June 22, 2018, 02:22:45 AM

Title: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on June 22, 2018, 02:22:45 AM
Ultimate Respec Lite

"Ultimate Respec (https://steamcommunity.com/sharedfiles/filedetails/?id=841702558)", an extension of the "FreeSpec" mod by @Chthon, is currently the most popular TL2 respec mod on the Steam Workshop.  Adding positive stat-allocation buttons—in addition to the negative ones provided by FreeSpec—it addresses the significant issue of "hundred-click syndrome" brought on by large numbers of unused stat-points.  As far as Stat-respec mods go, it is, indeed, the "ultimate". 

Problems and Solutions
That being said, "Ultimate Respec" suffers from the same problem that plagued "FreeSpec"—namely its lack of support for custom classes.  This is because both "FreeSpec" and "Ultimate Respec" set the minimum value for each Stat to the starting values for the player's current class—a process which requires a complicated static registry to implement. 

However, this restriction is oriented more towards immersive consistency than mechanical necessity.  Potion based respec mods like "Respec/Restat Potions (https://steamcommunity.com/sharedfiles/filedetails/?id=136669949)" work just fine without checking whether a player is below his or her "starting stats"—which indicates to me that starting Stats are more or less arbitrary. 

And so I decided to remove that unecessary code.  Following the class-adding instructions provided in the official FreeSpec thread (https://forums.runicgames.com/discussion/60605/mod-freespec-full-skill-and-stat-respec-via-respec-npcs), I created a set of class-triggers linked to the generic "Player" unit-type (which both vanilla and modded classes inherit).  For these triggers, I set all Stats to a minimum value of 5 (instead of 10 or 15).  Then I removed all class-specific files and triggers from the mod—leaving only the "generic" Stat respec triggers in place. 

After a quick test with both a vanilla Embermage character, and my own custom "Emberdrake" class, I can confirm that this simplified version of the "Ultimate Respec" mod correctly works on both modded and vanilla classes. 

Try it out at the link below! 


Download link (RGF):
https://www.runicgamesfansite.com/mod_downloads/npcs-tl2/download-1526-ultimate-respec-lite.html (https://www.runicgamesfansite.com/mod_downloads/npcs-tl2/download-1526-ultimate-respec-lite.html)

Download link (Steam Workshop): 
https://steamcommunity.com/sharedfiles/filedetails/?id=1421956260 (https://steamcommunity.com/sharedfiles/filedetails/?id=1421956260) 

Source repository (Github): 
https://github.com/LordNyriox/Ultimate-Respec-Lite (https://github.com/LordNyriox/Ultimate-Respec-Lite)


Title: Re: [TL2] Ultimate Respec Lite
Post by: Sch123 on June 22, 2018, 06:21:19 AM
Hi @Lord Nyriox

So far so good, there is no problem.

I've done a quick test on some existing classes, like in the Mod Variant [archer], Tl1CP [vanquisher], FEP [mongol archer], Vanilla class, Synergies [warlock]. All class can respect skill & status without any problems. ;)

Asking for permission:

By the way, is this free to use for merge with other mod?
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on June 22, 2018, 04:12:16 PM
I've done a quick test on some existing classes, like in the Mod Variant [archer], Tl1CP [vanquisher], FEP [mongol archer], Vanilla class, Synergies [warlock]. All class can respect skill & status without any problems. ;)

That is wonderful to hear! 

I did not personally test it with more than a couple of classes (one vanilla and one custom), so hearing that it works with the more popular class-packs is great confirmation.  :} 

Asking for permission:

By the way, is this free to use for merge with other mod?

Unless otherwise stated, the answer is "Yes" for all my mods. 

I would appreciate credit for any work you copy from one of my mods, but I do not require it.  ;} 
Title: Re: [TL2] Ultimate Respec Lite
Post by: Phanjam on June 22, 2018, 05:41:14 PM
downloaded and will now be a main staple in my mods load-out!

Do u plan to put this on RGF and steam workshop too? (i urge you too :) )

Elegant work!  Thanks so much for doing this :thumbsup: :thumbsup:
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on June 22, 2018, 11:34:25 PM
Do u plan to put this on RGF and steam workshop too?

Thanks for the reminder, @Phanjam!  ;} 

I just posted this mod on RGF.  You can find it at this link (https://www.runicgamesfansite.com/mod_downloads/npcs-tl2/download-1526-ultimate-respec-lite.html). 

EDIT:  Thanks to @Phanjam, the mod is also on the Steam Workshop!  You can find it at this link (https://steamcommunity.com/sharedfiles/filedetails/?id=1421956260). 


Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on July 04, 2018, 08:08:20 PM
The Steam version of this mod now has 92 subscribers, and the RGF version now has 42 downloads under its belt! 

I am frankly amazed how popular this mod has become. 
Title: Re: [TL2] Ultimate Respec Lite
Post by: Phanjam on July 05, 2018, 01:52:13 PM
It addresses what i think is a widespread issue, and does it well to boot ;)
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on July 29, 2018, 05:35:58 PM
Help Request

The edits I have already made to the "Ultimate Respec" mod for this project, are pretty minimal. 

Since the original mod was essentially just an expanded form of @Chthon's "FreeSpec (https://forums.runicgames.com/discussion/60605/mod-freespec-full-skill-and-stat-respec-via-respec-npcs)" mod, I was able to get away with simply replacing its "<Class_Name>" UnitType checks with a single set of generic "Player" UnitType checks, with the minimum value for each main Attribute set to "5". 

I have, however, received reports of gradually increasing lag when players leave the Respec window open for a while. 

Since I changed the code to affect all players indiscriminately (regardless of class), some of the existing Logic is likely redundant (which might contribute to the lag somehow).  Unfortunately, I am not familiar enough with the Logic system to be able to easily tell what is actually safe to remove. 

Could someone please examine the code of my "Ultimate Respec Lite" mod, and point out where I can simplify things? 

Thank you for your consideration.  :} 


For convenience, I have attached the source directory of the mod in question

Title: Re: [TL2] Ultimate Respec Lite
Post by: Phanjam on July 29, 2018, 10:56:34 PM
Cant commit timing but will have a look-see and let u know if i find anything ;)
Title: Re: [TL2] Ultimate Respec Lite
Post by: doudley on July 30, 2018, 02:10:34 AM
I could try and bug check the logic system but not sure when I'll be able to get access with GUTS again, hopefully this weekend. Maybe a screen capture of the logic/s would help us figure out what's going on.
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on July 30, 2018, 03:46:32 PM
Maybe a screen capture of the logic/s would help us figure out what's going on.

Thanks, @doudley.

There is also an "aura" component (attached to the Respec NPCs), and a Skill component (regulated by StatWatchers). 

As I understand it, those two components do most of the actual leg-work in this mod—the Logic simply regulates their activation.   


Honestly, I wish @Chthon was still around so I could pick his brains on the technical side of FreeSpec.  That would save us all a whole lot of trouble.  :\
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on July 30, 2018, 04:40:10 PM
Frankly, there are enough changes that I am hoping to (eventually) make, that I am almost considering a total rewrite of the mod. 

Title: Re: [TL2] Ultimate Respec Lite
Post by: doudley on August 06, 2018, 08:52:36 AM
Maybe a screen capture of the logic/s would help us figure out what's going on.

Thanks, @doudley.

There is also an "aura" component (attached to the Respec NPCs), and a Skill component (regulated by StatWatchers). 

As I understand it, those two components do most of the actual leg-work in this mod—the Logic simply regulates their activation.   


Honestly, I wish @Chthon was still around so I could pick his brains on the technical side of FreeSpec.  That would save us all a whole lot of trouble.  :\

I recently updated Variant Classes mod (Steam). Maybe now I could take a look at your mod. I won't have an access to GUTS right now, only on Sundays, but if I can have a view of the "media" folder/unpacked files of your mod, maybe I won't need to look at 'em in GUTS.

Share me a link, if its okay with you.
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on August 06, 2018, 04:58:25 PM
I won't have an access to GUTS right now, only on Sundays, but if I can have a view of the "media" folder/unpacked files of your mod, maybe I won't need to look at 'em in GUTS.


I will not have access to GUTS for at least another week, if not longer.  :\

I attached the source files for the mod to my original "Help Request" post.  I linked it here for convenience.

[LINK REMOVED]
Title: Re: [TL2] Ultimate Respec Lite
Post by: doudley on August 07, 2018, 08:52:38 AM
@Lord Nyriox
Thanks for the link!

Try this code:
Code: [Select]
[SKILL]
<STRING>NAME:Respec_Aura
<TRANSLATE>DISPLAYNAME:Respec Aura
<TRANSLATE>BASE_DESCRIPTION:Enables stat respec
<STRING>ACTIVATION_TYPE:PASSIVE
<STRING>TARGET_ALIGNMENT:GOOD
<STRING>TARGET_TYPE:SELF
<FLOAT>RANDOMRANGE:0
<FLOAT>TURNRATEOVERRIDE:-1
<BOOL>CAN_BE_SILENCED:0
<INTEGER64>UNIQUE_GUID:4921236809504979266
[LEVEL1]
<FLOAT>RANDOMRANGE:0
[EVENT_START]
<STRING>FILE:media/skills/monsters/questunits/respec_aura.layout
<BOOL>FOLLOWS:1
<BOOL>NOSTEALEFFECTS:0
<BOOL>STATSHIDDEN:1
<BOOL>CAN_CLONE:0
[AFFIXES]
<STRING>TARGET:FRIEND
<STRING>TARGETTYPE:PLAYER
<STRING>AFFIX:RESPEC_GENERIC
[/AFFIXES]
[/EVENT_START]
[EVENT_END]
<BOOL>CAN_CLONE:0
[AFFIXESREMOVE]
<STRING>AFFIX:RESPEC_GENERIC
[/AFFIXESREMOVE]
[/EVENT_END]
[/LEVEL1]
[/SKILL]

@Aherin
I think the lagging issue here is similar with Potion of Insight mod earliest lag issue, regarding skill being executed endlessly.
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on August 07, 2018, 10:57:14 PM
Try this code:
Code: [Select]
	[LEVEL1]
<FLOAT>RANDOMRANGE:0
[EVENT_START]
<STRING>FILE:media/skills/monsters/questunits/respec_aura.layout
<BOOL>FOLLOWS:1
<BOOL>NOSTEALEFFECTS:0
<BOOL>STATSHIDDEN:1
<BOOL>CAN_CLONE:0
[AFFIXES]
<STRING>TARGET:FRIEND
<STRING>TARGETTYPE:PLAYER
<STRING>AFFIX:RESPEC_GENERIC
[/AFFIXES]
[/EVENT_START]
[EVENT_END]
<BOOL>CAN_CLONE:0
[AFFIXESREMOVE]
<STRING>AFFIX:RESPEC_GENERIC
[/AFFIXESREMOVE]
[/EVENT_END]
[/LEVEL1]


So, the changes here, are adding "<BOOL>CAN_CLONE:false", and an "EVENT_END" block.

Can you explain what each does, in terms of the aura? 

I think the lagging issue here is similar with Potion of Insight mod earliest lag issue, regarding skill being executed endlessly.


Given that the slightest interruption here can result in a loss of stat-points (this "aura" continually applies an active Skill to all nearby Player Units, which is then partially enabled/disabled using Stats and UI Logic), might changing this increase the risk of things going wrong?
Title: Re: [TL2] Ultimate Respec Lite
Post by: doudley on August 08, 2018, 08:53:51 AM
So, the changes here, are adding "<BOOL>CAN_CLONE:false", and an "EVENT_END" block.

Can you explain what each does, in terms of the aura?


Can't clearly remember what "CAN_CLONE" bool does but I read somewhere (Maybe on Torchmodders wiki) that can_clone should always be off unless needed. I'm not sure if this would make sense but I think what it does, is make sure that the skill is being executed on a single instance and not make the game tag that skill to your player continuously, because doing so makes the game's cache to overload.

The event end is a safety precaution, it tells the game that when the skill ends it will do as it is told/scripted. Just try the skill with the event end and if the respec function got broken, remove it.

Given that the slightest interruption here can result in a loss of stat-points (this "aura" continually applies an active Skill to all nearby Player Units, which is then partially enabled/disabled using Stats and UI Logic), might changing this increase the risk of things going wrong?

I think, the activation of the skill depends on the "LAYOUT" skill that triggers a pulse, on which it radiates from the Vendor/NPC, then hitting the player units. Making the pulse rate lesser than the chance the player can click the button of the recpec menu, will give a high chance of not activating the skill's effect efficiently. So, as long as the layout skill is hitting the player, the skill function will continue to work. As you can see in the new code, only the "RESPEC_GENERIC" affix would be removed and that means it will stop the self-cast skill activation given by that affix and let the game continue without the self-cast skill affix when your player is not in range with the NPC anymore.
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on August 08, 2018, 04:16:44 PM
Alright.  Thanks, @doudley!

Unfortunately, I will not be able to test this for a few weeks.  I am having some technical difficulties with my computer. 

That aside, do you think you can help me code a button, that does something along the lines of gytfunke's suggestion (https://forums.runicgames.com/discussion/comment/506790/#Comment_506790) for a "Reset All" button for a Stat?

Quote from: gytfunke
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.


P.S.  Please note that, in my variant, the "class base" for each Stat is always equal to 5
Title: Re: [TL2] Ultimate Respec Lite
Post by: doudley on August 09, 2018, 05:13:29 AM
That aside, do you think you can help me code a button, that does something along the lines of gytfunke's suggestion (https://forums.runicgames.com/discussion/comment/506790/#Comment_506790) for a "Reset All" button for a Stat?
I need to see the Logic Group of your UI for me to understand how all these work. A screen capture would help but I do understand that you don't have access to GUTS too for a while.

What I do noticed and curious of, why is there multiple stat for add dex, add str, add, add foc, and add vit? Stats are empty to begin with, I don't think it is needed like that. The logic can assign a 1, a 10, and 100 in a single stat.

Quote from: gytfunke
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.


P.S.  Please note that, in my variant, the "class base" for each Stat is always equal to 5.
If I would try to do a reset all stat function, I will make it like somewhere similar to my Brother-in-Arms (2017) mod. On which, the human companion have its own character stat menu (Attribute points), where you can subtract and add stat points easily. But for the "reset all stat button", it is something similar with the human companion's skill menu, where as all skill points are being monitored by another stat (dummy) then able to return/convert them back to unused skill points whenever the respec skill button is pressed.

So the key condition here is that this would only work if the attribute stats distribution were monitored from the start of the game, so that the dummy stat can return all the new attribute stats gained by the player.

Another way might be to have a dummy stat for each attribute (Dex, Str, Foc, & Vit), so that you can return them to unused points.

I may need to refresh my memory regarding this intricate system, I'll also try to review my BiA logic groups.
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on August 09, 2018, 10:44:25 PM
@doudley

I need to see the Logic Group of your UI for me to understand how all these work. A screen capture would help but I do understand that you don't have access to GUTS too for a while.

Currently, my entire computer system is down for the count.  I am replying to this discussion on a phone.  :P 

What I do noticed and curious of, why is there multiple stat for add dex, add str, add, add foc, and add vit? Stats are empty to begin with, I don't think it is needed like that. The logic can assign a 1, a 10, and 100 in a single stat.

As I understand it, the author of the "Ultimate Respec" mod, simply extended the methods already used in the original "FreeSpec" mod.

Feel free to draft a method to simplify that mess, for me.  ;}

So the key condition here is that this would only work if the attribute stats distribution were monitored from the start of the game, so that the dummy stat can return all the new attribute stats gained by the player.

I want to keep this mod as lightweight as reasonably possible—which is part of why I eliminated the "starting stats" concept when I turned the mod generic. 

To put my prior request in better terms: 
Quote from: Lord Nyriox
How would you make a button, that sets the player's points for a specific stat, to exactly "5"—then gives a number of "investable Stat Points", equal to "the Old Value of the Stat, minus 5"? 

Title: Re: [TL2] Ultimate Respec Lite
Post by: doudley on August 11, 2018, 07:41:30 AM
To put my prior request in better terms: 
Quote from: Lord Nyriox
How would you make a button, that sets the player's points for a specific stat, to exactly "5"—then gives a number of "investable Stat Points", equal to "the Old Value of the Stat, minus 5"? 

I can give you my new code for "RESPEC_GENERIC.DAT" right now but we still need to make adjustment with the logic group of the UI.

I think it would be difficult to make a reset all button function, I'm not sure if "AWARD STATPOINT" effect can be statmodified...this need to be tried and be tested. If statmodify doesn't work, the last resort would be to make an auto pressing UI logic...as seen in my "Auto-Spend Stat Points" mod. This would make the respec stat activate continuously until it reaches the value of dex 5, str 5, foc 5, and vit 5.
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on August 13, 2018, 07:00:29 AM
I can give you my new code for "RESPEC_GENERIC.DAT" right now but we still need to make adjustment with the logic group of the UI.

Well, I would certainly like to at least see your proposed code. 

Any potential optimizations would likely be welcomed.  :}

I think it would be difficult to make a reset all button function, I'm not sure if "AWARD STATPOINT" effect can be statmodified...this need to be tried and be tested. If statmodify doesn't work, the last resort would be to make an auto pressing UI logic...as seen in my "Auto-Spend Stat Points" mod. This would make the respec stat activate continuously until it reaches the value of dex 5, str 5, foc 5, and vit 5.

If the auto-pressing method would be simpler to implement, then I have no problem using it. 

I would prefer a more "proper" method, of course—but we can use whatever is easiest.  ;} 



Final Request

I also have one final proposal, that I would like your input on. 

Target 4:  Add a system to allow purchasing additional Stat-points and Skill-points. 

In other words, there would be 2 additional UI buttons (each with a gold-price next to it), which add investable Stat and/or Skill points—without triggering a Respec or Level-up event.

For Stat-points, this should be fairly easy ("AWARD STATPOINT" with a gold-cost)—but there is apparently no equivalent effect for Skill-points (check "EffectsList.dat" if you do not believe me). 

Is there some in-game method (that you know of) to add investable Skill-points to a player?


Thanks again for all your help! 
Title: Re: [TL2] Ultimate Respec Lite
Post by: Sch123 on August 14, 2018, 09:48:35 AM
Hi @doudley

What about this skill_potion (https://steamcommunity.com/sharedfiles/filedetails/?id=198103586&searchtext=elixir) Mod. :)
Title: Re: [TL2] Ultimate Respec Lite
Post by: wolfeng_ on October 25, 2018, 04:13:55 AM
Hi. there seems to be a bug with Hardcore Lite (https://steamcommunity.com/sharedfiles/filedetails/?id=921708134).

When both mods are loaded and you try to respec you gain more skill points and can keep clicking the button for even more.

Sadly I don't know nearly enough about modding to understand why this happens, even after looking through the files.
Title: Re: [TL2] Ultimate Respec Lite
Post by: Phanjam on October 25, 2018, 01:13:49 PM
Hi @wolfeng_ thanks v much for bringing this to our attention. We havent heard from @Lord Nyriox in a while but @Aherin (author of Hardcore Lite) does come by quite often.

Yo Aherin is it possible the unitthemes you and Nyriox use for your respective mods are interfering with each other?

Edit
And welcome to the forums Wolfeng_!
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on October 25, 2018, 11:58:45 PM
When both mods are loaded and you try to respec you gain more skill points and can keep clicking the button for even more.

I would have to check the internals of that "Hardcore Lite (https://steamcommunity.com/sharedfiles/filedetails/?id=921708134)" mod, to see what in its code may interfere with the standard "Respec all Skills" Effect. 

@doudley and @Aherin, any ideas?

is it possible the unitthemes you and Nyriox use for your respective mods are interfering with each other?


Technically, I did not write or change the Skill-respec component--but from what I could tell the affected button is just a shim for the vanilla "Respec" ("KEFFECT_TYPE_RESPEC") Effect, which is commonly used by Respec Potion (https://steamcommunity.com/sharedfiles/filedetails/?id=135164919) mods.

The EffectsList.dat description for the Effect reads:
Quote from: EffectsList.dat
Refund all Skill Points

Title: Re: [TL2] Ultimate Respec Lite
Post by: doudley on October 27, 2018, 07:23:49 AM
When both mods are loaded and you try to respec you gain more skill points and can keep clicking the button for even more.

I would have to check the internals of that "Hardcore Lite (https://steamcommunity.com/sharedfiles/filedetails/?id=921708134)" mod, to see what in its code may interfere with the standard "Respec all Skills" Effect.
I'll do that to, later. Maybe something is disrupting the respec system of the mod.
Title: Re: [TL2] Ultimate Respec Lite
Post by: doudley on November 04, 2018, 08:17:27 AM
When both mods are loaded and you try to respec you gain more skill points and can keep clicking the button for even more.

I would have to check the internals of that "Hardcore Lite (https://steamcommunity.com/sharedfiles/filedetails/?id=921708134)" mod, to see what in its code may interfere with the standard "Respec all Skills" Effect.
I'll do that to, later. Maybe something is disrupting the respec system of the mod.
The issue didn't occur to me when I used this mod with Hardcore Lite mod.

Could be just a mod conflict issue, @wolfeng_ should check his/her mod load order and probably put Ultimate Respec Lite on top.
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on December 22, 2018, 11:04:09 PM
I have managed to work out a mockup (https://torchmodders.com/forums/lordnyriox's-playground/(tl2)-ultimate-respec-lite/?action=dlattach;attach=1947;image) of a partially-enhanced "Ultimate Respec" UI, adding the "Buy Statpoint" buttons (https://torchmodders.com/forums/lordnyriox's-playground/(tl2)-ultimate-respec-lite/msg9450/#msg9450) we discussed previously.  I will still need help making the buttons functional, however. 

The updated source-code also includes your "Respec_Aura" patch (https://torchmodders.com/forums/lordnyriox's-playground/(tl2)-ultimate-respec-lite/msg9550/#msg9550).

The updated "Ultimate Respec Lite" files are attached to this post.

EDIT:  Sub-project abandoned.  Help request and files rescinded.
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on January 01, 2019, 04:21:05 AM
Ugh, I have run into a roadblock on my "Buy Statpoints" project. 

I finally figured out how Layout logic can manipulate Gold (using the "Money Taker" object)...only to find out that GUTS considers it "not valid" for the "UI scene". 

Which means, basically, that I will have to either:

Option 1 is messy, inelegant, and prone to failure, and Option 2 not only breaks GUTS editing capabilities for the UI, but it may not even function.  Such fun!
Title: Re: [TL2] Ultimate Respec Lite
Post by: Lord Nyriox on January 07, 2019, 06:07:17 PM
Ugh, I have run into a roadblock on my "Buy Statpoints" project.
You know what?  Fperj it.

I am reverting my prior UI tweaks, in favor of an easier (and more useful) set of changes (https://torchmodders.com/forums/lordnyriox%27s-playground/%28tl2%29-ultra-respec/).