Skip to content

Commit de20aff

Browse files
committed
Add missing 'add_child' call in template and fix typos in docs
1 parent 6ec8f10 commit de20aff

File tree

13 files changed

+48
-24
lines changed

13 files changed

+48
-24
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Change Log
22
Important changes to _inkgd_ will be documented in this file.
33

4+
## [0.4.X](https://github.com/ephread/inkgd/releases/tag/0.4.X)
5+
Released on 2022-0X-3X.
6+
7+
### Fixed
8+
- Add missing `add_child` call in templates.
9+
410
## [0.4.6](https://github.com/ephread/inkgd/releases/tag/0.4.6)
511
Released on 2022-07-31.
612

addons/inkgd/editor/templates/ink_template.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ onready var _ink_player = InkPlayer.new()
2121
# ############################################################################ #
2222

2323
func _ready():
24+
%TS%# Adds the player to the tree.
25+
%TS%add_child(_ink_player)
26+
2427
%TS%# Replace the example path with the path to your story.
2528
%TS%# Remove this line if you set 'ink_file' in the inspector.
2629
%TS%_ink_player.ink_file = load("res://path/to/file.ink.json")

addons/inkgd/editor/templates/ink_template_signals.gd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ onready var _ink_player = InkPlayer.new()
2222
# ############################################################################ #
2323

2424
func _ready():
25+
%TS%# Adds the player to the tree.
26+
%TS%add_child(_ink_player)
27+
2528
%TS%# Replace the example path with the path to your story.
2629
%TS%# Remove this line if you set 'ink_file' in the inspector.
2730
%TS%_ink_player.ink_file = load("res://path/to/file.ink.json")

docs/source/advanced/choosing_between_inkgd_and_godot_ink.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ instance, methods are written in PascalCase. Additionally, some types —such as
2121
InkList— can't be easily bridged to GDScript.
2222

2323
*inkgd* provides a snake-cased API that integrates well with other GDScript
24-
scripts, but suffers from poor performances. The GDScript implementation is
24+
scripts but suffers from poor performance. The GDScript implementation is
2525
about 50 times slower than *godot-ink*. These performance limitations are
2626
detailed in :doc:`/advanced/performance`.
2727

docs/source/advanced/differences_between_api.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ InkRuntime contains a few configuration settings you may want to tweak, see the
6060
.. note::
6161

6262
When using InkPlayer, you don't need to manually add the runtime node to
63-
the tree. All the properties defined on InkRuntime also available on
63+
the tree. All the properties defined on InkRuntime are also available on
6464
InkPlayer, use them instead if you did not instantiate the node by
6565
yourself.
6666

@@ -203,14 +203,14 @@ information, refer to :doc:`this document</advanced/error_management>`.
203203
:ref:`exception_raised<class_inkruntime_exception_raised>`.
204204

205205

206-
Getting the ouput of ``evaluate_function``
206+
Getting the output of ``evaluate_function``
207207
------------------------------------------
208208

209209
``evaluate_function`` evaluates an **ink** function from GDScript. Since it's
210210
not possible to have in-out variables in GDScript you need to pass ``true`` to
211211
``return_text_output`` to retrieve the text output of the function.
212212
``evaluate_function`` will then return a dictionary containing both the return
213-
value and the outputed text.
213+
value and the output text.
214214

215215
.. code:: gdscript
216216

docs/source/advanced/error_management.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Depending on the build type the runtime will behave differently.
5050
to the editor/terminal using ``push_error``;
5151

5252
* if ``__InkRuntime.stop_execution_on_exception`` is ``true``, exceptions are reported using
53-
``assert`` instead, which pauses the execution and make them explicit.
53+
``assert`` instead, which pauses the execution and makes them explicit.
5454

5555
#. This is a release build:
5656

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
Migrating to Godot Mono
22
=======================
33

4-
To be added.
4+
To be added. In the meantime, see the example project and `story_player.gd`_.
5+
6+
.. _`story_player.gd`: https://github.com/ephread/inkgd/blob/main/examples/scenes/common/story_player.gd

docs/source/advanced/performance.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Benchmarks
2222
The time required to create and allocate a story is benchmarked below.
2323

