loot_battery = container ID, must be unique
name = Any text or language key from lang_*.json
caption = cut-off feature, just leave blank
items_casual = (optional) list of items IDs that will be spawned in easy mode
items = array of items IDs
Create new container copy with ID "my_loot_container" and add there few medkits and antirads.
How to test it? Well... We can do some trick. If you look into source code project, it has level_editor folder there.
Inside it, there will be prefabs that can be used in Godot Engine level editor but we can trick it with external scripts that inside game build path assets/scripts/.
Remember the path to the prefab:
(in game root directory -> res://) /level_editor/usable_triggers/items_loot_trigger.tscn
items_loot_trigger.tscn
# this file contains keys parameter and you can change invisible state or loot id
# by scripts using: *Prefab_Node_When_Instantiated*.keys["key"] = ...
keys = {
"invisible": true,
"loot_id": "id_from_assets_gameplay_loot_containers_json"
}
Open assets/scripts/p_game.gd script and at the start of the game add this code:
"intro":
# preload and spawn object to the scene tree
var my_container_prefab = preload("res://level_editor/usable_triggers/items_loot_trigger.tscn").instantiate()
# set stash ID with meds
my_container_prefab.keys["loot_id"] = "my_loot_container"
# always generate colliders and visibility for that type of prefabs
# or you can use only GameManager.generate_collider(my_container_prefab or *other node*)
GM._visibility_collision_generation(my_container_prefab)
# add trigger zone to the current level
GM.current_level.add_child(my_container_prefab)
Run the new game and look at the middle between corpses: