Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ extends SceneLink

## [InventoryItem] provided by this collectible when interacted with.
@export var item: InventoryItem:
get = _get_item,
set = _set_item

@export_category("Dialogue")
Expand Down Expand Up @@ -52,11 +53,19 @@ func _get_configuration_warnings() -> PackedStringArray:
return warnings


func _get_item() -> InventoryItem:
# Replace anonymous resource stored in scene file with separately-stored resource.
# Can be removed when we don't expect to have to rewrite any new quests being merged.
if item and item.is_built_in():
item = InventoryItem.with_type(item.type)
return item


func _set_item(new_value: InventoryItem) -> void:
item = new_value

if sprite_2d:
sprite_2d.texture = item.get_world_texture() if item else null
sprite_2d.texture = item.world_texture if item else null

if interact_area:
interact_area.action = "Collect " + item.type_name() if item else "Collect"
Expand Down
13 changes: 13 additions & 0 deletions scenes/globals/game_state/inventory/imagination.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[gd_resource type="Resource" script_class="InventoryItem" format=3 uid="uid://cchnv5pn6fa8e"]

[ext_resource type="Texture2D" uid="uid://wyiamtqmp4gk" path="res://assets/first_party/collectibles/imagination.png" id="1_f7k4n"]
[ext_resource type="Script" uid="uid://bgmwplmj3bfls" path="res://scenes/globals/game_state/inventory/inventory_item.gd" id="2_mhd08"]
[ext_resource type="Texture2D" uid="uid://6bf8rum68wq3" path="res://assets/first_party/collectibles/world_imagination.png" id="3_vln5c"]

[resource]
script = ExtResource("2_mhd08")
type = 1
color = Color(0.969, 0.792, 0, 1)
hud_texture = ExtResource("1_f7k4n")
world_texture = ExtResource("3_vln5c")
metadata/_custom_type_script = "uid://bgmwplmj3bfls"
44 changes: 14 additions & 30 deletions scenes/globals/game_state/inventory/inventory_item.gd
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,26 @@ enum ItemType {
MEMORY,
IMAGINATION,
SPIRIT,
NONE,
}

const COLORS_PER_TYPE: Dictionary[ItemType, Color] = {
ItemType.MEMORY: Color(0.459, 0.867, 0.0, 1.0),
ItemType.IMAGINATION: Color(0.969, 0.792, 0.0, 1.0),
ItemType.SPIRIT: Color(0.929, 0.0, 0.0, 1.0)
}

const HUD_TEXTURES: Dictionary[ItemType, Texture2D] = {
ItemType.MEMORY: preload("uid://brspc1u02oawt"),
ItemType.IMAGINATION: preload("uid://wyiamtqmp4gk"),
ItemType.SPIRIT: preload("uid://c4fefrg0tfkpl")
}

const WORLD_TEXTURES: Dictionary[ItemType, Texture2D] = {
ItemType.MEMORY: preload("uid://5wscjc8yqqts"),
ItemType.IMAGINATION: preload("uid://6bf8rum68wq3"),
ItemType.SPIRIT: preload("uid://cepg1o3ihp055")
}

@export var type: ItemType
@export var color: Color
@export var hud_texture: Texture2D
@export var world_texture: Texture2D


func get_hud_texture() -> Texture2D:
return HUD_TEXTURES[type]


func get_world_texture() -> Texture2D:
return WORLD_TEXTURES[type]


# TODO: can we eliminate this?
static func with_type(a_type: ItemType) -> InventoryItem:
var item := new()
item.type = a_type
return item
match a_type:
ItemType.MEMORY:
return load("res://scenes/globals/game_state/inventory/memory.tres")
ItemType.IMAGINATION:
return load("res://scenes/globals/game_state/inventory/imagination.tres")
ItemType.SPIRIT:
return load("res://scenes/globals/game_state/inventory/spirit.tres")
_:
push_error("Unknown ItemType %d" % a_type)
return null


func type_name() -> String:
Expand Down
12 changes: 12 additions & 0 deletions scenes/globals/game_state/inventory/memory.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[gd_resource type="Resource" script_class="InventoryItem" format=3 uid="uid://ck0wbckgm5un8"]

