Showing posts with label scripts. Show all posts
Showing posts with label scripts. Show all posts

Friday, June 22, 2012

Tutorial: Creating A Skill

Object: To create a new skill using Papyrus scritps

Difficulty: Very complicated and difficult

Time Needed: A great deal. If you are an unexperienced modder, it will take you even longer. For experienced modders, while actually writing the scripts might not take much time, designing the system, implementing it, and perfecting it until it plays well can still take a long time.

An extended version of this tutorial, along with a fully-functional example woodcutting skill mod are available on the Skyrim Nexus for free.

Things you will need:



  • Creation Kit.
  • A plan for how the skill will work mathematically
  • Scripting and general Skyrim modding experience

Note: You cannot create a new skill that uses the vanilla interface without editing most of the base code of the game. This tutorial explains a workaround tactic for create a system of scripts that let you track the how much the player does a certain item so that you can add perks, quests, or other features that depend on the player reaching a certain level in that skill. This tutorial is not going to follow the normal format (a list of buttons that you need to click and actions that you need to do). Rather, it is going to explain the concept of the skill workaround, and how to design/implement it. The actual implementation and the specific equations will be left to you to develop. In this tutorial, we will be using a Woodcutting skill as an example.

Setting up the XP: You first need to plan out the math of your skill. How you gain XP, how much XP you need to level, whether each level requires more XP, what higher levels give you, etc. These decisions will decide how the skill actually works mathematically and are extremely subject to change. I can't tell you how many times I have tweaked and changed my Unarmed leveling system in Way of the Monk. Once you being testing the skill you will inevitably find ways in which it can be improved or tweaked. What sounds good  in theory may not play well in the real game.

The first thing that you need to determine is the XP system. Even though Skyrim tries to take away the numbers as much as possible so that the game feels more immersive, it does actually use XP. Every time you use one of the skills (by casting a spell, hitting an enemy with a weapon, creating a potion, etc.) your XP is raised by a certain amount. Once it hits a cap, the skill level is then increased and the amount of XP needed to reach the next level is raised. You can study the XP system in Skyrim on the UESP wiki. I would highly recomend that you study the vanilla skills to gain a grasp of how they work. In the Woodcutting skill that I will be using as an example I used the following Papyrus Code:
if WoodcuttingXP.GetValue() >= 100
    WoodcuttingLevel.SetValue()WoodcuttingLevel.GetValue() + 1)
    WoodcuttingXP.SetValue(WoodcuttingXP - 100)
endif
Each time you activate the Woodcutting block, your XP will be raised. In the above code, the IF statement determines that when your XP reaches 100, your skill level is raised by one and your XP is reset.

If you want to have the amount of XP required to level increased every time, then you can do one of two things. 1) Instead of increasing the XP by a set amount every time the Woodcutting Block is activated, you should use a variable that can be decreased every time you level. So, say the variable starts out at a value of 10 and you must use the Woodcutting block 10 times to reach level 2. You should add to the above code a line that decreases that variable from 10 to (for instance) 8. Next time, it will take 12.5 (rounded to 13) uses of the Woodcutting Block to raise your level to 3. You can continue that process as long as you want to make it harder to level each time. Keep in mind, though, that if you simply subtract from the variable each time then the variable will eventually hit 0 and the level will never increase. So I would advise you to either write an IF statement to make sure that it never hits 0, or make sure that it hits 0 at just the right time if you want to have a level cap.

2) The other possibility is to have the amount of XP required to level set as a variable and increase it each time you gain a level. So, say at level 1 you gain 10 XP each time you use the Woodcutting Block and must acquire 100 XP to reach level 2. You can write the code so that when you hit level 2, the amount required to level is raised to (for example) 130. That way, it will take 13 uses of the Woodcutting Block to reach Level 3.

So, which of those methods should you use? It's really up to you. The second method is much more natural and runs much smoother than the first. But the first one makes it easier to modify the speed at which you raise your level with perks/abilities, and can be set up so that it stops level progression after a while.

