» Sun Aug 09, 2009 6:22 am
Oblivion skills seem to be based on event detection: every time the player is struck by a weapon, the engine checks to see what type of armor the player is wearing and increments the player's Heavy Armor or Light Armor skill according to the amount specified in the Use Value box in the skill definition in the CS. Every time the player hits an enemy, the engine determines what weapon the player is using and increments the Blade or Blunt (or Hand to Hand) skill. The point is, these events (being hit by an opponent, hitting an opponent, etc.) are hard-coded. The skill definitions use these events to increment the player's experience, but they can't alter or add events. If you look in the CS under Character -> Skills, you'll see that the game allows you to change the amount of experience gained for each detected event, the governing attribute, specialization, icon, and descriptions but the Actions (events) are greyed out and the actual implementation of the Perks is completely inaccessible.
If you want to add your own skill, therefore, you have to go about it in one of two ways: by overwriting an existing skill or by creating a completely scripted skill. Overwriting an existing skill is slightly easier, but both of them are going to be tough to do. If you are overwriting an existing skill, the first thing you have to do is zero out the Use Value for the skill you're overwriting: the engine is still going to detect those events and increment the player's experience every time one is detected and you probably don't want that. The next thing you need to do is create some way for the player to execute the skill, which means you'll have to create a key binding or some other way for the player to use his or her skill. Vanilla uses keys (attack, block, jump, cast spell, etc.), dialogue icons (to activate the persuasion and mercantile mini-games), object activation (for the security mini-game), and item equipping (for the alchemy and armorer menus). In all likelihood, you're going to need to create animations to capture the character performing the action...unless you plan on implementing some sort of mini-game or menu, in which case you'll have to figure out how to do that. After you have that part figured out, you'll have to script the results of performing the action with hooks to the key/animations and increment the player's skill use. Not sure how you'd do that, exactly, maybe OBSE has some way to access the use value so you can turn it on and off dynamically to increment the skill. (Remember, this is for an overwritten skill which you want to increase only when the player performs your new skill and not during normal Vanilla events.)
If you want to add a completely custom skill without overwriting a Vanilla skill, most of the above still applies, but you have to also figure out a way to get the skill to show up in the player's character sheet. I believe there is a way to do this, but I don't have any idea how. Maybe by editing the xml files.
You'll also have to figure out how to implement perks for your skill, which may require more animations and definitely a lot more scripting. And don't forget to rewrite the descriptions and create a new icon for your skill.
Again, I've never tried to implement a custom skill myself, so there may be different/easier ways to go about it and some of this info might be incorrect. Check TESNexus, PES, etc., for some custom skills and open them up in the CS to see how they implemented them. If you're lucky, someone with more insight will see the thread and add to/correct what I've said.
hth