Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update some instructions for workflow changes in YarnSpinner-Godot 0.2.0 #40

Merged
merged 4 commits into from
Feb 11, 2024
Merged
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .gitbook/assets/YarnSpinnerGodot-Csproj-File.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 11 additions & 17 deletions docs/beginners-guide/using-a-game-engine/yarn-spinner-for-godot.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Yarn Spinner for Godot is a Yarn Labs project. It is not fully, or officially su

This step of the beginner's guide helps you move from writing Yarn scripts outside of a game engine, to initial integration steps to turn them into a game with Godot

First, launch Godot 4.1 (C# version) and create a new project.
First, launch Godot 4.2 (C# version) and create a new project.

## Installing Yarn Spinner for Godot

Expand All @@ -47,7 +47,7 @@ Next, open the project folder in Visual Studio Code. In the sidebar of VS Code,

Your brand new project should look something like this in VSCode:

<figure><img src="../../.gitbook/assets/Screenshot 2023-10-17 at 3.14.29 pm.png" alt=""><figcaption><p>The <code>.csproj</code> for your project.</p></figcaption></figure>
<figure><img src="../../.gitbook/assets/YarnSpinnerGodot-Csproj-File.png" alt=""><figcaption><p>The <code>.csproj</code> for your project.</p></figcaption></figure>

Save the tweaked `.csproj` file and return to Godot, everything is almost ready to go. Click the Build button in the very top right-hand corner of the Godot window. This will trigger a build of the C# solution for the project, which is required to make Godot aware of Yarn Spinner for Godot.&#x20;

Expand Down Expand Up @@ -75,27 +75,21 @@ Your Scene dock will look like this showing a node hierarchy that's entirely bas
You could also instantiate the `DefaultDialogueSystem.tscn` into your scene at a lower part of the hierarchy, instead of the root node, to display dialogue using the provided default UI, instead.
{% endhint %}

Next, create a new Yarn Project by right-clicking in the FileSystem dock, and choosing Resource...:
Next, create a new Yarn Project using the menu Tools > YarnSpinner >Create Yarn Project:

<figure><img src="../../.gitbook/assets/Screenshot 2023-10-17 at 3.23.05 pm.png" alt="" width="563"><figcaption><p>Creating a new Resource in the FileSystem dock.</p></figcaption></figure>
<figure><img src="../../.gitbook/assets/YarnSpinnerGodot-Create-YarnProject.png" alt="" width="563"><figcaption><p>Opening the menu to create a new .yarnproject file.</p></figcaption></figure>

Then filter to the `YarnProject` resource type, and click the Create button:
Then choose a directory to save your new YarnProject in. For example, you can save it to the root of your project. Name the new Yarn Project `FirstProject.yarnproject`:

<figure><img src="../../.gitbook/assets/Screenshot 2023-10-17 at 3.23.14 pm.png" alt="" width="563"><figcaption><p>Creating a new YarnProject resource.</p></figcaption></figure>
<figure><img src="../../.gitbook/assets/YarnSpinnerGodot-Create-YarnProject-Dialog.png" alt="" width="563"><figcaption><p>Selecting a location to save your .yarnproject file.</p></figcaption></figure>

Name the new Yarn Project `FirstProject.tres`.&#x20;
Next, create a new Yarn script (a file with a `.yarn` extension) by using the menu Tools > YarnSpinner >Create Yarn Script. In the resulting "Create a new Yarn Script" window, set the File name to `MyStory.yarn`, and click the Save button::

Next, create a new Yarn script (a file with a `.yarn` extension) by right-clicking in the FileSystem dock, and choosing New TextFile:
<figure><img src="../../.gitbook/assets/YarnSpinnerGodot-Create-YarnScript.png" alt="" width="413"><figcaption><p>Opening the Create Yarn Script window</p></figcaption></figure>

<figure><img src="../../.gitbook/assets/Screenshot 2023-10-18 at 10.12.52 am.png" alt="" width="413"><figcaption><p>Creating a new TextFile, in order to add a Yarn script.</p></figcaption></figure>
It may take a moment, but Godot will import your new `.yarn` file, and it will appear in the FileSystem dock. When it's appeared, double-click on the Yarn Project, `FirstProject.yarnproject` in the FileSystem dock and look to the Inspector, making sure that `res://MyStory.yarn` is in the list of Source Scripts, which are the Yarn scripts that compromise the new project:

In the resulting New Text File... window, select All Files (\*) from the dropdown in the corner, set the File name to `MyStory.yarn`, and click the Save button:

<figure><img src="../../.gitbook/assets/Screenshot 2023-10-18 at 10.19.15 am.png" alt="" width="563"><figcaption><p>Naming the file for a new Yarn script.</p></figcaption></figure>

It may take a moment, but Godot will import your new `.yarn` file, and it will appear in the FileSystem dock. When it's appeared, double-click on the Yarn Project, `FirstProject.tres` in the FileSystem dock and look to the Inspector, making sure that `res://MyStory.yarn` is in the list of Source Scripts, which are the Yarn scripts that compromise the new project:

<figure><img src="../../.gitbook/assets/Screenshot 2023-10-18 at 10.25.13 am.png" alt="" width="563"><figcaption><p>The Yarn Project, with the Yarn script identified as a Source Script.</p></figcaption></figure>
<figure><img src="../../.gitbook/assets/YarnSpinnerGodot-YarnProject-Inspector.png" alt="" width="563"><figcaption><p>The Yarn Project, with the Yarn script identified as a Source Script.</p></figcaption></figure>

Next, open the `MyStory.yarn` file in VS Code, and add the following Yarn script to it, before saving it and returning to Godot:

Expand Down Expand Up @@ -129,7 +123,7 @@ Narrator: Someone read the Beginner's Guide!

</details>

Select the the `DialogueRunner` node in the Scene dock, and look to the Inspector. Assign the Yarn Project you created to the `DialogueRunner` by dragging the `FirstProject.tres` Yarn Project from the FileSystem dock into the Yarn Project slot of the Inspector:
Select the `DialogueRunner` node in the Scene dock, and look to the Inspector. Assign the Yarn Project you created to the `DialogueRunner` by dragging the `FirstProject.tres` Yarn Project from the FileSystem dock into the Yarn Project slot of the Inspector:

<figure><img src="../../.gitbook/assets/Screenshot 2023-10-18 at 10.34.38 am.png" alt="" width="563"><figcaption><p>The new Yarn Project resource assigned as the Yarn Project for the <code>DialogueRunner</code>.</p></figcaption></figure>

Expand Down