The Daily Click ::. Forums ::. Klik Coding Help ::. Dialogue system problem?
 

Post Reply  Post Oekaki 
 

Posted By Message

J.C



Registered
  22/03/2013 05:18:14
Points
  118
23rd September, 2015 at 23/09/2015 19:49:00 -

Hi.

I'm having trouble implementing a dialogue system where the player says more than one line of dialogue (in sequence, not randomized) when examining an object.

The setup is that when pressing space bar on the thing he wants to examine (a skeleton) He should be saying the first line, then when pressing space bar again to exit the dialogue and give control back to the player, he should be saying line 2 when examining the object again, and line 3 the third time.

Here is an mfa for your convenience. (The dialogue code starts at line 80, ends at 95)

https://www.dropbox.com/s/xoczg7waerfo2vc/Dialogue%20Advancement%20Test.mfa?dl=0

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
24th September, 2015 at 24/09/2015 08:55:59 -

i managed to complete a dialog system. read the purple comment to learn how to use it.

http://www.mediafire.com/download/5hkxjergqd3m1a8/AirflowStyleDialogue.mfa

the best kind of dialogue system would load information externally. but internally this is pretty good.
An even better internal system would search for a label in a list object and read lines until it reaches a blank.
The usefulness of lists in mmf2 is something I learned from the dungeon dash example on nivrams page

http://www.castles-of-britain.com/mmf2examples.htm

 
n/a

J.C



Registered
  22/03/2013 05:18:14
Points
  118
24th September, 2015 at 24/09/2015 17:13:58 -


Originally Posted by Airflow
i managed to complete a dialog system. read the purple comment to learn how to use it.

http://www.mediafire.com/download/5hkxjergqd3m1a8/AirflowStyleDialogue.mfa

the best kind of dialogue system would load information externally. but internally this is pretty good.
An even better internal system would search for a label in a list object and read lines until it reaches a blank.
The usefulness of lists in mmf2 is something I learned from the dungeon dash example on nivrams page

http://www.castles-of-britain.com/mmf2examples.htm

Thanks airflow!

I just looked at the mfa you sent out. While I like the idea, there's one element missing. I wanted the player character to say a new line of dialogue when he interacts with the object a second time. I know there are a couple more dialogue pieces in the mfa, but I'm not sure how I'm supposed to code paragraph 3 in there.

The way it is setup now, only paragraph 2 plays every time I interact with the object.

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
25th September, 2015 at 25/09/2015 05:27:15 -

there are many ways you can do it.
if you want dialog 1, set "Dialogue Number Counter" to 1. if you want dialog 2, set "Dialogue Number Counter" to 2.
all you need is to make code which chooses the right number.

do it like this:
while object value a>0, subtract 1 from object value a
on pressing spacebar and overlapping object and object value a=0 and object value b=0, set Dialogue Number Counter to 1, and set object value a to 10, and value b to 1
on pressing spacebar and overlapping object and object value a=0 and object value b=1, set Dialogue Number Counter to 2, and set object value a to 10, and value b to 2
on pressing spacebar and overlapping object and object value a=0 and object value b=2, set Dialogue Number Counter to 3, and set object value a to 10, and value b to 2
...
etc

the trick is value a=0, i wont explain it because it's a bit complex, but remember to always set it to 10

 
n/a

J.C



Registered
  22/03/2013 05:18:14
Points
  118
25th September, 2015 at 25/09/2015 22:54:29 -

Ok. I just tried that. I created an updated mfa file to go with it as well. I set up the code in the frame marked LVL 3 as the dialogue test frame. (The new code starts at line 56)

https://www.dropbox.com/s/474a0l75pncwk03/Dialogue%20System%20Test.mfa?dl=0

However, there seems to be a conflict, as it goes through only the first paragraph of dialog 1 and 2, but it goes through all of dialog 3. I think the coding you put in seems to conflict with this new code somehow.

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
26th September, 2015 at 26/09/2015 00:48:07 -

i fixed it. Make the following changes:
delete event 28
move your events to where event 28 was (above the advanced group,so you could move the advanced group instead if you like)
make sure you set value b to 3
add condition 'Dialogue Number Counter = 0' to all 3 events

the text display does a trick with the space bar which requires "Dialogue Number Counter" to be set in the events above the text display code.
it's a problem with order of operations, sorry about that, i didn't realise

 
n/a

J.C



Registered
  22/03/2013 05:18:14
Points
  118
26th September, 2015 at 26/09/2015 02:26:13 -

It worked! So many thanks Airflow!

Now, let's say that when it goes through the last piece of dialogue (dialogue 3) It sets the Dialogue Number Counter back to 0 so it can start again from 1 the next time the player character interacts with the object.

 
n/a

Airflow

imafirinmahlazr

Registered
  24/09/2003
Points
  -197

VIP MemberSonic SpeedSnow Cloud!Computer
27th September, 2015 at 27/09/2015 04:07:18 -

great! good luck on your project.
i hope you can figure that one out for yourself

 
n/a
   

Post Reply



 



Advertisement

Worth A Click