Rewards: A skill is useless without rewards. You can give the player as fancy of an XP system as you want, but if it doesn't change the gameplay for them, then there is no point in downloading your mod. The vanilla game uses a perk system and a scaling system to reward the player for using a skill. The manner of your rewards depends entirely upon the skill that you are creating. For a Woodcutting Skill, the player might expect to be able to get a perk that increases the amount of firewood that they get each time they use the Woodcutting Block. Another good reward might be the ability to create items with your wood (arrows, bows, Forsworn items, etc.). Decide what type of reward you would like to give to the player.

Perks are the standard method of rewarding the player for raising their level. They are also an incredibly versatile way of giving bonuses to the player. I won't discuss perks in detail, since that's another discussion for another time. I will add, though, that one of the conditions that you can add to perks and their effects is the GetGlobalValue condition. This condition is extremely useful when using a skill system based upon Global Variables. If (for example), you want to specify that a Perk Entry only works when your Woodcutting Level is over 10, you can choose the S GetGlobalValue(WoodcuttingLevel) >= 10 condition information. This condition can also be used on Magic Effects in Spells.

Perk points are a good way of giving the player a choice in how they level. There is a reason why the game developers of Skyrim gave the player the choice of choosing their perks, rather than making the perk rewards mandatory like in Oblivion. It adds replay value and makes the player feel more invested in their character. If you're going to give the player that option, you will most likely end up having to create more perks so that they have some to choose from. While that means more work, it also means a more enjoyable playing experience.

The other type of reward that I mentioned was scaling. Scaling is when your ability to use the skill is improved as your level is increased. In the case of weapons, it means that your damage is increases when your level in that type of weapon is raised. The best way to set this up is to use an equation or perk that includes the skill level divided by a certain amount (e.g. effectiveness = 1 + Level*.01). You can also increase the effectiveness by a finite amount each time you level.

Example, using the equation:

        WoodcuttingEffectiveness.SetValue(1 + (WoodcuttingLevel.GetValue()*0.01))

OR by increasing it by a finite amount:

      WoodcuttingEffectiveness.SetValueInt(WoodCuttingEffectiveness.GetVaueInt() + 1)
This can be done with perks or by code in the leveling script. In the case of the example Woodcutting skill, the player can gain perks that increase the amount of wood that you gain each time you chop at the Chopping Block.



Another standard way of rewarding the player for raising their level is with new abilities or spells. New powers can be hard to make if you are trying to create a new type of effect that suits your skill, but they are a great way of making the player feel like they have accomplished something.

The other standard way of rewarding the player is with items. If you are a 3d artist, know someone who is, or have the permission of a mod author to use their models, you can add new items to reward the player with. Otherwise, you can add new enchantments or allow the crafting of vanilla items that you previously could not craft. Now, to fit the rest of the game, you probably don't want to simply add the item to their inventory once they reach a certain skill level. That breaks immersion and seems totally unnatural or special. It is best to either have a quest or a leveled list to give the item to the player. You can either make a quest for them to find it that you can only start once your skill reaches a certain level, or you can create a leveled list that has a chance to give you the item determined by a global variable. You can learn more about using globals in leveled lists by reading the "Chance None" entry on the wiki page, or by studying the Golden Touch perk in the Creation Kit.

The Coding Process: Now that you have finished the planning process, you need to actually write the code.

First, you need to find an Event that will run the code. This can actually be more challenging than it sounds. In my Way of the Monk mod, the Unarmed leveling script actually used the OnEffectStart Event because it was implemented as a script on a Magic Effect. Why? Because it was the only way to make sure that the script ran when the player successfully hit the enemy. Finding the right event can be tricky, and will likely take some testing. The Event that you use is totally dependent upon the nature of your skill, and it will probably take a lot of testing and inventive designing to find the right one.

For the Woodcutting example skill, finding the event was a bit difficult. I tried creating a unique script that ran on the OnActivate Event, but that ended up only running it whenever the player pressed 'e', rather than each time that they chopped wood. It would also run whenever NPCs used the Chop Block. So, instead, I edited the woodchoppingscript (not the vanilla script for the process) and added in my calculations as a function that ran when the played chopped a piece of wood.


        if WoodCuttingLevel.GetValueInt() <= 3
                WoodcuttingXP.SetValueInt(WoodcuttingXP.GetValueInt() + 1)
                if WoodcuttingXP.GetValueInt() >= 10
                        WoodcuttingLevel.SetValueInt(WoodcuttingLevel.GetValueInt() + 1)               
                        WoodcuttingXP.SetValueInt(WoodcuttingXP.GetValueInt() - 10)        
                        Debug.Notification("Your Woodcutting level has been raised to " + WoodcuttingLevel.GetValueInt())
                        PerkPointsAvailable.SetValueInt(PerkPointsAvailable.GetValueInt() + 1)
                        PerkPointsEarned.SetValueInt(PerkPointsSpent.GetValueInt() + PerkPointsAvailable.GetValueInt())
                endif
        endif

 After this, I created some perks, created a power to let you choose your perks and check your stats, and some notifications to let the player know that they are leveling as they use the Chop Block.

After you have found the Event to use, and have implemented the code, you need to test your mod. Creating the code is the easy part. Refining it takes time. I would highly suggest finding a group of modders to beta-test your skill once you have finished it. A system that seems to work well in the code and in your own testing might not work as pleasantly when others are using it.

Testing: After you have finished your planning, your coding, and your implementation, you must test your mod. I would highly suggest gathering a group of beta testers. You can do this by uploading your mod as a BETA version online. Let players know that what they are downloading is still in beta-mode, and give them an invitation to report any bugs or areas which could be improved.


Example: If you want to see an example of this tutorial in action, then feel free to download the Woodcutting Skill mod. You can also download an extended tutorial for creating a skill in PDF format.

Thursday, May 10, 2012

Way of the Monk - Part 1 Updated!

My Way of the Monk Skyrim mod has been updated to version 1b. The 'b' does not mean that it is a beta, but that it is the updated, second version. I'm sorry for the long wait, guys. I've been pretty busy and haven't had as much time as I'd like to mod.

The full list of changes is below:


  • Fix Unarmed leveling so that the skill is only raised when you are using Monk Weapons
  • Seer Pillar now gives you the Seer power rather than the Dimensions one
  • Fixed spelling and grammatical errors in "The Pillars" book
  • Add a riddle for the Elemental Pillar
  • Changed the Magic Resistance buff for the Elemental Pillar to 10 for balancing
  • Added Progress on the Way lesser power that lets you check your stats while adventuring
  • Added Choice Upon the Way lesser power that lets you choose new perks while adventuring
  • Shadow Pillar now gives you the Shadow bonuses like it should
  • Activating the Pillar of the Way now gives you the Progress and Choice lesser powers
  • Changed Soft Resistance perks so that the Armor Rating bonus is visible in your inventory
  • Changed Evasion robes to use normal brown and yellow monk robes to add color variety
  • Changed IDs for areas with Pillars so that they can be coc'd to with the console
  • Added a one second delay to the Unarmored leveling script so that you do not level at an insane speed when hit by a concentration spell
  • Raised default attack speed for Unarmed weapon to 1.1.
  • Leveled the Burning, Freezing, and Electrical robes so that they do not all deal the same amount of damage
  • Fixed the Choice Pillar so that it now shows you the Unarmored perks when you meet the proper requirements. 
So far, I have not found a way to restrict Unarmored leveling to when you are not wearing armor. I am going to contact some people on various forums for help. Hopefully that issue should be fixed in an upcoming update or version.

Friday, April 13, 2012

Way of the Monk: Mod Diary #3



Work has been a bit slow recently because of end-of-semester school, but I have been able to put in a fair amount of modding hours on the weekends. Last weekend I added a whole ton of new craftable weapons, as well as some enchantments.

You can take a look at the Screenshots page for pics of my progress.

Weapons:


