Uses for every material (clay jar, bedroll, pelt rug, fang necklace, bear cloak, pemmican, bait), Q to drop, K/M bag rows on 1-8, help pages; protocol 14
This commit is contained in:
27
tools/site/dump_data.gd
Normal file
27
tools/site/dump_data.gd
Normal file
@@ -0,0 +1,27 @@
|
||||
extends SceneTree
|
||||
## Writes the game's own reference data as JSON, for the help pages
|
||||
## (tools/site/make_guide.py): creatures (creature.gd KINDS), server settings
|
||||
## (server_config.gd DEFAULTS and which can be changed live), and the fish.
|
||||
## Items and recipes come straight from data/*.json.
|
||||
## godot --headless --path . --script res://tools/site/dump_data.gd -- <out.json>
|
||||
|
||||
func _initialize() -> void:
|
||||
var out_path := "user://site_data.json"
|
||||
var args := OS.get_cmdline_user_args()
|
||||
if not args.is_empty():
|
||||
out_path = args[0]
|
||||
var C: Script = load("res://scripts/creatures/creature.gd")
|
||||
var SC: Script = load("res://scripts/net/server_config.gd")
|
||||
var consts: Dictionary = SC.get_script_constant_map()
|
||||
var d := {
|
||||
"creatures": C.get_script_constant_map().get("KINDS", {}),
|
||||
"server_defaults": consts.get("DEFAULTS", {}),
|
||||
"server_public": consts.get("PUBLIC", []),
|
||||
"server_settable": consts.get("SETTABLE", {}),
|
||||
"version": String(ProjectSettings.get_setting("application/config/version", "")),
|
||||
}
|
||||
var f := FileAccess.open(out_path, FileAccess.WRITE)
|
||||
f.store_string(JSON.stringify(d, "\t"))
|
||||
f.close()
|
||||
print("wrote ", out_path)
|
||||
quit(0)
|
||||
Reference in New Issue
Block a user