T1 tutorial: Actions events, the Guide autoload, chapter 1 with Old Tam the hermit, guide panel and marker, saved progress; roadmap: auto-update plan
This commit is contained in:
@@ -69,7 +69,8 @@ var thieves: Node3D ## thieves.gd: crows and foxes after food left o
|
||||
var hazards: Node3D ## hazards.gd: lightning on trees, hard-winter ice (P4)
|
||||
var stones: Node3D ## standing_stones.gd: the altar and the Old Stag (P5)
|
||||
var barrow: Node3D ## barrow.gd: the burial mound and its guards (scenery; guards where creatures run)
|
||||
var _saved_bear: Dictionary = {} ## its saved state, kept until bears exists (and re-saved if it never does)
|
||||
var _saved_bear: Dictionary = {}
|
||||
var _saved_tutorial: Dictionary = {} ## the tutorial's progress (Guide), from the save ## its saved state, kept until bears exists (and re-saved if it never does)
|
||||
var net_sync: Node ## net_sync.gd when playing on a server, else null
|
||||
var has_bed_spawn := false
|
||||
var bed_spawn := Vector3.ZERO ## position of the bed you respawn at
|
||||
@@ -417,6 +418,10 @@ func _on_terrain_ready() -> void:
|
||||
wolves.setup(self, den)
|
||||
if not "--no-creatures" in OS.get_cmdline_user_args():
|
||||
_setup_bear()
|
||||
# The tutorial (docs/TUTORIAL_DESIGN.md): a world made for it (meta.json
|
||||
# "tutorial"), or any world with `-- --tutorial` (for now, T1).
|
||||
if bool(Saves.read_meta(Saves.current_id).get("tutorial", false)) or "--tutorial" in OS.get_cmdline_user_args():
|
||||
Guide.start(self, _saved_tutorial)
|
||||
_maybe_capture()
|
||||
|
||||
## The island's bear and its patch (bear_range.gd), and the crows and foxes
|
||||
@@ -542,6 +547,8 @@ func save_now() -> bool:
|
||||
func _exit_tree() -> void:
|
||||
if server_mode and Saves.has_world() and _session_time > 0.0:
|
||||
save_now()
|
||||
if Guide.world == self:
|
||||
Guide.stop()
|
||||
|
||||
func _notification(what: int) -> void:
|
||||
if what != NOTIFICATION_WM_CLOSE_REQUEST or menu_mode:
|
||||
@@ -601,6 +608,7 @@ func collect_save() -> Dictionary:
|
||||
},
|
||||
"dropped": dropped,
|
||||
"time": {"day": day_night.day, "time": day_night.time},
|
||||
"tutorial": Guide.save_data() if Guide.world == self else _saved_tutorial,
|
||||
"spawn": {"bed": has_bed_spawn, "pos": [bed_spawn.x, bed_spawn.y, bed_spawn.z]},
|
||||
"forage_regrow": regrow,
|
||||
"regrow": props.regrow.duplicate(),
|
||||
@@ -750,6 +758,7 @@ func _apply_save(s: Dictionary, with_player: bool) -> void:
|
||||
props.pickups[uid].collected()
|
||||
# Regrowth timers (older saves have none: everything gone starts a fresh timer).
|
||||
props.restore_regrow(s.get("regrow", {}))
|
||||
_saved_tutorial = s.get("tutorial", {}) if with_player else {}
|
||||
if barrow != null:
|
||||
barrow.load_data(s.get("barrow", {}))
|
||||
if stones != null:
|
||||
|
||||
Reference in New Issue
Block a user