Developing a quest system

Get help using Construct 2

Post » Thu Sep 10, 2015 5:39 am

Anyone here added quest / missions to their games? I'm doing this for the first time and would like to get some input on how to go about it. I have a few things in mind but they just sound...rough. My main idea is to just use dictionaries with a custom quest editor to create all the keys and default vals...so it'd be something like this:

Quest_GetTheKeys_Description : String
Quest_GetTheKeys_Active? : Bool
Quest_GetTheKeys_Complete? : Bool
Quest_GetTheKeys_Key1 : Bool
Quest_GetTheKeys_Key2 : Bool
Quest_GetTheKeys_Key3 : Bool

Then when a key object is collected I'd run a loop to see if all 3 have been collected. If so, Quest_GetTheKeys_Complete is set to 1 and the player is able to turn it in.

Thoughts?
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770

Post » Thu Sep 10, 2015 6:56 am

I am fairly new to Construct 2 but I can't see why your idea shouldn't work? I guess that you are making top down RPG game?
I would change the code like something below to easier reuse the code if you are going to have another quest later on, like GetTheKeysAgain. Then you just have to change how many keys you are going to collect (IntComplete) and then change the Quest string.

Quest_GetTheKeys_Description: String
Quest_GetTheKeys_Count: 0
Quest_GetTheKeys_IntComplete: 3
Quest_GetTheKeys_Complete: false

When picking up a key:
Quest_GetTheKeys_Count+1
if Quest_GetTheKeys_Count = Quest_GetTheKeys_IntComplete
then
Quest_GetTheKeys_Complete: True
Quest_GetTheKeys_Count = 0 (Reset)

When you hand it in:
Quest_GetTheKeys_Complete: false;
Add 1000000 coins + 500000000 xp
B
14
S
5
G
1
Posts: 32
Reputation: 1,038

Post » Fri Sep 11, 2015 4:09 am

My system is probably not as technical as a lot of people would make theirs out to be, but it works great for me. I just have a list of every quest in my game (I keep a spreadsheet). Each one has a number assigned to it. This corresponds to an in-game column in my data array that I store everything in. I just change the value of each cell to correspond to the status of the quest. Typically, 0=Open, 1=In Progress, 2=Complete unless the quest needs more to keep track of. I do the same thing for puzzles, chests, and objects throughout the game--the game just checks an instance variable on an object vs that cell in the array to see what to do (or not do!).

Is it the best way to do it? I'm sure it isn't. Does it work flawlessly and do everything I need (and is easy)? Absolutely.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Tue Sep 15, 2015 2:00 am

@C-7 Yeah that doesn't sound too bad, actually. I just prefer dictionaries because of the named keys.

Off topic but for "item persistence" you mentioned at the end there, I prefer using dictionaries for that too. You can add a key with the object's IID and layout, then refer to that to see if it's collected or not. No need for manual checks or spreadsheet/array reference! I can see how that would be better in some cases, though.
Image
B
243
S
30
G
13
Posts: 1,787
Reputation: 18,770


Return to How do I....?

Who is online

Users browsing this forum: David181, OBLIVION and 62 guests