Showing posts with label menus. Show all posts
Showing posts with label menus. Show all posts

Thursday, January 10, 2013

Tutorial: Adding Help Files to Skyrim's Main Menu

Object: Add Help files to Skyrim's main menu.

Difficulty: Very Easy

Time Needed: Besides the time needed to write the files, about two minutes.

What You Will Need:


  • The Creation Kit. The Creation Kit is the modding tool for Skyrim, and can be downloaded from Steam.
  • Some previous understanding of the Creation Kit (preferably).
  • The text for the Help file that you want to add.

There are a number of ways to add guides and Help files to your mod. The most common way is to use a book or a Message Box menu system. With the addition of MCM (Mod Configuration Menu) to the SkyUI,  it is now also possible to add them to your mod's MCM. 

This tutorial focuses on adding Help files directly to Skyrim's normal main menu. When you press 'Esc' ingame, you can save, load, read your journal, review your achievements, etc. There are also Help messages for guiding the player in how to use the game. It is possible to add your own messages to this list. To do this, two things need to be done:

1) Create a new message by navigating to Miscellaneous > Messages in the Object Window, right-clicking in the right-hand panel, and clicking 'New'.
  • Write or copy the text that you want to be read in the Help menu.
  • Make sure that the Messagebox checkbox is checked.
  • I suggest that you follow the naming scheme that the other Help Message have: "Help[Topic]Long".
  • Ensure that there are no Menu Buttons or Conditions. Click 'Ok' to create the Message.

2) Navigate to "Miscellaneous > FormList" in the Object Window and find the "HelpManualPC" FormList. Double-click to edit it. Now go back to the Messages category, select your Help Message, and then drag it into the FormList.



3) Save your plugin. Start Skyrim.exe and select your plugin from the Data Files. Begin the game, load a save, and press 'Esc' to test your modification. Navigate to the 'Help' menu, and look for your message. The Help messages are categorized alphabetically by the Message's name.


There you go! Your Help files have now been added to Skyrim's Main Menu.

Wednesday, October 24, 2012

SkyUI 3 MCM compatability

Howdy, y'all.

I'm sorry for not releasing a new version during the past couple of months. I have been far too busy with school and work to make an update. I have not forgotten about this mod, though. If at some point I have more free time to work on it, then I will. I am not ignoring the complaints and bug reports that y'all give; rather, I simply haven't had the time to respond to you or to fix them.

That being said, with the announcement of the Mod Configuration Menu for SkyUI 3, I am going to try to take out some time from my busy schedule the next few weeks to make an MCM menu for Way of the Monk. One of the biggest complaints about this mod is the menus. They're crap. I know. Not only are they annoying to you, but they are annoying to me. To make the menus of the sort that WoM uses now often requires over 1000 lines of code, and many hours. I spent probably 100-200 hours working on the menus alone. The MCM is not only easier for the player to use, but supposedly it reduces the scripting time to a couple of hours max. Not only that, but it allows checkboxes, drop-down menus, option highlighting, sliders, and many other useful features. It is still in alpha phase, so it might change over time and y'all might not have downloaded it yet. However, once I learn the system and have taken the time to script it, I will hopefully have made Way of the Monk MCM compatable.

What does that mean for y'all? Well, first, the menus won't be so annoying. You will be able to press 'escape' to access them, rather than casting a spell or power. You will also be given more options. I will try to code into the menus new options including leveling speed. This will allow you to change how quickly you raise your Monk skills. I am not sure what the menu restriictions are, but I *might* (I stress *might*) even be able to create a menu for choosing perks. I hate the current menu system that this mod is using. It's awful. Especially when choosing perks. Many peoples' complaint is that they don't want to have to use those awful menus, and they want the process of choosing new perks to be easier. So far, that has not been possible without replacing an existing skill tree in the main leveling menu. MCM may allow me to do that.

I'm not sure exactly when I will create this menu. Likely, it will be an incremental process that may take a week or two, as I learn the MCM system and code when I get the opportunity. I may also need to wait a while for MCM to get out of alpha stage, to ensure that I don't have to rewrite part of the code. Supposedly, Gopher is going to make a tutorial on creating MCM menus, which I am also waiting for. The one downside of this is that the MCM menu will not be available for Steam Workshop users. I am going to add an optional download here on the Nexus for it. Also, I may have to change Way of the Monk to an ESM, which would make it incompatible with the Workshop.

Tuesday, July 24, 2012

1.4 Changelog

This is a complete changelog for the 1.4 beta update to Way of the Monk. If more changes are made in the release edition of 1.4, then they will be added to this list.

You can download the beta version of 1.4 here.

Changelog:

+ Evasion and Escape enchantments can now be put onto other robes
+ Fixed requirements of the Rapid Fists 2 perk and the Rending Strikes 2 perk
+ Added a Perk Requirements book that tells you the requirements for every perk. It has been added to the table at the Pillars of the Way.
+ Changed Soft Resistance to apply to all weapons
+ Created two more levels of the Unarmored Stance perk and changed its requirements
+ The Whirlwind effect now only works on the Unarmed weapon
+ Created the Unimpeded Combat perk, with three levels, that increases your attack speed when you are unarmored
+ Created the Endurance perk that increases your health regen in combat
+ Created the Vitality perks, which lets you choose the Stamina or Magicka attribute. Which ever one you choose will have its regen fortified in combat.
+ Created the Silent Movement perk that reduces your movement noise by 50% when you are unarmored
+ Created the Padded Movement perks that make you harder to detect when sneaking and unarmored
+ Created the Chokehold perks that increases your sneak-attack damage with the Unarmed weapon and with the Monk weapons
+ Created the Knockout Punch perk that allow you to knock out your enemies when sneaking, undetected, and using the Unarmed weapon
+ Created the Martial Master perk that reflects 10% of damage when you are unarmored
+ Split the Unarmored perk category into two subcategories: Defense and Combat. The perks have also been re-organized.
+ Changed the menus and functions of the Progress, Choice, and Rewalking Pillars to reflect changes

