Scripting a massive skillup? In over my head!

Post » Mon Nov 19, 2012 10:02 am

So I had this neat idea to play the game as a high level right off the bat, with all skills maxed. Well, easier said than done, since just forcing the skill AVs to 100 doesn't allow for perks, and doesn't actually change the character's level, so what I hit upon next was using advskill to advance the lowest skill up to the level of the next skill, then advancing those up to the level of the next one, and so on until I'm advancing all 18 up to 100. Tedious, but doable, or so I thought until I actually tried advskill and found that it only adds 1 skill XP, not an entire skill level.

So I figured I'd write a little mod to do it, with a script that simply looks for the lowest-valued skill(s) and run advskill on it. Basically it'd get the lowest-leveled skill, and advance all skills that are at that level by 1 skill XP per iteration, then repeat. And now I'm lost in the Papyrus sea. Here's a few specific questions/comments, followed by my incomplete script and its compiler errors:
1) Do I need to extend this script from another, and if so, what do I extend it from?
2) The comments near the top enumerate the list of skills from the wiki, in order, for reference while trying to build the array. It's just a copy/paste job turned into a comment. Likewise, the comment at the bottom is a reminder for me of the syntax for stopping a quest.
3) If I attach this to a quest, will it run when the quest starts, same as how it works in Oblivion? Or is there some other technique to trigger this to run, then stop when all skills reach 100? My plan was to make the quest not enabled at start, then start it via console, then manually handle the levelups after it was finished. Also, I thought by doing it this way, I'd maximize my final level.
Here's the fragment of a script that I have:
Scriptname SuperLevelScript  ;Skills;;	OneHanded;	TwoHanded;	Marksman (Archery);	Block;	Smithing;	HeavyArmor;	LightArmor;	Pickpocket;	Lockpicking;	Sneak;	Alchemy;	Speechcraft (Speech);	Alteration;	Conjuration;	Destruction;	Illusion;	Restoration;	Enchantingint[] SkillLevelArrayEvent OnInit()	SkillLevelArray = new int[18]	set SkillLevelArray[1] = Game.GetPlayer().GetActorValue("OneHanded")endevent;SuperLevelQuest.Stop()

EDIT: oh yea, the errors:
Starting 1 compile threads for 1 files...Compiling "SuperLevelScript"...c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\SuperLevelScript.psc(27,20): required (...)+ loop did not match anything at input '['c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\SuperLevelScript.psc(27,1): function variable SkillLevelArray already defined in the containing scriptc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\SuperLevelScript.psc(27,22): required (...)+ loop did not match anything at input ']'No output generated for SuperLevelScript, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on SuperLevelScript
User avatar
tegan fiamengo
 
Posts: 3455
Joined: Mon Jan 29, 2007 9:53 am

Post » Mon Nov 19, 2012 11:41 am

Hi Kristoffer,

You'll probably want to have a read of this page on the wiki - http://www.creationkit.com/Differences_from_Previous_Scripting

In order to be able to attach a script to an object, the script must extend a type that the object possesses. Objects can inherit types via 2 mechanisms:
  • All scripts are type definitions. When a script is attached to an object, that object inherits the type defined by the script. For example, if I create a script called MyScript and attach it to an object, then that object will possess the type "MyScript" in addition to all of its other types.
  • All objects have a "native" type associated with them, which is defined by the relevant native http://www.creationkit.com/Category:Script_Objects. For example, quests all have the native type http://www.creationkit.com/Quest_Script
So, in order to attach your script to a quest, it will need to extend either Quest or another script already attached to this particular quest. If your quest doesn't have any scripts attached yet, then you'll have to extend quest.

That compilation error is due to your use of "set" on line 27. That's no longer necessary in Papyrus; you can just do this instead of relying on set/to:
VariableName = Expression

Once that has been fixed, you'll see another compilation error:
c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\SuperLevelScript.psc(27,16): type mismatch while assigning to a int (cast missing or types unrelated)
This one is due to the fact that http://www.creationkit.com/GetActorValue_-_Actor returns a value of type Float, but you're trying to assign its return value to an element in an array of Ints. The compiler won't automatically http://www.creationkit.com/Cast_Reference values of type Float to Int, so you'll either have to do it manually...
SkillLevelArray[1] = Game.GetPlayer().GetActorValue("OneHanded") as Int
...or change the type of your array to Float:
float[] SkillLevelArray...SkillLevelArray = new float[18]
Once you've made one of those changes as well, your script will compile.

The http://www.creationkit.com/OnInit event will be called on a quest when the script is attached to the object and whenever the quest is reset. This means it will not wait for your quest to be started. Also, while this is usually pretty straightforward, quests that are not set to "Run Once" will be reset whenever they are started, so if they're also set to "Start Game Enabled" then they will be reset immediately after the script is attached to the object, causing the OnInit block to be called twice in a row.

Cipscis
User avatar
Craig Martin
 
Posts: 3395
Joined: Wed Jun 06, 2007 4:25 pm

Post » Mon Nov 19, 2012 2:58 pm

Thanks for your quick reply!

If the GetAV is returning a value of type float, then does that mean it's returning greater precision than what an int can hold - info that correlates to xp gained towards a skill raise? I initially had the array as type float, but I thought GetAV returned an integer value so I changed it to match. If it's returning an integer value, but with a float type, then I may as well cast it into an int, since it's not going to be using that value other than to make a decision on which skill to run a AdvSkill on.

Correct me if I'm wrong, but once my script decides which skill to advance, I can do something like this (I'll check the wiki to ensure proper syntax) to both advance the skill, and update the array:
Game.GetPlayer().AdvSkill("OneHanded",1)SkillLevelArray[1] = Game.GetPlayer().GetActorValue("OneHanded")
EDIT: Yes, and I figured out what I did wrong there that would make it not compile.
Which brings up another question - what's the easiest way to tell it which skill to advance, since that's done by a string? Would it work to create a string array with those strings? EDIT: Yes, that seems to work based on defining such a string array filling it, then using it to with a while loop to run the GetAV command (which would throw a compiler error if it didn't see a string in the correct place)

Also, is there an easy way to find the smallest value in an array? As in, the value itself, not necessarily which index holds that value. Though that info would be helpful too, if the GetAV is returning more precise information which corresponds to skill XP towards next skillup. That will actually determine how I complete this script.

Here's what I have now; the preliminaries are all completed and the script compiles as is, but I don't know what to put to make the real effect happen. I did shorten the name of the skill level array, since there would be nothing with which to confuse it with, no similarly-named or similarly-functional non-array variable.
Scriptname SuperLevelScript extends Quest;Declaring variablesint[] SkillLevel ;Array for holding the skill levelsstring[] SkillName ;array for holding the skill namesint counter ;int for use in while loopsint lowestvalue ;for holding the lowest value in the arrayint lowestvalueindex ;for holding the index number of the lowest value in the arrayEvent OnInit()    SkillName = new string[18] ;initializing the arrays    SkillLevel = new int[18]    ;Filling the skillname array    SkillName[1]="OneHanded"    SkillName[2]="TwoHanded"    SkillName[3]="Marksman"    SkillName[4]="Block"    SkillName[5]="Smithing"    SkillName[6]="HeavyArmor"    SkillName[7]="LightArmor"    SkillName[8]="Pickpocket"    SkillName[9]="Lockpicking"    SkillName[10]="Sneak"    SkillName[11]="Alchemy"    SkillName[12]="Speechcraft"    SkillName[13]="Alteration"    SkillName[14]="Conjuration"    SkillName[15]="Destruction"    SkillName[16]="Illusion"    SkillName[17]="Restoration"    SkillName[18]="Enchanting"    ;filling the skilllevel array    While counter <= 18        SkillLevel[counter] = Game.GetPlayer().GetActorValue(SkillName[counter]) as int        counter += 1 ;increment the counter, very important!    Endwhile    counter = 0 ;reset the counter after execution of the              ;while loop    ;this is where the fun starts    ;compare all the values in SkillLevel with each other, and    ;increment the one(s) with a value equal to the lowest    ;value    while counter <= 18        ;This is where I compare the values in SkillLevel                ;This is where I advance the skills which match the        ;lowest value in SkillLevel        Game.AdvanceSkill(SkillName[lowestvalueindex],1)        SkillLevel[1] = Game.GetPlayer().GetActorValue(SkillName[lowestvalueindex]) as int        counter += 1 ;increment the counter, very important!    Endwhileendevent;SuperLevelQuest.Stop()
As you can see, I heavily commented this code. I'm bad at that, and I really need to get into the practice of commenting. I've got old programs I've written dating back to my Highschool days programming in Pascal, which have nary a comment at all.
User avatar
kelly thomson
 
Posts: 3380
Joined: Thu Jun 22, 2006 12:18 pm

Post » Mon Nov 19, 2012 6:01 am

I don't have access to Skyrim at the moment to test it, but the wiki's documentation for http://www.creationkit.com/GetActorValue_-_Actor casts the result to an integer in each example, so I'm not sure if is actually returning any more information than could be stored in an Int.

One thing you could do here that you might find useful is make your String array an auto property. This will allow you to initialise it in the Creation Kit, which will both speed up your code (setting initial values this way should be faster than doing it in a function body) and keep your script cleaner, although it will also require a bit more setup in the Creation Kit:
String[] Property SkillName Auto
Another thing worth mentioning is that http://www.creationkit.com/GetPlayer_-_Game is notoriously slow. The best approach of which I'm aware (http://www.gamesas.com/topic/1409991-best-practices-papyrus/) is to use a property, which can be auto-filled in the Creation Kit if given the appropriate name:
Actor Property PlayerRef Auto
There's no existing native "min" function of which I'm aware, but writing your own should be fairly straightforward. For example:
Spoiler
Int Function Min(Int[] aiArray)	If !aiArray		Return 0	EndIf	Int Min = aiArray[0]	Int i = 1	While i < aiArray.Length		If aiArray[i] < Min			Min = aiArray[i]		EndIf		i += 1	EndWhile	Return MinEndFunction
As far as I know, there is no equivalent function to AdvSkill in Papyrus. I don't know if the other functions for manipulating Actor Values will be appropriate.

If they're not, then the best approach might be to write a batch file that can be run from the console, allowing you to run a bunch of console commands by only entering a single line yourself, using the bat command.

Cipscis
User avatar
Bryanna Vacchiano
 
Posts: 3425
Joined: Wed Jan 31, 2007 9:54 pm

Post » Mon Nov 19, 2012 4:57 am

As far as I know, there is no equivalent function to AdvSkill in Papyrus.

There is; the script compiles properly with the Game.AdvanceSkill(SkillName[lowestvalueindex],1) line in place. So the equivalent is Game.AdvanceSkill.

Thanks again for all your help. This script is coming along nicely. Also, since this is a run-once type of deal, I'm not going to focus on too much optimization (though I did change the reference to the player to the more efficient method); once it serves its purpose, it shouldn't run anymore. That said, it may indeed be beneficial to do some optimizations since I don't know how long this script will need to run. However, I'm not sure what I need to do in the CK to define the auto property for the string array.

On that note, if I set the quest to Game Start Disabled, and Run Once enabled, do I need to stop the quest in the script? Will starting the quest run the script, then stop the quest, or does it still need to have a manual quest stop command? And lastly, how do I stop the quest? I modified your min function to grab the index of the min value but otherwise used it as-is, and tried:
	if min(SkillLevel) == 100		SuperLevelQuest.Stop()	endif

Which generated this compiler error:

Starting 1 compile threads for 1 files...Compiling "SuperLevelScript"...c:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\SuperLevelScript.psc(71,2): variable SuperLevelQuest is undefinedc:\program files (x86)\steam\steamapps\common\skyrim\Data\Scripts\Source\SuperLevelScript.psc(71,18): none is not a known user-defined typeNo output generated for SuperLevelScript, compilation failed.Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on SuperLevelScript

So how do I properly reference the quest in the script so that the script can stop it?
User avatar
Agnieszka Bak
 
Posts: 3540
Joined: Fri Jun 16, 2006 4:15 pm

Post » Mon Nov 19, 2012 1:01 pm

Sorry, you're absolutely right about that function. For some silly reason I'd only looked for it in the http://www.creationkit.com/Actor_Script.

As for stopping the quest, I don't believe it will stop unless you tell it to. However, there probably isn't any harm in leaving it running.

You might find this tutorial I've written, which talks about properties in the context of how they make Papyrus different to scripting in Oblivion and Fallout 3/New Vegas, useful - http://cipscis.com/skyrim/tutorials/editorids.aspx

Cipscis
User avatar
Elea Rossi
 
Posts: 3554
Joined: Tue Mar 27, 2007 1:39 am

Post » Mon Nov 19, 2012 3:21 pm

Well if there's no harm in keeping it running, then I'll just cut out that problematic "if" statement and call it good. Time to test this then...


...nothing happened.
Scriptname SuperLevelScript extends Quest;Declaring variablesActor Property PlayerRef Auto ;player.refint[] SkillLevel ;Array for holding the skill levelsstring[] SkillName ;array for holding the skill namesint counter ;for use in while loopsint MinIndex ;for holding the index number of the lowest value in the arrayInt Function Min(Int[] aiArray)	If !aiArray     		Return 0	EndIf	Int Min = aiArray[0]	Int i = 1	While i < aiArray.Length		If aiArray[i] < Min			Min = aiArray[i]			MinIndex = i		EndIf		i += 1	EndWhile	Return MinEndFunctionEvent OnInit()	SkillName = new string[18] ;initializing the arrays	SkillLevel = new int[18]	;Filling the skillname array	SkillName[1]="OneHanded"	SkillName[2]="TwoHanded"	SkillName[3]="Marksman"	SkillName[4]="Block"	SkillName[5]="Smithing"	SkillName[6]="HeavyArmor"	SkillName[7]="LightArmor"	SkillName[8]="Pickpocket"	SkillName[9]="Lockpicking"	SkillName[10]="Sneak"	SkillName[11]="Alchemy"	SkillName[12]="Speechcraft"	SkillName[13]="Alteration"	SkillName[14]="Conjuration"	SkillName[15]="Destruction"	SkillName[16]="Illusion"	SkillName[17]="Restoration"	SkillName[18]="Enchanting"	;filling the skilllevel array	While counter <= 18		SkillLevel[counter] = PlayerRef.GetActorValue(SkillName[counter]) as int		counter += 1 ;increment the counter, very important!	Endwhile	while min(SkillLevel) < 100				Game.AdvanceSkill(SkillName[MinIndex],1)		SkillLevel[MinIndex] = PlayerRef.GetActorValue(Skillname[MinIndex]) as int	endwhileendevent
User avatar
Matt Fletcher
 
Posts: 3355
Joined: Mon Sep 24, 2007 3:48 am

Post » Mon Nov 19, 2012 5:53 pm

Ah, I think the problem is that you're treating the arrays as being 1-based arrays, whereas in fact they are 0-based arrays. In case you're not aware, this means that the first element's index is 0, which also means the last element's index is 1 less than the array's length.

Because of all this, your current script will fail on line 50, as it tries to set the element at index 18 of an array of length 18. This element is out of range, so I expect the function call will be aborted. Try this instead:
Spoiler
Scriptname SuperLevelScript extends Quest;Declaring variablesActor Property PlayerRef Auto ;player.refint[] SkillLevel ;Array for holding the skill levelsstring[] SkillName ;array for holding the skill namesint counter ;for use in while loopsint MinIndex ;for holding the index number of the lowest value in the arrayInt Function Min(Int[] aiArray)	If !aiArray     	Return 0	EndIf	Int Min = aiArray[0]	Int i = 1	While i < aiArray.Length		If aiArray[i] < Min			Min = aiArray[i]			MinIndex = i		EndIf		i += 1	EndWhile	Return MinEndFunctionEvent OnInit()	SkillName = new string[18] ;initializing the arrays	SkillLevel = new int[18]	;Filling the skillname array	SkillName[0]="OneHanded"	SkillName[1]="TwoHanded"	SkillName[2]="Marksman"	SkillName[3]="Block"	SkillName[4]="Smithing"	SkillName[5]="HeavyArmor"	SkillName[6]="LightArmor"	SkillName[7]="Pickpocket"	SkillName[8]="Lockpicking"	SkillName[9]="Sneak"	SkillName[10]="Alchemy"	SkillName[11]="Speechcraft"	SkillName[12]="Alteration"	SkillName[13]="Conjuration"	SkillName[14]="Destruction"	SkillName[15]="Illusion"	SkillName[16]="Restoration"	SkillName[17]="Enchanting"	;filling the skilllevel array	While counter < 18		SkillLevel[counter] = PlayerRef.GetActorValue(SkillName[counter]) as int		counter += 1 ;increment the counter, very important!	Endwhile	while min(SkillLevel) < 100				Game.AdvanceSkill(SkillName[MinIndex],1)		SkillLevel[MinIndex] = PlayerRef.GetActorValue(Skillname[MinIndex]) as int	endwhileendevent

Also, just as a side note and in case you weren't aware, you can get an array's length with the following syntax:
ArrayName.Length
Cipscis
User avatar
carrie roche
 
Posts: 3527
Joined: Mon Jul 17, 2006 7:18 pm

Post » Mon Nov 19, 2012 8:49 am

I've learned a lot from you today. You're right, I was treating them as 1-based, and even trying to force them to be 1-based. I was next going to use that Arrayname.Length thing. The debug information in the console was showing me that the first value in SkillLevel was 0 and the first value in SkillName was "" so I knew something was wrong; I just assumed backwards as to what it was.

EDIT: I think the main problem was that Min(SkillLevel) always returned 0, so the Game.AdvanceSkill command was being run with a null string, and never advancing anything.

And it works!

And it's slow, not like bogging-the-computer-down slow, more like driving-in-1st-gear slow; the potential's there for it to be much faster. Gonna tweak the AdvanceSkill value in the script to see if I can't make it go faster.

EDIT: OK, it's running faster now... but the script's running without the quest being enabled. It's not that the quest started on it's own, but rather the sqv console command lists it as stopped, yet the quest is running on its own. What could be the cause of that?
User avatar
MarilĂș
 
Posts: 3449
Joined: Sat Oct 07, 2006 7:17 am

Post » Mon Nov 19, 2012 5:35 am

Download my ASAP mod (v4.0 Beta) and check out the ASAPscript.
Feel free to take and modify the script to suite your needs.
Most of what you want to do is already scripted, you'll need to make some adjustments to make it do exactly what you want, but it should do the trick.
It adjust / advances skills and perks - you'll just need to loop it more to do individual skill increases instead of jumping like it's written.
PM any detailed question you want to ask.
User avatar
Brad Johnson
 
Posts: 3361
Joined: Thu May 24, 2007 7:19 pm

Post » Mon Nov 19, 2012 1:24 pm

Finally got it sorted. I had to add yet another array with hand-derived XP coefficients to speed up the process without having some skills level up much faster than others. In the end, though, the whole skillup process still took 20 minutes, and didn't give as many levels as I'd have liked (somewhere in the 70s) but I'm gonna definitely go ahead with this playthrough.
User avatar
Sami Blackburn
 
Posts: 3306
Joined: Tue Jun 20, 2006 7:56 am

Post » Mon Nov 19, 2012 5:39 am

I keep thinking there has to be a better way than how I'm doing it. Is there no way to invoke http://www.creationkit.com/IncrementPCSkill from a script? I didn't see one, but that doesn't mean it's not there. I'm a novice at this.

I also am still curious about the script running without the quest being enabled. This leads to an oddity wherein, if the mod is enabled at game start, you'll get levelup credit for skillups that are later taken away (reset to default values) which can then result in gaining additional levels. When I discovered this, I ended up with a character of level 116, by letting the script run its course, then disabling the mod and re-enabling it after my skills were lowered to default values. I retained the skillup credit but not the actual skill levels. Avoiding this issue results in a character of level 81, at least with that particular race.
User avatar
Ashley Hill
 
Posts: 3516
Joined: Tue Jul 04, 2006 5:27 am

Post » Mon Nov 19, 2012 1:34 pm

I keep thinking there has to be a better way than how I'm doing it. Is there no way to invoke http://www.creationkit.com/IncrementPCSkill from a script? I didn't see one, but that doesn't mean it's not there. I'm a novice at this.

Am I confused about what you want to do? Because the way I understood it, you simply want to start the game at the level cap with all skills at 100, and all perks ready to be assigned.

If that's correct, you don't need to increment skills by 1 point at a time to level up. You just need to use advanceskill instead of set/mod/force the actor value. If you advance a skill to 100 with one function call, you still get every skill up and they all count as level progress. Also, you can't go over 100 by advancing skill experience, so if all you want to do is max them, you do not need any math... just use a ridiculous value like 10 million. (I think the highest xp required for any skill is about 2 million), Then all you would need to do is have a loop that runs 18 times, increasing each skill's progress by 10 million, and you'll have all skills at level 100 and be able to level up to the level cap. If you want the "absolute" level cap, you could also set them all to 0 first, ignoring race defaults. Actually you could gain even more levels by resetting the skills to 0 again and advancing them again... any advancement contributes to level progress even if you've gotten that skill to 100 before, you just normally can't advance it once you've done that. You will also unlock perks normally with this method, because you'll actually have to level in-game. There is no way to force the level up event thingy with a script, so you'll still have to go to the skills menu and select which actor value to increase for each level.

Is there something about what you want to do that I'm missing, which would make advancing them to 100 in one function call not work?
User avatar
Stephani Silva
 
Posts: 3372
Joined: Wed Jan 17, 2007 10:11 pm

Post » Mon Nov 19, 2012 3:17 pm

Am I confused about what you want to do? Because the way I understood it, you simply want to start the game at the level cap with all skills at 100, and all perks ready to be assigned.

If that's correct, you don't need to increment skills by 1 point at a time to level up. You just need to use advanceskill instead of set/mod/force the actor value. If you advance a skill to 100 with one function call, you still get every skill up and they all count as level progress. Also, you can't go over 100 by advancing skill experience, so if all you want to do is max them, you do not need any math... just use a ridiculous value like 10 million. (I think the highest xp required for any skill is about 2 million), Then all you would need to do is have a loop that runs 18 times, increasing each skill's progress by 10 million, and you'll have all skills at level 100 and be able to level up to the level cap. If you want the "absolute" level cap, you could also set them all to 0 first, ignoring race defaults. Actually you could gain even more levels by resetting the skills to 0 again and advancing them again... any advancement contributes to level progress even if you've gotten that skill to 100 before, you just normally can't advance it once you've done that. You will also unlock perks normally with this method, because you'll actually have to level in-game. There is no way to force the level up event thingy with a script, so you'll still have to go to the skills menu and select which actor value to increase for each level.

Is there something about what you want to do that I'm missing, which would make advancing them to 100 in one function call not work?

By doing it the way you describe, it stunts your maximum level. Skillups count towards level gain more when they're your highest skill, so by keeping all skills at the highest while you level, it ensures maximum leveling, and thus maximum perks, and maximum level enemies. It's actually a bit challenging before you get decent gear or spells.

At any rate the script is working the way I want it to, but it's a very slow process. I was just looking to see if there was a way to call that console function from a script, as a potential means of speeding it up. As it stands, it takes 20 minutes from loading the save to the skills being maxed out, and yes, there's the unaviodable additional time needed to assign stat points and perks. It's already time-consuming enough without the script taking so long to run.

As far as the highest XP required for any skill, yes, it's 1.4 million for speech. Contrast that to 300 for Enchanting. It's not exactly a perfect system.

I get the impression that you might not have read my last post in this thread, right before yours.
User avatar
Trevi
 
Posts: 3404
Joined: Fri Apr 06, 2007 8:26 pm

Post » Mon Nov 19, 2012 4:21 pm

By doing it the way you describe, it stunts your maximum level. Skillups count towards level gain more when they're your highest skill, so by keeping all skills at the highest while you level, it ensures maximum leveling, and thus maximum perks, and maximum level enemies. It's actually a bit challenging before you get decent gear or spells.

No, I'm 99% sure that's incorrect, for I just tested with the console. Should work the same with the scripted version.

There are separate scales for skill and level xp, so level xp gets added to when a skill increases once. I'll just ignore skill increase XP because it's irrelevant. On UESP I read:
The formula for character leveling is as follows: Character XP gained = Skill level acquired
Example: Training alchemy from 20 to 21 gives 21 Character XP points

Default values for character/level xp are:
fXPLevelUpBase = 75
fXPLevelUpMult = 25

And the amount of experience required for the next level is:
Next level xp = fXPLevelUpBase + fXPLevelUpMult * Current level

The total would be:
Total next level xp = last level xp + fXPLevelUpBase + fXPLevelUpMult * Current level

So we can calculate the total XP required for each level by that. I won't bother, but it would always come out so that the amount of total XP required for a particular level is the same, as long as those values aren't changed by a mod,

You are mistaken because the amount of XP that you'll get for leveling all skills to 100 is always the same as well. Because it's just the total of each level of each skill increase you've gotten... this is kind of hard to explain, but for example if you have 100 archery and started with 15 archery, the xp you've gained from it is 100 + 99 + 98 + etc, until 15 because you started it at level 15. So if you add all of these together, you'll find that it's always the same once you've gotten everything to 100. I think you were remembering how it's faster to level up if you already "high level" skills? You can level faster, or level in a more optimized way by controlling which skills you level first at lower levels, but once you get to the level cap, the total XP you've gained is always the same no matter what order you level in.

The only things that could possibly affect it are:
- If races had inequal distribution of starting skill bonuses but they, instead of all having +35.
- If each skill did not give equal level xp for the same level up (i.e. level 20 in alchemy gave 50 xp while level 20 in one handed gave 20).

But these issues would only affect comparison between races of course.

And I did read the previous post. You should probably start the quest some time after you choose your race. Like put an altar outside of the tutorial area to set everything to 100. Also the reason I suggested to level them all to 100 at once is that it would probably be faster?
User avatar
Nauty
 
Posts: 3410
Joined: Wed Jan 24, 2007 6:58 pm

Post » Mon Nov 19, 2012 5:22 am

Yes, it would be faster, and in light of this new information I can make it run in a matter of seconds instead of 5 minutes I managed to get it down to (was 20 using the AdvanceSkill method).

I can just use http://www.uesp.net/wiki/Skyrim:Leveling#Skill_XP and go back to AdvanceSkill. Thanks for correcting my misconception. I don't even have to bother with how high any given skill is, if they're all automatically 15 or higher at game start, and any overage of Skill XP will be ignored.

Wow, all that effort to do it how I thought was the right way... and I did get it working, too, even had a little messagebox pop up when it was finished. And now...

One last question. How do I keep the script from running until I enter Helgen Keep for the first time (I'm thinking by looking for an associated quest stage, but I don't know how to look for those in a script)?

EDIT: scratch that. I just replaced the mod with a batch file:
player.advskill Alteration 176269
player.advskill Conjuration 251812
player.advskill Destruction 391707
player.advskill Illusion 114958
player.advskill Restoration 26403
player.advskill Enchanting 310
player.advskill OneHanded 83938
player.advskill TwoHanded 88875
player.advskill Marksman 56861
player.advskill Block 65285
player.advskill Smithing 91601
player.advskill HeavyArmor 139159
player.advskill LightArmor 132202
player.advskill Pickpocket 10785
player.advskill Lockpicking 2036
player.advskill Sneak 12658
player.advskill Alchemy 571425
player.advskill Speechcraft 1468901
User avatar
Vicki Blondie
 
Posts: 3408
Joined: Fri Jun 16, 2006 5:33 am

Post » Mon Nov 19, 2012 7:30 pm

Yes, it would be faster, and in light of this new information I can make it run in a matter of seconds instead of 5 minutes I managed to get it down to (was 20 using the AdvanceSkill method).

I can just use http://www.uesp.net/wiki/Skyrim:Leveling#Skill_XP and go back to AdvanceSkill. Thanks for correcting my misconception. I don't even have to bother with how high any given skill is, if they're all automatically 15 or higher at game start, and any overage of Skill XP will be ignored.

Wow, all that effort to do it how I thought was the right way... and I did get it working, too, even had a little messagebox pop up when it was finished. And now...

One last question. How do I keep the script from running until I enter Helgen Keep for the first time (I'm thinking by looking for an associated quest stage, but I don't know how to look for those in a script)?

Haha, it's okay because haven't you learned stuff about papyrus and the leveling system from this exercise? So your time was not wasted, you've gotten something from it. :)

I don't know about keeping the script from running as a quest, because I haven't done anything with quests yet (only gameplay mechanics). But you could attach the script to a magic effect, and make a PC start spell with conditions related to that quest, so the effect starts after the right stage. Then dispel the effect/remove the spell when you're done. I know you can check quest stages with the creation kit conditionals, which can be applied to spell effects.
User avatar
alyssa ALYSSA
 
Posts: 3382
Joined: Mon Sep 25, 2006 8:36 pm

Post » Mon Nov 19, 2012 4:58 am

Haha, it's okay because haven't you learned stuff about papyrus and the leveling system from this exercise? So your time was not wasted, you've gotten something from it. :smile:

Good point. I'm better equipped to tackle the next project I come up with, not only in what I've learned about scripting with Papyrus but also what I've learned about how to find the answers to questions about scrupting with Papyrus :D

I do wish there was the option to use esp-embedded scripts like in Oblivion, in addition to the new system.
User avatar
Minako
 
Posts: 3379
Joined: Sun Mar 18, 2007 9:50 pm


Return to V - Skyrim