documentation - messagebus, base, knowledgebase

master
chimchooree 2 years ago
parent 5b8b01678e
commit e5386e633b

@ -0,0 +1,34 @@
<p>The MessageBus is a node singleton that delivers messages and data between objects. It rests at res://Singleton/MessageBus.gd. <br></p>
<br>
<h3>flow </h3>
<p>A handler first subscribes to a topic. When a particular topic comes up, it is published and passed to the subscribed handlers. When a topic is no longer relevant to a handler or the handler exited the tree, it unsubscribes.<br></p>
<br>
<p>Also, all objects that inherit from the <a href="/blessfrey-gdd/docs/base">base</a> request a ref_id at ready. <br></p>
<br>
<h3>signals </h3>
<p><ul>
<li>•&nbsp;<b>-</b>: - </li>
</ul><br>
<br>
<h3>variables </h3><br>
<p><ul>
<li>•&nbsp;<b>current_ref_id</b>: int. ref ids are handed out sequentially by incrementing this value. Its initial value is -1. </li>
<li>•&nbsp;<b>topics</b>: Dictionary. Holds a list of handlers for each topic. </li>
</ul><br></p>
<br>
<h3>methods </h3><br>
<p>int designate_ref_id() <br></p>
<p>increments current_ref_id by one then returns it. <br></p>
<br>
<p>void publish(String topic, ??? data) <br></p>
<p>If the topic has any active subscriptions, its handlers are prompted to handle the data. <br></p>
<br>
<p>void subscribe(String topic, Object handler) <br></p>
<p>An entry in topics is made for the topic if needed, then the handler is added to the topic's list. <br></p>
<br>
<p>void unsubscribe(String topic, Object handler) <br></p>
<p>if the topic has an active subscription, the given handler is erased from the topic's list. <br></p>
<br>
<p>void _on_handler_tree_exited(String topic, Object handler) <br></p>
<p>During subscribe, the handler is connected to execute this if it exits the tree. It unsubscribes the handler from the topic. <br></p>
<br>

@ -0,0 +1,58 @@
<p>The Base is a node with IDs, a name, and a description. It rests at res://Entity/Base.gd. <br></p>
<br>
<h3>flow </h3>
<p>At ready, it gains a ref_id from the MessageBus. <br></p>
<br>
<h3>signals </h3>
<p><ul>
<li>•&nbsp;<b>-</b>: - </li>
</ul><br>
<br>
<h3>variables </h3><br>
<p><ul>
<li>•&nbsp;<b>base_id</b>: Color. The id shared by all instances of this type of object. For example, all instances of Melon Soda have the same base id but different ref ids. </li>
<li>•&nbsp;<b>desc_key</b>: String. The key used by the TranslationServer to retrieve the object's description. </li>
<li>•&nbsp;<b>is_player</b>: bool. Only true when this object is the player. </li>
<li>•&nbsp;<b>name_key</b>: String. The key used by the TranslationServer to retrieve the object's display name. </li>
<li>•&nbsp;<b>player_base_id</b>: Color. The base id of the player. </li>
<li>•&nbsp;<b>ref_id</b>: int. The id that identifies a particular instance of an object. </li>
</ul><br></p>
<br>
<h3>setters + getters </h3>
<p>Color get_base_id () <br></p>
<p>base_id getter <br></p>
<br>
<p>??? get_base_id_in_hex()<br></p>
<p>returns base_id in hex <br></p>
<br>
<p>String get_desc()<br></p>
<p>returns description in current language <br></p>
<br>
<p>String get_desc_key()<br></p>
<p>desc_key getter <br></p>
<br>
<p>String get_display_name()<br></p>
<p>returns display name in current language <br></p>
<br>
<p>bool get_is_player()<br></p>
<p>returns whether this object is the player <br></p>
<br>
<p>void set_ref_id(new_ref_id)<br></p>
<p>ref_id setter <br></p>
<br>
<p>int get_ref_id()<br></p>
<p>ref_id getter <br></p>
<br><br>
<h3>methods </h3><br>
<p>bool compare_base_id(second_object) <br></p>
<p>returns whether this object and the given object are the same kind of object. <br></p>
<br>
<p>bool compare_base_id_to_hex(hex) <br></p>
<p>returns whether this object has the given hex as a base id. <br></p>
<br>
<p>bool compare_ref_id(second_object) <br></p>
<p>returns whether this object and the given object are the exact same object. <br></p>
<br>
<p>??? make_instance(path) <br></p>
<p>returns an instance of the scene at the given path. <br></p>
<br>

@ -0,0 +1,36 @@
<p>The KnowledgeBase is a node singleton that stores and manages all the knowledge in the game. It rests at res://Singleton/KnowledgeBase.gd. <br></p>
<br>
<h3>flow </h3>
<p>On ready, the encountered, forgot, and learned topics and handlers are set up. <br></p>
<br>
<p>Knowledge is learned by setting
<br>
<p>Also, all objects that inherit from the <a href="/blessfrey-gdd/docs/base">base</a> request a ref_id at ready. <br></p>
<br>
<h3>signals </h3>
<p><ul>
<li>•&nbsp;<b>-</b>: - </li>
</ul><br>
<br>
<h3>variables </h3><br>
<p><ul>
<li>•&nbsp;<b>current_ref_id</b>: int. ref ids are handed out sequentially by incrementing this value. Its initial value is -1. </li>
<li>•&nbsp;<b>topics</b>: Dictionary. Holds a list of handlers for each topic. </li>
</ul><br></p>
<br>
<h3>methods </h3><br>
<p>int designate_ref_id() <br></p>
<p>increments current_ref_id by one then returns it. <br></p>
<br>
<p>void publish(String topic, ??? data) <br></p>
<p>If the topic has any active subscriptions, its handlers are prompted to handle the data. <br></p>
<br>
<p>void subscribe(String topic, Object handler) <br></p>
<p>An entry in topics is made for the topic if needed, then the handler is added to the topic's list. <br></p>
<br>
<p>void unsubscribe(String topic, Object handler) <br></p>
<p>if the topic has an active subscription, the given handler is erased from the topic's list. <br></p>
<br>
<p>void _on_handler_tree_exited(String topic, Object handler) <br></p>
<p>During subscribe, the handler is connected to execute this if it exits the tree. It unsubscribes the handler from the topic. <br></p>
<br>