2424
All benchmarks use variations of *ipsuminious*, a story based on the
25-
Intercept, which can replicate itself to artifically increase the number
25+
Intercept, which can replicate itself to artificially increase the number
2626
of words and constructs. The growth is linear. Size 12 is 12 times bigger than
2727
size 1.
2828

@@ -172,7 +172,11 @@ Average novels contain about 90,000 words.
172172
Alternatives to *inkgd*
173173
-----------------------
174174

175-
If *inkgd* proves too slow for you needs, the only other option is to migrate
176-
to Godot Mono and use the official C# implementation through `godot-ink`_.
175+
If vanilla *inkgd* proves too slow for your needs, there are two options
176+
involving Godot Mono.
177+
178+
1. use the (undocumented) compatibility layer of inkgd, that exposes
179+
the official C# implementation while keeping the same API;
180+
2. use the official C# implementation through `godot-ink`_.
177181

178182
.. _`godot-ink`: https://github.com/paulloz/godot-ink

docs/source/advanced/using_inkplayer.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ Main differences with *story.gd*
2727
the JSON bytecode.
2828

2929
2. It unifies Ink's original handlers and *inkgd* custom signals under
30-
a same set of consistent signals.
30+
the same set of consistent signals.
3131

32-
3. It adds convenience methods to save and load the story state.
32+
3. It adds convenient methods to save and load the story state.
3333

3434
4. It simplifies certain APIs, such as
3535
:ref:`evaluate_function<class_inkplayer_evaluate_function>`
@@ -40,13 +40,12 @@ Main differences with *story.gd*
4040
Loop-based vs. signal-based flow
4141
--------------------------------
4242

43-
InkPlayer can be used in two different ways. The examples below are
44-
incomplete, for a working example, refer to `the_intercept.gd`_.
43+
InkPlayer can be used in two different ways.
4544

4645
.. warning::
4746

48-
The example below are not complete. For a working example, refer to
49-
`the_intercept.gd`_.
47+
The examples below are not complete. For a working example, refer to
48+
`story_player.gd`_.
5049

5150

5251
Loop-based
@@ -130,7 +129,7 @@ more flexible.
130129
if !choices.empty():
131130
print(choices)
132131
133-
# In a real world scenario, _select_choice' could be
132+
# In a real-world scenario, _select_choice' could be
134133
# connected to a signal, like 'Button.pressed'.
135134
_select_choice(0)
136135
@@ -165,7 +164,7 @@ in code.
165164
|
166165
167166
On platforms that don't support threads, the feature is automatically disabled
168-
regardles of the value of
167+
regardless of the value of
169168
:ref:`loads_in_background<class_inkplayer_loads_in_background>`.
170169

171170
.. _`story_player.tscn`: https://github.com/ephread/inkgd/blob/main/examples/scenes/common/story_player.tscn

docs/source/classes/class_inkplayer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Story Flow
9090
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
9191
| void | :ref:`choose_choice_index<class_inkplayer_choose_choice_index>` **(** int_ index **)** |
9292
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
93-
| void | :ref:`choose_path<class_inkplayer_choose_path>` **(** String_ path_string **)** |
93+
| void | :ref:`choose_path<class_inkplayer_choose_path>` **(** String_ path_string **)** |
9494
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
9595
| void | :ref:`switch_flow<class_inkplayer_switch_flow>` **(** String_ flow_name **)** |
9696
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
@@ -140,7 +140,7 @@ Variables
140140
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
141141
| void | :ref:`remove_variable_observer<class_inkplayer_remove_variable_observer>` **(** Object_ object, String_ method_name, String_ specific_variable_name **)** |
142142
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
143-
| void | :ref:`remove_variable_observer_for_all_variables<class_inkplayer_remove_variable_observer_for_all_variables>` **(** Object_ object, String_ method_name **)** |
143+
| void | :ref:`remove_variable_observer_for_all_variables<class_inkplayer_remove_variable_observer_for_all_variables>` **(** Object_ object, String_ method_name **)** |
144144
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
145145
| void | :ref:`remove_all_variable_observers<class_inkplayer_remove_all_variable_observers>` **(** String_ specific_variable_name **)** |
146146
+---------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+

0 commit comments

Comments
 (0)