Dialogue System Template (Templates)

Discuss Scirra's 2D Asset Store

Post » Thu Apr 07, 2016 3:54 pm

@Magistross Thank you! And I hope that in the end it does play as good as it looks, that's my main concern too.
B
119
S
41
G
40
Posts: 835
Reputation: 27,790

Post » Wed May 18, 2016 9:34 pm

Hey I love this dialogue system, took me a bit of reading to get my head around it but I've got it working fine now, I can call saved dialogues on the fly :) -

One thing I am having difficulty with, I want to have in-game cutscenes and can't figure out how I would implement things like character movement during dialogue scenes (I know that's not well explained)

An example would be: Npc says one line of dialogue, when the player hits enter to continue the dialogue the npc that is "speaking" walks to the other side of the room.

Is there a way to, for example, call a function from within the saved JSON? something like "Hey this is some dialogue" {callfunction : functionname}.

Sorry if this is poorly worded, I'm not quite sure how to describe what I mean :(
B
20
S
6
Posts: 17
Reputation: 1,342

Post » Thu May 19, 2016 8:19 pm

Hey @smallrobot, thanks for your kind words!

It's quite feasible, the "text command" functionality is entirely customizable. You could create a "callfunction" command that accept at least one parameter (a callback function name) and optional parameters to be passed to the callback. Or you could also create a dedicated command called "MoveNPC" that accepts parameters to customize what NPC should move and how it should move.

To create new commands you simply have to add more events under the "Dialogue_ProcessCommand" function event in the "Text commands" group.

Let me know if you need further help! ;)
B
58
S
23
G
22
Posts: 890
Reputation: 16,790

Post » Thu May 19, 2016 8:59 pm

Hey @magistross

Thanks for such a quick reply bud - I don't know how I missed the text commands group, I feel daft now. That worked great, I added commands to select an object from a variable and then move it, change its current animation etc... so now I can just write up entire cutscenes in the dialogue and call them when needed, which is super handy.

Thanks again!
B
20
S
6
Posts: 17
Reputation: 1,342

Post » Thu May 19, 2016 10:28 pm

That's pretty neat @smallrobot. Good job on sucessfully turning my dialogue system in a full fledged cutscene scripting language. :lol:
B
58
S
23
G
22
Posts: 890
Reputation: 16,790

Post » Sun May 22, 2016 8:09 pm

Funny enough I got to the same point this weekend. Working on cutscenes with dialogue and was trying to figure out how to control my characters during and after dialogue. Came here and @smallrobot had pretty much asked my exact question :lol: Text commands work great! Controlling the cutscenes via the dialogue is really handy. You really thought this asset out well @magistross!
B
37
S
11
G
1
Posts: 258
Reputation: 3,162

Post » Mon May 30, 2016 9:52 pm

Running in to an issue: I'd like to move the dialogue box to a different position for cutscenes. I tried setting up a text command that set the DIALOGUE_POSITIONX and DIALOGUE_POSITIONY when called via dialogue. I couldn't get it to move the dialogue box and I even tried setting the local variables as static.

I found a temporary fix by doing this: Image

Is there a better way to do this? Thanks!
B
37
S
11
G
1
Posts: 258
Reputation: 3,162

Post » Mon May 30, 2016 10:25 pm

@bclikesyou That's actually the proper way to do it. The DIALOGUE_POSITIONX and DIALOGUE_POSITIONY are local variables used when creating a new dialogue. Setting them as static is only half the solution, you still have to move the current window/spritefont/portrait. Take note that the variables won't revert to their original values, so you might want to add new variables to store default values and a function to revert to them.
B
58
S
23
G
22
Posts: 890
Reputation: 16,790

Post » Tue May 31, 2016 2:54 pm

Magistross wrote:@bclikesyou That's actually the proper way to do it. The DIALOGUE_POSITIONX and DIALOGUE_POSITIONY are local variables used when creating a new dialogue. Setting them as static is only half the solution, you still have to move the current window/spritefont/portrait. Take note that the variables won't revert to their original values, so you might want to add new variables to store default values and a function to revert to them.


Ah perfect! Yeah it's working great for me so far.
B
37
S
11
G
1
Posts: 258
Reputation: 3,162

Post » Mon Jun 06, 2016 12:23 pm

Thanks for this system, a little bit complicated and the workflow with the utility is hard to pick up at first, but got it up and running in my game within an hour. Some documentation would probably be helpful to newer users as I had to read through this thread to get going. Great work @Magistross
B
15
S
4
G
1
Posts: 14
Reputation: 1,453

PreviousNext

Return to Scirra Store

Who is online

Users browsing this forum: No registered users and 2 guests