@ -0,0 +1,34 @@
<p>The MessageBus is a node singleton that delivers messages and data between objects. It rests at res://Singleton/MessageBus.gd. <br></p>
<br>
<h3>flow </h3>
<p>A handler first subscribes to a topic. When a particular topic comes up, it is published and passed to the subscribed handlers. When a topic is no longer relevant to a handler or the handler exited the tree, it unsubscribes.<br></p>
<br>
<p>Also, all objects that inherit from the <a href="/blessfrey-gdd/docs/base">base</a> request a ref_id at ready. <br></p>
<br>
<h3>signals </h3>
<p><ul>
<li>•&nbsp;<b>-</b>: - </li>
</ul><br>
<br>
<h3>variables </h3><br>
<p><ul>
<li>•&nbsp;<b>current_ref_id</b>: int. ref ids are handed out sequentially by incrementing this value. Its initial value is -1. </li>
<li>•&nbsp;<b>topics</b>: Dictionary. Holds a list of handlers for each topic. </li>
</ul><br></p>
<br>
<h3>methods </h3><br>
<p>int designate_ref_id() <br></p>
<p>increments current_ref_id by one then returns it. <br></p>
<br>
<p>void publish(String topic, ??? data) <br></p>
<p>If the topic has any active subscriptions, its handlers are prompted to handle the data. <br></p>
<br>
<p>void subscribe(String topic, Object handler) <br></p>
<p>An entry in topics is made for the topic if needed, then the handler is added to the topic's list. <br></p>
<br>
<p>void unsubscribe(String topic, Object handler) <br></p>
<p>if the topic has an active subscription, the given handler is erased from the topic's list. <br></p>
<br>
<p>void _on_handler_tree_exited(String topic, Object handler) <br></p>
<p>During subscribe, the handler is connected to execute this if it exits the tree. It unsubscribes the handler from the topic. <br></p>
<br>

@ -19,7 +19,7 @@
<li><b>Price:</b> $874.99 USD</li> <li><b>Price:</b> $874.99 USD</li>
<li><b>Press Contact:</b> find me IRL</li> <li><b>Press Contact:</b> find me IRL</li>
<li><b>Social:</b> taking a social media break but should try Mastodon, HIVE more seriously</li> <li><b>Social:</b> taking a social media break but should try Mastodon, HIVE more seriously</li>
</ul> </ul><br><br>
</div> </div>
<div class="textbox desc"> <div class="textbox desc">
@ -41,12 +41,12 @@ The dual-class and skillbar building systems are inspired by Guild Wars 1 and Ma
<li>Freely relocate skill points and swap out skills in safe zones</li> <li>Freely relocate skill points and swap out skills in safe zones</li>
<li>Learn new skills through themed exploration and gameplay. No skill shops nor UI skill trees</li> <li>Learn new skills through themed exploration and gameplay. No skill shops nor UI skill trees</li>
<li>Explore an above ground rural town and an underground world populated by fantasy species </li> <li>Explore an above ground rural town and an underground world populated by fantasy species </li>
</ul> </ul><br><br>
</div> </div>
<div class="textbox dev"> <div class="textbox dev">
<h2>Developer </h2> <h2>Developer </h2>
Chimchooree has a programming and art background, studying both in school and at home since she was a kid. Her five favorite videogames are Oblivion, Guild Wars 1, Arcanum, Divine Divinity, and Anachronox. Keep up with her activity on her <a href="/diary">dev diary</a>. <br> Chimchooree has a programming and art background, studying both in school and at home since she was a kid. Her five favorite videogames are Oblivion, Guild Wars 1, Arcanum, Divine Divinity, and Anachronox. Keep up with her activity on her <a href="/diary">dev diary</a>. <br><br>
</div> </div>
<div class="textbox videos"> </div> <div class="textbox videos"> </div>
@ -59,7 +59,7 @@ The dual-class and skillbar building systems are inspired by Guild Wars 1 and Ma
<div class="textbox contact"> <div class="textbox contact">
<h2>Contact</h2> <h2>Contact</h2>
<p>I'll link social media, etc, later. <br></p> <p>I'll link social media, etc, later. <br><br></p>
</div> </div>
<div class="textbox credits"> <div class="textbox credits">
@ -70,7 +70,7 @@ The dual-class and skillbar building systems are inspired by Guild Wars 1 and Ma
<li>Design: chimchooree, husband</li> <li>Design: chimchooree, husband</li>
<li>Engine: Godot Engine</li> <li>Engine: Godot Engine</li>
<li><a href="/credits">Full Credits</a></li> <li><a href="/credits">Full Credits</a></li>
</ul> </ul><br><br>
</div> </div>
<div class="textbox permissions"> <div class="textbox permissions">

Loading…
Cancel
Save