Add perk Trees DG style - Proof of Concept

Post » Tue Nov 05, 2013 3:30 pm

This mod IS a Proof of Concept, UNFINISHED, BUGGY and UNSTABLE (and needing your help) idea to provide a framework to add new perk trees in the style DG did for Werewolf and Vampire.

The idea behind it is "hot plugin loading" http://www.gamesas.com/topic/1385562-creation-kit-feature-hot-loading-plugins/ and more exactly the fact that after hlp the reloaded mod becomes the last in the loading order overwriting other plugin changes. So, to have multiple perk trees, I switch the last loaded plugin overwriting the perk tree depending on situation.
Unfortunately hot loading is prone to CTD, including on my machine, and I'll probably stop working on this until I get a better machine. Anyway I look forward for any possible help from other modders to improve the key points of this mod.

Key points:
1. Switching the plugins (hlp console command): I try to execute console commands by simulating input via SKSE's Input.HoldKey/ReleaseKey() functions...TapKey was too fast eating characters. I really hope SKSE will one day include either: console command execution from script OR the hlp as a script function OR even an lighter implementation and ctd free that will only change the plugin order (as hlp does) but without any support for changed content in plugin (hoping to be more robust because of this)
API: EnablePerkTree(String asPluginName, Float afPerkPoints, Float afSkillLevel) ;calls hlp for asPluginName and sets the skill points for the GUI
DisablePerkTree(String asPluginName, Float afPerkPoints, Float afSkillLevel);ends the magic and reloads the default (werewolf) perk try via hlp
2. Setting the perk points and skill level: setting perk points seem pretty straightforward by just setting the value of a global already defined in DG. I wasn't able, yet, to show the proper progress to the next perk point even if by the looks of it globals are defined and I would expect them to work as easy as the perk points one.
API: see the previous and
UpdatePerkTree(String asPluginName, Float afPerkPoints, Float afSkillLevel) ;updates the skill points while asPluginName is active
Float Function GetPerkPoints(String asPluginName) ;needs to be called before updating or disable a custom skill because the perk points global is automaticaly decreased when a perk is selected
3. Showing the perk tree: is done by calling a lighter copy of the werewolf transformation spell upon pressing the Tab key and then invoking the perk tree GUI via TapKey again. By all means I need a better way to do this cause all I found out is that I need to use a Werewolf archetype magic effect and a setRace to the exact werewolf race (even using a duplicate of that race doesn't work). I'd be happy when the method won't break mount riding, current playing animations and will work well with custom shapeshifting mods (like a werebear for example)
API: handled autocratically via key listener or, in the future, possibly to allow mods to directly call it (to show the tree from a dialogue for example) via:
Function OpenPerkTree()
Function ReleasePerkTree()

Future plans (if the idea shows any potential):
- improve handling of the three key points including as I found out how or SKSE will add needed features
- better threading synchronization
- better API
- proper setting up load order of the plugins at game load
- allow skill plugins to work with different level of customization: custom key mapped, custom opening perk tree method
- add notifications via SKSE's mod events for different things

This mod requires Dawnguard.
Load order and adding skills:
LHDGPerksFramework.esp - the actual framework should be first of them in the load order, possible esm in the future
CustomSkillImplementation(s) - should handle the new skill leveling and will call the API of the framework
CustomPerkTree(s) - those are the mods that will be reloaded via hlp. They should be, for obvious reasons, as lightweight as possible having the CustomSkillImplementation as a master and only change the skill tree on the actor value. Should be just before the last mod in the order (which is the DefaultWerewolfSkill below)
werewolfperks.esp - an esp that slightly changes the werewolf perk tree in order to overwrite the changes of the CustomPerkTree. Should be the very last in the load order, regardless what other mods that you have might say, as it will be relocated dynamically anyway. It is provided with the framework.

Compatibility considerations:
The framework itself, more exactly the default skill replacer, should only be incompatible with mods that alter the werewolf perk tree. In order to overcome that, those mods should provide compatibility patches for the skill tree similar with werewolfperks.esp but with the own perks replacing this default one by name or registered via API: Function RegisterDefaultPlugin(String asPluginName)

What I need?
I need people willing to test this in order to see if is viable: no ctds on good machines, save/load game ok...as I sayed on my laptop it ctds.
I need modders helping me improving the key points as described.
In order to test this a demo ability is there that you should add with "help LHDGPerksDemoAbility" and "player.addspell [id_returned]". The ability enables the custom perk tree while in first person. I suggest you add the spell while in 3rd person to avoid being in console when it starts doing it's job. While in 1st person press Tab and Esc and a butchered werewolf skill tree should pop up.

Available at http://skyrim.nexusmods.com/mods/46415/?

User avatar
Tiffany Holmes
 
Posts: 3351
Joined: Sun Sep 10, 2006 2:28 am

Post » Tue Nov 05, 2013 4:33 am

And I j!zzed in my pants.

User avatar
Jessica Raven
 
Posts: 3409
Joined: Thu Dec 21, 2006 4:33 am


Return to V - Skyrim