Difference between revisions of "Simple custom courier"
imported>Thingy Person m |
imported>Vincentd m |
||
Line 1: | Line 1: | ||
{{WarningBox|This tutorial is unfinished, therefore unusable. Until someone comes along and finishes it, do not waste your time.}} | |||
== A Simple Custom Courier == | == A Simple Custom Courier == | ||
Revision as of 20:06, 9 August 2015
A Simple Custom Courier
This page is about how to make a courier that is similar to the courier in the base game, but not as complex.
This operation requires:
- Creation Kit
Please note: This quest requires dialogue! It does not have to have actual recorded lines to work, but this particular tutorial does not use the original courier's dialogue at all, so your courier will say nothing unless you record the lines you want him/her to say.
You will be creating several things for your courier, these will be explained in some detail but not exhaustive detail as it is assumed the user has some idea how to use the Creation Kit. They include:
- A new actor (the courier)
- A new container
- A new global variable
- 2 new AI packages
- A new quest with several aliases, dialogue, some script (papyrus) fragments and a primary script.
Create the Courier's Essentials
In the Creation Kit, create a new Actor that will be your courier. You can do this by going to Actors --> Actor in the Object Windows and changing the editor ID of an existing actor (like the original courier, for example) or you can create a new NPC by right-clicking in the list of actors and clicking "New". Another term for an actor is NPC or Non-Player Character; the terms actor and NPC will be used interchangeably.
- Once you have created your courier, go to the Cell View window and make sure the dropdown menu for World Space is " Interiors". Within the list below this menu find "WICourierCell" and double-click the name of the cell. The cell will appear in the Render Window. Click and drag your created courier into the middle of the room from the NPC list in the Object Window.
- Create a container that the courier will use to house the letters that he/she will deliver to the player. The original courier uses a barrel specially named "WICourierContainer" which is suitable for this purpose.
- Place an X marker near your courier's position in the room (in the Object Window, select All and search for "Xmarker"). This X marker must be inside the room and allow the courier to be teleported onto it.
Now that those items have been placed, give each of them a UNIQUE editorID (i.e. each of those three things will have a different editor ID). You can use something like "MyCourierContainerRef" and "MyCourierRef" etc.
Global Variable
The courier heads out when a Global Variable is set to higher than 0, so we need to create a Global Variable for our courier. Go to the Object Window --> Miscellaneous --> Global. Right-click in the list and click "New", then enter in a name for the variable. The radio button should already be set to "Short" and the Value should already be "0". Leave them as they are.
AI Packages
Next you will need to create (er, basically you will just copy the existing courier's packages) AI Packages for your courier. Go to the Object Window --> Character --> Package and enter "courier" in the search box. You will see a few packages but you want the two that are "WICourierDeliverToPlayer" and "WICourierWaitForPlayer". Double-click the "WICourierDeliverToPlayer" package and give it a new ID, however KEEP the phrases "DeliverToPlayer" and "WaitForPlayer" in the ID so you know which is which. Do the same for the other package. You will edit these again later.
Create the Courier's Quest
- In the Object Window, go to Character --> Quest. Right-click in the list of Quests and click "New". Give the quest any ID you want, and the name can be blank or anything at all, the player will never see it.
- Set Priority to 40
- Click the dropdown menu for "Event" and choose Change Location Event. This means that the Story Manager will check to run this quest when the player changes location.
- For quest type, choose None.
- Click the OK button to create your quest (the Creation Kit needs you to create the quest first before it can be fully used)
Now we have to add aliases to the quest, these are very important. Open up your quest again and go to the Quest Aliases tab. Make sure your courier and the things we added in his/her cell are visible in your Render Window, it will make this easier. Here we go:
- Right-click in the empty field and select New Location Alias. Type in "Location" for Alias Name, and click the radio button for "Find Matching Location", then click the "From Event" checkbox. The dropdown menu should say "Change Location Event", if not, change it to that. Click the next dropdown menu and select "New Location. This makes it so that the quest recognizes when a player enters a new location and gets that location's information for the courier.
- Add a New Reference Alias, name it "LocationCenterMarker". Click the Location Alias Reference radio button, and make sure the following dropdown menu is "Location" and the RefType is "LocationCenterMarker".
- Add a New Reference Alias, name it "Courier". Click the "Specific Reference" radio button and click the box next to it labeled "Select Forced Reference". Click "Select Reference in Render Window" and double-click your courier when it brings you to the Render Window. If you have not given your courier an editorID, you will not be able to select him/her! You will need to add a few more things to the courier alias later.
- Add a New Reference Alias, name it "Container". Like with the courier, select the Specific Reference radio button etc. and select the container you put in the courier cell. Once again, if it doesn't have a unique ID you won't be able to select it.
- Add a New Reference Alias, name it "Marker". As with the courier and container, select the X marker you placed in the courier cell with the Specific Reference in the Render Window.
- Add a New Reference Alias, name it "Player". This time you will select the Specific Reference radio button, click the "Select Forced Reference" button but you will just click the cell dropdown menu and select "(any)" at the top of the list. This allows you to then select "Player" at the top of the list in the Ref dropdown menu.
Whew. Now you've created all the aliases for the courier. But don't close the quest yet!
- Note: You can name the aliases anything you want, but it is much easier if you simply name them something that describes what they are as I have instructed, hence the names "courier" and "container".
Create the Courier's Dialogue View and edit AI Packages
Click the "Dialogue Views" tab next to the aliases tab. Right-click in the empty field on the left side and click "New". Give this a name that ends in something like "Dialogue" or "View". Click on your newly created Dialogue View and then right-click in the empty field to the right and select "Create Branch". You will then create a dialogue branch and a topic all in one go. You will need this topic for your AI Package when the courier goes to greet the player. If you need help on dialogue please check this wiki and other places for help, as I will not go into it here.
- This is where dialogue is important. The courier must have something to say when he/she greets the player to give them the message (well, I guess the courier COULD just hand the player a note). You should create an introduction line, a line explaining the letter, and a "goodbye" line. Whether or not you record actual audio for this, you should put in lines that can appear as captions. If you have done the quest tutorial with Bendu Olo, you will remember that captions don't appear on screen long enough unless there is some sort of recorded audio for that line, so recording a few seconds of silence in the Creation Kit is better than nothing.
Now we need to go back to the AI Packages we created (ahem, copied) earlier and edit them to reflect our topic. Open the first package that contains the phrase "DeliverToPlayer" and go to the first tab "Package". Change the very first item in the list below (the Topic) to the topic you just created in the dialogue view, I hope you made it easy to find! This will make it so that your courier uses the lines that you gave him/her when he/she greets the player. Go to the dropdown menu below the editorID which reads "Owner Quest" and select your courier quest from the menu. Finally, go to the Conditions tab and at the top of the list there will be a "GetGlobalValue" condition, change this so that it is looking for your courier's Global Variable we created earlier instead of the original courier's variable.
Add AI Packages to Courier Alias
Go back into the quest we created earlier for the courier and go to the Quest Aliases tab, double-click the "Courier" alias to bring up that alias's attribute window. On the right side, below the Scripts section there is a field that is titled "Alias Package Data". Leave this alias window open and go to the Object Window, navigate to the AI packages we created that have the phrases "DeliverToPlayer" and "WaitForPlayer" in them. Click on the packages one at a time and drag them into the "Alias Package Data" field. Now, when the courier alias is used, it will be given these packages to run which make the courier either run up to greet the player or hang around for the player to show up. Click OK to save these changes.
Create Quest Stages and Add Scripts
Ok, we are almost done! Hopefully you are still inside the courier quest; if not, go back into it. Go to the "Quest Stages" tab and right-click in the "Index" field on the left side, click "New". In this manner create the following stages and follow additional instructions for each stage:
- Create Stage 0 (yes, zero) and check the "Start Up Stage" box. In the "Log Entry" field right-click and select "New", then go to the Papyrus Fragment window and enter (or copy/paste) the following code:
Alias_Courier.getReference().moveto(Alias_LocationCenterMarker.getReference())
Alias_Courier.getReference().enable()
registerForUpdate(10) - Create Stage 200 and check the "Shut Down Stage" box. Right-click in the "Log Entry" field and select "New", then in the "Papyrus Fragments" box enter (or copy/paste) the following code:
Alias_Courier.getReference().moveto(Alias_Marker.getReference())
Alias_Courier.getReference().disable()
unRegisterForUpdate()
Next is a very tricky part, we need to add the main script for the courier and the properties that go along with it.