[Solved]About visual novel framework.

Announcements, support questions, and discussion for the Dialogue System.
HaiiroMukuro
Posts: 80
Joined: Sun Jul 17, 2016 3:38 pm

[Solved]About visual novel framework.

Post by HaiiroMukuro »

Good day everyone! Right now, I'm working for a visual novel. Right now, I don't have an idea what script to use to change the background image during the scene on conversation.
Image
I have 2 background, the bedroom and the dining room. What will happen is, the character will wake up early in the morning then fix the bed. After that, the background image will change into the dining table/room.
Image
Here goes my questions:
1. Is it possible to change these background images just putting a script inside the script textbox? or Is there any other method to make it happen?
2. I have a music playing when the game starts, good thing its stop when clicking the "start button." But when I put music together in different panels. Both of them starts to play. What should happen is a there is a music playing on main menu, which is done already and when the game starts or changing scenery the music will change . How to play these audio on different sceneries?

Sorry for a lot of questions, I'm just a newbie. Thanks a lot. :D
Last edited by HaiiroMukuro on Wed Aug 03, 2016 3:34 pm, edited 1 time in total.
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: About visual novel framework.

Post by Tony Li »

Hi,

I recommend using the SetActive() sequencer command to change background images by enabling and disabling GameObjects. Use the Sequence field. For example, say your background image is on a GameObject named "France Background". Put this in the START node's Sequence:

Image

You can disable a GameObject by adding "false" to the end of the command:

Code: Select all

SetActive(China Background, false)
You can also use the Audio() sequencer command to change the music. Let's say you've added an Audio Source component to a GameObject named "Music". You can tell it to play a song named "French Song" by adding an Audio() command:

Code: Select all

SetActive(France Background);
Audio(French Song, Music)
Note the semicolon ( ; ) at the end of SetActive. This separates the SetActive() command from the Audio() command.

The final step is moving the file "French Song" into a folder named "Resources". This folder can be anywhere in your project, and you can have as many "Resources" folders as you want.
HaiiroMukuro
Posts: 80
Joined: Sun Jul 17, 2016 3:38 pm

Re: About visual novel framework.

Post by HaiiroMukuro »

Thanks a lot!
I set two sounds as a game object, when I start the game both of them are playing, how can I disable the other one while another one is playing?
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: About visual novel framework.

Post by Tony Li »

In your Sequence, you can use SetActive() to deactivate the GameObject containing the Audio Source, or SetEnabled() to disable just the Audio Source component. For example, let's say the Audio Source is on your Main Camera GameObject:

Code: Select all

SetEnabled(AudioSource, false, Main Camera)
HaiiroMukuro
Posts: 80
Joined: Sun Jul 17, 2016 3:38 pm

Re: About visual novel framework.

Post by HaiiroMukuro »

Thanks a lot! It's working now. It is possible also for scene transition?
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: About visual novel framework.

Post by Tony Li »

It's possible to change scenes, but the visual novel framework was originally designed to run in one scene.

To change scenes, use the LoadLevel() sequencer command.

Also add a LevelManager component to the Dialogue Manager so it can record the current scene in saved games.
HaiiroMukuro
Posts: 80
Joined: Sun Jul 17, 2016 3:38 pm

Re: About visual novel framework.

Post by HaiiroMukuro »

What should I put inside the Default Starting Level? The current scene or the next scene?
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: About visual novel framework.

Post by Tony Li »

The current scene.
HaiiroMukuro
Posts: 80
Joined: Sun Jul 17, 2016 3:38 pm

Re: About visual novel framework.

Post by HaiiroMukuro »

I'm still having problems with the sequence. I've change my method, I use the sequence trigger and sets the trigger on the end of the conversation. What happen is the music is playing on the scene suppose to loaded but the canvas still remains on the previous scene. In other words, in the end of the conversation, nothing loads but only music. I'm thinking if I forgot to put script or a component on the scene suppose to be loaded or on the current scene. :cry:
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: About visual novel framework.

Post by Tony Li »

Hi,

Can you please post your current sequences here?
Post Reply