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

YarnScript not correctly imported #42

Closed
WeersProductions opened this issue Oct 11, 2020 · 3 comments
Closed

YarnScript not correctly imported #42

WeersProductions opened this issue Oct 11, 2020 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@WeersProductions
Copy link

What is the current behavior?
Trying to start a dialogue results in 'Cannot load node example: No nodes have been loaded', where 'example' is the node that is passed on as the 'startNode'.

Please provide the steps to reproduce, and if possible a minimal demo of the problem:
Created a yarn script (newTest.yarn) with just a text:

title: newTest
---
my text
===

Created a yarn program and assigned it as the destination program to newTest.yarn.
Created a localizationDatabase and assigned it as the LocalizationDatabase to newTest.yarn. Localization is initialized/parsed and correctly set up in the editor after doing this.

Yarn program warns that no source scripts have been assigned.
Create an empty gameobject in the scene and adding a dialogueRunner, InMemoryVariableStorage, TextLineProvider, DialogueUI and setting the correct fields (referring to yarnProgram and localizationDatabase).

What is the expected behavior?
I expect the yarn scripts to be shown in the yarn program as they refer to the yarn program as destination.

Please tell us about your environment:

Other information
Strange behaviour: Seems like my .yarn files are not imported correctly. Line 73 from YarnProgramImported.cs filters based on whether the destinationProgram of a script is not equal to this. For me, even though they refer to a 'similar' (same name) object this is always true. This might be due changes in the Unity Editor Assets (but that's a guess).
Since extraneousSourceScripts contains the .yarn file, sourceScripts doesn't. This results in the file not being processed.

Changing the !=, not equal, to ==, equal, results in the files being shown as part of the yarnProgram (as expected). This is obviously not a fix, but shows that this might be part of the problem.
Making this change, reimporting the yarnScript, results in correct behaviour. YarnSpinner runs as expected.

@WeersProductions WeersProductions added the bug Something isn't working label Oct 11, 2020
@radiatoryang
Copy link
Contributor

I can't easily replicate this bug on develop... the Yarn script importer inspector looks like this, there's no way to manually assign a destination YarnProgram -- just a button to click "Create New Yarn Program":

image

Upon creating the new program, the Yarn Program field is grayed-out read-only and cannot be assigned to:

image

And when I use that button, all the source scripts are correctly assigned and the program runs fine for me.

Are you creating and compiling YarnPrograms via C# script at runtime, and not via the Unity editor inspector at editor time? If so, I think you'd need to post that C# script here to help us actually replicate the issue -- but also keep in mind that isn't really the intended pipeline here (see #43) where, ideally, you just ship the precompiled bytecode program with your game instead of the source scripts + compiler.

@WeersProductions
Copy link
Author

Hi, thank you for your response!
I will retry this with an updated version, I think it might have been related with the Unity version I was using.
The workflow you showed is what I was expecting as well.

@parisba parisba added this to the YS2.0 milestone Oct 27, 2021
@parisba parisba assigned desplesda and unassigned desplesda Oct 27, 2021
@McJones
Copy link
Contributor

McJones commented Nov 3, 2021

Thanks for filing the issue, however I am unable to reproduce this on a variety of different versions of Unity, closing for now.
If it still persists please open another issue.

@McJones McJones closed this as completed Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants