Sixteen quests that walk a new game through the things it contains: ore,
the mothership, exploration, a yard and a second hull, planetfall and
conquest, extractors, gas, freight, power, the lab, a new vessel type, an
outpost, and a survey.
The chain turns on the second quest. The fleet builds the mothership to
call the World Ship and hears nothing - and the array is not at fault. The
breach put them further out than that signal will carry, so every quest
after it is a search that has to be flown rather than transmitted.
Three pieces:
Quests.gd the chain, as data and nothing else. Two rules it obeys:
nothing may ask for something unreachable - research points
come only from conquering a planet, so every doctrine that
costs them sits after the conquest quest - and a quest names
one goal, with the research it implies said in the brief
rather than split into an errand of its own.
GameState how far along the chain the player is, and the answer to each
goal kind. Progress latches for free: the chain is walked one
quest at a time, so collecting five ore and spending it cannot
un-complete the quest that asked for five - by then nothing is
asking. It lives here so a quest finished on a planet surface
is still finished after take-off.
the HUD QuestTracker, the standing objective, in the wave alert's
idiom; QuestDirector, which reads the lines out.
Lines are QUEUED by GameState and drained by the director rather than
emitted at a banner, because quests advance in the autoload, which runs on
a planet surface too - where a line emitted straight at a banner would be
lost. Both scenes now carry a banner, a tracker and a director, so a quest
finished underground is announced underground.
The chain is armed by reset_new_game(), the same gate the prologue uses -
the only door into a real game - so instantiating a scene is not by itself
a reason to start briefing somebody.
27 lines
1.1 KiB
GDScript
27 lines
1.1 KiB
GDScript
extends Node
|
|
|
|
# Forgejo #132: the voice of the quest chain.
|
|
#
|
|
# GameState walks the chain and QUEUES what it wants said (see
|
|
# GameState.quest_messages); this node is the thing that says it. The split
|
|
# is not ceremony: quests advance in the autoload, which keeps running on a
|
|
# planet surface where there is no narration banner at all, so a line
|
|
# emitted straight at a banner would simply be lost down there. Queued and
|
|
# drained, a quest finished on a surface is read out on the way back up.
|
|
#
|
|
# Draining every waiting line at once is safe: the banner queues lines
|
|
# itself and shows them one at a time, and each one stops the game until it
|
|
# is acknowledged (#128).
|
|
|
|
@onready var narration: Control = get_node_or_null("../UI/NarrationBanner")
|
|
|
|
|
|
func _process(_delta: float) -> void:
|
|
if narration == null:
|
|
return
|
|
# The prologue owns the banner while it runs. A quest line arriving in
|
|
# the middle of the convoy being torn apart would be read as part of it.
|
|
if GameState.intro_active:
|
|
return
|
|
for message in GameState.take_quest_messages():
|
|
narration.say(String(message.line), String(message.speaker))
|