Welcome to the Valnir Rok - Quest Editor. The following documentation will give you a detailed overview of how to implement basic and advanced quests in the game. Quests in Valnir Rok are self-contained script-files written in the language groovy.
A thorough quickstart for groovy can be found here. The system will parse the script-file and constructs a new instance of the class which in return is used in our internal server system.
As said before each quest is a script-file which in turn contains a specific class that depending on the quest type either inherits from PersonalQuestBehavior or WorldQuestBehavior.
These two base classes are the pillars of our questsystem and encapsulate the meat and bones of the system from the groovy-side. On the other hand our server executes specific methods or notifies the quest whenever a quest specific event in the gameworld happens.
The following sample is the basic framework that every class needs.
import PersonalQuestBehavior; // Rename for easier handling of quests! import com.encuriogaming.scripting.AIScriptInterface as ai; import com.encuriogaming.scripting.PlayerScriptInterface as player; import com.encuriogaming.scripting.QuestScriptInterface as quest; final class Quest_Your_Name extends PersonalQuestBehavior { //====================================================================================== // Quest: Meta-Data // Please use this space to set the necessary quest data. There will be an error check // by the manager so please see server console for any occurring errors with your script! // //====================================================================================== //====================================================================================== // Quest: Logic // //====================================================================================== }
This of course won't compile correctly when loaded in the server since some vital information is missing. The reason is that all the meta-data that describes the quest is missing from the class. As you can see the comments encapsulate two areas one which is used to declare meta-data and the other to have your custom quest logic.
You will find more information and how to set meta-data or implement logic within the following chapters from the menu on the left.
Starting this application will prompt you to select a workspace to work in. The workspace in general is just a folder in which all your quest-scripts reside. For us as a developer we work directly in the folder of our local server application in order to minimize iteration times, but if you're a community developer you can just go ahead and create some folder on your computer to develop.
You can easily create a new quest by pressing the new button from the toolbar in the editor. This will open a new window asking you for the quest name and type. After selecting both it will automatically create the file and a basic template strcture for you in order to start right away!
For more information about how to deploy quests on your server please see the "Deploy on Server" section.
The meta-data consists out of methods / functions that return basic information about the quest itself. While loading the quest the server will parse and process the meta-data and use the information to set it up correctly.
The first and most important meta-data is the Id. You'll have to select an unique id. The best practice is to use a Q and then use the name of the quest in a shortened version. In the example the name of the quest is "A cold night" so the id we have choosen is "Q_Cold_Night".
public String Id() { return 'Q_Cold_Night'; }
The category is used to logically group quest content. And inform the player about the content of the quest. You can choose between: "Story", "Side" and "Tutorial"
public QuestCategory Category() { return QuestCategory.Story; }
The Difficulty indiciates how hard the quest will be for a single player. However the programmer of the quest still needs to find a way how to make the quest more difficult. You can choose between: "Easy", "Intermediate" and "Advanced"
public QuestDifficulty Difficulty() { return QuestDifficulty.Easy; }