Final 1.4 update (after beta):
+ Created a chest to contain the books and items at the Pillars of the Way
+ Added a Hooded Robes of the Way at the Pillars of the Way for those who are playing at high difficulties
+ Update the Choice power with the menu changes
+ Update the Progress power with the menu changes
+ Corrected Unarmored Stance description
+ Fixed the misdirecting buttons in the Progress menu
+ Slightly increased base damage of Orcish claws for balancing
+ Slightly increased base damage of Daedric claws for balancing
+ Slightly decreased base damage of Elven Glaive for balancing

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.

Monday, June 4, 2012

Version 1.3 Changelog

I have completed most of the work on the next update and will post the final version as soon as I can on the Nexus and the Workshop. I am also going to release a temporary beta version tonight for those aching to play it. That way, some of ya'll get to go ahead and play it, and the others get to play a more polished version when it is released tomorrow or the day after.

As for the changes, there are quite a lot. Most of these changes required numerous other changes to code and systems that I do not even mention. If I make any more for found bugs by beta-testers, or if I add something new, then I will add that work to the list below. The most important changes are listed in the Highlights section.

Highlights:



  • Savegame bloat issue has been eliminated. It might still bloat a little more than without any mods, but no more than is expected. I have not done extensive testing on this, but it appears that you might even be able to use a character from a bloated save. Load the save with the new version and create a new save when you are done playing. Basic testing seemed to indicate that the fix eliminated or at least reduced existing bloat.
  • A level cap of 100 on both skills has been added
  • A large set of ingame help and troubleshooting files has been added to the Pillar of the Way
  • You can now disable either of the skills at the Pillar of Rewalking
  • Many of the menus have been either improved or mostly recreated to be easier to use and less buggy
  • The perks have been rebalanced so that you can specialize in using the "Unarmed" weapon or using the monk weapons (more details to come in a blog post)


Efficiency/Coding-improvements:

  • Removed some calculations from leveling scripts to improve speed
  • Changed a number of debug notifications to use message notifications with flags to insert variables
  • Perk Points Earned is only calculated when neccesary to reduce the amount of math on each Event, changed the Pillars' scripts to account for that
  • Changed some variables to integers rather than floats
  • Changed the way that the Level progress is calculated to use integers and be more efficient
  • Eliminated some redundant Objects that are not used by the mod, but were added during creation
  • Eliminated Unarmored scaling script (got rid of the savegame bloating)
  • Eliminated the non-functioning Unarmed scaling scripts
  • Elemental perks are now removed when you choose a new Path
  • Corrected the conditions for a number of perks and messages that were not working


Gameplay:



  • A level cap of 100 has been added to both skills
  • Both skills take more time to level
  • The teleportation ability and a number of spell have been removed from Apostate Elders
  • Savegame bloat issue has been eliminated
  • Removed Unarmed and Unarmored scaling scripts. They weren't working properly and were causing the bloat
Menus:

  • Help menus added to the Pillar of the Way for the Pillars, Monk weapons, Leveling system, equipment, and Player Guides
  • Troubleshooting menus added to the Pillar of the Way
  • A 'Give Unarmed' Button has been added to the Pillar of the Way so that you can get another "Unarmed" weapon if you need one
  • A Settings menu has been added to the Pillar of Rewalking that lets you disable either of the skills
  • The 'Update' option has been removed from the menus
  • The Stats menu has been improved and the Level Progress is now displayed as a whole number
  • Changed the perk system so that the categories are broken down into branches
  • Eradicated the bug where clicking 'Ok' when there were not perks available would take you to a message for a perk
  • Added some 'Return' and 'Close' buttons to various menus for navigation ease
  • Cleaned up the text for some menus to improve their appearance and readability
  • Changed the content of a number of menus to be updated to the current system and be more informative
Perks:

  • Damage bonus for The Shadow Pillar now properly works and adds an extra 20% chance to crit when sneaking and using either the "Unarmed" weapon or the
  • Perk names now follow a format. Those with "Fists" in the name work for the "Unarmed" weapon. Those with "Strikes" in the name work for the Monk weapon. And those with "Blows" in the name work for both.
  • Bleeding Hands renamed to Rending Strikes
  • Renamed Quick Blows to Rapid Fists
  • Renamed Tiring Blows to Draining Fists
  • Renamed Critical Blows to Iron Fists
  • Renamed Weak Points to Penetrating Blows
  • Renamed Vitals Shot to Critical Blows
  • Renamed Fist Stabber to Puncturing Strikes
  • Changed weapon requirement of Rapid Fists to only work with the "Unarmed" weapon
  • Rending Strikes now only works on Monk weapons and the effect does not stack
  • Fixed the conditions of Critical Blows so that it now works properly
  • Draining Fists now only works with "Unarmed" weapon
  • Unencumbered perks do not stack
  • Puncturing Strikes no only works on Monk weapons
  • Changes Unarmored Stance so that you need at least the second level of one of the previous perks, rather than the final level
Thanks to Kibaken on the Nexus for helping me rebalance the perks!