Dialogue System Template (Templates)

Discuss Scirra's 2D Asset Store

Post » Thu Sep 08, 2016 7:12 pm

Magistross wrote:How is your sci-fi game doing? I hope you're still motivated to finish it, it looked really promising! ;)


Yes! I am- but its going to be a bigger game. I am making a smaller game in the process to develop a map system that I will incorporate into the bigger game that you saw. I do plan on finishing! and Thanks for asking and the compliment!

http://www.amonthlygame.blogspot.com blogging the process of the smaller one here- only a week into it so far.
B
14
S
5
G
6
Posts: 64
Reputation: 4,243

Post » Thu Sep 15, 2016 7:55 pm

is there a way to use a variable in the dictionary to tell what animation and frame to use for the character portraits?
something like charPortrait,{activeChar},{frame}

or better yet- can I tell it what animation and frame to load?

Right now I only see the ability to specify the sprite file to be used- can we add charPortrait("hero",2) or something like that?

So charPortrait would be the name of the sprite- hero the name of the animation, and 2 for it to load frame 2.

Would help me consolidate all of the assets greatly! Thanks
B
14
S
5
G
6
Posts: 64
Reputation: 4,243

Post » Thu Sep 15, 2016 8:37 pm

Not too sure I understood your question correctly, but here goes nothing! :lol:

The portrait is actually a single sprite object, named "Portrait". Each animation define a single portrait, it can be animated or not, depending on your need.

There is the premade "changeportrait" text function that change the current portrait animation. It accepts only a new animation name, but you could easily modify it to allow specifying an animation frame number. Both parameter could be provided by a variable in the dictionary.

That said, one could also decide to bypass the portrait mechanism provided by the system and create an entirely new one using only custom text commands.
B
54
S
21
G
19
Posts: 870
Reputation: 14,948

Post » Thu Sep 15, 2016 9:56 pm

Yes that answers my question- Ill see if I can find it and alter the code :shock:

I am an artist / animater learning to "code" so I may not explain things clearly for you code ninjas :D You got the idea of what I was trying to explain though.

Another question- how to the touch controls work? I have "Tap Choice Mode" checked when I create the json files in your editor but the touch controls dont work. Is there something else I need to do there? Thanks!

I can tap on this screen to get to the choice screen:
Image

but then at the choice screen tapping does nothing.
Image



Also need to make the font bigger... I wish you had a read-me instructions cheat sheet for us noobs :D Thanks so much for all your patience with me-
B
14
S
5
G
6
Posts: 64
Reputation: 4,243

Post » Thu Sep 15, 2016 10:28 pm

Oops, I guess it was a bit misleading with the "Tap Choice Mode" in the editor. It's only there for preview purpose. Ticking it will change the "Dialogue_TapChoice" global variable to 1. When that particular variable is set to 1, all choice initiated will have to be resolved with a tap gesture.

Here's one way how the "changeportrait" function could be reworked to allow changing the animation frame.
Image

Changing the font size is basically done by changing the spritefont's sprite, and by changing a few value here and there so the system knows about the size of characters and what not. I'll help you when you get there if need be! ;)

By the way, that game of yours looks pretty sick! :shock:
B
54
S
21
G
19
Posts: 870
Reputation: 14,948

Post » Fri Sep 16, 2016 4:10 am

my solution for touch controls... works well enough

Image


now I gotta see if I can implement the frame chooser and change the font to something bigger.


Magistross wrote:By the way, that game of yours looks pretty sick! :shock:


Thanks man!
B
14
S
5
G
6
Posts: 64
Reputation: 4,243

Post » Thu Sep 22, 2016 9:15 am

Hey @Magistross is there a way to just adjust the spacing of the portrait and not the text? I mean:

DIALOGUE_MARGIN sets the spacing withing the tiledbackground used for the "textbox" but it also moves the portraits. I want to adjust the text whenever I dont use a portrait so it doesnt look too much in the middle, but if I do so then when a portrait comes is almost on the edge, do you understand what I mean?

Thank you
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Thu Sep 22, 2016 2:52 pm

Could you provide a screenshot of the unwanted behavior and perhaps a picture of what should occur ?

It's possible to change how the portrait sprite is positioned at creation. The event in question is event #15. (or close by, if our numbering doesn't match)
B
54
S
21
G
19
Posts: 870
Reputation: 14,948

Post » Sun Oct 02, 2016 5:02 pm

Magistross wrote:Could you provide a screenshot of the unwanted behavior and perhaps a picture of what should occur ?

It's possible to change how the portrait sprite is positioned at creation. The event in question is event #15. (or close by, if our numbering doesn't match)


Will try to do. Until then, I have another question. Is there a call for "on dialog "X" finished"?

Or just a way to stop everything until the dialogue is finished
B
14
S
5
Posts: 248
Reputation: 1,705

Post » Mon Oct 03, 2016 3:33 am

Smileh wrote:Is there a call for "on dialog "X" finished"?

Or just a way to stop everything until the dialogue is finished

If you want to stop everything else while a dialogue is running, you will have to base your game logic around some kind of boolean variable. This variable should be set to "true" on the Dialogue_StartDialogue function and to false on the Dialogue_End function. (lines 5 and 127)

If said variable is true, stop all other game logic, disable behaviors, etc., depending on how your game is made.
B
54
S
21
G
19
Posts: 870
Reputation: 14,948

PreviousNext

Return to Scirra Store

Who is online

Users browsing this forum: No registered users and 2 guests