Difference between revisions of "Scripting Tutorial: Updating your leveled items"
Scripting Tutorial: Updating your leveled items (edit)
Revision as of 05:06, 4 June 2010
, 05:06, 4 June 2010some minor changes
imported>ZuTheSkunk m |
imported>Qazaaq m (some minor changes) |
||
Line 1: | Line 1: | ||
You probably know about level | You probably know about level scaling used in entire game. And you probably know about common problem which comes with leveled rewards from quests - once you receive one particular version of the item, including low-leveled ones, then it remains the same forever, what can be quite annoying when your character reaches 30-th level or higher and you still possess that stupid 10-th level version of the sword. If you wish to make level scaling less annoying - no matter for what purpose you might need it, for your own pleasure, or maybe also for other users of your mod - then you should consider creating a script which updates specific leveled items every time your character reaches enough high level. And this is what I am going to show in this tutorial. | ||
{{Tools|req0=[[The Elder Scrolls Construction Set|Construction Set]]}} | {{Tools|req0=[[The Elder Scrolls Construction Set|Construction Set]]}} | ||
Line 23: | Line 23: | ||
The idea of the script itself is simple - it runs all the time, checking if you are possessing a specified item with too high level, and if yes, then replaces it with better version. For example, if you type to check does you are possessing a steel longsword while having level 16 or higher, the script will notify if those two conditions are true and will perform the desired result. For the purpose of this tutorial, I have created a custom script of updating the Blackwater Blade from quest "Unexpected Voyage". You can take a look on him at the bottom of this article and see for your own. | The idea of the script itself is simple - it runs all the time, checking if you are possessing a specified item with too high level, and if yes, then replaces it with better version. For example, if you type to check does you are possessing a steel longsword while having level 16 or higher, the script will notify if those two conditions are true and will perform the desired result. For the purpose of this tutorial, I have created a custom script of updating the Blackwater Blade from quest "Unexpected Voyage". You can take a look on him at the bottom of this article and see for your own. | ||
* Start Construction Set as usual. Checking Oblivion.esm as master file is required. | * Start Construction Set as usual. Checking Oblivion.esm as [[master file]] is required. | ||
* Open [[Edit Scripts|Script Window]] and use the File Menu (those buttons at the top) to create a new one. | * Open [[Edit Scripts|Script Window]] and use the File Menu (those buttons at the top) to create a new one. | ||
Line 37: | Line 37: | ||
</pre> | </pre> | ||
This part will run whenever the "LVL" variable is not equal to the player's level, what means you have reached another level. It is not essential for your script and I am using it to simplify the progress, so you will not need to type every time "player.getlevel", but just "LVL". With this part, our script will look this way so far: | This part will run whenever the "LVL" [[variable]] is not equal to the player's level, what means you have reached another level. It is not essential for your script and I am using it to simplify the progress, so you will not need to type every time "player.getlevel", but just "LVL". With this part, our script will look this way so far: | ||
<pre> | <pre> | ||
scn <Name of your script> | scn <Name of your script> | ||
Line 144: | Line 144: | ||
* There is only one thing to do - you must add it to the quest in order to make it working. Set type of your script as "Quest" at the File Menu. | * There is only one thing to do - you must add it to the quest in order to make it working. Set type of your script as "Quest" at the File Menu. | ||
* Open the [[Quest|Quest Menu]] by | * Open the [[Quest|Quest Menu]] by pressing "Q". | ||
* Add new quest by clicking RMB on the list and | * Add a new quest by clicking RMB on the list and choosing "New". | ||
* | * Select the new quest, and under "Script" choose your script from the list. | ||
* You did it! Now save your mod and you are free to go. | * You did it! Now save your mod and you are free to go. | ||
Line 200: | Line 200: | ||
* To avoid this, you should also add this script to the '''item''': | * To avoid this, you should also add this script to the '''item''': | ||
<pre> | <pre> | ||
scn <Name of | scn <Name of this script> | ||
Begin OnAdd Player | Begin OnAdd Player | ||
Line 212: | Line 212: | ||
And this is all. Below you will find my example of complete script, to be absolutely sure that you have understood everything correctly. | And this is all. Below you will find my example of complete script, to be absolutely sure that you have understood everything correctly. | ||
<blockquote>If the item already has a script, you'll have to append the above script. (Don't copy the first line "scn <Name of this script>", as the original script already has a name.) Note that this is not always a viable option, as only one mod can modify an item's script.</blockquote> | |||
== Example of completed script == | == Example of completed script == | ||
Line 367: | Line 369: | ||
Items | Items | ||
Level | Level | ||
Scaling | |||
Tutorial | Tutorial | ||
End Search Terms --> | End Search Terms --> |