ACCESS the FULL COURSE here: https://academy.zenva.com/product/rpg...
Hey guys, my name in Austin Gregory, and in this course I'm gonna teach you how to make a pretty simple questing system for your Unity games. This course is going to build on what we've learned throughout that previous courses in this RPG series. So, we're gonna take all that and build something cool, making a questing system. So I wanna create a new project in the hub here. I wanna call it Quest System, and I wanna launch using the latest version available to me, which is 2018.1.5F1. Template can be 2D, don't need anything special here, and no analytics enabled. So, create project. So now, in a fresh Unity project, I wanna create a scripts folder, to keep all of our script files in. And inside of that, I wanna create a folder for our questing scripts. (typing) Just like that. And now, inside of questing, I wanna create a new C-sharp script, and we're gonna start off by creating the goals of our quest. Now, let's talk a bit about what the quest is going to be, or what our quests are going to be. And, then we'll talk about what the goals are in relation to the quests. So, our quests are going to be scripts, that simply have derived children, that are based on them, basics of object oriented program, we've talked about that a lot in this series. So, a quest is going to have a name, a description, a goal that you have to complete in order to complete the quest. And then a reward, and that kind of thing. And then, from there, we can build variations on that, right? So it's gonna be the parent quest, and then we're gonna have children of that. And that's where we can decide, what goal does this quest have? What do you get whenever you complete this quest? You get the items as a reward, or whatever, but you may also unlock something. So, each quest has to do something specific for a reward, perhaps. Maybe it doesn't for your case, maybe it does for your case. So, we're gonna be able to derive from a parent class, and then do anything that we want to unique, for every single quest that we create. Or, just create a template quest, and just make them all based on that, that kind of thing. But, I would imagine you want to have some type of way to create unique quests throughout your game, so we're gonna be able to do that.
Also, quests are going to have a goal, like I said. You have to complete the goal to complete the quest. And a goal, is going to be just progress. You're going to start at zero, and work your way up towards the required integer to complete the goal. So if you say you have to kill vampires, you're gonna have to kill ten vampires. Start at zero, kill ten vampires, you complete the quest. We're also gonna have derived goals from the parent goal class here, because a goal can be kind of generic. So, if you wanna have a kill goal, or a collection goal, or a location goal. You wanna be able to set those up with the required parameter. So, a kill goal will require an enemy ID, look for this ID whenever enemy dies. Does that correlate to this goal, for this quest? If it does, then I can add some progress to this goal. Or if I collect an item, is that item ID, the item ID this collection goal requires? And same for location, that kind of thing. And we're gonna focus on one type of goal in this, but it's gonna be very easy to see how you can take that type of goal and make it work for something else, in your specific situation. So, we'll start off with the base class for goal, open this up in Visual Studio. So, for a goal, what does a goal need? Well, we need a goal number to get to. So, if we have to kill ten vampires, like I said, we need to know that we need ten vampires. So, we wanna have a count needed, or a count required, that kind of thing. What I also wanna keep track of, how many vampires we've already killed. So, we wanna have a count current, or a current count. Wanna keep track of whether or not the goal is completed, so a simple Boolean for completed. And we also wanna know, what quest this goal is related to, so we'll have that in there a bit later on. So, let's start with the stuff we know. We want a public INT, that's going to be the count needed. We want a public INT, that's going to be the count current.
And we want a public Boolean, that's going to be whether or not we have completed it. And I don't know why I'm doing these in capitals, that is incorrect. (typing) Normally I would use properties here, but as we know, Unity serialization does not care for those. So, I just try to avoid them for the courses, because it requires a bit more work to get them to work in the inspector and what not. So, we're going to avoid that. So, that's all of the data we're gonna need for our goal for now. We also wanna have the ability to increment the current count value.
Watch video Creating a Quest System in Unity How to Set Quest Goals online without registration, duration hours minute second in high quality. This video was added by user Zenva 26 October 2018, don't forget to share it with your friends and acquaintances, it has been viewed on our site 7,755 once and liked it 84 people.