Appendix 2: Using the Construction Set for Fun and Profit |
|
|---|---|
|
|
|
|
|
Along with Morrowind Bethesda Softworks has included a second product called the Elder Scrolls Construction Set. This is a very powerful tool that can be used to totally change Morrowind and the way it is played. The Construction Set is the software used by Bethesda itself to create everything you see in the game. With it, you can alter the way the game works by changing anything within it or you can create your own items, dungeons, quests, NPCs or anything else and include them in the game for your character to find, acquire and interact with. Working with the Construction Set is almost as much fun as playing the game itself and there is something neat about creating a new item or NPC then encountering your own creation within the game. Here, I am going to give you some basic instruction on how to use the Construction Set and some ideas for things you may want to try. But first, let me get this out of the way. There is no doubt that many of the things you can do with the Construction Set can only be described as cheating. If you are a purist you may want to avoid some of my suggestions below. You can also alter the play balance of the game in such a way that it becomes either ridiculously easy or impossibly hard. So, if you create an unstoppable item and give it to your character then finish the game in 15 minutes, don't complain to me about the game becoming too easy. Also, be aware that you are making fundamental changes to the way the game works and to the game world and that the wrong change, even a seemingly innocuous one, can cause Bad Things™ to happen. At a minimum, it may become impossible to finish the game, impossible to complete many of the tasks within the game, parts of the game world can be destroyed or altered in unpredictable ways, your save games can become corrupted or the game itself may even crash. Since there is no way to know what other plug-ins you have installed in your game even the changes I outline below may cause problems on your system. Therefore, anything you do to your game you do at your own risk and I assume no responsibility for anything that may happen. Not that I'm trying to scare you off from using the Construction Set. It is simply that it is a very powerful tool and, as the saying goes, with great power comes great responsibility. The BasicsWith that out of the way, put the Construction Set CD in the drive and launch the Construction Set. (Actually, the Construction Set will run without the CD but you will run into problems fairly quickly as not all of the files on it are copied to your hard drive when you install it and you will need access to them for anything more than the most basic edits.) A window should appear with three panes. The largest one on the left is the Object Window. This window will contain every item, npc, piece of scenery, conversation, spell effect and everything else in the game. On the bottom right is the Cell Window. Cells are "locations" in the game. Every building, town, cave and area of landscape is a cell and larger locations are made up of multiple cells. The Cell Window itself contains two panes; the left pane is a listing of all cells in the game while the right shows all items in the currently selected cell. Finally, on the top right is the Render Window. This shows what the currently selected cell looks like. I strongly recommend making this window bigger by dragging one of its edges. (Don't completely cover the Object and Cell windows though.) Now, before we do anything else, let's do a tiny bit of setup. Pull down the "File" menu and select "Preferences...". When the Preferences dialog appears, make sure the "Use Data Files on CD-ROM" option is selected. (Don't worry about any of the other options right now.) Click "OK" to continue. At the moment all of the windows are empty because we haven't told the Construction Set which files we want to work with. Pull down the "File" menu and select the "Data Files..." option. A dialog box will appear with a list of files. There are two types of files that the Construction Set works with. esm files are modules and contain everything that makes up the game itself. You should see a morrowind.esm file (and tribunal.esm, bloodmoon.esm and other supplement files if you have them installed). You may also see a number of esp files. These are "plug-ins" and contain additional or modified content. Plug-ins add content to or modify content from the esm files. There have been a number of plug-ins released by Bethesda itself as well as any number of fan-created plug-ins and any of them that you have downloaded and installed will appear here. Any changes you make using the Construction Set will form a new plug-in. You must select at least one module file to work with so toggle on the checkbox next to the morrowind.esm file. We don't want to use any of the other files at this point so just hit OK. (If you get a message saying that you don't have an active file tell it to proceed without using one.) There will be a slight pause as the files are loaded and suddenly all the windows will be filled. Let There Be Light!My first experience with the Construction Set came after I became frustrated while looking for the Dwemer Puzzle Box in Arkngthand. It was so dark (on my monitor anyway) that I could barely see anything. So I decided to make Arkngthand brighter. Let's do the same for our first experiment with the Construction Set. Look down at the list of cells in the Cell View window and scroll down until you see several cells all with names starting with Arkngthand. Select any one of them (it doesn't matter which at this point). Then pull down the "World" menu at the top of the screen and select "Interior Cells...". A dialog box will appear. There are a number of options in the dialog but the ones we are interested in are the three values for "Ambient". This controls the general brightness in the cell and the three settings allow for different values for red, green and blue so you can make the general lighting any color you wish. Values here can range from 0 to 255 so let's set red to 150 and blue and green to 80. This will make it a good deal brighter but will also give everything a reddish tint which will still make the area look strange. Hit "Apply" to tell the Construction Set to use our new values then go to the next cell. There are two ways to do this. We can close the dialog and select the next cell from the Cell Window but the easiest way is to use the pull-down menu at the top of the dialog. Just select the next cell and make the changes. Do this for all of the Arkngthand cells. When you are done, close the dialog then select the File menu and "Save...". A standard file dialog will appear asking for a file name. The Construction Set is about to create a new plug-in file containing our changes to Arkngthand. We can call this file anything we like but it may be convinent to think a bit. It will probably be best to name our file something meaningful so we will know what it is if we find ourselves at some point in the future with dozens of plug-ins. We also want to come up with a fairly unique name so that we won't have a situation where we and another plug-in creator both name our files the same thing. I avoid the latter problem by putting the first few letters of my name as the start of my file name and the former by using a descriptive name. So, I would call this file "Tans More Light.esp". Enter whatever you like, hit save then exit the Construction Set. Now we need to tell Morrowind to use our new plug-in. Launch the game and on the initial menu screen select "Files". You will see a list of all esm and esp files available. Scroll down until you find your plug-in and toggle the checkbox next to it then return to the main screen. Start the game, load your most convinent save and go visit the brightly lit Arkngthand. 'I Attack the Darkness!'OK, with Arkngthand brightly lit it was a simple matter to find the Puzzle Box for Hasphat Antabolis. Now, Shaun gra-Muzgob wants you to find a skull in the Andrano Ancestral Tomb. Uh-oh. Underground again. There are a lot of caves, tombs and other dark places in Morrowind and it is going to get really tiring to keep changing their lighting one location at a time. So, let's approach the problem from a different angle. There is a spell in Morrowind called "Night Eyes" which lets you see in the dark but the spell only lasts for a short while and if you are a starting player you can't cast it very well or very often. There are magic items. It is possible to enchant a magical item to cast a Night Eyes spell for us but even items have their limitations. The spell only lasts for so long (again), the item runs down and you have to wait for it to recharge itself (or burn a lot of soul gems recharging it yourself). And, of course, you either have to pay someone within the game to create one for you or create it yourself and that introduces difficulties of its own. (See Better Living Through Alchemy if you decide to go that route.) So, let's create an item that allows us see in the dark. We'll create a "Night Vision Helm" and place it in the game for our character to find. Start by launching the Construction Set as usual, select morrowind.esm as the file to work with and select no other files (and thus have no active file). Once everything is loaded look at the Object Window on the left. Since we are creating a Helm, click on the "Armor" tab. The window will fill showing every item of armor in the game. We aren't modifying an existing item so right-click anywhere in the Object Window and select "New..." from the menu that pops up. The Armor dialog appears. Every item in Morrowind has two names. One is what everyone in the game calls the item while the other is an identifier used by the game engine to keep track of things behind the scenes. Now, we can call our new item whatever we want in the game but the identifier has to be unique; we don't want to accidentally destroy another item in the game and we also need to try to avoid picking an identifier that will conflict with the name chosen by another plug-in designer. We can get around this by following the same standards we did with our plug-in names and prefixing the identifier with the first few letters of our name. So, for Item Name enter "Night Vision Helm" and for Identifier enter "tans_night_vision_helm". (The underscores are not strictly neccessary but it seems to be the convention that Bethesda follows for the most part.) Now we need to tell the Set about our item. For weight let's put 2.0 which will make it light armor. Let's set Armor Rating at 5 (so it isn't too powerful), Health at 1000 (so it won't break too fast) and Cost at 5000. (Just suggestions; put whatever you like for these.) Next we need to decide what our helm looks like. We'll decide that our helm is a Dwemer artifact so we'll make it look like a Dwemer helm. Note the two buttons labled "Add World Art" and "Inventory Image". Start by clicking "Add World Art". A standard file dialog will appear. Make sure you are pointing to the drive containing the Construction Set CD and look in the "Data Files\Meshes" folder. You should see a bunch of folders all labeled a, b, c and so on. These all contain data files defining what an object looks like in the game. Open the "a" folder and scroll over until you find "A_Dwemer_Helmet.nif". Select this and click "Open". Now we need to define how the icon representing the helm will appear in our inventory. Click on the "Inventory Image" button and a "Select Image File" dialog will appear. Again, make sure you are pointing to the "Data Files\Icons" folder on the Construction Set CD. Now, there are two types of Icons used by Morrowind. Pull down the "Files of type:" menu at the bottom of the dialog and select "Morrowind TGA Icons (*.TGA)". Then, open the "a" folder and scroll over to "TX_Dwemer_helmet.tga". Select this and click "Open". That done, we need to define how the helmet is actually used. Pull down the first menu under "Biped Object" and select "Head". Then, pull down the first menu under "Male Armor" and select "a_dwemer_helmet". Helmets work the same for both male and female charcters so there is no need to select anything under "Female Armor". Finally, we need to add the enchantment to our helm. In Morrowind the enchantment on an item is separate from the item itself (so the same enchantment can be placed on multiple items if neccessary). We don't have an enchantment for our helm yet so let's create it now. Click the "Save" button to close the dialog we have been working with then click on the "Enchantment" tab on the top of the Item Window. As before, right-click inside the window and select "New...". We are now looking at the Enchantment dialog. Enchantments like this are only used internally so they don't have names but we do need to give it an Identifier. We'll call this one "tans_night_vision_helm_EN". (The "EN" at the end is just to let us know we are looking at an Enchantment and also seems to follow Bethesda's usual standard but again you can call it whatever you like.) We now must define how the Enchantment works. We want this item to always be "on" so use the pull-down at the top right to select "Continuous". (Several fields become greyed out since we don't have to define how much magicka the item has and how much is consumed with each use.) Each row in the dialog allows us to assign a different effect to the enchantment. Pull down the first box on the top row and scroll down to "Night Eyes". The boxes at the end of the row define the effect range so enter 70 for both to give us a constant 70% effect. (I advise against setting it to 100 as it looks fairly strange within the game if you do. If you don't like the value you can always edit the plug-in later and change the value here.) We aren't adding any other enchantments to the item so click "Save" to close the dialog. Switch back to the Armor tab and scroll down until you find our helm. Right-click on it and choose "Edit...". Now, use the pull-down at the bottom of the dialog labeled "Enchantment" and scroll down until you find the enchantment we just created. Select it then exit this dialog as well. We have now created the item and all that is left is to place it in the game. Since it is a Dwemer artifact, let's place it in our favorite Dwemer Ruin of Arkngthand. In fact, let's place it in the same room as the Dwemer Puzzle box. Go to the Cell Window and scroll down to "Arkngthand, Cells of Hollow Hand" and select it. A listing of all items in the cell will appear in the right half of the Cell Window and a view of the cell will appear in the Render Window above. What you probably see is a small clump in one corner since the view always seems to start fully zoomed out. The easiest way I have found around this is to select any of the items in the cell (by double-clicking on the item in the Cell Window) and hitting the "c" key. This causes the Render Window to center on the selected object and zoom in on it. In fact, you will probably have to zoom out some by using the mouse wheel or the + and - keys. You move around inside the Render Window by using the mouse. Clicking selects items (and you can select multiple items by clicking and dragging a box around them) and you move items by dragging them. Be careful; it is very easy to accidentally click the wrong thing and drag the floor out of the room or drag items in it through the walls. Undo (from the Edit menu) comes in very handy here. The Render Window is a three dimensional display and you can move the display using the mouse and keyboard. While holding the space bar move the mouse left or right or up and down to move the display around. Hold down the "shift" key and move the mouse up or down to to "tilt" the display towards or away from you and move it left or right to "rotate" the display around the selected object. Using these methods, manuver the display around until you are looking more or less "down" on the room. Now, select the helm in the Item Window and "drag" it into the Render Window. Don't release the mouse until the helm is over the room. (I try to position things over a shelf or crate so they will be sitting on an object but you can leave things in the middle of the floor if you like.) The helm is now "floating" somewhere over the cell. You can move the helm around in the view window by dragging it with the mouse. If you hold down the "Z" key on the keyboard, you can move the helm up or down. (If you are already looking "down" on the cell, you may not notice much difference when you do this but moving an item "down" until it is closer to the room can help in positioning it.) Move the view around in the Render Window to make sure the helm really is above the floor of the room; because of the way the three dimensional view is displayed on your two dimensional screen it may appear as if the helm is over the room when in reality it is in front of or behind it. When you are satisfied as to the location of the helm, make sure it is selected and hit the "F" key on your keyboard. This causes the helm to "fall" into the display, stopping on the first horizontal surface. If you don't want the helm on the top surface (say you want it on a lower shelf for example) hit "F" again. Just be sure you don't drop the helm through the floor of the room. If you don't like the way the helm is facing, hold down the right mouse button and drag left or right; this rotates the helm around its vertical axis. Now we're done. Save the plug-in, call it something like "Tans Night Vision Helm.esp", exit and launch the game. Select the new plug-in from the Files menu, load your saved game then travel to to Arkngthand and find your way to the Chamber of the Hollow Hand. Look around and you should find the helm, right where you dropped it. 'Life! Life! Give My Creation... Life!'OK, we've created our helm and placed it in the world. You can use the helm yourself and anyone you give the plug-in to can use it as well. But, how does anyone know the helm is there? Let's take the next step and create a mini-quest around the helm. That way our helm becomes an integral part of the Morrowind world. Now this is quite a bit more complicated than the very minor edits we have been doing so far, so it will be in our best interests to stop and think a few minutes about what we are planning to do. Let's add an NPC to the game who will tell our player about the helm and ask the PC to retrieve it for them. (Hey, everyone else in Vvardenfell wants you to do something for them, so why not?) Let's also decide that the NPC is an untrustworthy sort who plans to insure our PC's silence by killing them as soon as we return with the helm. This gives us enough to get started. From this, we can create a mini-quest complete with custom dialog options and journal entries. There are a few details we still have to work out but we'll take care of them as we come to them. As usual, start by firing up the Construction Set. It probably makes the most sense to add our new quest to the same plug-in as the helm, so for data files select the morrowind.esm and the "Tans Night Vision Helm.esp" files and make the "Tans Night Vision Helm.esp" file the active file. When everything has loaded, select the NPC tab in the Object window, then right-click anywhere inside the window and select "New...". The NPC Dialog will appear. As before, we have an internal ID and a Name. Let's name our new NPC "Kalyn Faloran" and give him an ID of "tans_kalyn_faloran". (As usual we are prefixing our IDs with our name to avoid possible conflicts with other plug-ins. Note that Bethesda doesn't use underscores in its IDs here but I prefer using them for consistency.) Again, you are free to choose whatever name and ID you like. Most of the initial choices should be obvious and you can select whatever you like but here is how I defined Kalyn. For Race I chose "Breton" and I picked "Nightblade" as his class and made him level 5. I decided to leave him male so I didn't select the "Female" checkbox. I also decided to not make him part of a faction so I left both of the "Faction & Rank" boxes blank. The two boxes at the top right define how the NPC looks. I selected "B_N_Breton_M_Head_07" and "b_n_breton_m_hair_01". Leave the "Essential", "Corpses Persist" and "Respawn" checkboxes blank. Note that most of the "Attributes" boxes are greyed out. You can change these if you like by unchecking the "Auto Calculate Stats" checkbox but I'll just leave them alone. I'll also leave the skills alone as well. (If you want to change his skills, right-click on a skill then left-click and it will let you change the skill level.) Now Kalyn is pretty much defined but he's also naked at the moment. We need to give him something to wear as well as some armor and a weapon or two. Leave the NPC dialog open and click on the "Clothing" tab in the Object window. Scroll down until you find "common_pants_03". Click on the item, drag it to the "Item" window in the NPC dialog and release the mouse. The "common_pants_03" should appear in the Item list. Do the same for "common_shirt_03" and "common_shoes_03". Then, switch to the "Armor" tab and give him a cuirass and shield then go to the "Weapon" tab and drag over a weapon or two. Do the same for any other items you may want him to have. You can now click on the "Spells" tab to select which spells the NPC knows. There are already a good number here but you can add more by selecting the "Spellmaking" tab in the Object window and dragging the spell onto the "Spells" window. You can remove spells by clicking on one to select it then hitting the "Delete" key. Finally, click on the "AI" button at the bottom of the dialog. We are only interested in the "Wander" package which should already be present. (You may have noticed that Morrowind NPCs don't stay in one place but wander around a bit; this is the routine responsible for that.) Double-click on the "Wander" package and, on the dialog that appears, change the "Distance" to 25. This will let our NPC move around a bit but keep him more or less where we want him to. Click "Save" to get out of the Wander package window, "Save" again to exit the AI package window then "Save" a third time to close the NPC dialog. (We get all the way out because sometimes the Construction Set doesn't let us continue until we save the NPC.) Select the "NPC" tab in the Object window and scroll down until we find our NPC. (This is probably a good time to point out that we can sort the window on any column by clicking on the column name. So, click on the "ID" column heading to sort by ID or on the "Name" column heading to sort by name.) When we find our NPC, right-click and select "Edit...". When the NPC dialog appears, click on the "Dialogue" button at the bottom. It will take a few seconds but eventually the Dialogue dialog will appear. Now, Dialogue editing in the Construction Set is a bit less than intuitive. There are a lot of options and screens available from this window. To make things easier, I'll be explaining them as I use them, so don't worry about everything you see right now and just follow along. The first thing you should notice is a list of dialogue topics on the left side of the window. These are the topics the NPC already knows about. Do not delete any of these topics. Dialogues for all NPCs in Morrowind are stored in a single database and if you delete these then Very Bad Things™ will happen. You have been warned. At the very top of this list you should see several tabs. There are more tabs than will fit, and you can scroll left and right through the tabs by using the arrows to the right of the tabs. Scroll through the tabs until you find the "Greetings" tab and click on it. In Morrowind, a "greeting" is what an NPC initially says to you when you start talking to them. There are ten "categories" of greeting, titled Greeting 0 thru Greeting 9. The general categories are:
As you can see, some of the categories are fairly arbitrary. The important thing to know is that the game will start with Greeting 0 and search forward until it finds the first greeting that applies. This is the standard behavior for the Dialogue system. Since we are creating a mini-quest we probably want our new greeting to be part of Greeting 5. (We don't choose Greeting 1 since that would allow us to interact with our NPC even if we were a vampire or werewolf or suffering from corprus or some other disease, which normally we shouldn't be able to.) This gives us our first problem; we don't have an entry for Greeting 5! The reason is that we are "filtering" the dialog options to only show those that apply to our new NPC. Look down at the bottom left of the window. You should see a drop-down labled "Filter for" with "tans_kalyn_faloran" selected. Select this drop-down and scroll all the way to the top to a blank line. Select that and a lot of additional information will suddenly appear. At the top-right of the window you should see a pane labled "Info/Response". Right now there should be a lot of information there. There are some interesting things here but we are creating a new dialogue now, so right click inside the "Info/Response" pane and select "New". A new blank dialogue line will appear. (The new dialogue will appear at the point that your right click. You can add your new dialogue anywhere in the list but I prefer to scroll all the way to the bottom and add it there. This is because the dialogue you click on gets marked as "changed" when you add the new line and we want to avoid making any more changes than we have to.) Directly below the "Info/Response" window is a large text box. With the dialogue line you just entered selected, click in this box. (Your new dialogue will probably change to say "Empty". This is fine.) In the box, type
What we have done is tell the game that when we first talk to our NPC instead of giving a standard greeting he will ask us for our help. The odd-looking word "%PCName" is a variable that will be replaced with the name of the PC when the dialogue appears. OK, there are two problems with what we have done so far. First, our NPC will say this every time we talk to him. Also, we have added this as a universal comment, so there is now a chance that every NPC in the game will try to say this to us! Obviously we don't want either of these, so let's set some limits on how this will appear. Just below the text box you should see the "Speaker Condition" pane. This lets us set limits on when the dialogue appears. The first, obvious one is that we only want our NPC to say this line. Look at the drop-down menu labled "ID". Select this and scroll down until you find the ID for our NPC. (tans_kalyn_faloran in our case). Select this. Now, only our NPC has this dialogue. You will note that there are several other options below "ID". These allow us to limit dialogues in other ways. For example, we can set dialogues that will only be spoken by members of a particular race, class or faction, only by NPCs of a particular rank, by any NPC located in a particular Cell, or by anyone if the PC is of a particular faction or a particular rank. This would let us add a new greeting to be spoken by everyone in Balmora if we wanted to, or by all Argonians, or by everyone if the PC was a member of the Morag Tong, or whatever. There are also a set of boxes labled "Function/Variable". These allow us to put further restrictions on when the dialogue is used. Pull down the first box on the first line and select "Function". Select "Talked To PC" from the second box, "=" from the third and "0" from the fourth. What we have just done is tell the game that this dialogue option will only appear if this character has never spoken to the PC before. If we have talked to him even once before, it will not show up. (You may be curious about some of the other options available here. We'll get to some of them later.) We have one more thing to do. Our NPC has just asked for our help with a problem so we need to have a way of asking him what it is. Look at the very bottom of the window and you will see a box labled "Result". Here you can add scripting code to cause things to happen within the game. In this case, type
This will cause "a little problem" to appear in the list of possible conversation topics. Now, since we've just added a new conversation topic, we had better go define it. Go back to the "Topic" tab (using the arrows above the topic list if neccessary). Right-click inside the list and select "New". A blank will appear in the topic list. Enter "a little problem" (without the quotes). You may be wondering why I am using "a little problem" instead of "a_little_problem" or "tans_a_little_problem" like my usual convention has been. The reason is that the topic text has to be exactly as it appears in the dialogue. You may have noticed that when you are talking to an NPC, the topics you can talk to them about are highlighted in their dialogue text. This is because the game searches through the entire topic list and highlights any words or phrases that match a dialogue topic for that NPC. So, we have to name the topic exactly the way it will appear. In our case, when our NPC says his greeting of "I don't suppose you could help me out with a little problem?", the phrase "a little problem" will be highlighted. This means that you have to be careful when adding dialogue topics. It should be safe to reuse an existing topic as long as you have the Speaker Conditions set properly but it is something you need to be aware of. OK, back to our dialogue. With our new "a little problem" topic selected in the topic list, right-click inside of the "Info/Response" window and select "New". Then, in the large text box, type:
Under "Speaker Condition", pull down the menu under "ID" and select "tans_kalyn_faloran". Then, in the "Result" window, type:
We've done several things here. First, we have added "Night Vision Helm" as another conversation topic. This will let us talk to the NPC some more about our artifiact. Since he mentions Balmora we'll also add it as a topic just in case the player decides to talk to him about that too. Finally, we're putting an entry into the player's journal about the helm. This is the purpose of the "Journal" command. The "tans_night_vision_helm_JO" is an identifier for this set of topics in the Journal; think of it as the identifier for the quest. The 10 is an "index" for which journal entry is being created and is basically an indicator of how far along the player is in the quest. Basically, each time the player reaches a milestone in a quest it is a good idea to put an update into their Journal noting this. That way the player is kept apprised of their success and we can use the Journal to keep track of what they have accomplished so far. We're almost done here; we've identified another conversation topic and a Journal entry, both of which we now need to go define. But, before we go, let's do one more bit of housekeeping here. Right now this dialogue will appear every time the player asks our NPC about "a little problem". We don't want to keep adding the same Journal entry over and over again and probably don't want to keep giving the same explanation over and over either. So, let's define a second dialogue that the NPC will use if they have already told the player about their problem. Once again right-click inside the "Info/Response" pane and select "New". Then, in the text box, enter:
Under "Speaker Condition" set the "ID" to "tans_kalyn_faloran". Then, under "Function/Variable", pull down the first box and select "Journal". Set the second box to "tans_night_vision_helm_JO", the third to ">=" and the fourth to "10". What we have done is tell the game that whenever we talk to this NPC, check to see if the journal index for the quest "tans_night_vision_helm_JO" is at least 10. If it is, then the player has already talked to the NPC about "a little problem" at least once and so we don't need to go into the details again. (We use ">= 10" as opposed to "= 10" because it is possible that the player is further along in the quest. It is usually a good idea to test this way since we don't know what our player may have been up to.) OK, there is one final problem. When deciding what dialogue to use, the game starts at the top of the list and works its way downward; it stops at the first topic for which all of the "Speaker Conditions" are matched. Our first dialogue, the one that starts "I was part of an expedition..." only requires that the speaker be our NPC. The one we just added requires our NPC and requires that the Journal index for the quest be at least 10. Since the conditions for the first dialog will always be satisfied, if we don't change anything else then only the first dialogue will ever be used. What we need to do is make sure the most specific dialogues are always at the top so that they will get checked first. Highlight the "I was part of an expedition..." line and hit the right arrow on your keyboard. This will move the dialogue down one line in the "Info/Response" pane. Now the "I really need to get that helm back" dialogue is at the top and will be checked first. If the journal topic is at least at index 10 then the player has been given the quest and the NPC gives this response. Otherwise, the game checks the next line and the whole explanation is given. In general you will want to do this for all dialogues. Put the most specific responses at the top and the more general ones at the bottom. You should try to make sure your last response will be general enough that it will always be used. That way your NPC will always have something to say on a topic. All right, we're done with this topic. Let's go look at the Journal entries. Use the arrows at the top of the topics list to scroll over to "Journal" then select that tab. As before, right-click in the topics list, select new and, when the box appears, enter "tans_night_vision_helm_JO". Once again we have an "Info/Response" window though here most of the "Speaker Condition" fields are greyed out. Right-click inside of this pane and select "New". Then, in the text box, enter
Finally, in the "Speaker Condition" pane, enter 10 in the "Index" box. That's all we have to do here. When the 'Journal "tans_night_vision_helm_JO" 10' command is executed, this set of text will appear in the player's Journal. While we're here, let's go ahead and enter the rest of our Journal entries. For each of the following, right-click in the "Info/Response" pane, select "New" then enter the following text.
And, finally...
As you can see, the index increases as the player gets further into the quest. You can set these indexes to anything you like (as long as they are unique within a quest) but it makes it easier to add new steps if you space them out. That takes care of all of our Journal entries. We have added a few that we haven't referenced yet so let's take care of those now. Scroll back to the "Topic" tab, right-click in the topics list, select "New" and enter "Night Vision Helm". Now, right-click in the "Info/Response" pane, select "New" and enter
In the "Speaker Condition" pane set the "ID" to "tans_kalyn_faloran". In the "Result" pane, enter:
This gives a bit more background information about the helm and adds another entry into the player's Journal. Now, add another new entry in the "Info/Response" pane and enter:
Under "Speaker Condition", set the "ID" to "tans_kalyn_faloran" and, under "Function/Variable", set the first line to read "Journal tans_night_vision_helm_JO >= 20" and the second line to read "Item tans_night_vision_helm = 0" The first of these two "Function/Variable" lines means only give this response if the Journal index is at least 20 while the second means to do so only if the helm is not in the player's inventory. In other words, we only get this dialogue if we have 1) already asked the NPC about the "Night Vision Helm" topic at least once and 2) don't have the Helm. Now, obviously this is a more specific response than the first one we entered so highlight it in the "Info/Response" pane and move it before the "It's a Helm that is enchanted..." dialogue. Finally, we add the dialogue for when we return with the Helm. Right-click in the "Info/Response" pane, select "New", then enter:
Then, under "Speaker Condition", set the "ID" to "tans_kalyn_faloran" and, under "Function/Variable", set the first line to read "Journal tans_night_vision_helm_JO >= 10" and the second line to read "Item tans_night_vision_helm >= 1". Finally, under "Result", enter:
We have done several things here. First, this response will only appear if 1) we have talked to the NPC about starting the quest (in this case, we have at selected the "a little problem" topic at least once) and 2) have the Helm in our inventory. If this condition occurs, we 1) update the player's Journal, 2) start a fight with the PC and 3) end the conversation. You will notice that we check against a Journal index of 10, not 20. This is because the player may have gotten the "a little help" topic then left to find the Helm without ever asking more about it. On the other hand, it is possible that the player has found and taken the helm before ever speaking to the NPC and we want him to have at least told the player that he is looking for the Helm before attacking him; otherwise it is a bit unfair to let the player be attacked out of the blue. Of course, if you want the player to be attacked without warning then you can simply remove the Journal check. Actually, you can go back to the Greeting tab and add the Item check to an entry there. That would mean the player could get attacked the very first time they ever talk to the NPC! OK, we are done with our Dialogues but there is one more thing we need to do. Close the Dialogue and NPC windows (remembering to save our changes first) then save the changes to the plug-in. Now, switch to the "Armor" tab in the Object window and scroll down to the tans_night_vision_helm. Either double-click on it or right-click and select "Edit" to bring up the armor dialog. Notice the blank line in the dialog labled "Script". We are going to add a script to our helm so that a message will be added to the player's Journal when the Helm is found. Click on the "..." to the right of the "Script" box to bring up the Script Editor. Since the Helm doesn't have a script (yet) select "New" from the "Script" menu. Then, enter the following: begin tans_night_vision_helm_SC short updatedJournal if ( OnActivate == 0 ) Return endif if ( updatedJournal == 0 ) if ( GetJournalIndex, "tans_night_vision_helm_JO" >= 10) if ( GetJournalIndex, "tans_night_vision_helm_JO" < 40 ) Journal, "tans_night_vision_helm_JO", 30 set updatedJournal to 1 endif endif endif Activate end tans_night_vision_helm_SC Scripts are like small programs which run when called. In this case, this script is run whenever an interaction with our Helm occurs. The first line simply defines the name of the script, "tans_night_vision_helm_SC". Next, we define a variable called "updatedJournal". We will use this to prevent us from updating the player's Journal more than once. The next thing we do is see if we are "activating" this object. Every item in the game has a default action which occurs when it is activated; items are picked up, doors and containers are opened, books are read and NPCs are talked to. If we are doing anything other than trying to activate this object then we don't want this script to run so we "Return" or exit without doing anything. Next we need to see if we have already updated the player's Journal. If we have not, we then check to see if we need to do so. We only want to update the Journal if 1) we have been told by the NPC to look for the helm and 2) haven't attempted to return it to him and been attacked. (This is to avoid odd cases where the player finds the helm before talking to the NPC, attempts to return it, then later puts it down and picks it up again. We don't want a journal entry created in this case, thus the check.) Assuming the quest is active, we add the entry for index 30 to the Journal. We then set the "updatedJournal" variable to indicate that we have done so. Finally, we call the "Activate" function ourselves so that the game will continue with whatever it needs to do. In this case that means the Helm will be picked up. Save the script then exit the script editor. Now, make sure the script we just created is entered in the "Script" window in the dialog. If it isn't, pull down the menu, scroll down to tans_night_vision_helm_SC and select it. Hit save to return to the Object window. OK, so our quest is in place but what if our players won't cooperate? Suppose they just walk past our NPC and head into the ruins, take the Helm and leave without ever seeing any of our work. Poor Kalyn Faloran... He's standing out there in front of Arkngthand and no one wants to talk to him. Let's give Kalyn a bit of an attitude. We'll change things so that Kalyn will approach the player with his problem instead of waiting for the player to talk to him (and learn a bit more scripting in the process). Switch to the NPC tab and scroll down to Kalyn Faloran then double-click on him to bring up his dialog. We're going to add a script to Kalyn so click on the "..." to the right of the "Script" box to bring up the editor then select "New" from the "Script" menu. Enter the following: begin tans_kalyn_faloran_SC float timer short done if ( done == 1 ) Return endif set timer to ( timer + GetSecondsPassed ) if ( timer > 5 ) if ( GetDistance, Player <= 500 ) if ( GetLOS, Player == 1 ) ForceGreeting set done to 1 endif endif set timer to 0 endif end tans_kalyn faloran_SC There are several new concepts here so let's go through the script. As before, the first line simply defines the name of the script. Then we define two variables, timer and done. Notice that we call done a "short" and timer a "float". In general, a short is the same as an integer (whole numbers like 1, 5 and -3) while a float is a "real" number (numbers with decimals like 1.7, 2.315 and 3.1415929). We are using done as a flag so all we need is an integer but we are going to be keeping track of fractions of a second with timer so we need the decimal there. Next, we check to see if done is 1. If it is, then Kalyn has already talked to the player once. Since there is no reason to keep pestering the player, we leave the script without doing anything else. Skip the section with the timer for a moment and go down to the "if (GetDistance, Player < 500)" line. What this does is look to see how far away the player is from whatever is running the script (in this case, the NPC Kalyn Faloran). The distance is in internal game units and there are about 20 units to a foot, so 500 units is around 25 feet. We then need to make sure that Kalyn can actually see the player. That is the purpose of the next line. If the player is invisible or successfully sneaking then this check will fail. When the player is both close to and visible to him, we force Kalyn to start talking to the player. We then set our done flag to prevent him from trying to talk to the player over and over. Now, let's back up and look at those timer statements we skipped. To understand what we are doing here you first need to know a bit more about how Morrowind runs scripts. In Morrowind, scripts are almost always attached to objects. Whenever the player is in a cell, the scripts for every object in that cell as well as the scripts for every object in every adjacent cell (basically, everything that is potentially visible) are constantly running. Each script executes once every time the screen is updated. So, if your frame rate is 20 frames per second then every script executes 20 times a second. The flip side of this is that every script has to finish before the screen can be updated. This means that if you have a script that takes a long time to run, it will cause the player's frame rate to drop whenever the player is in the cell with the object that owns the script or in an adjacent cell. This happens even if the player isn't even trying to do anything with the object in question. This explains why need need things like our done flag and this timer check. The "GetLOS" function we are using is a bit slow and if our script tried to call it every time it ran it would cause a noticable slowdown whenever the player was in the cell. So, we use a timer and only run our check once every five seconds. GetSecondsPassed tells us how much time has elapsed since the last time it was called. We keep a running total of the time and only perform the range and visibility checks when five seconds have elapsed since the last check. Save everything and go back to the Object window. We only have one thing left to do and that is to place our NPC in the world. We want him to be near Arkngthand so locate the cell containing the entrance (I'll save you the trouble of searching; it's "Molag Amur Region 0,-2") and double-click on it in the Cell View window. When the Render Window has loaded, move it around until you can see the area in front of the entrance to Arkngthand. Switch back to the Object window and click on the "NPC" tab then scroll down to our NPC. Then, simply drag him from the Object Window into the Render Window. Make sure he is over an open area, then hit "F" to drop him to the ground. And, we're done! Save the plug-in and exit the Construction Set then launch Morrowind, make sure the plug-in is active, load your most convinent save game and head for the entrance to Arkngthand. You should find Kalyn Faloran standing there waiting for you. Good luck. By now you should have a good idea of what can be accomplished with the Construction Set. The few examples here have been quite basic, but keep in mind that literally the entire game was created this way. With a little bit of effort, you too can add a new epic quest to the Morrowind world. Morrowind, The Elder Scrolls and all related characters and elements are © & ™ by Bethesda Softworks. All rights reserved.
|
|
|
|
|
Dennis Matheson - tanstaafl@earthlink.net
Last Updated: April 19, 2006
|
|