Page 1 of 3

[Solved]About visual novel framework.

Posted: Fri Jul 22, 2016 9:06 am
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

Re: About visual novel framework.

Posted: Fri Jul 22, 2016 10:12 am
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.

Re: About visual novel framework.

Posted: Fri Jul 22, 2016 2:00 pm
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?

Re: About visual novel framework.

Posted: Fri Jul 22, 2016 2:23 pm
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)

Re: About visual novel framework.

Posted: Fri Jul 29, 2016 5:40 am
by HaiiroMukuro
Thanks a lot! It's working now. It is possible also for scene transition?

Re: About visual novel framework.

Posted: Fri Jul 29, 2016 9:06 am
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.

Re: About visual novel framework.

Posted: Fri Jul 29, 2016 10:09 am
by HaiiroMukuro
What should I put inside the Default Starting Level? The current scene or the next scene?

Re: About visual novel framework.

Posted: Fri Jul 29, 2016 10:29 am
by Tony Li
The current scene.

Re: About visual novel framework.

Posted: Fri Jul 29, 2016 2:55 pm
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:

Re: About visual novel framework.

Posted: Fri Jul 29, 2016 3:22 pm
by Tony Li
Hi,

Can you please post your current sequences here?