Last active
March 7, 2023 22:15
-
-
Save kingthrillgore/cbf06266d0af3a5eacbef9a81844c5f1 to your computer and use it in GitHub Desktop.
Standard task implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extends "res://scripts/quests/task.gd" | |
# Fields | |
var tasks : Array | |
var tasks_completed : Array | |
# System Methods | |
# Called when the node enters the scene tree for the first time. | |
func _ready(): | |
pass # Replace with function body. | |
# Custom Methods | |
## Starts the task in earnest. You need to add your signal calls here to carry out the actual | |
## logic, obviously. At the end of the method, it makes a callback to Task.startTask() to handle | |
## designated cleanup. | |
func startTask() -> void: | |
#TODO Put your logic here | |
.startTask() | |
## This method is intended to do the basic confirmation of task completion. At the end of it, there is | |
## a call to whenCompleted() which is where you want to handle post-completion actions. | |
func taskCompleted() -> void: | |
#TODO Put your logic here | |
.checkIfCompleted(true) | |
whenCompleted() | |
## This method is where you want to handle rewards and post-complete conditions. It also needs to keep its | |
## callback to parent whenComplete() to mark the status as done. | |
func whenCompleted() -> void: | |
#TODO Put your logic here | |
.whenCompleted() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment