achievements, controls, inspect, inventory, item, pathfinding

This commit is contained in:
Mimi Momo
2022-11-11 11:43:11 -06:00
parent ef07db338c
commit c74356b372
7 changed files with 62 additions and 10 deletions
+2 -4
View File
@@ -9,17 +9,15 @@
<br>
<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>
<br>
<h2>works for...</h2>
<ul>
<li>move to item then pick up✓ </li>