Training mod help

Post » Thu Jun 21, 2012 8:22 am

I'm trying to write a mod that allows a player to "bank" missed training opportunities. For example, if a player hits level 3 without training, the player would have 5 points available for training, but I'd like the player to have 15 points.

Given this script:

Scriptname MHBankTrainingScr01 extends Quest  {On level up, carries over unused training points.}Event OnStoryIncreaseLevel(int aiNewLevel)   Int MHTimesTrained = Game.QueryStat("Training Sessions");   Int MHTrainingPerLevel = Game.GetGameSettingInt("iTrainingNumAllowedPerLevel");   Int MHTrainingOpportunities = aiNewLevel * MHTrainingPerLevel;   Int MHTrainingMissed = MHTrainingOpportunities - MHTimesTrained;   Debug.MessageBox("You are level " + aiNewLevel + " and have trained " + MHTimesTrained + " times.  You have had a total of " + MHTrainingOpportunities + " training opportunities, and have missed " + MHTrainingMissed + " of these.  You can train " + MHTrainingPerLevel + " time(s) per level.");   Stop();endEvent

My initial idea was to adjust the game setting iTrainingNumAllowedPerLevel after each level increase to accomodate what the player should have accrued. So in the original example at the opening of this post, iTrainingNumAllowedPerLevel would be set to 15 at level 3 if no training has been taken.

I can't see a way around adjusting the game setting iTrainingNumAllowedPerLevel, but it appears there's no way to set this value from Papyrus. This feature doesn't appear to be available in SKSE yet, either(?).

Any ideas? Or will I simply have to wait until SKSE supports this?
User avatar
JUan Martinez
 
Posts: 3552
Joined: Tue Oct 16, 2007 7:12 am

Post » Thu Jun 21, 2012 8:09 am

It appears that this is a Console Command Only: http://www.creationkit.com/SetGameSetting

(IDK why they decided to leave some functions as Console-Only ... well, I guess I do, but I wish they hadn't ...)

So, while there is a workaround with getting your users to run a batch file to set Console Commands before playing your MOD, really you can't do it "in" your MOD.

However; as it is a Console Command, it is at least pretty-likely that SKSE will - at some point - allow scripting of the function ... So you'll have to keep your fingers crossed for proper access.


(You can get all of the GameSetting Values via Papyrus ... http://www.creationkit.com/GetGameSettingInt_-_Game ... just not set them ... I don't think?)
User avatar
Dezzeh
 
Posts: 3414
Joined: Sat Jun 16, 2007 2:49 am

Post » Thu Jun 21, 2012 12:50 pm

Thanks much h4 --- that confirms what I've found so far.

For now I may fix the math above and have the mod just tell me how much training I *should* have (based on the desired mod functionality), and I can manually set it. When SKSE puts in the capability to set these globals I can implement it and release it as a mod.
User avatar
dav
 
Posts: 3338
Joined: Mon Jul 30, 2007 3:46 pm


Return to V - Skyrim