Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Hey Luyren, the docs are fantastic and I've already implemented a few of your behaviours :) I do have a question, do you have any advice/ideas on the following scenario. I have two actors in a scene, I've applied the dialog box to them, now I want to switch the order of conversation, so there is some back and forth conversation, for example:

A: hi, how you doing today 

B:Great thanks 

A:Do you want to go out somewhere?

 B:Yes

A: Okay I know a place

A: Let go now

B: Ok sure

There are a number of ways to do it, depending on how you setup the dialog interface for each actor. I recommend using the Events Manager behavior in your "NPC" actor.

1- If your dialog is set on scene coordinates, you can just make the same actor use different presets to represent different actors speaking. If you are using the dialog like speech bubbles at each actor's position, use the other mehtods.

2- If your player is pressing a key to activate the cutscene when near an actor, then you have to use the "Set Actor" event to switch between "Self" and "Player Actor." That way, when you reach the dialog events, you'll be calling the dialog for different actors.

3- If your actors are not colliding or interacting via key press, you can use the "Get Player Actor" event. Then, use the same method described in 2. The player actor must be on screen for that event to work.

4- If the dialog doesn't involve the player actor in any way, you can use Instance Customization for the actor that has the cutscene script, configure the "Cutscene Actor" attribute to the other actor you want to take part in your dialog, and again use the Set Actor event, now setting it to Cutscene Actor (check the attribute's description in the Events Manager behavior).

5- This is a bit more convoluted: you set up a script in each of the actors you want to speak in the dialog. You set a global value to increment by 1 after each dialog, and the scripts just use that global value as a condition to play the dialog for each actor. It becomes a sort of back and forth between two scripts.

The Set Actor event basically switches which actor is being target by the events.

This is a script that has an example of back and forth, using the "Get Player Actor" event. Only I'm changing between the Player Actor and a Stored Actor at key 0. If you create actors through the cutscene script, you can store them and reference them later to be targeted by events like this.

You can check the specific of those events in the Behaviors List file. Go to the Events Manager explanation, and look for the "Events" explanation. That info is also in that attribute's description in the Events Manager behavior itself. But either way, I'll definitely include that in the expanded video documentation!

Dude, thank you for the response, so many options and approaches. Love it!