[ext_resource type="Texture2D" uid="uid://brspc1u02oawt" path="res://assets/first_party/collectibles/memory.png" id="1_kqroc"]
[ext_resource type="Script" uid="uid://bgmwplmj3bfls" path="res://scenes/globals/game_state/inventory/inventory_item.gd" id="2_5x7xc"]
[ext_resource type="Texture2D" uid="uid://5wscjc8yqqts" path="res://assets/first_party/collectibles/world_memory.png" id="3_t6yoc"]

[resource]
script = ExtResource("2_5x7xc")
color = Color(0.459, 0.867, 0, 1)
hud_texture = ExtResource("1_kqroc")
world_texture = ExtResource("3_t6yoc")
metadata/_custom_type_script = "uid://bgmwplmj3bfls"
13 changes: 13 additions & 0 deletions scenes/globals/game_state/inventory/spirit.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[gd_resource type="Resource" script_class="InventoryItem" format=3 uid="uid://c44l6x4e7sfx3"]

[ext_resource type="Texture2D" uid="uid://c4fefrg0tfkpl" path="res://assets/first_party/collectibles/spirit.png" id="1_puqvu"]
[ext_resource type="Script" uid="uid://bgmwplmj3bfls" path="res://scenes/globals/game_state/inventory/inventory_item.gd" id="2_glbdd"]
[ext_resource type="Texture2D" uid="uid://cepg1o3ihp055" path="res://assets/first_party/collectibles/world_spirit.png" id="3_45k8j"]

[resource]
script = ExtResource("2_glbdd")
type = 2
color = Color(0.929, 0, 0, 1)
hud_texture = ExtResource("1_puqvu")
world_texture = ExtResource("3_45k8j")
metadata/_custom_type_script = "uid://bgmwplmj3bfls"
23 changes: 0 additions & 23 deletions scenes/globals/game_state/inventory_state.gd
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,6 @@ signal item_consumed(item: InventoryItem)
## [member clear_inventory].
@export var items: Array[InventoryItem]

## Types of items in [member inventory], for storage. Use [member inventory]
## in game code.
@export_storage var item_types: Array[String]:
get():
var types: Array[String]
for item: InventoryItem in items:
types.append(InventoryItem.ItemType.keys()[item.type])
return types
set(new_value):
items = []
for type_name: String in new_value:
if InventoryItem.ItemType.has(type_name):
items.append(InventoryItem.with_type(InventoryItem.ItemType[type_name]))
else:
push_warning("Ignoring unknown inventory item type: %s" % type_name)
emit_changed()


## Add the [InventoryItem] to [member items].
func add_collected_item(item: InventoryItem) -> void:
Expand All @@ -46,9 +29,3 @@ func clear_inventory() -> void:
items.erase(item)
item_consumed.emit(item)
emit_changed()


