Few questions related to engine

Discuss authoring naninovel scenario scripts.
Post Reply
CastorClamwhistler
Posts: 6
Joined: 27 Sep 2021 06:47

Few questions related to engine

Post by CastorClamwhistler »

Hello,

Just recently bought the naninovel and had two few questions,

  1. Are there commands/tags I could use to change the size, color of the text within a printer during dialogue(ie. make text smaller to indicate whispering)? if not, how would I go about customizing this during dialogue?

  2. I would like to see if I could set things up to where the player can get access to any episode of the visual novel through the title screen. I'm assuming I would have to make a custom UI screen where the user can select a episode. My question is how can I have a button load an naninovel script once the user clicks on it?

CastorClamwhistler
Posts: 6
Joined: 27 Sep 2021 06:47

Re: Few questions related to engine

Post by CastorClamwhistler »

I think I found the answer to question two. Is it relating to this below?

"In order for the UI to support visibility (visible on awake, fade time) and interaction options (disable interaction), also attach a Canvas Group component to the same object.

If you're OK with C# scripting and want to override default logic of the UI, create a new component, implement IManagedUI interface (feel free to inherit the component from CustomUI to fulfill all the interface requirements) and attach the created custom component instead. Check Naninovel/Runtime/UI folder for reference implementations of the built-in UIs. Here is an example of minimal implementation of a custom UI component:

using Naninovel.UI;

public class MyCustomUI : CustomUI
{


}
#Play Script On Unity Event
When creating custom UIs, you may want to execute some commands or start playing a specific naninovel script in reaction to some events (eg, a button click).

Add Play Script component to a game object and either select an existing naninovel script or write the commands right inside the text area field; then route Unity event of some other component to invoke Play() method on the Play Script component. The script will be executed when the event is triggered at play mode. The example below hides a custom UI when the button is clicked.

It's also possible to reference Unity event arguments in the script text with {arg} expression; supported arguments types are: string, integer, float and boolean. Below example demonstrates executing camera shake and playing a sound effect when a boolean Unity event is positive and playing a background musing when it's negative."

CastorClamwhistler
Posts: 6
Joined: 27 Sep 2021 06:47

Re: Few questions related to engine

Post by CastorClamwhistler »

I just realized that this should be moved to the UI section, could somebody please move it for me? Sorry :)

idaot
Posts: 217
Joined: 01 Aug 2020 08:25

Re: Few questions related to engine

Post by idaot »

Can't find a way to move the thread but it's fine.

  1. It's possible with text tags (https://naninovel.com/guide/text-printe ... ext-styles) although in this case I highly recommend using TMPro printers as they support far more tags (default Unity text will be depreciated in 1.19 so it's a good idea to move over if you're thinking about updating Naninovel in the future)
  2. I recommend checking out the Map example project (https://github.com/Naninovel/Map) which shows several examples of Play Script use as well as a Custom UI with unlockable elements.
CastorClamwhistler
Posts: 6
Joined: 27 Sep 2021 06:47

Re: Few questions related to engine

Post by CastorClamwhistler »

idaot wrote: 08 Dec 2022 10:53

Can't find a way to move the thread but it's fine.

  1. It's possible with text tags (https://naninovel.com/guide/text-printe ... ext-styles) although in this case I highly recommend using TMPro printers as they support far more tags (default Unity text will be depreciated in 1.19 so it's a good idea to move over if you're thinking about updating Naninovel in the future)
  2. I recommend checking out the Map example project (https://github.com/Naninovel/Map) which shows several examples of Play Script use as well as a Custom UI with unlockable elements.

Got it. I'll probably just stick with the default text styles for now. I downloaded the sample map project you suggested and I've been able to see how the playscript works and implement it into my own project. Thank for suggesting that to me.

Naninovel is a great extension. It's certainly helped streamline a lot of stuff for me. Thank you!

Post Reply