So basically I plan to have in my Voyage of the Eldritch game an university “quest-board” where your character can complete various sidequests from many npcs at the university (Lexi, Samuel, Alicia, Tetris, Olapen, Leon etc) and the mini quests only complete if your character actually gets the items required.
Question is, how do I go about writing the coding for the many sidequests? I’m also planning to have some of the sidequests to be related to various jobs or tasks (ie Barista or Professor)
There could be many different things involved in coding sidequests, depending on how you want to do it. The way I do it in my own WIP might not be the way you do.
Okay, then I’d make it a subroutine, and just list out all the quests, and hide them behind boolean checks. That way you can set them to true when they are unlocked, and they should show up on the board.
And then a choice for accepting them, hiding behind the same *if check.
So, maybe you could write the “boolean check” example for me, in case I need to write it for quest coding later on? Thanks… Also before I forget, how do I make the game check if the player collected the necessary items for the npc sidequests?
I’m writing it as quests that gets unlocked at specific times, or player actions.
If they need to be specifically accepted, before they can be turned in, that requires another layer of variables.
EDIT: I guess you could make the variables numerical instead, and have 0=unavailable 1=inactive 2=active, or something like that.
Do I have to create the quest items in the startup.txt beforehand, or do the items work just as fine on a seperate page with coding? Also, how do I randomise the NPCs and [hours] for questing?
Ie. Collect coffee for [npc], complete by [_] hours
Approximately 13 quests, but some side-quests usually lead into permanent content unlocked for the player (ie. npc “Kotone” being unlocked after completing specific spell for Olapen, for example)
*create quest_01 false
*create quest_02 false
*create quest_03 false
*create quest_04 false
*create quest_05 false
*create quests 5
*create sidequest_01 false
*create sidequest_02 false
*create sidequest_03 false
*create sidequest_04 false
*create sidequest_05 false
*create sidequests 5
*label start_here
These are the current quests available…
*choice
*if (quests > 0)
#Main Quests.
*goto main
*if (sidequests > 0)
#Side Quests.
*goto side
#Accepted Quests.
*goto accepted
*label main
*choice
*if not (quest_01)
#Quest One.
*set quest_01 true
*set quests - 1
*goto quest_one
*if not (quest_02)
#Quest Two.
*set quest_02 true
*set quests - 1
*goto quest_one
*if not (quest_03)
#Quest Three.
*set quest_03 true
*set quests - 1
*goto quest_three
*if not (quest_04)
#Quest four.
*set quest_04 true
*set quests - 1
*goto quest_four
*if not (quest_05)
#Quest Five.
*set quest_05 true
*set quests - 1
*goto quest_five
#No more quests.
*goto start_here
*label quest_one
This is the first quest.
*goto start_here
*label quest_two
This is the second quest.
*goto start_here
*label quest_three
This is the third quest.
*goto start_here
*label quest_four
This is the fourth quest.
*goto start_here
*label quest_five
This is the fifth quest.
*goto start_here
*label side
*choice
*if not (sidequest_01)
#Side quest One.
*set sidequest_01 true
*set sidequests - 1
*goto sidequest_one
*if not (sidequest_02)
#Side quest Two.
*set sidequest_02 true
*set sidequests - 1
*goto sidequest_one
*if not (sidequest_03)
#Side quest Three.
*set sidequest_03 true
*set sidequests - 1
*goto sidequest_three
*if not (sidequest_04)
#Side quest four.
*set sidequest_04 true
*set sidequests - 1
*goto sidequest_four
*if not (sidequest_05)
#Side quest Five.
*set sidequest_05 true
*set sidequests - 1
*goto sidequest_five
#No more quests.
*goto start_here
*label sidequest_one
This is the first side quest.
*goto start_here
*label sidequest_two
This is the second side quest.
*goto start_here
*label sidequest_three
This is the third side quest.
*goto start_here
*label sidequest_four
This is the fourth side quest.
*goto start_here
*label sidequest_five
This is the fifth side quest.
*goto start_here
*label accepted
*if (quest_01)
Quest One accepted.
*line_break
*if (quest_02)
Quest Two accepted.
*line_break
*if (quest_03)
Quest Three accepted.
*line_break
*if (quest_04)
Quest Four accepted.
*line_break
*if (quest_05)
Quest Five accepted.
*line_break
*if (sidequest_01)
Side Quest one accepted.
*line_break
*if (sidequest_02)
Side Quest two accepted.
*line_break
*if (sidequest_03)
Side Quest Three accepted.
*line_break
*if (sidequest_04)
Side Quest Four accepted.
*line_break
*if (sidequest_05)
Side Quest Five accepted.
*line_break
*goto start_here
Here is the code I used for the example so you can see what I did.
edit: are the quantity of items going to be individually collected or will the quest just send them to get them or will players need to keep track of how much they have?