func _validate_property(property: Dictionary) -> void:
match property.name:
"inventory":
property.usage &= ~PROPERTY_USAGE_STORAGE
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
[ext_resource type="PackedScene" uid="uid://b2mj4jggli0ci" path="res://scenes/quests/lore_quests/quest_000/tutorial_npc/tutorial_npc.tscn" id="9_be8bo"]
[ext_resource type="PackedScene" uid="uid://fuhl3l6gxq5k" path="res://scenes/game_elements/props/collectible_item/collectible_item.tscn" id="10_pbknt"]
[ext_resource type="Resource" uid="uid://bvxfbfjv2oleg" path="res://scenes/quests/lore_quests/quest_000/2_stealth/components/tutorial_stealth.dialogue" id="11_hiptn"]
[ext_resource type="Script" uid="uid://bgmwplmj3bfls" path="res://scenes/globals/game_state/inventory/inventory_item.gd" id="11_nil71"]
[ext_resource type="PackedScene" uid="uid://dv4f232y8w8dv" path="res://scenes/game_elements/props/decoration/water_rock/water_rock.tscn" id="12_es244"]
[ext_resource type="Script" uid="uid://x1mxt6bmei2o" path="res://scenes/ui_elements/cinematic/cinematic.gd" id="13_qj7hh"]
[ext_resource type="SpriteFrames" uid="uid://c5q1t8qd1h1pl" path="res://scenes/game_elements/props/decoration/water_rock/components/water_rock_02.tres" id="13_thfh2"]
Expand All @@ -29,6 +28,7 @@
[ext_resource type="SpriteFrames" uid="uid://tchths61dylv" path="res://scenes/game_elements/characters/enemies/guard/components/storyvoretorch_frames_green.tres" id="22_ym6ys"]
[ext_resource type="Script" uid="uid://c8405c212rbn6" path="res://scenes/game_elements/props/background_music/components/background_music.gd" id="25_qj7hh"]
[ext_resource type="AudioStream" uid="uid://qnqpd21qyfnc" path="res://assets/first_party/music/Threadbare_Stealth.ogg" id="26_m6viv"]
[ext_resource type="Resource" uid="uid://ck0wbckgm5un8" path="res://scenes/globals/game_state/inventory/memory.tres" id="27_bh43r"]
[ext_resource type="SpriteFrames" uid="uid://d000bjl2xdg0g" path="res://scenes/game_elements/props/checkpoint/components/knitwitch_frames_green.tres" id="28_06hgc"]
[ext_resource type="PackedScene" uid="uid://7873qa54birk" path="res://scenes/game_elements/props/tree/tree.tscn" id="30_06hgc"]
[ext_resource type="SpriteFrames" uid="uid://2ek86nvw6y28" path="res://scenes/game_elements/props/tree/components/tree_spriteframes_yellow.tres" id="31_thfh2"]
Expand All @@ -55,10 +55,6 @@ size = Vector2(168.25, 122)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_thfh2"]
size = Vector2(168.25, 122)

[sub_resource type="Resource" id="Resource_rl5ft"]
script = ExtResource("11_nil71")
metadata/_custom_type_script = "uid://bgmwplmj3bfls"

[sub_resource type="RectangleShape2D" id="RectangleShape2D_es244"]
size = Vector2(1216, 1473)

Expand Down Expand Up @@ -259,7 +255,7 @@ debug_color = Color(0, 0, 0, 0.42)
unique_name_in_owner = true
position = Vector2(2881, 254)
revealed = false
item = SubResource("Resource_rl5ft")
item = ExtResource("27_bh43r")
next_scene = "uid://c2cdgfy31u86r"
exit_transition = 5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
[ext_resource type="PackedScene" uid="uid://iu2q66clupc6" path="res://scenes/game_elements/characters/player/player.tscn" id="9_41blb"]
[ext_resource type="SpriteFrames" uid="uid://dtoylirwywk0j" path="res://scenes/game_elements/characters/components/sprite_frames/storyweaver_blue.tres" id="10_pxyem"]
[ext_resource type="PackedScene" uid="uid://fuhl3l6gxq5k" path="res://scenes/game_elements/props/collectible_item/collectible_item.tscn" id="11_wdt4i"]
[ext_resource type="Script" uid="uid://bgmwplmj3bfls" path="res://scenes/globals/game_state/inventory/inventory_item.gd" id="12_rogtb"]
[ext_resource type="PackedScene" uid="uid://cokul8w425pja" path="res://scenes/game_elements/characters/enemies/void_spreading_enemy/void_spreading_enemy.tscn" id="13_app83"]
[ext_resource type="Resource" uid="uid://c44l6x4e7sfx3" path="res://scenes/globals/game_state/inventory/spirit.tres" id="13_tjonm"]
[ext_resource type="Script" uid="uid://bdhjixygupit1" path="res://scenes/game_elements/props/area_filler/area_filler.gd" id="14_2lxhj"]
[ext_resource type="PackedScene" uid="uid://b2mj4jggli0ci" path="res://scenes/quests/lore_quests/quest_000/tutorial_npc/tutorial_npc.tscn" id="14_sdmwi"]
[ext_resource type="PackedScene" uid="uid://7873qa54birk" path="res://scenes/game_elements/props/tree/tree.tscn" id="15_m0rx6"]
Expand All @@ -27,11 +27,6 @@
[ext_resource type="PackedScene" uid="uid://cfcgrfvtn04yp" path="res://scenes/ui_elements/hud/hud.tscn" id="25_xfbr2"]
[ext_resource type="PackedScene" uid="uid://dv4f232y8w8dv" path="res://scenes/game_elements/props/decoration/water_rock/water_rock.tscn" id="28_af6h4"]

