Dialogue System Template (Templates)

Discuss Scirra's 2D Asset Store

Post » Mon Sep 28, 2015 10:00 pm

Hello Magistross,

I have few questions regarding your dialogue system:

- is it possible to play a sound for each letter shown, like seen in some RPG (earthbound, golden sun, etc)
Examples : Golden sun : https://www.youtube.com/watch?v=RWbanjnE1LU
Earthbound : https://youtu.be/Q7LGGMK8-WY?t=1m22s

- Is it possible to add some text effects? Like shaking text, or wave animation?

Thanks!
B
6
S
2
G
1
Posts: 39
Reputation: 605

Post » Tue Sep 29, 2015 3:45 pm

Hi @Flodcp, thank you for your interest in my template ! :)

Good questions you have there.

Adding sound effects for each letter shown is dead easy. Adding a "play sound" at event 81 of the "DialogueEvents" sheet could suffice. However, it could lead to unwanted behavior like tons of sounds playing at once for instant text (delay = 0) or skipped sequence, sometimes the event not really fetching a new char since it's in a "wait" state (Dialogue_Timer > 0), or even the last char fetched that shouldn't trigger a sound since it's basically a EOF (Dialogue_CharIndex = len(AllText)). Having said all that, you can create a sub-event directly under 81 that would deal with all those cases.

Here's a screenshot of what event and where would it be optimal to place it :
Image

The local static variable make sure that no sound plays twice in a single tick, so it single-handedly deals with most of the previous issues I mentionned.

(As a side note, the examples you provided use a different approach than "play a sound for each letter", I can't say for sure, but I believe they are "playing a repeating sound while text is writing". It could be achieved too with my template, but it would be quite different than what I explained)

For visual effect, the only avenue for us is to use WebGL effects. However, those effects are applied to the spritefont texture as a whole and thus you won't obtain a cool shaky effect on individual characters like in your examples. One possible way to implement WebGL effects would be to add all the desired ones to the spritefont object and activate them with new text commands like {wave}.

Hope this helps ! ;)
B
75
S
31
G
27
Posts: 1,000
Reputation: 20,735

Post » Thu Oct 01, 2015 7:07 pm

Thanks a lot for your answer! I'll take a look in detail in your proposition.
B
6
S
2
G
1
Posts: 39
Reputation: 605

Post » Sun Oct 18, 2015 4:41 pm

This is an excellent template. Congrats!
B
124
S
51
G
24
Posts: 401
Reputation: 22,617

Post » Tue Oct 20, 2015 6:33 pm

hey @magistross !! look what I did using your template ;D https://www.scirra.com/arcade/shooting-games/2ws-2856
Image
B
22
S
5
G
2
Posts: 65
Reputation: 1,724

Post » Wed Oct 21, 2015 3:41 am

@fremachuca wrote:hey @magistross !! look what I did using your template ;D https://www.scirra.com/arcade/shooting-games/2ws-2856

That's quite impressive! Nice work adapting the template to your style too, it fits seamlessly!
B
75
S
31
G
27
Posts: 1,000
Reputation: 20,735

Post » Sun Dec 06, 2015 12:35 am

Hi @magistross! Just bought your template last night.

So i have a question on

5. Be sure to have a "HUD" layout in all your layouts where you need dialogues. (You can also define your own layer by changing the "DIALOGUE_LAYER" constant)
..

what does this mean?
B
6
S
1
Posts: 43
Reputation: 492

Post » Sun Dec 06, 2015 4:24 am

Typo, I meant "HUD" layer in all layout, sorry. I guess a global layer could work too.
B
75
S
31
G
27
Posts: 1,000
Reputation: 20,735

Post » Sun Dec 06, 2015 7:18 am

alright thanks :)....so i got most of the part done....
how do i use this template?
In order for me to write my own dialogue i have to use the utililty right? After i have done that what should i do?

and i cant understand what you mean by this:
Oh, forgot about that part. The JSON file must be loaded via the "Load" action of the "DialogueDictionary". Best if you add the JSON file as a project file too first. There's probably a tutorial on how to load an external file somewhere but basically all you have to do is use the AJAX object, request a project file, and "Load" the AJAX.LastData inside the Dictionary with a "on request complete" event.


oh and another thing, what would i do if i want to from sequence 1 to sequence 2 automatically..Only player have to wait for a few seconds?
sorry...im new to this Construct and coding thing..
B
6
S
1
Posts: 43
Reputation: 492

Post » Sun Dec 06, 2015 3:31 pm

The utility definitely help to create and test dialogues, but its most useful capability is to export to a JSON file. It's that particular file that must be added to your project and then loaded via AJAX.

For your last question, the text function {wait:3000} and {next} can be combined so it will automatically go to sequence 2 after 3 seconds. (3000 milliseconds).
B
75
S
31
G
27
Posts: 1,000
Reputation: 20,735

PreviousNext

Return to Scirra Store

Who is online

Users browsing this forum: No registered users and 4 guests