Dialogue System Template (Templates)

Discuss Scirra's 2D Asset Store

Post » Sat Dec 30, 2017 9:17 am

@Mikal First off THANK YOU SO MUCH FOR THIS ASSET!! You saved the story mode in my game. :D I've already extended the code by adding about 8 different commands. Very cleanly written and I love that it doesn't need any 3rd party plugins.

Quick question. By default each character is show after DIALOGUE_DEFAULTDELAY time. How difficult would it be to get each word to appear instead of a character. I assume I'd need to modify the "Dialogue_NextChar" function to look for spaces as a delimiter, but I wasn't sure how much trouble it would be to get working. It's a "nice to have" feature so if it's too much to change, no worries.

Thanks again!
B
70
S
25
G
7
Posts: 163
Reputation: 8,484

Post » Sun Dec 31, 2017 12:50 am

JarrydHuntley wrote:@Mikal First off THANK YOU SO MUCH FOR THIS ASSET!! You saved the story mode in my game. :D I've already extended the code by adding about 8 different commands. Very cleanly written and I love that it doesn't need any 3rd party plugins.

Quick question. By default each character is show after DIALOGUE_DEFAULTDELAY time. How difficult would it be to get each word to appear instead of a character. I assume I'd need to modify the "Dialogue_NextChar" function to look for spaces as a delimiter, but I wasn't sure how much trouble it would be to get working. It's a "nice to have" feature so if it's too much to change, no worries.

Thanks again!


FYI, I'm not the creator, I'm a happy user like yourself.

@magistross created the template.
B
63
S
28
G
19
Posts: 190
Reputation: 14,592

Post » Sun Dec 31, 2017 5:39 am

@Mikal Ooops! Sorry, I posted it late and copied the wrong user name. :lol:

@Magistross The below message was meant for you ;)
JarrydHuntley wrote:@Mikal First off THANK YOU SO MUCH FOR THIS ASSET!! You saved the story mode in my game. :D I've already extended the code by adding about 8 different commands. Very cleanly written and I love that it doesn't need any 3rd party plugins.

Quick question. By default each character is show after DIALOGUE_DEFAULTDELAY time. How difficult would it be to get each word to appear instead of a character. I assume I'd need to modify the "Dialogue_NextChar" function to look for spaces as a delimiter, but I wasn't sure how much trouble it would be to get working. It's a "nice to have" feature so if it's too much to change, no worries.

Thanks again!
B
70
S
25
G
7
Posts: 163
Reputation: 8,484

Post » Mon Jan 08, 2018 4:57 pm

Hi @JarrydHuntley!

I'm glad you found my template to be useful. It's always interesting to see what other people do with it. ;)

I guess you could hack in some sort of while loop to fetch text word by word. At the very end of the "Dialogue_NextChar" (as you correctly identified), try modifying the "Add normal character" part like so :
Image

This should produce the desired result. Keep in mind that this will skip any command placed inside words, since the "Dialogue_CheckCommands" will only be executed at the begining of words and at each whitespace (instead of at every single character).

You might need to change the Regex I used on line 91 of this screenshot. "\S" will match any non-whitespace character, including punctuation and the like.
B
81
S
33
G
27
Posts: 1,029
Reputation: 21,143

Post » Tue Jan 09, 2018 12:10 am

There is only one word for this. Sexy.
If you are looking for solutions and workarounds to the Windows 10 C2 performance issues feel free to reach out to me.

Following rexrainbow's lead - Goodbye.
B
50
S
24
G
14
Posts: 632
Reputation: 12,505

Post » Wed Jan 24, 2018 12:47 pm

Quick question: Will this dialogue template system work with Construct 3?
B
10
S
1
Posts: 26
Reputation: 558

Post » Wed Jan 24, 2018 2:32 pm

Being 3rd party plugin free, it should work right off the bat. Everything worked as it should when I tried, and it seems it was the case for @mikal too. There was some sort of problem with copying objects between projects but it seems to have been resolved, so adding the template to an existing project should also be the same as in C2.
B
81
S
33
G
27
Posts: 1,029
Reputation: 21,143

Post » Fri Feb 02, 2018 2:54 am

@Magistross Thanks for the awesome template!
Everything is working great except choice commands; for some reason all the choices show the selection 9-patch graphic simultaneously (as if choice selected/active). Any of the choices don't activate by keypress (choice list can be scrolled up/down though). When clicking the mouse button over the choice they work fine and can be activated.

I'm unable to locate the problem, any ideas what could be causing this? I'm using the dialog file from utility for testing (works fine otherwise) and have set the spritefont size to 8x8 and halved the margins, 9-patch size etc, not sure if that can have any effect. Otherwise everything should be pretty much set up the same and I'm using the same events as in UtilityEvents sheet to call functions..
B
50
S
20
G
16
Posts: 167
Reputation: 11,972

Post » Fri Feb 02, 2018 5:16 am

@Waltuo It seems the system is set in "Tap choice" mode. Locate the Dialogue_TapChoice global variable is set it to 0. This should put back the system in selector mode.
B
81
S
33
G
27
Posts: 1,029
Reputation: 21,143

Post » Fri Feb 02, 2018 5:31 pm

@Magistross

PERFECT!! That solved it, everything's working now 8-) Thanks for your top notch support and help! :)
B
50
S
20
G
16
Posts: 167
Reputation: 11,972

PreviousNext

Return to Scirra Store

Who is online

Users browsing this forum: No registered users and 1 guest