Dialogue System Template (Templates)

Discuss Scirra's 2D Asset Store

Post » Mon Jun 20, 2016 6:42 am

Magistross wrote:here's the breakdown of what you should do :

1. Copy these objects to your project (an event-less layout works wonder, like the "Dummy" layout) : ContinueIndicator, PortraitSprite, SpriteFont, WindowFrame
(edit: Version 1.02 now needs additional objects : UpArrow, DownArrow, ChoiceSelector)

2. Create these objects and name them like so :
1 Array Object named "DialogueData"
1 Dictionnary Object named "DialogueDictionary"
1 Dictionnary Object named "DialogueCommands"
1 Dictionnary Object named "GameVariables" (this is where you game should store its variables, so that dialogues can fetch them)
1 Function Object named "Function" (default)

3. Create a new event sheet, and copy over all the content from the "DialogueEvents" sheet from the template. If all objects were correctly copied / created, it should give no error message.


I did all this and I am embarrassed to admit I am getting an error message doing step 3...

Image

Any help would be appreciated- purchased tonight and excited to get it incorporated into my game. Thanks!

Edit: -I figured it out... Copied in pieces, starting with the variable on top which is what was missing in the error message. I got too excited I ran to the forums before reading and trying to figure it out myself... Thanks anyway! I am sure Ill have some questions shortly.
B
14
S
5
G
6
Posts: 65
Reputation: 4,245

Post » Mon Jun 20, 2016 7:03 am

Glad you figured it out on your own. I might as well edit the post you quoted to so to specify that variables should be copied over before the rest of the events. I'll be sure to answer any further question! ;)
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Mon Jun 20, 2016 7:17 am

I notice your file has a huge list of Object Types added- From Ajax, Audio, Browser, to Touch. Which of these (if not all) are required to properly use this? Should we make sure the project we want to use this in has all of these added? (Also I noticed I had to add some of these before copying over the DialogEvents successfully.) A readme file included in the .zip with install instructions would be very helpful- and maybe consider adding a list of all the object types needed. Going to bed but ill keep trying to get it working tomorrow. Thanks
B
14
S
5
G
6
Posts: 65
Reputation: 4,245

Post » Tue Jun 21, 2016 12:03 am

Yes indeed, a lot of new objects made their way into the template as it grew from version to version. A few objects are mandatory, like the "Browser" object for expression evaluating and "Sound" object to play sound and music with text commands. The "Touch" object is there to enable choice selection with a tap gesture, it can be safely omited along with event 76 and its sub-events.

The other object types are for the utility, and the "UtilityEvents" event sheet are not at all required inside your project, but it can provide some clues as to how to handle dialogue data loading and how to start and execute actual dialogues.
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Wed Jun 22, 2016 6:34 am

Another question from me-

I got everything working awesomely with the dictionary loading multiple different dialog sequences etc. Amazing! So fluid!

So now Im trying to do something somebody else asked about earlier- trigger animations inbetween dialog windows. I first added the Command in the DialogEvents to trigger a function as follows (doubt this is "best practice" :oops: ):

Image

Then I created a "No Text Box" dialog sequence in the dictionary file (which pauses and works great)
Image

Then I defined the function in another events sheet- which does not appear to get triggered - neither one of these did anything:

Image
Image

Any help / Advice here will be greatly appreciated! Thanks!
B
14
S
5
G
6
Posts: 65
Reputation: 4,245

Post » Wed Jun 22, 2016 6:45 am

smallrobot wrote: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!


This is exactly what I am trying to do- any chance you could share a screen shot of how you accomplished it?
B
14
S
5
G
6
Posts: 65
Reputation: 4,245

Post » Wed Jun 22, 2016 2:30 pm

Well, I can't say for sure why it doesn't do anything but I'll go with a basic round down of what to do to debug something like this.

First, if the new event sheet is not tied to any layout, or tied to another layout, be sure to include it in the layout you are currently using for your tests. When everything seems in order, try to set text on screen, do some "Browser" alert or log to console within the "guardGun" function. If nothing happens, you'll know for sure that the event isn't triggered, and you'll probably need to review the "pullGun" command (although it looks pretty straightforward :P). If you can see it triggered, but didn't seem to affect the guard sprite, it's either a picking problem, or there is another event that overrides the guard animation.

Le me know if you still can't resolve your issue.
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Wed Jun 22, 2016 4:23 pm

its working now! Im golden. Thanks!

See for yourself :Dhttps://dl.dropboxusercontent.com/u/24751251/media/ice_video_20160622-141316.webm
B
14
S
5
G
6
Posts: 65
Reputation: 4,245

Post » Thu Jun 23, 2016 1:20 am

Hahaha ! :lol: Loved those kind of games that punished you harshly for being a jackass!
B
69
S
28
G
24
Posts: 977
Reputation: 18,739

Post » Fri Jun 24, 2016 4:16 am

2 more questions :oops:

Question 1:
How do you check a variable within a fork?

I have a variable "hasappointment" .I set it to 1 when he does and 0 when he doesnt

here is what the dialog sequence says:

{setdelay:0}-Guard Chief Bruno-{setdelay:50}
Checking... {#hasappointment}{pause}{fork:{#hasappointment}=1,12,11}

I was going off of the money checking example that was there before. Maybe that was not just checking a variable. I want it to go to dialog 12 if "hasappointment" is set to 1. If not, then go to 11.

Question 2
is there a way to call another sequence from the end of another sequence? for example- say at the root I have a bunch of questions on sequence2. After every answer instead of ending after he answers the question, id like to go back to that sequence2 so they can ask other questions. Is there an easy way to do that? I tried the ::2 at the end like you see in the choice example but that didnt seam to do anything. Thanks in advance! Sorry for hounding you with so many questions!

Something like this:

s1 - hello how can I help you?
s2 - choice:
what am I supposed to do?
tell me about this place?
why are you so ugly?
How long have you been standing there?
I must be going now.
s3 - answer / return to s2
s4 - answer / return to s2
s5 - answer / return to s2
s6 - answer / return to s2
s7 - ok, bye {end}
Last edited by haddy22 on Fri Jun 24, 2016 8:54 pm, edited 1 time in total.
B
14
S
5
G
6
Posts: 65
Reputation: 4,245

PreviousNext

Return to Scirra Store

Who is online

Users browsing this forum: No registered users and 4 guests