<p>Tangibles and inventory items both have inspect menus, but their code has to be separate. They are too different from each other. <br></p>
<br>
<p>I intend for the player to be able to pick up an item through the inspect menu without changing his current target. For now, InspectMenu.gd/set_subject(subject) sets the player target. MoveToDestination.gd/handle_moved_result tracks the user's current target using character/find_distance_to_target(). Instead, it would need to receive the relevant subject from the inspect menu or skill or attack target from the character and pass it through character/find_distance_to(target). <br></p>
<br>
<p>It doesn't close the inspect menu if pickup is chosen while item out of range, even after item is picked up. <br></p>
<p>The programmatic element facilitates picking up, collecting, and dropping items. The control element displays and offers relevant options. <br></p>
<br>
<h2>pickup: floor item -> inventory item </h2>
<p>Item pickup is initiated by MoveToDestination.gd/_on_item_arrived(floor_item) -> floor_item.pick_up().pick_up(). The base item's pick_up initiates character/pickup(base_item) and publishes "item_picked_up" and itself to the <a href="/blessfrey-gdd/achievements">MessageBus</a>. <br></p>
<br>
<p>character.gd/pickup(base_item) calls (programmatic)Inventory.gd/pickup and _pickup(base_item) which updates the phone inv app if it's currently open. <br></p>
<br>
<p>Inventory.gd/pickup(base_item) published "item_obtained" and the base item to the <a href="/blessfrey-gdd/achievements">MessageBus</a> then calls reverse_pickpocket(base_item). <br></p>
<br>
<p>Inventory.gd/reverse_pickpocket(base_item) appends the base item to the inventory and connects the depleted and dropped signals. <br></p>
<br>
<h2>opening the inventory app </h2>
<p>If you press the <a href="/blessfrey-gdd/controls">inventory key (I)</a>, UI/open_window(UI.open_inv_scene(),"inventory", Vector2(100,150)) is called. It opens a window at the Vector2, assigns "inventory" as its key, and fills it with the given scene. The UI will call open_app and provide the inventory app scene. <br></p>
<br>
<p>If you bring up the smartphone and tap the inventory app from the home screen, the inventory button is connected to 'open_app" on "pressed", sending the associated app. <br></p>
<br>
<p>Smartphone.gd/open_app(scene) sets is_open to true, the current_app to the scene,
<p>Items are objects that may be picked up, purchased, used, equipped, dropped, or sold. They include currency, quest items, equipment, consumables, readables, upgrades, keys, and trinkets. <br></p>
<br>
<h2>four representations </h2>
@ -11,7 +12,7 @@
<br>
<p>Merchandise appears in store windows. <br></p>
<br>
<h2>item pickup </h2>
<h2>move to pick up item </h2>
<p>Items can only be picked up by the player. They can be picked up via item targeting or through selecting 'pick up' on the <a href="/blessfrey-gdd/inspect">inspect menu</a>. <br></p>
<br>
<p>Item pickup is triggered when a floor item is targeted, that is, a 'target' (left-click) triggers a $Item/Body/Sprite/Sprite.gd/_on_input_event. If 'no_move_to_target' (shift) is held while targeting, the item will be targeted without initiating pickup. Otherwise, floor_item.gd/target_event(viewport,event,shape_idx) is called to set the target and handle the input before prompting the player to consider pickup. <br></p>
@ -22,10 +23,11 @@
<br>
<p>If the item is within the player's <a href="/blessfrey-gdd/proxemics">intimate distance</a>, the character will be prompted to pick up the item.
<br>
<p>Otherwise, <a href="/blessfrey-gdd/pathfinding">pathfinding</a> begins towards the floor item. Upon arrival, it calls item.pick_up().pick_up(). <br></p>
<p>Otherwise, <a href="/blessfrey-gdd/pathfinding">pathfinding</a> begins towards the floor item. Upon arrival, it calls floor_item.pick_up().pick_up(). The floor item's pick_up removes itself from the room and returns the base item, then the <a href="/blessfrey-gdd/inventory">inventory system</a> takes care of the rest. <br></p>
<br>
<br>
<h2>challenges/known issues </h2>
<p>I intend for the player to be able to pick up an item through the inspect menu without changing his current target. For now, InspectMenu.gd/set_subject(subject) sets the player target. MoveToDestination.gd/handle_moved_result tracks the user's current target using character/find_distance_to_target(). Instead, it would need to receive the relevant subject from the inspect menu or skill or attack target from the character and pass it through character/find_distance_to(target). <br></p>
<p>path_to_point calls cancel on the player and path_to_object(goal_target). Mobile.gd/path_to_object(goal_target) sets the floor item as the next then reassesses the path with each call. If there is no current_dot, dots are set between the user and the goal_target and the method ends. Otherwise, the last_dot is either the last dot or the current_dot. If the goal hasn't moved, the method ends. If the goal is further, the path is wholly or partially recalculated. If the goal is nearer, the path is recalculated between the last_dot and the goal. <br></p>
<br>
<p>choose_velocity() sets the entity's body's internal velocity to current_dot - current_pos. mobileBody.gd/_process(delta) sets its physics_body_node's move_and_collide to velocity (judged from internal velocity) * speed * delta * KnowledgeBase.logic_time, publishing "moved" and the entity to the MessageBus. <br></p>
<p>choose_velocity() sets the entity's body's internal velocity to current_dot - current_pos. mobileBody.gd/_process(delta) sets its physics_body_node's move_and_collide to velocity (judged from internal velocity) * speed * delta * <a href="/blessfrey-gdd/achievements">KnowledgeBase</a>.logic_time, publishing "moved" and the entity to the <a href="/blessfrey-gdd/achievements">MessageBus</a>. <br></p>
<br>
<p>The MessageBus's Moved.gd handler will judge progress and emit a signal. Since "reached", "arrived", etc are connected during MoveToDestination's Enter phase, handle_moved_result handles the package. If it is "arrived" and track is true, 'item_arrived' signal is emitted, the first waypoint is popped off, and the entity calls clear_movement. <br></p>
<p>The <a href="/blessfrey-gdd/achievements">MessageBus</a>'s Moved.gd handler will judge progress and emit a signal. Since "reached", "arrived", etc are connected during MoveToDestination's Enter phase, handle_moved_result handles the package. If it is "arrived" and track is true, 'item_arrived' signal is emitted, the first waypoint is popped off, and the entity calls clear_movement. <br></p>
<br>
<p>MoveToDestination.gd/_on_item_arrived(floor_item) calls arrived to disconnect signals, set track to false, and clear the entity's movement. Then it calls item.pick_up().pick_up(). <br></p>
<br>
<h2>challenges/known issues </h2>
<p>Navigation2D and get_simple_path will be removed in a future version of Godot. <br></p>
<br>
<p>I intend for the player to be able to pick up an item through the inspect menu without changing his current target. For now, InspectMenu.gd/set_subject(subject) sets the player target. MoveToDestination.gd/handle_moved_result tracks the user's current target using character/find_distance_to_target(). Instead, it would need to receive the relevant subject from the inspect menu or skill or attack target from the character and pass it through character/find_distance_to(target). <br></p>
% for i in ["cast","credits","ID","inspect menu", "item","job","keyword","mechanics","Mercur","milestones","pathfinding","proxemics","setting","skill","story","style guide","terms","vibe","website"]:
% for i in ["achievements","cast","controls","credits","ID","inspect menu", "inventory","item","job","keyword","mechanics","Mercur","milestones","pathfinding","proxemics","setting","skill","story","style guide","terms","vibe","website"]: