dialogic-godot / dialogic

💬 Create Dialogs, Visual Novels, RPGs, and manage Characters with Godot to create your Game!
https://dialogic.pro
MIT License
3.42k stars 206 forks source link

Can't find Dialogic (DialogicClass.gd) node/file #1916

Closed freddiearms closed 6 months ago

freddiearms commented 6 months ago

The problem

Describe the bug I can't find the node to create which allows me to pick which timeline I want to appear first (Dialogic (DialogicClass.gd) it should be called - or something similar. I've finished my project and I would like to export it etc. But to do that I need to create that node apparently - and I can't find the node. I believe it should be called something like 'Dialogic (DialogicClass.gd'

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Create New Node'
  2. There should be something called 'Dialogic (DialogicClass.gd)' which is what I think I need, but there isn't.

Expected behavior I expected to find the node/file, and then select which timeline I want to appear first in the game but I can't find it.

Screenshots

dialogic 1 dialogic 2

System (please complete the following information):

CakeVR commented 6 months ago

Have you taken a look at the introduction? https://dialogic-docs.coppolaemilio.com/documentation/getting-started/

freddiearms commented 6 months ago

Have you taken a look at the introduction? https://dialogic-docs.coppolaemilio.com/documentation/getting-started/

Thanks, I've had a look - however it doesn't say the names of the nodes which I should add or provide an in-depth tutorial. Is there anything which can provide more specific information?

CakeVR commented 6 months ago

Thanks, I've had a look - however it doesn't say the names of the nodes which I should add or provide an in-depth tutorial. Is there anything which can provide more specific information?

All you need is your own script and call the referenced method in that Getting Started page: Dialogic.start

Dialogic is set up as an autoload, it will attach the needed logic to the current scene automatically before anything happens.

Jowan-Spooner commented 6 months ago

@freddiearms I'm not sure if you've used 1.x previously or just got confused by some 1.x documentation. However as CakeVR said in dialogic 2 there is no node you add to start dialog, instead it's done via code. A good code example for that is in the gettings started documentation.

To make sure this happens as soon as you start the game you just put the call in the ready function of your main scenes script. You can set the main scene in the project settings or by right clicking the scene file in the file system dock.

freddiearms commented 6 months ago

I understand a bit more now, however my bad coding/computer skills is still holding me back. I'll pay someone £30 ($37) if they can fix my project to make it export and work properly. I've done all the work, all I need is someone to tell me what exactly to do now (eg. what code to add to which script and if I need to do anything else what that is etc.)

Also, I seem to have accidentally added 2 scripts (which have code in them) called DialogicUtil.gd and BranchEnd.gd when trying to run the project because, when prompted to select a main scene on trying to run the project (because one was not set), I foolishly blindly selected some random file called BranchEnd.gd in the events folder of Dialogic. I need someone to let me know if and how I need to delete that DialogicUtil.gd script. I don't know what the hell I've done with my project and really need help lol.

help
CakeVR commented 6 months ago

I recommend to create a new scene from scratch. Attach a script to the root node, inside the _ready function, load your timeline with the aforementioned Dialogic.start.

You can change your main scene in the project settings: image

freddiearms commented 6 months ago

I did that, but again, I don't know what type of node to add to the main scene - so because I don't know what to add I added a random node (CustomEventConverter) and attached the dialogic script (with this code included in the script as well as the other stuff: func _ready():

Load the Dialogic timeline

Dialogic.start('timeline 1')

When I ran the project, unsurprisingly, it gave me an error saying instance_create: Script inherits from native type 'Resource', so it can't be assigned to an object of type 'Node'.
help 1

So I need help with what type of node to add to the main scene etc.

CakeVR commented 6 months ago

What do you mean by adding to the main scene? I do not recommend to attach any random nodes to your scene, it's just asking for trouble. Just a simple Node.

When you create a new scene, you already have a root node and you attach your own new script to it. You need no Dialogic nodes at all, they are used internally in the Dialogic layouts.

freddiearms commented 6 months ago

When I create a new scene though, I don't get a root node. Instead, I have to create either a 2d, 3d, user interface or other node.

help 2

This is where I don't know what to do.

CakeVR commented 6 months ago

If you make a 2D game, simply click 2D Scene, it will create the root accordingly and then you can attach your own script. I recommend to learn a bit more about Godot's basics.

freddiearms commented 6 months ago

I clicked 2D Scene, and added my script - which was the script created by Dialogic after I simply created my timelines. However, when I tried to run the project it gave this error.

help 3

Do you see the problem now?

CakeVR commented 6 months ago

Do not attach any scripts by Dialogic, you must create your own GDScript file for this.

Right-click the node and select "Attach Script". Now, select some path where you want your scripts to be stored and decide on the name.

freddiearms commented 6 months ago

Ohh, thank you so much for your help. Sorry for the confusion. I did what you said and everything works perfectly now.

Thank you.