The new weapons are from tom349's mod Fist Weapons. I was given permission from him to use his models, as well as from BloodySunday's to use his retexture of tom249's mod.

They are all lore-friendly, craftable, and enchantable. The animations and killcams on them are a bit weird, but that is not my fault. For some reason, any weapon that uses the default Hand-To-Hand attack animation neither appears on the right hand when it is equipped, or is on the body when sheathed. This is not my fault, but the Creation Kit's. The way they designed the animation, it's not built to have models that use it. I am going to try my best to find a way to get the weapons to use the default animation, but I may not be successful. If you think you can help, feel free to contact me.

Robes:


As you can probably tell from the screenshot, there will also be some new robes. There was actually an entire set of hooded and non-hooded monk robes in the Creation Kit that were never used in the game. Fortunately for me, this means that they wont conflict with current items and will be new to players. Since they were all monk robes, they will also fit well with my mod.

Perks:


There were two perks which were not working properly. One of them suddenly decided to start working, though. I could not find any reason why it was not working in the first place, and since it is working now, I won't complain. The other one is still not working, but it should be fixable with some more coding.

Nearly done!


I'm mostly done! I just need to finish adding enchantments, fix that one perk, add some new characters, and write some backstory before sending the first version off to beta testers. Compared to the total amount of work that I have done, what is left is not very much. I have yet to decide whether I will add a follower for the first version. I'm not entirely sure how to do that, so I don't want to begin working on something that will extend the release too far. It may still be a few weeks because of beta testing and my own busy life, but it the first version should be complete soon.

By the way, if you want to beta test Way of the Monk for me, contact Woverdude and you will be added to the list. I ask only that you not distribute the files before I release the mod, and that you promote the release when you get the chance.

I will post more information on the release soon, including a detailed brief of all the new features and a plan for the release and second version.

Saturday, April 7, 2012

WIP Screenshots!

A new Screenshots page has been added to the navbar at the top. Pre-Alpha Way of the Monk content screenshots and teasers are on it, and new pictures will be added as I complete the mod. Check out the page regularly for new screenshots of the WIP mods of our modders!

Wednesday, April 4, 2012

Way of the Monk Update: 4-4-12

First off, let me state that I've been taking a bit of a break from modding. I have two tests that I must take tomorrow and have been preparing for them. I have, however, managed to accomplish quite a bit since me last update.

Pillars:

The script that manages all of the power-giving Pillars has been completed, the Pillars are planned and organized, and several of them have been added to the game. You can find the script for them here. It's based off of the powerShrineScript from the vanilla game that manages the Standing Stones.

I've written a list of all of the Pillars that I plan on adding to the first edition. Some of them are proving to be troublesome to code and figure out, but I am confident that I can complete them with enough work. The Pillar that I've added and am currently working on is the Pillar of the Elements.

Here's a screenshot:



I'm having some trouble getting the effect to be applied. I've found that for some strange reason, all weapons that use the HandToHand attack animation have trouble with perk effects and are not considered Weapons of the normal sort. I'm not sure what's going on, but it has somewhat crippled my perk and item designing. I hope to find a workaround or fix soon, though.

Items:


I've gained permission from tom348 at the Nexus Forums to use his mod Fist Weapons, as well as Bloodsunday's permission to use his retextures of tom349's weapons. I'm not sure that I'll use all of the models in my mod, but a good number of them will be going into the game. I'm having some trouble with the weapons being mysteriously invisible when equipped in the right hand, but other than that it's all going well.

Unarmored Skill:


I have also added in a separate Unarmored skill in addition to the Unarmed skill. Along with this skill are a number of Unarmored perks and enchantments that will be added. The perks will be chosen independently from each other and will level with use.

Plans:


The next few weeks are going to be pretty hectic and busy for me. I have two tests tomorrow, am moving in a week, and have finals later this month. So, I wont be able to do nearly as much modding. :-( I will, however, be writing tutorials. Also, keep watch, because I'm soon going to announce a great new opportunity/project for all of you modders and players. I will post the news soon. :-)

Sunday, March 25, 2012

Way of the Monk: Unarmed Overhaul, Mod Diary #2

Mod Diary #2

Pillars:

So, after tens of hours of studying Papyrus, posting questions on forums, and writing nearly one thousand lines of codes with around one hundred properties, I have finally completed the scripts for all of the Pillars that manage your stats in the mod. Not only that, but they all work! One of them is a tiny bit glitchy, but I aim to fix that soon. These Pillars of the Way will be used to manage and check your perks, stats, and skill inside the mod. For ease, you will also be able to use Balls of the Way (misc. items with the model of an Attunement Sphere) that have the same functions. These Pillars were vital for the work on the other mod to allow for proper testing and smooth use. They have also been added to the world and given a map marker for fast-traveling. Along with the completion of the Pillars, I have also completed every perk that the player can gain from leveling. 

There are some other Pillars that the player can find around the map (similar to the Standing Stones) that have not been completed, but they are next on my list. 

Enchantments and Focus Crystals:

They have not all been added yet, but I have decided upon them all and know for the most part how I am going to add them to the game. There is still some uncertainty on how to make Gauntlets that are both a piece of Armor and a Weapon, but I think I may have found a way to create them by mimicing the way shields work in the game.

Tutorials:

Along with all of this tedious scripting, I have learned a great deal about Papyrus and the CK. In the next few days I will post tutorials on making message box sequences, new skills, and (once I figure it out) weapons that are also categorized as armor.

Screenshots:

Pillar of Rewalking (allows you to reset your perks):


Archway to lead the player to the Pillars of the Way:


Pillars of the Way:


Monday, March 19, 2012

Way of the Monk: Unarmed Overhaul, Mod Diary #1

Mod Diary #1

If you haven't heard about my new mod project Way of the Monk: Unarmed Overhaul, check it out, because that's what I'm going to be talking about. :-)

So, one thing I decided about making this mod was that I was going to use the opportunity to help other modders improve their mod. As I make the mod I am going to be writing a Mod Diary of what, how, and why I add or take away features from my mod. I hope that you enjoy my diary and learn from it as much as I had to learn to write it. :-D

Please keep in mind that this all takes a lot more time than it seems from reading it. For those of you trying to decide whether to get into modding, realize that it will take up a huge amount of your time. While it only takes a few minutes to write a paragraph about a step in the process, that step could have taken hours or even days to complete. Consider this both a warning to new modders, and a request to please understand why I take days to do what may it may appear should take minutes or hours. :-)

Note: This is going to be a pretty long and detailed post. Just giving you fair warning...

First steps:

The first step in any process is always the inception of the project, and the planning. I started having an idea that I wanted to make a new Unarmed mod over several weeks. During those weeks I saw that, while my Unarmed Warfare mod did improve the Unarmed gameplay, it was extremely buggy and felt too much like a workaround. So, I decided to build a new mod from scratch, following a different concept and process from the first one. 

Scripts:
One of the main desires I had was to have a scaling system for Unarmed damage, as well as having a "skill" and perks for Unarmed combat. Now, the CK does not allow the creation of new Actor Values, which is the class of object that skills are. So, that meant I was going to write a script that ran in the background as the user plays the game. Here is the basic concept of the script:

There are three main variables that the leveling-system/skill runs off of:
1. Use
2. Mod
3. Level

Use is the progress towards the next skill. Mod is the amount of XP that is gained each time the player makes a successful Unarmed attack. Level is the level of the skill. These three variables are stored as global variables.

(The entire script can be found here. The font might not be acceptable to the CK, though.) The equation :

when the player makes a hit
then Use = Use + Mod
if Use >= 100
then Use = Use -100
        Level = Level + 1
        Mod = Mod - .01
endif

So, every time you hit an enemy, your Use (level progress) increases by Mod. When this has occured enough times so that Use equal to or greater than 100, then your level increases by one. When your level increases, Mod goes down by .01 so that the speed of leveling decreases over time.

Practical application:

At Unarmed level one: It will take 100 hits to advance to level 2
At Unarmed level ten: it will take approximately 110 hits to advance to level 11
At Unarmed level 50: It will take approximately 200 hits to advance to level 51
And so on...

Now, the number of hits would get unmanageably high at higher levels, but only if you did not have any perks or items that sped up the process. If you are playing an Unarmed character, though, I expect that you would, since they are available.

The Unarmed Damage scaling is rather simple. It is multiplied by (1 + Level/20). Thus: At level 20, you would do twice Unarmed Damage, at level 40 you would do 3 times, etc. To get the script, click here.

Now this all might sound relatively simple. But it took me a lot of time to plan, balance, and translate into Papyrus syntax. I started out knowing very little about Papyrus. I still do not know a lot, but I have certainly improved my knowledge.

Perks:

Overall, I want to have 20+ new perks/enchantments. That may sound kind of bold, and maybe a bit imbalanced, but the whole goal is to build an entirely new combat style within the game. To do that, I'm going to have to add a lot of new options. As far as perks go, you will be able to choose a new perk every 5 levels. There will be both an "Unarmed" and an "Unarmored" branch that crossover on occasion. 

There will also be a number of more significant perks that you get from special Pillars. Across the landscape of Skyrim there will be a number of Pillars that are similar to the Standing Stones. You will only be able to have one active at a time, but each one can significantly change your gameplay. So far, I have ideas for several pillars, which you can read about here. Each pillar will have a perk that modifies Unarmed gameplay and a perk that modifies Unarmored gameplay.

So far I've only copied the perks from my Unarmed Warfare mod, but I will work on adding new ones as soon as I have them planned out.

Managing your stats:


Now, you might be wondering how you will be able to manage your stats. Across the road from the Guardian Stones will be a set of Pillars that perform that function. One pillar will add the perks start the scaling scripts, and will allow you to view your level, level progress, and amount of perk points.

Another Pillar will allow you to choose new Perks, and a third will let you reset your perks. If you're worried about managing your stats on the go, don't fret! You'll also get several Balls that let you do the same thing as the Pillars. Between the Pillars will be a table with a book on it that shows a tree of perks and explains the mod and its concept.

Making this and the perks functional is what I am currently working on.

Enchantments:

I will create a series of new enchantments that can be used for Unarmed combat. They can be added to any piece of armor, jewelry, or clothing. Now, I know the objection that the player will be losing an Equip Slot by doing that. Since you won't be using any weapons, you won't be able to enchant them. I am going to work around that by making new items called Focus Crystals. They will be equipable and enchantable. In the world they will look like crystals, but when you equip them they will not appear on your body.

The work on Enchantments will begin once I have finished all of the perks, scripts, and managing work.

Items:


Along with the new perks and enchantments will come Items to implement them. There will be a number of new gloves, clothing, and Focus crystals that you can find or purchase. They will not use new textures or models, but will have unique enchantments.

Items will be added once I have created the Enchantments for them.

Enemies:

Don't be surprised if you encounter enemies with the same abilities as you! I am going to create a new Combat Style for enemies that focuses entirely on Unarmed combat. I will also create varieties of the standard enemies that are Unarmored and fight with their hands. These enemies will provide a way of finding new items, as well as providing an interesting challenge and aspect to the game. Around the

The enemies will be added once all other work is completed.

Feedback is appreciated!


What I need the most is feedback. I can only come up with so many ideas for perks and enchantments. Please share with me your ideas!

Keep in mind that I won't be adding new animations (at least for the first version). So, please don't ask me to create an entirely new, awesome ninja attack. :-)

If you have any questions about the technicalities of how I am adding certain features, feel free to ask. I will answer them to the best of my abilities.

For the next Diary I am only going to share what is new since the last update. This one is only really long because I wanted to let people know my plans for the mod.

Saturday, March 17, 2012

Way of the Monk: Unarmed Overhaul

Way of the Monk: Unarmed Overhaul


