Rpg Tutorial

Páginas: 10 (2388 palabras) Publicado: 12 de agosto de 2012
R

Role-Playing Sample Tutorial – Adding a Quest





Introduction

In this tutorial, you are going to add a quest to an instance in the Role-Playing Game (RPG) Sample. You can apply this tutorial to an instance of the sample without any other modifications.





What is a Quest?

Quests are an important part of a role-playing game. A quest defines the storyline that takes theplayer through the game content. In the RPG Sample, quests provide additional dangers and rewards to the player. They provide access to the next element in the story line.

Quests are specified as XML files. They are located in the Content\Quests directory in the Sample. These XML files are built by the XNA Content Pipeline. They are loaded at run time into a Quest object. They are defined inQuests\Quest.cs in the RolePlayingGameData project for your platform.





What is a Quest Line?

Quests are organized into “lines.”Lines are a series of quests that open sequentially as previous entries complete. The Sample initially only supports one quest line at a time: the “main quest line.” The first quest begins as soon as a new game starts. It continues until the primaryadversary is defeated.

Quest lines are also specified as XML files, which are located in the Content\Quests\QuestLines directory in the Sample. The XNA Content Pipeline builds these XML files. They are loaded at run time into a QuestLine object. This object is defined in Quests\QuestLine.cs in the RolePlayingGameData project for your platform.

The Sample comes with one quest line,Content\Quests\QuestLines\MainQuestLine.xml. When the player starts a new game, a new Session object is created with the data in Content\MainGameDescription.xml, which is processed by the XNA content pipeline and loaded into a GameStartDescription object. This description object tells the Session to load MainQuestLine.xml and start the first quest immediately (“Mercadia”).

As each quest is completed, thenext quest in the quest line immediately begins until there are no more quests.




What Quest Shall We Make?

In the beginning of the game, the player is instructed to visit “Shed-darr the Wise,” which is a non-player character (NPC) near the player’s starting position. Shed-darr gives the players a few simple quests and hands out starting equipment such as a piece of armor and a sword as areward. He sends the player into a relatively easy fight with Sir Shire, and then sends him out to fight goblins.

Let’s get the player some more gold, experience, and a helmet before the party has to face Sir Shire.





Creating a New Quest

First, we need to create a new XML file. The easiest way to do this, and the best way to make sure it is in the right location, is to open theRPG Sample and navigate in the Solution Explorer to the RolePlayingGame project for your platform, and then go to the Content\Quests folder. Right click on the Quests folder and select “New Item,” and choose “XML File” from the New Item dialog. Make sure you remove any content in the file before you follow the rest of the steps in the tutorial. Another way to do this is to create a new textdocument using Notepad or a similar application (as long as it makes plain text). Then rename it to XML, copy it to the Content\Quests folder within the RolePlayingGame project for your platform, and add it to the project after you are done. Make sure the XML file is named AndNowAHelmet.xml, so the “content name” property on the item is “AndNowAHelmet.”





Outer Tags

The outermost tagsare required for the XNA Content Pipeline, but they are not very interesting to us. They must be present in all XML files that describe quests. Otherwise, the XNA Content Pipeline cannot load the file.








Add the rest of the tags inside the Asset tag. The order of the content is significant. Your quest will fail to build (typically with a “missing tag” error where it expected...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Tutorial Rpg Xv
  • Tutorial rpg maker
  • Rpg maker
  • Lenguaje RPG
  • Rpg informe
  • RPG 23
  • Programacion rpg
  • Tutoriales

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS