Help with Respec Script

Post » Mon Jun 18, 2012 9:51 pm

Here's what I would like to do:

Get an array of the "perk name" type.*

Define and call a function to count the total number of perks possible (accounting for user-added trees and perks) to define the scope of the above array.

Define and call a function that walks the array and checks for each (perk name field) if the value is 1/true and adds this to an output count integer, while simultaneously removing this perk by id from the player.

An event that performs these functions (simple activate, dialogue or quest output, etc.), then adds a number of perk points to spend based on the counted number from the above function, plus any number of existing unspent perk points at the time of the event.**

*First question: How do I get a list of possible perk ID's, accounting for user-added content?

I know the various perk "families" or constellations are Skills (like Alchemy, Marksman, etc.), and you can check the actual skill level of these using http://www.creationkit.com/GetActorValue_-_Actor, however this doesn't seem extensible as I would imagine.

What if I wanted to check the value of a user-added skill? Say a mod added the skill family/constellation "Acrobatics." How would I check the player's Acrobatics level if I didn't know the unique ID of that non-vanilla Skill?

Other than again coding a mod for each and every mod out there, shouldn't there be a way to say, send all available skill ID's to an array?

Further, in the case of this script, shouldn't there be multiple Properties of Skills available to return?

Since Skills contain Perks shouldn't a Property of Skill be Perk, and shouldn't I be able to call that with syntax specifying the variable type, to send to an array to do stuff with?

**Second question: Likewise, how do I access the “current unspent perk points” variable?

I have also looked through the default global variables list and there doesn't seem to be a holder there for "unspent perk points" either.
User avatar
NEGRO
 
Posts: 3398
Joined: Sat Sep 01, 2007 12:14 am

Post » Tue Jun 19, 2012 1:22 am

As far as I'm aware, there's no way to simply look in the master file(s) for what objects exist. If you want to get a handle on an object, you need some way to find it, and it looks like you won't have one in this case. Maybe SKSE will be able to help with this in the future, I'm not sure.

I don't know where perk points are handled, but there are some mods available that manipulate them (I think they all use ScriptDragon, from memory) that you could take a look at.

Cipscis
User avatar
Hannah Barnard
 
Posts: 3421
Joined: Fri Feb 09, 2007 9:42 am

Post » Tue Jun 19, 2012 3:02 am

Thanks, would really prefer not to get into 3rd party language extensions just yet though. It just seems logical there might be some hidden/undocumented way to call the Properties of a Skill to retrieve all qualifying entries in the "perk" category by various type (ID, name, etc.) But I might be doing my own thinking. =P
User avatar
rae.x
 
Posts: 3326
Joined: Wed Jun 14, 2006 2:13 pm

Post » Mon Jun 18, 2012 9:13 pm

A good rule of thumb is that if Bethesda didn't need to do something in Papyrus, there won't be a working native function for it. Lower level stuff like what you're suggesting would be handled by the game engine, so they never needed to implement it as part of Papyrus.

Cipscis
User avatar
JESSE
 
Posts: 3404
Joined: Mon Jul 16, 2007 4:55 am

Post » Mon Jun 18, 2012 4:11 pm

I refuse to give up! This is just too logical a function for it not to be possible.

You know, this is what I loved about modding for Morrowind. When I made my Sgaileach Estate mod (sig), I remember there were all these little "quirks" in the scripting engine. Like with the mannequin re-spawning feature I implemented where you could make them male or female. You should see the convoluted crap I had to pull to get that working! teleporting the player and setting view angles, all to work around some wacky positioning "feature."

The thing that always pulled me through was the logic. I knew it SHOULD be possible, so I kept tweaking strategies and trying new approaches until it became possible!

"DO AS I SAY! Infernal game logics!"
User avatar
Dean Ashcroft
 
Posts: 3566
Joined: Wed Jul 25, 2007 1:20 am

Post » Mon Jun 18, 2012 11:34 pm

Good luck, I would love a respec mod :D
User avatar
Josh Dagreat
 
Posts: 3438
Joined: Fri Oct 19, 2007 3:07 am

Post » Mon Jun 18, 2012 8:56 pm

Another possible way to account for user-added perks would be to have a quest script or something track when the player assigns a perk, and get that single perk ID at that time, and add it to a list of non-vanilla perks to later check for.

Since I can know all the “vanilla” ID’s through the editor I can account for those. This would allow me to keep a running list of anything new, as well as how many points were put into non-vanilla perks to-date.

Only trouble with that is, it would only be able to track (and remove) custom perks you’d assigned after the mod was installed.

I am also not entirely certain if the engine supports an “on assign perk” type event either, nor do I know if the packet that event sends is available to the Papyrus layer, or allows an ID string variable…
User avatar
Lakyn Ellery
 
Posts: 3447
Joined: Sat Jan 27, 2007 1:02 pm

Post » Mon Jun 18, 2012 8:22 pm

Good luck with it, but it just doesn't seem possible to me.

I know I wouldn't expect a respec mod to be compatible with modded perks, and would love one that just allowed a respec on vanilla perks!
User avatar
Jennie Skeletons
 
Posts: 3452
Joined: Wed Jun 21, 2006 8:21 am


Return to V - Skyrim