|
Doombuggie41
Acolyte
Joined: Sat Feb 21, 2009 11:36 pm Posts: 385
Activity Points: 0
Donate
Reputation: 1
Location: The Ocean State
Has thanked: 0 time
Have thanks: 0 time
|
 Oblivion Tutorial Part 2: Making a Basic Quest
Oblivion Tutorial Part 2: Making a Basic Quest
Introduction
So you followed the tutorial that showed you how to add a single line of Dialog to an NPC and you thought, that was a lot of work just to get the NPC to say hello. If you did not, then you need to read that tutorial first.
Believe it or not, that tutorial taught you how to make a quest and we need you to have that quest handy for this tutorial. It did not teach you how to control a quest and a quest without controls is not a quest at all, its a mess. Now you know the basics of adding dialog, its time to explain the parts the other tutorial failed to explain. In this tutorial I will show you how to turn that 1 line of dialog in to a real quest with conditions nice green arrows and a reward for the player. This is what I call the BASIC quest, that means additional tutorials on making it more fun may follow.
Making a Real Quest.
In the previous tutorial we made a quest called "MyQuest", yours may have a different name. Open that quest in the quest window again. Do you remember where the quests option is ? It is in the character menu, just scroll down and you will see it. Find your quest and select it. Right, lets make some changes to your quest so it is more what we want.
In Quest Data change the Quest Name to "The Sword of Tiber Septim".
Now click on Topics, do you see Myquest1 or what ever you called yours, select it. See the the one line of Topic Text ? It says ""Ooo did you know...", change it to say "The Sword of Timber Septim", now click on the line below it and change the line to say "I believe the sword of Timber Septim is hidden in Horn Cave.", if you want, record the new line and make it an MP3 as instructed in the previous tutorial.
Since somebody has to say this line, we might as well leave it set to MariusCaro, the count of leyawiin.
But we do not want this quest offered until after the player recovers the Armour of Tiber septim for martin. After that point, we want this quest available to the player. So now we have to find the quest where the player recovers the Armour and find the stage when it ends. We need to know this information for our condition that prevents this running too early. So in the quest window, look on the left hand side for quests called MQ (Main Quest), the quest your looking for is The Blood of the Divines, its actually MQ09 and you give the armour martin at MQ09 stage 90. So any time after that is perfect for us.
Now, if we used a script to check for this, we would add these lines to it to make it wait before changing the stage.
CODE If (getstage MQ09 >= 90) Setstage MyQuest 10 endif
If we wanted to do that outside of a quest script, so the line is just waiting to appear when that quest stage is reached during the main plot, we would add a condition to the Topic that basically says Getstage MQ09 >= 90, as you can see it is more or less the say thing except we do not need setstage 10 to make the line available. We only need to do this one way, we do not need to do it in a script AND in the Topic conditions, one or the other will do.
Now I am a scripter and I prefer doing this in a script, but scripting is hard for some so, for this tutorial, we will do it in the Topic conditions. So select the quest window, go to the Topics an select your line "I believe the sword of Timber Septim is hidden in Horn Cave." and then go down to conditions and select new. Now select Getstage, then in Function Parameters select MQ09, next change the == to >= and change the 0.0000 to 90.0, do not worry about any extra zeros on the end. Also please note the decimal point, that's vital you remember that.
We do not want this line constantly offered, so we tick say once and to be doubly careful we right click on our new condition and and we duplicate it.
Now we need to edit the duplicated condition, change the function parameters to MyQuest and the change the >= to == and change the 90.0 to 0.0
Now the Count of Leyawiin will offer this quest if the player has given Martin the armour of Tiber Septim and if MyQuest is still at stage 0. Notice we use stage 0 not 10, it can be done lots of different ways, its just easier this way for this example.
Now in the Result Script box write this.
CODE setstage MyQuest 10
What this does is it set stages MyQuest to 10 once the player has listened to the count say his one line which is "I believe the sword of Timber Septim is hidden in Horn Cave.".
Creating Tiber Septims Sword.
Now we need to do something at MyQuest stage 10 but first we need to make Tiber Septims Sword and put it in a chest. In the object window in the construction kit, scroll down to Weapons, find steel and select the WeapSteelLongsword (Steel Longsword). I am going to show you the correct way to make a unique item in Oblivion so it does not conflict, without needing a new mesh and texture.
Select the sword called WeapSteelLongsword, double click on it then change the ID to say MQSwordofTiberSeptim and then Change the name to "Sword of Tiber Septim". We add MQ to the ID because it makes it easier to find all items for MyQuest later, MQ = My Quest, understand ? But you do not actually need to do that, its just good modding practice if you do. Now Ok that, it will say, Create a new form, SAY YES.
Its VITAL you said yes to that last question, if you did, the original sword will not be edited, a new sword will be created, if you did not, then the old sword would be renamed and you will have created a massive mod conflict. VERY BAD that.
Now scroll down to Containers in the Object Window, find a chest, any chest. Double click on it and change the ID to MQTiberschest and change the name to Old Chest. Untick Respawn if its ticked and delete any items listed as being in the chest. Now ok that and when asked if you wish to create a new form, Say YES. Saying no changes the original, which is very bad, it is same problem mentioned above only this time its for a chest.
Now your a good little mod maker, you have a unique 100% conflict free "Sword of Tiber Septim" and a 100% conflict free "Old Chest", if you do not feel pleased with your self right now, then you should, you just avoided a mistake many mod makers make. You avoided editing an original item and created your own and edited your copy rather than original. When ever you edit anything, you ALWAYS make your own version this way first. ALWAYS, NO EXCEPTIONS (I lie but it is complicated so assume there are no exceptions for now). This is good mod making practice.
On a scale of 1 to 10, the importance of doing it this way is 100.
Editing the Chest Contents.
Find your new chest again and open it, then whilst its open, find your Sword of Tiber Septim and drag it in to the chest. Make sure it has a 1 next to the name. We do not want you to have 2 swords of tiber septim in that chest do we.
Finding Horn Cave.
Now in the CELL View window make sure World Space is set to interiors, scroll down to Horn Cave and select HornCave, now select an item from the window on the right to load horncave in the window that lets you see the cave it self. Now drag and drop your new chest somewhere in that window, with it selected hold down shift or Z to move the chest around the map using your mouse. Place it in the case somewhere on the ground where the player will find it. Then double click on the chest, tick initially disabled, and in the empty Reference Editor ID box give it a name "MychestREF".
Remember we talked about the difference between a REF object and an Editor Master object and how Dialog needed the Masters ID Name, well what we need to do next requires the REF object name not the master. You just disabled the chest so nobody get it until we enable it, that was the REF object being disabled. The master was the chest you selected and dropped in the Cell view window, once it appears in the Cell the Master becomes a REF object. Master objects never appear in a CELL, they only appear in the Construction Sets Object window.
Making the quest work.
Go back to the Quest Window. In Quest stages make sure you have stages 0 10 20 and 30. Now go to Quest Targets, IM going to show you how use the green arrow to point towards the chest. Right click in the Target Ref window and select new. With the new entry selected choose Quest Target Data, notice there's a Select Reference in Render Window button ? Also notice I did not tell you to close the Cell View window. Well press the "Select Reference in Render Window" button and click on the chest you placed in horncave.
What!!!! the pointer stays red...OMG panic..............you idiot, what did you do..slap your self, again...harder...ooo that hits the spot...actually you did nothing wrong, IM just being evil and let you make a mistake that everybody makes. Click on the chest and notice the Persistent Reference Option ? Tick that box. Now select the "Select Reference in render window" again and click on your chest to set the chest as the target for the green arrow.
See it works. This happens when ever an item used in a quest is not persistent. Also NPCs will not sit on chairs if they are not persistent. So you just learned the importance of persistent objects as a bonus. Well done
We need a condition adding for that green arrow, it must only run when our quest is as stage 20. So in conditions, select new, find and select getstage. Now in the Function Parameters find and select MyQuest and the == can be left as === but the 0.0 needs to be changed to 20.0. Once again additional zeros at the end can be ignored. Now that green arrow will only work whilst our quest is at stage 20.
Go to the quest window again, select Quest stages, select stage 10, that's the 10 on its own. Select new under Log Entry and in the white box under the other Log entry, yes there's 2 Log entry boxes, this last one is the one next to the Result Script box. In that Log entry make up a log for the player that says something like "The count of leyawiin told me he believes Tiber Septims Sword is hidden in Horn cave. I should go there and try and find it.
In the Result Script box type these lines
CODE MQTiberschest.enable setstage MyQuest 20
The moment that log entry appears the stage will change and the chest will appear as if by magic in horn cave. Then and only then will the green arrow appear.
Bewarned, the above line will skip anything in a script below stage 20, that script results box takes priority over the script and runs first. So if you need a script to control when your quest changes stages, do not use that Result Script box AND your script, use one or the other. Not both. In fact, do not have anything at state 20 in your script, it will just be skipped unless your careful and have conditions in place to control everything.
Now stage 20 needs to exist because our quest uses it, if it does not exist, we would get an error, but we are not actually going to have any logs for it. But 30 is our last quest log, so select that and select new, In log entry write something like "I have found Tiber Septims Sword in Horn Cave, Woopie Doodie Dandie" or something to that effect Now tick Mark Quest Completed and in the results box for 30 type
CODE Stopquest MyQuest.
Now in the object window, find your chests MASTER, if your looking in the CELL view for it, your looking in the wrong place. To to the Object Window, scroll down to containers, find your Chest. Remember you called it MQTiberschest if you used the name I suggested. Double click on it and then select Script. The script window will appear, select new from the script menu.
Now this next script is an example of how you make the player setstage (advance the quest a stage) a quest just by opening a chest. Cut and paste it in to your new script window.
CODE scn mqmychestscriptSCRIPT
short done
begin OnActivate Activate if done == 0 setstage MyQuest 30 set done to 1 endif end
What the script does is it lets the player open the chest (that's what activate does), it checks to see if the player has already opened the chest, if he has not it sets the quest stage to 30. Remember what log entry you added for 30 ? It went something like this "I have found Tiber Septims Sword in Horn Cave, Woopie Doodie Dandie". So guess what log appears the moment that chest is opened
That's right, so guess what Sword the player will see inside the chest when he opens it.
That's right, the sword of tiber septim.
Save the script, close the script window, close the quest window. Save your mod. Find your chest again, select script if its not already listed as being part of the chest (it may still be empty), if it is empty look for a script called mqmychestscriptSCRIPT and add it to the chest. Now save your quest.
You have just made quest to find "The Sword of Tiber Septim", well done.
BUT do you want to make a clean quest ? one that tidys up after it self when its finished ?
Yes of course you do, go to the Quest Stages tab in Quests, find 30, untick Mark Quest complete, and remove the Stopquest MyQuest.from the results box.
Add a stage 40 and 45.
Select new for 45 and type in this new Log entry.
"Word must have gotten out by now that the Sword of Tiber Septim has been found, IM going to be Famous".
In the result box box add this line.
CODE Stopquest MyQuest
Tick Mark Quest as complete.
Now do you want to make the player famous for finding the sword ? Yes of course you do
Above Stopquest, type this
CODE modpcfame 1
Now when quest ends, the players fame will be increased by 1 point.
Now click stage 30, in the result box type this
CODE Setstage MyQuest 40
Now go to the Quest Data and open up your Quest Script, the one you created in the "Adding Dialog to an NPC" tutorial.
Add this.
CODE If (getstage MyQuest == 40) && ( player.GetinCell ICMarketDistrict == 1 ) MQTiberschest.disable setstage MyQuest 45 endif
Your old script looked like this.
CODE scriptName MyQuestScript
Short my_quest_wants_this_done_once
begin gameMode if (my_quest_wants_this_done_once == 0)
AddTopic Myquest1
set my_quest_wants_this_done_once to 1 endif
end
With the new additions, it will look like this.
CODE scriptName MyQuestScript
Short my_quest_wants_this_done_once
begin gameMode if (my_quest_wants_this_done_once == 0)
AddTopic Myquest1
set my_quest_wants_this_done_once to 1 endif
If (getstage MyQuest == 40) && ( player.GetinCell ICMarketDistrict == 1 ) MQTiberschest.disable setstage MyQuest 45 endif
end
What the new bit does is it waits for MYQuest to reach stage 40 and then next time the player enters the imperial marketdistrict it disables the old chest so it is no longer in the game and set stages to 45 to end the quest. We could do a getdayspassed job on this but that can be complicated for a noobie and it does not work very well anyway and the last thing you want as a noobie is a problem like that. The ICMarketDistrict is actually just the cell name, or in this case the World space name, if it does not work you can replace it with any cell name the player is likely to enter. It will serve the same job.
All it does is it makes sure the player is not in Horn Cave when it disables the chest.
And thats it, you now have a quest to find Tiber Septims Sword and all you had to start with was a single line of dialog.
Final thoughts.
This quest will run once and never run again, a mod reset will be needed to make it usable again in future tutorials IF you do not keep a save made before you started creating this quest. Its important to know that quests that start at te beginning of the game will auto run the moment the game loads. Any save you make after that already has that quest running in it. Which can make tweaking the quest difficult if its already running. So for this reason, always keep a save handy thats not had the quest running in it and use that for testing.
There are several ways to improve this quest now the basic building blocks are there, we can easily add more monsters, have guards follow you and protect you on the quest without editing the quest, but thats for another tutorial. All you need to know right now is that this is the core quest, the part you test before you make it too difficult to test on your own. You play this light weight version to death as a mod maker, making sure this version works correctly before you add anything fancy bits I will be telling you about in future.
Next time we will cover topics like Parent objects, how to use conditions to make sure packages run on NPCS at the right time and use these to make this quest one hell of a battle.
Enjoy.
giskard
_________________

|