NPC Dialog

Get help using Construct 2

Post » Sat Jan 21, 2012 8:35 am

Hello All
For 3 Days Ive been working on a NPC conversation but I dont know something went wrong. When the arrows are clicked I want the conversation between the player and NPC to continue. Could someone please take a look a my file and show me where Im messing up.

http://www.fileserve.com/file/WxYTkDM/Oyashima.caproj
B
3
Posts: 5
Reputation: 313

Post » Sat Jan 21, 2012 8:38 am

The download isn't working; you saved it as a folder, but didn't give us the whole folder.

The easiest thing to do is click "Save as a single file" and then upload that. Much less hassle for other people.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sat Jan 21, 2012 7:17 pm

Sorry about that hopefully this works
Oyashimasingle.capx
B
3
Posts: 5
Reputation: 313

Post » Sat Jan 21, 2012 8:16 pm

So first thing you're doing wrong : your file host ^^
Really, prefer using dropbox, so that the users don't have 5 click and a captcha to answer, this is just bad.

Then, you should use instances rather than showing/hiding your gui elements as you go by.
For now you have three, but I bet you're aiming for "a big game" and you'll end up drown in thousands of such objects.

Rather than Next, Next1, Next2, etc... use a single object and private instances to see where you're at.

There are several dialog systems in the how do I FAQ
[quote]A dialog system with answers - LINK
Visual Novel/Dialogues example - LINK[/quote]

I strongly suggest to check them out and find a way to implement/adapt them in your own game.

It's not an easy task, but dialogs are a complex subject.
Good luck

Edit: also I forgot, the current problem is because when you use the condition "click on Next" the click occurs when the mouse button is down.
This makes the second sentence appear, but as you're still "clicking" for C2, it jumps to the third, and the next one...

Checking the examples will allow you to wait for the user's action before displaying one sentence or another.Kyatric2012-01-21 20:19:19
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Sat Jan 21, 2012 8:29 pm

Okay, I fixed it. I also fixed, well... a lot of things.

http://db.tt/UmBj3oH3

I'll try to explain all the changes I made.

The biggest problem with the dialogue system was that you were trying to create new objects for each part of the conversation, which wasn't necessary to do at all. It gets very messy trying to deal with all those objects, and the way I set it up is much simpler. Instead of having all of those conversation objects, there's a single one, simply named Conversation, with all of the different pictures set as frames of an animation. Normally, that means it would cycle through the pictures as an animation, but I also set the animation speed to 0, meaning it doesn't move; at that point, you use events to set the animation frame, switching between them as you want.

In addition to the conversation pictures, you also tried to create different text objects for the actual words. Again, you only need one text object. For each part of the conversation, you can use the text object's "Set text" action to display the dialogue you want.

Same goes for the "Next" and "Close" objects -- you only need one.

To advance the conversation, I gave Next a private variable called "Convo". When Next is clicked, Convo is increased by 1. Based on the current value of Convo, you change the conversation picture and the text to be what you want it to be.

Also, the thing mentioned before about putting all the pictures into an animation with a speed of 0 can be applied to things like the corpses, which I did for you. You won't have to have separate objects like Corpse1, Corpse2, and Corpse3; just one object called Corpse, with all three pictures in it. In the editor, you can click an object and set its initial frame under the "Properties" section.

I'm not too good at explaining things, so don't hesitate to ask any questions if I confused you with all of this.
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sat Jan 21, 2012 8:30 pm

Oh come on, Kyatric!

Serves me right for not refreshing before posting this...
B
20
S
9
G
6
Posts: 607
Reputation: 6,112

Post » Sat Jan 21, 2012 8:42 pm

dialogStuff.capx
But next time, please, use dropbox (:

Damn I've been double ninja'd
Last edited by Yann on Sun Sep 14, 2014 11:07 am, edited 1 time in total.
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Sat Jan 28, 2012 8:07 am

Thank you for your help
B
3
Posts: 5
Reputation: 313

Post » Mon Dec 02, 2013 11:58 am

I have learn something new here thanks
B
206
S
27
G
13
Posts: 1,845
Reputation: 35,820


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 23 guests