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
65
S
22
G
7
Posts: 157
Reputation: 8,045

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
50
S
22
G
19
Posts: 166
Reputation: 13,619

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
65
S
22
G
7
Posts: 157
Reputation: 8,045

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
78
S
32
G
27
Posts: 1,021
Reputation: 20,952

Post » Tue Jan 09, 2018 12:10 am

There is only one word for this. Sexy.
B
48
S
22
G
10
Posts: 611
Reputation: 10,201

Previous

Return to Scirra Store

Who is online

Users browsing this forum: No registered users and 5 guests