Welcome to Part 12 of our Developer Tools guide. This is the last part of the quest creation tutorial. In the previous parts, we prepared assets and resources needed for a quest. Now let’s tie them all together First open “Quest Assist” from the editor toolbar (the star shaped icon) Right-click in the newly opened window and select Create .pxsl file from the context menu. Now, add a new name for our quest file and click ‘save’ It is important that the newly created quest file is in Data->Quest->Your map name.
One file can contain several quests, and you can use different files to group and sort quests. In the newly created file we add our quests, using the codenames created earlier – MyWallet and MyWalletEpilog. If we want to create a series of consecutive quests, we use ‘parent’ parameters together with the codename of the preceding quest. In our case it will be MyWallet preceding MyWalletEpilog. Every game needs an ending, and it will end after completing the last quest. Our last quest is MyWalletEpilog, so we add another parameter to it: -final=true There can be only one quest with –final=true parameter. After the last quest is finished, the credits trigger. To avoid rolling the credits, you can use the semaphore phase, which stops the game. Phases are actions that the player needs to take before the quest progresses. They consist of names, descriptions between two pointy brackets, and objects and parameters. Let’s add an example description to the semaphore phase. The Semaphore phase does not have any parameters, so let’s add one make the player wait 5 seconds before the epilogue starts.
While we’re in epilogue, let’s finish the creation of this sample quest. Let’s use the “goto” phase, which points the player to a place he needs to get to. In our case, it will simply be getting back to the spawn point. Input “goto”, description and the class of the object the player needs to get to, so SpawnPoint, and a unique name defining our target spawnpoint, so MapStart. The “Goto” phase has got a distance parameter available, which is the minimal distance the player has to be from the target object to complete the phase. This parameter can have negative value, which requires players to get a set distance away from the object. The last element of our phase is assigning an objective to it.
To do that, we will use “–obj” parameter. It is similar to assigning an ID to an object, so we also input it between two ampersands. Now, let’s focus on the main part of our quest, so the elimination of the enemy, and collecting the quest item. To do that in the MyWallet quest, we will use phase ‘kill’, which defines which AI enemy from which spawner is the target The spawner used in our quest belongs to the AI-SpawnBoxNumber class. Let’s just add an objective, and the first part of our quest is ready.
Now for the wallet. For collecting items we use phase ‘take’, to which we assign the object belonging to QuestInventoryItemDI class. We add an objective, and the quest is ready. Click ‘compile’ and let’s see if everything works. The Validator shows us we forgot to name the quest item, so let’s fix that and name it. Try ‘compile’ again, everything seems fine Let’s check it from the game. The quest log shows our custom texts. Let’s proceed with the quest and grab some loot along the way. After eliminating the zombie the objective updates. The wallet has our specified name on it. And after collecting the wallet, the epilogue starts. Everything works as intended. That’s it for this episode. Thanks for watching..
As found on Youtube