SKYRIM
RPG-Style Leveling Scripts by 747823
Skyrim » Modders resources and tutorials
Added: 10/04/2012 - 06:57AM
Updated: 13/04/2012 - 01:28AM

8 Endorsements

1.0 Latest version

359 Unique D/Ls

517 Total D/Ls

19,180 Total Views

Uploaded by 747823

Description

Last updated at 1:28, 13 Apr 2012 Uploaded at 6:57, 10 Apr 2012

RPG-Style Leveling Resource
This is a different leveling system + alternate start I made for my total conversion mod.
That means it's a mod resource, not a standalone mod. You won't be able to start a new game and play normally with just this - it's designed to be used as part of a total conversion.

*** No permission necessary to distribute or modify this resource in any way ***

However, if you're working on a project and want to include this, I'd like it if you left a comment or sent me a message so I could see it just out of curiosity/interest.

---
How it works:
---
After you create a character, you assign 40 points to 7 different attributes. These are the classical attributes of TES, minus luck. Currently, I've set caps on each attribute for each race, but these may be altered. I'll explain how to alter them later.

Next, you pick 3 "major skills" which simply get a bonus of 10 at level 1.

To level up, instead of skills advancing with use, you gain experience when killing actors who have an experience script attached to them.

When your experience is above the total experience required for the next level, you'll level up the next time you sleep. If you gain 2+ levels of experience before sleeping, you'll have to sleep twice to level up twice.

Experience to the next level 120% of the experience needed for the previous level, starting at 1000 at level 0. Since you start at level 1, you'll actually need 1200 experience to get to level 2. To get to level 3 from level 2, you'll need 1440 more experience, and so on.

When you level up, you get to select 2 skills to advance by 5 points until your skills are all level 100, and every 5 levels you get to select 2 attributes to advance by one point, until your attributes are all 20.


There are two "catches", and the reason why this is a mod resouce instead of a full replacement:
1. Every actor needs to have the _ExpOnDeath script attached and the experience property set.
2. The level is an artificial level set with a global variable, so leveled lists will not be affected and perks will not be added. There's currently no way to properly increase the player's level in a script, so unless SKSE adds a function to do this in the future, it will stay this way.

My suggestion for dealing with perks is to make them sold by NPCs if your skill is a high enough level. This also solves the problem of training becoming useless because of the leveling style - buying perks replaces buying training.

As for leveled items, I suggest to avoid using them in most cases, but if you want to use them badly you can write some scripts to add different items to a container based on the player's level. Perhaps I'll make my own and upload them later if I decide to use leveled items in my mod.


---
Configuration:
---
1. Character creation - _PlayerSetupNewGame.psc, attached to player, auto-fill properties

Attributes:
Currently, I allow 40 attribute points to be distributed, like in Fallout. You can change this value by changing the line:
int AttrT = 40
on line 71
If you change this value, you must make sure it's below the total of the attribute caps.

Every race has a cap for each attribute. This cap isn't permanent - it's just the cap for distributing attributes at the start of the game. You can disable this cap and use the same cap for all races by changing:
int UseRaceCaps = 1
on line 158
If you disable this, the "defaults" will be used.

By default, every race's caps total to 70. As I said before, never allow more attributes to be distributed than the cap total, or you'll be stuck in character creation forever. You can set the caps to whatever you want, they are defined in alphabetical order like this:
0 - Agility
1 - Endurance
2 - Intelligence
3 - Personality
4 - Speed
5 - Strength
6 - Willpower

I suggest making every race's cap total equal the same value, for obvious reasons.

While attributes can be selected and leveled, they aren't implemented for anything yet. This is because this is a big task and I don't know how you want to implement them. Attributes are set as faction ranks (aaStrengthFaction, etc.) for the player, so to use them elsewhere, call Game.GetPlayer().getFactionRank(aaStrengthFaction), etc.

Skills:
I allow 3 "main skills" to be selected at the start of the game. You can change this value here:
int SkillsPerLevel = 3
Don't set it above 18, as this is every skill in the game and you can't choose the same one twice.

If you want to change how much each skill is increased, change the added value at the end of lines 894, 963, and 1032:
Game.GetPlayer().SetAv( stealthSkillsArray[stealthSkillCounter], ThisstealthSkill + 10 )
You can see that it's 10. You can also replace it with your own variable and just set it once, I forgot to do this as you can see.


---

2. Leveling - _PlayerLevelUpTest.psc, attached to player, auto-fill properties

Currently, experience required for every level increases by 20% every level. So for example, going from level 1 to 2 requires 1200 experience, and going from 2 to 3 requires 1440 (or 2640 total).
This value is a global variable which you can change in the editor:
aaLevelScale
It is 1.2 by default, so it translates to percentage.

The base experience for a level is 1000. You can change this with:
aaLevelBaseExp
Note that the base is from level 0 to 1, so getting to level 2 will require 20% more than this value.

A player is allowed to pick two skills and two attributes per level. I suggest not changing these unless you have a lot of scripting knowledge, because if you change them currently, you might get stuck in the level up menu when you're near the level cap (if the player can get that far in your mod). My checks for making sure this doesn't happen don't take into account these values being changed.

---

3. Death experience - _ExpOnDeath.psc, attached to all actors you want to give experience, auto-fill properties

Set the property dExp to whatever experience you want this actor to give when killed by the player.


---
Further implementation and testing
---
Currently, the new game menus appear less than a second after starting a new game. This is just enough time to show the race menu before attribute and skill selection. If you don't want to show the race menu right away, you'll need to move everything from "OnLoad" event in the new game script to a different function, and call that function externally when you want the player to select their attributes/skills.

I've also edited the very first stage of MQ101, the first main quest. This is the first stage that runs when the game starts, so you should change the "NewStartMarker" alias to your new starting location. If you're making a total conversion, you can either add your own quest here, or add it with an script on an object in the start area. If you're trying to implement this system into Skyrim, you should start MQ102 for the player after your custom starting sequence.

I've added a "test" location for starting the game, with a bed and an NPC to kill who gives 1500 experience on death. This is enough for you to test character creation and level 1 -> 2. If you want to test more levels, you can use the console to set your experience higher, like this:
set aaPCTotalExp to
set aaPCTotalExp to 3000
set aaPCTotalExp to 10000
set aaPCTotalExp to 99999

Hopefully I've explained everything.