I am currently working on a new Unarmed mod. My Unarmed Warfare mod was mostly a workaround and was pretty buggy, as you probably found out if you played it. The one I'm creating will add a skill. It won't be visible in the levelup screen, but will scale your unarmed damage and add many new perks that you can get. It will run in the background, but will notify you when you level up. As you level up you can gain perks by visiting various 'pillars' (kind of like the Standing Stones), reading books, or gaining items. I will also add a number of new gloves that add unique effects for your unarmed. In addition to Unarmed-related perks, I am also going to add a series of Unarmored (not wearing armor) perks.

As it relates to differences with my Unarmed Warfare mod, there will be no 'Unarmed Weapon' that you have to use to raise your OneHanded; you will merely use your fists. If you want an 'enchantemt', there will be a number of new unarmed-related affects that you can add to your gloves or other armor.

The mod will be called Way of the Monk (in reference to the classic Monk-class in standard rpg's), and will be built entirely from scratch to avoid bugs. Unlike in my Unarmed Warfare mod, I am also going to take care to make sure that it has as little conflicts as possible, by not changing a great deal of content, only adding new content.

If you can think of any enchantments or perks related to Unarmed or Unarmored, please share them. I can only think of so many by myself, but the more input I get, the more that I can add to the mod. :-)

Details:

The Skill: The skill will consist of a series of scripts that scale the damage and keep track of a "level". The scaling and leveling will work approximately the same way that the normal skills do, but will work in the background. You will be notified whenever you levelup, and you will be able to choose a new perk immediately, or delay choosing a new perk until later. 

Perks: You will be given a spell that lets you choose new perks (it will use the same perk points that the other skill use), check your level and leveling progress, and reset your perks if want to (I will limit the amount of times that you can reset them). These perks will be basic perks that give you bonuses and neat features as you level up. To get the best perks, however, you are going to have to travel around Skyrim and find a series of Pillars. Each pillar will have a unique, powerful perk, and will work like Standing Stones in the way that you can only have one active at a time. There will be perks related both to Unarmed and Unarmored that you can choose from.

Enchantments: I will add a number of new enchantments to the game. These enchantments will have effects that change the way your Unarmed combat works, the amount of damage you do, add magical damage when you hit an enemy, etc. You won't be able to enchant your fists, but you can enchant gloves, other armor, rings, circlets, and other wearable items. And that brings me to items:

Items: Along with these enchantments will come items that have have them. Because I don't want to add conflicts with other mods, I will simply add these items to leveled lists to be found as loot. I may leave one or two of them around particularly hard-to-get-to Pillars, as well. For the most part, these items will use vanilla models and textures, but will have new enchantments. I am not a 3d artwork guy, so I don't have the ability to make new models. If someone wants to volunteer some, I'd be happy to add them to the mod. 

Enemies: Just as you are going to start using Unarmed attacks, so might your enemies. So don't be surprised if you run into a character with some of the same abilities and items as you!

Animations? I am not an animator, so I won't be able to add new animations. I may try to find some way to  make the right and left hand attacks somewhat different (to let you have your own playing style), but other than that I cannot add new anims. If anyone wants to make some for me, I would GREATLY appreciate it! :-D

Schedule:

Since the work on Skyrim Books is not totally complete, it may be a while before the first version of Way of the Monk is complete. I've got Spring Break this week, though, so I'm going to be doing a lot of work on my mods. Hopefully I can get a fair amount of work done on WoM (Way of the Monk).

Tutorials:

As I work on WoM, I will write tutorials on various aspects of what I do in the mod. I may even write a sort of Modding Diary that details the whole process that I took to make the mod. If I do, then I hope you will enjoy them and learn from them. :-)

Thursday, February 23, 2012

Tutorial: Readable Spell Tomes

Object: To make spell tomes readable, instead of losing them when the spell is learned.

Difficulty: Easy-Moderate (involves script editing)
[edit] It appears that modifying the spell tomes causes conflicts with the vendors lists with Crash To Desktop whenever the spell tomes are hovered in the lists. Hence another solution will have to be figured out but the tutorial is still interesting to approach the functions of spell tomes and scripting.

Time Needed: Less than 5 minutes

Things you will need:

  • Creation Kit. The Creation Kit is the modding tool for Skyrim and can be downloaded for free on Steam.
  • Some previous experience with item-editing, and (preferably) script editing
Note: The scripting part of this tutorial is a one-time ordeal. After the script has been made, you will simply need to add it to each book that you want to apply it to, rather than creating a new script for each item. For users of the Readable Spell Tomes mod on the Nexus and the Workshop, you can skip to step 8.

Download: To download the Readable Spell Tomes mod, visit the:
Steam Workshop at:  http://steamcommunity.com/sharedfiles/filedetails/?id=13474
Nexus at: http://skyrim.nexusmods.com/downloads/file.php?id=10954

1. Open the Creation Kit and load the appropriate Data Files.
2. Open the 'Gameplay' Menu and click 'Papyrus Script Manager.'

3. Right-click in the Script Manager, and click 'New.' This allows you to create a new script.
4. Name your new script "SpellTomeReadScript". This is not a required name, but it is simple and easy to find when you search for it later. Also, type "ObjectReference" into the Extends text box. It MUST be "ObjectReference" and NOTHING else.

5. Click OK, and type/copy the following into the editor that pops up:


Scriptname SpellTomeReadScript extends ObjectReference  
{Adds spell to player on equip}

Event OnEquipped(Actor reader)
if (Game.GetPlayer().HasSpell(SpellLearned))
Debug.Notification("You already know this spell.")
endIf
Game.GetPlayer().AddSpell(SpellLearned)
EndEvent

Note that the first time you open a script you may need to tell Windows which program it should use to open the script file. If so, choose a program like Notepad (or Notepad++ if you have it) in the list Windows proposes.

6. Don't worry about the last line that you see in the image above. That is added in automatically by the CK when you add the script to an item later in the tutorial. (nox.fox: personnaly I had to add this last line to compile the script successfully)
7. Save the script. Right click on the script in the Script Manager, and click 'Compile'. Click on your script in the box that pops up. If the box disappears, then the script was compiled successfully and no errors were found. If it says that there was an error, then something in the script was typed incorrectly.
8. In the Object Window, navigate to the Items > Books category, and find the Spell Tome that you want to modify.
9. Double-click on the book to edit it. The first thing you must do is to deactivate the standard option of teaching a spell. On the left side of the Book window, there should be a 'Teaches' section, and then two options. For a spell-tome, the 'Spell' option should be filled, and the appropriate spell should already be selected in the drop-down menu. Open the drop-done menu, scroll to the top, and click NONE. This deactivates the spell-teaching, so that we can use the SpellTomeReadScript instead.
10. Now click 'Add' in the Scripts section of the Book window. A window should pop up that lists all of the scripts. Find the 'SpellTomeReadScript' and click OK.

11. In the Scripts section of the Book Window, select the 'SpellTomeReadScript' and click 'Properties.'
12. Click Add Property in the window that pops up.
13. Select SPELL from the drop-down menu in the new window, and type "SpellLearned" in the 'Name' text box.
14. Click OK. Select your new property, and click 'Edit Value'.
15. Select the spell that you want to add to the player from the drop-down menu, and click 'OK.
16. The script should be added correctly to the item. Save the mod, and test the spell tome ingame.
17. To make other spell tomes readable, repeat steps 9-15 for the spell tome or book that you want to modify.

Notes/Possible Bugs:

1. Note: This process can be used on any book to have it teach a spell without being destroyed.
2. If you have tested your book out, and it is not working, then go back over the tutorial carefully and make sure that everything was typed in correctly and that you disabled the standard method of making books teach a spell.


Feedback:

If you have any comments/questions, or would like to request a tutorial, then please feel free to leave a comment. I will answer your question as quick as I can. If you request a tutorial, I'll let you know when/if you should expect your request to be fulfilled.