Dialogue and Quest Course editor crashes unity

I started this course some time ago but abandoned it when I got no help with why the editor script crashes unity.
It still does not work for me, initially I changed a few parameters to siut my style, node colours and link placement, nothing drastic. On opening the project everything works until I get the editor then unity stops, no console messages and the only thing possible is to terminate the programme.
I started a new project with just the dialogue and SO scripts and followed the course exactly, same result.
I then used the git files and started another empty project, none of my code only Pats, same result.
I tried the whole process on every new unity version and last year built a new box for dev work but still cannot get Pats code to work. As others seem to get past this point I am assuming something with my setup is still wrong but I am not sure what. Unity versions are different, harware is different I even changed OS from Arch to endeavoros. Any ideas?

Hi weedfreak,
That sounds dreadfully frustrating. Especially if it’s crashing using the course repo.

I’m wondering if the issue isn’t Linux related. I’m not actually sure how many students have used Linux for the Shops and Abilities courses.

In the same folder that Unity normally puts your save files, you should find a file called Player.Log. It’s probably far too long to paste in here, you should be able to paste it at hatebin.com and link to it here (or try pasting it into a personal message to me, I won’t bite). Run the program until Unity crashes, and then locate the file an send it.

I do not have a Player.Log file in my projects folder. According Unity manual on linux it should be at ~/.config/unity3d/CompanyName/ProductName/Player.log but there is no log there either.

I would assume, probably incorrectly, that a Player log would not be created until I built the project and ran it as a Player. I have not attepted to build it as there is only the dev editor present and nothing for a player to interact with, trying to create a dialogue is where it crashes.

In that case, we need the Editor Log…
It looks like in Linux, that is located at ~/.config/unity3d/Editor.log

OK found that log, I will have to recreate the project and run it again to get a correct log, will post a link or PM it soon.

Hmmm… I think we’ve been focused too long on the Linux environment and not on the code…
The issue is a bit of infinite serialization caused by what’s going on in CreateNode (which we use when we create a node in the Editor. When we automatically create a new node in the creation of a new dialogue, that code in CreateNode() will cause a bit of hubbub with the Undo system (because the Dialogue doesn’t technically exist yet).

At a certain point, we created a new method MakeNode that doesn’t use the Undo system:

    private DialogueNode MakeNode(DialogueNode parent)
    {
        DialogueNode newNode = CreateInstance<DialogueNode>();
        newNode.name = Guid.NewGuid().ToString();
        if (parent != null)
        {
            parent.AddChild(newNode.name);
            newNode.SetPlayerSpeaking(!parent.IsPlayerSpeaking());
            newNode.SetPosition(parent.GetRect().position + newNodeOffset);
        }

        return newNode;
    }

in OnBeforeSerialize, change this:

if(nodes.Count==0)
{
     CreateNode(null);
}

to

if(nodes.Count == 0)
{
     DialogueNode newNode = MakeNode(null);
     AddNode(newNode);
}

Am I correct in my understanding of what you write, the git code at the ene of the editor section is in error? It seems the code was udated in a later section though I am not sure where. I had stopped following the course at that point as I could not use the editor.
I intend now to go back and redo the course completly so I understand how the error was made and corrected.

I crawled through the commits, and found this change was made in the lecture Getters, setters, and Undo

Privacy & Terms