[sub_resource type="Resource" id="Resource_6rywr"]
script = ExtResource("12_rogtb")
type = 2
metadata/_custom_type_script = "uid://bgmwplmj3bfls"

[sub_resource type="RectangleShape2D" id="RectangleShape2D_fwbcl"]
size = Vector2(337.5, 826)

Expand Down Expand Up @@ -130,7 +125,7 @@ editor_draw_limits = true
unique_name_in_owner = true
position = Vector2(2943, -135)
revealed = false
item = SubResource("Resource_6rywr")
item = ExtResource("13_tjonm")
next_scene = "uid://dmoxtp65y3r2w"

[node name="VoidSpreadingEnemy" parent="OnTheGround" unique_id=1007896559 node_paths=PackedStringArray("void_layer", "idle_patrol_path") instance=ExtResource("13_app83")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
[ext_resource type="PackedScene" uid="uid://1vunygl4wpj6" path="res://scenes/game_elements/props/button_item/button_item.tscn" id="11_umhh8"]
[ext_resource type="Script" uid="uid://bd046eokvcnu2" path="res://addons/phantom_camera/scripts/phantom_camera_host/phantom_camera_host.gd" id="12_512nx"]
[ext_resource type="PackedScene" uid="uid://fuhl3l6gxq5k" path="res://scenes/game_elements/props/collectible_item/collectible_item.tscn" id="12_s8bcj"]
[ext_resource type="Script" uid="uid://bgmwplmj3bfls" path="res://scenes/globals/game_state/inventory/inventory_item.gd" id="13_qywun"]
[ext_resource type="Script" uid="uid://bhexx6mj1xv3q" path="res://addons/phantom_camera/scripts/phantom_camera/phantom_camera_2d.gd" id="13_r0dvx"]
[ext_resource type="Script" uid="uid://8umksf8e80fw" path="res://addons/phantom_camera/scripts/resources/tween_resource.gd" id="14_d5yvg"]
[ext_resource type="PackedScene" uid="uid://covsdqqsd6rsy" path="res://scenes/game_elements/props/sign/sign.tscn" id="14_o5vgf"]
Expand All @@ -25,6 +24,7 @@
[ext_resource type="SpriteFrames" uid="uid://cfgahyntmtfgu" path="res://scenes/game_elements/props/powerup/components/powerup_thread.tres" id="17_k7scg"]
[ext_resource type="PackedScene" uid="uid://cfcgrfvtn04yp" path="res://scenes/ui_elements/hud/hud.tscn" id="18_ifd06"]
[ext_resource type="PackedScene" uid="uid://b2mj4jggli0ci" path="res://scenes/quests/lore_quests/quest_000/tutorial_npc/tutorial_npc.tscn" id="18_x2ecx"]
[ext_resource type="Resource" uid="uid://cchnv5pn6fa8e" path="res://scenes/globals/game_state/inventory/imagination.tres" id="19_512nx"]
[ext_resource type="Resource" uid="uid://ci8ll31uofkiw" path="res://scenes/quests/lore_quests/quest_000/6_grappling/components/tutorial_grappling.dialogue" id="21_x2ecx"]
[ext_resource type="Script" uid="uid://x1mxt6bmei2o" path="res://scenes/ui_elements/cinematic/cinematic.gd" id="24_fhcwk"]
[ext_resource type="PackedScene" uid="uid://dv4f232y8w8dv" path="res://scenes/game_elements/props/decoration/water_rock/water_rock.tscn" id="26_3gauf"]
Expand All @@ -39,11 +39,6 @@
[sub_resource type="Resource" id="Resource_atjeb"]
script = ExtResource("14_d5yvg")

[sub_resource type="Resource" id="Resource_u8qfb"]
script = ExtResource("13_qywun")
type = 1
metadata/_custom_type_script = "uid://bgmwplmj3bfls"

[node name="TutorialGrappling" type="Node2D" unique_id=217609538]
script = ExtResource("1_512nx")

Expand Down Expand Up @@ -239,7 +234,7 @@ position = Vector2(-865, 781)

[node name="ImaginationThread" parent="OnTheGround" unique_id=1678374994 instance=ExtResource("12_s8bcj")]
position = Vector2(-575, 315)
item = SubResource("Resource_u8qfb")
item = ExtResource("19_512nx")
collected_dialogue = ExtResource("21_x2ecx")
dialogue_title = &"thread_collected"
next_scene = "uid://cufkthb25mpxy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
[ext_resource type="PackedScene" uid="uid://be4o3ythda4cu" path="res://scenes/game_elements/props/sequence_puzzle_hint_sign/sequence_puzzle_hint_sign.tscn" id="9_evicy"]
[ext_resource type="PackedScene" uid="uid://7873qa54birk" path="res://scenes/game_elements/props/tree/tree.tscn" id="13_inhg4"]
[ext_resource type="PackedScene" uid="uid://fuhl3l6gxq5k" path="res://scenes/game_elements/props/collectible_item/collectible_item.tscn" id="14_src2c"]
[ext_resource type="Script" uid="uid://bgmwplmj3bfls" path="res://scenes/globals/game_state/inventory/inventory_item.gd" id="15_rxyid"]
[ext_resource type="SpriteFrames" uid="uid://dtoylirwywk0j" path="res://scenes/game_elements/characters/components/sprite_frames/storyweaver_blue.tres" id="15_s3slv"]
[ext_resource type="SpriteFrames" uid="uid://djwymcffy83" path="res://scenes/game_elements/props/tree/components/tree_spriteframes_red.tres" id="16_8nm0x"]
[ext_resource type="PackedScene" uid="uid://cfcgrfvtn04yp" path="res://scenes/ui_elements/hud/hud.tscn" id="16_ytxvq"]
Expand Down Expand Up @@ -45,6 +44,7 @@
[ext_resource type="AudioStream" uid="uid://c7om8kdork2rx" path="res://assets/third_party/sounds/characters/enemies/guard/Torch.ogg" id="31_ink4c"]
[ext_resource type="SpriteFrames" uid="uid://cefk7kf0bpm3q" path="res://scenes/quests/lore_quests/quest_001/1_music_puzzle/components/bonfire_sign/bonfire_sign_backward.tres" id="32_0wfv2"]
[ext_resource type="AudioStream" uid="uid://xuqj6b5qqs3w" path="res://assets/third_party/sounds/ambient/459405__pfannkuchn__small-river-1-fast-semi-close.ogg" id="35_l8fgn"]
[ext_resource type="Resource" uid="uid://ck0wbckgm5un8" path="res://scenes/globals/game_state/inventory/memory.tres" id="41_icnj0"]
[ext_resource type="PackedScene" uid="uid://dgrrudegturnw" path="res://scenes/game_elements/characters/npcs/townie.tscn" id="42_ps6xw"]
[ext_resource type="Script" uid="uid://edcifob4jc4s" path="res://scenes/game_logic/talk_behavior.gd" id="43_icnj0"]
[ext_resource type="Resource" uid="uid://jf1tng8jxd3o" path="res://scenes/quests/lore_quests/quest_001/1_music_puzzle/components/dialogues/music_lore_helper.dialogue" id="44_pgedt"]
Expand All @@ -53,10 +53,6 @@
[ext_resource type="Script" uid="uid://diskln3jup064" path="res://scenes/game_elements/characters/npcs/components/helper_character.gd" id="46_jaqfj"]
[ext_resource type="AudioStream" uid="uid://wkn0u0npcijf" path="res://scenes/quests/lore_quests/quest_001/1_music_puzzle/components/song_sanctuary_music.tres" id="47_orlow"]

[sub_resource type="Resource" id="Resource_dp3eg"]
script = ExtResource("15_rxyid")
metadata/_custom_type_script = "uid://bgmwplmj3bfls"

[sub_resource type="RectangleShape2D" id="RectangleShape2D_vigmf"]
size = Vector2(52, 61)

Expand Down Expand Up @@ -1477,7 +1473,7 @@ hint_sign = NodePath("../../Bonfires/BonfireSign4")
unique_name_in_owner = true
position = Vector2(-726, 43)
revealed = false
item = SubResource("Resource_dp3eg")
item = ExtResource("41_icnj0")
collected_dialogue = ExtResource("6_l4i5r")
dialogue_title = &"well_done"
next_scene = "uid://cgemeabsewy1f"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
[ext_resource type="TileSet" uid="uid://dfp36ffpanjq2" path="res://tiles/elevation.tres" id="7_vstxf"]
[ext_resource type="PackedScene" uid="uid://fuhl3l6gxq5k" path="res://scenes/game_elements/props/collectible_item/collectible_item.tscn" id="8_hyj3v"]
[ext_resource type="SpriteFrames" uid="uid://3ujiuhj7wpm2" path="res://scenes/game_elements/characters/enemies/throwing_enemy/components/ink_drinker_frames_red.tres" id="8_k5uk8"]
[ext_resource type="Script" uid="uid://bgmwplmj3bfls" path="res://scenes/globals/game_state/inventory/inventory_item.gd" id="9_rww0x"]
[ext_resource type="SpriteFrames" uid="uid://dxbt7cgoq3dg5" path="res://scenes/game_elements/characters/enemies/throwing_enemy/components/ink_drinker_frames_blue.tres" id="9_te0v3"]
[ext_resource type="PackedScene" uid="uid://cfcgrfvtn04yp" path="res://scenes/ui_elements/hud/hud.tscn" id="10_i5hhc"]
[ext_resource type="AudioStream" uid="uid://qf2d38rabx8o" path="res://assets/third_party/sounds/characters/enemies/throwing_enemy/Wings.ogg" id="10_uyhkg"]
[ext_resource type="AudioStream" uid="uid://bbnj2fog3rdy8" path="res://assets/first_party/sounds/throwing_enemy/Spray.wav" id="11_7kldn"]
[ext_resource type="PackedScene" uid="uid://c5jedlvvnnbi0" path="res://scenes/game_elements/props/projectile/ink_blob_projectile.tscn" id="12_ms350"]
[ext_resource type="Resource" uid="uid://cchnv5pn6fa8e" path="res://scenes/globals/game_state/inventory/imagination.tres" id="21_2anko"]
[ext_resource type="PackedScene" uid="uid://dgrrudegturnw" path="res://scenes/game_elements/characters/npcs/townie.tscn" id="23_2anko"]
[ext_resource type="Script" uid="uid://edcifob4jc4s" path="res://scenes/game_logic/talk_behavior.gd" id="24_7ypla"]
[ext_resource type="Resource" uid="uid://cm0wl5emmorln" path="res://scenes/quests/lore_quests/quest_001/2_ink_combat/components/dialogues/ink_helper.dialogue" id="25_tlsag"]
Expand Down Expand Up @@ -52,11 +52,6 @@ _data = {
&"goal_completed": SubResource("Animation_k5uk8")
}

[sub_resource type="Resource" id="Resource_na0be"]
script = ExtResource("9_rww0x")
type = 1
metadata/_custom_type_script = "uid://bgmwplmj3bfls"

[sub_resource type="RectangleShape2D" id="RectangleShape2D_0kgrx"]
size = Vector2(52, 61)

Expand Down Expand Up @@ -172,7 +167,7 @@ color = Color(1, 1, 0, 1)
unique_name_in_owner = true
position = Vector2(542, 510)
revealed = false
item = SubResource("Resource_na0be")
item = ExtResource("21_2anko")
collected_dialogue = ExtResource("2_fgs83")
dialogue_title = &"well_done"
next_scene = "uid://db6vhi7s2f37c"
Expand Down
Loading