Simple Conversations by LadyLexUK

Have something important that other people might find usefull? Well, drop it here and help others!
User avatar
LucidStew
Level 3
Level 3
Posts: 176

Simple Conversations by LadyLexUK

Post#1 » Mon Aug 15, 2016 6:16 pm

moved over from projectspark.com forums

Here is the scenario. Your player approaches a character and a conversation starts. Information about a quest is given and the player continues on his way.

You have a few options for this.
1. Cut scene version. The player has no control over the time the speech is displayed
2. Press a button to continue
3. A combination of the two (speech is timed, but a button press makes it progress faster (skip) )
4. Different options for the player to respond to the conversation (this is more complicated and will require another tutorial)

First thing to do is to deactivate your player when they interact with the quest giver.

In the quest giver brain.

Code:

WHEN [interacted] DO [objvar:hero][=][it]
...WHEN DO [objvar:hero][brain is active][=][false]
...WHEN DO [boolvar:conversation][=][true]

This will stop the player moving around. It also sets a boolean to start the conversation.
Code:

WHEN [boolvar:conversation] DO
...WHEN [started to] DO [numvar:speech][=][1]


This sets the conversation to start at speech 1.

For option 1 - timed speech
Code:

...WHEN [numvar:speech][=][1] DO
.../...WHEN DO [Fixed camera][Fixed camera 1]
.../...WHEN [duration timer][6] DO [Say][screen center right][text:Speech number 1]
.../.../...WHEN [else] DO [numvar:speech][=][2]

you can also add a modifier to type out the speech slowly - change line to:
Code:

.../...WHEN [duration timer][6] DO [Say][screen center right][text:Speech number 1][type on speed][10]

Experiment with the duration timer to get the line length right.
You then cut and paste this block and make it:
Code:

...WHEN [numvar:speech][=][2] DO
.../...WHEN [1st person camera]
.../...WHEN [look at target][objvar:hero]

.../...WHEN [duration timer][6] DO [Say][screen center left][text:Speech number 2]
.../.../...WHEN [else] DO [numvar:speech][=][3]

Carry on with these blocks until you get to the last bit of speech
Code:

...WHEN [numvar:speech][=][5] DO
.../...WHEN [fixed camera][Fixed camera 1]
.../...WHEN [duration timer][6] DO [Say][screen center right][text:Speech number 5]
.../.../...WHEN [else] DO [numvar:speech][=][0]
.../.../.../...WHEN DO [boolvar:conversation][=][false]
.../.../.../...WHEN DO [objvar:hero][brain is active][=][true]


Option 2 & 3 - Conversation with skip buttons

Add this line
Code:

...WHEN [A][pressed] DO [numvar:speech][incremented by][1]

If you leave the duration tiles and else statements in, this will act like a skip to next.

If you remove the duration timers and the else statements then this will act as a continue.

You should also display the button to skip or continue.
Code:

...WHEN DO [display][icon:A][+][text:to skip][screen bottom center][x-large font]

Also add (the number being one more than the last speech)
Code:

...WHEN [numvar:speech][=][6] DO [numvar:speech][=][0]
.../...WHEN DO [boolvar:conversation][=][false]
.../...WHEN DO [objvar:hero][brain is active][=][true]
End of line.

Return to “Tutorials and guides”

Who is online

Users browsing this forum: No registered users and 1 guest

cron