Dynamic character stats

All about user interface, be it customizing built-in UIs or adding new ones.
Post Reply
Wizard1200
Posts: 5
Joined: 26 Jul 2021 08:39

Dynamic character stats

Post by Wizard1200 »

Is it possible to display character stats (hit points, spell points, ...) with different printers or is there a better option?

I ask, because i have tried to delete everything which was -in my opinion- not required from a dialogue printer to achieve the previously mentioned result, but the printer did not work.

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

Re: Dynamic character stats

Post by idaot »

Hi, instead of deleting the components try disabling them instead as some of them may seem harmless but serve a purpose to the printer's functions. That way you can go back and forth when doing trial and error.

As for displaying stats, you can use Custom variables and Custom Variable Trigger components to display them on a printer or a UI. https://naninovel.com/guide/custom-vari ... -variables

And while you can display the stats on a Printer, I'd recommend using a custom UI instead as printers are primarily meant for revealable text. By adding the stats to a Custom UI you can show/hide the stats at any point (unless you know C# in which case you can create a custom command for toggling the stats on or off) https://naninovel.com/guide/user-interf ... -ui-layout

Wizard1200
Posts: 5
Joined: 26 Jul 2021 08:39

Re: Dynamic character stats

Post by Wizard1200 »

Thank you very much for your detailed reply!

I have another question :) Is it possible to add line breaks in the text of an event trigger (pointer enter)? Using \n works in the naninovel script, but sadly not in the text field of an event trigger.

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

Re: Dynamic character stats

Post by idaot »

I'm not sure what you mean as Event Triggers don't have a text field by default.
But generally it should work with these:

  • For regular UI text it is \n.
  • For regular text printers you can use [br]
  • For TextMeshPro UI text and text printers, you can use both [br] and <br> (I recommend using the latter)
Wizard1200
Posts: 5
Joined: 26 Jul 2021 08:39

Re: Dynamic character stats

Post by Wizard1200 »

Thanks again for your help!

Wizard1200
Posts: 5
Joined: 26 Jul 2021 08:39

Re: Dynamic character stats

Post by Wizard1200 »

I have another question :) Is it possible to show/hide a single image (icon) with a custom variable trigger within a custom UI? I have tried to use 'bool enabled', but i have no idea how i can change the value from 'true' to 'false' with the @set command.

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

Re: Dynamic character stats

Post by idaot »

Yes, that's possible. Just ensure that you choose the enabled under Dynamic bool and not bool enabled under Static Parameters in the dropdown menu. Then it's just a matter of setting the bool correctly in naniscript, you can find examples of how @set works via the command API: https://naninovel.com/api/#set

Wizard1200
Posts: 5
Joined: 26 Jul 2021 08:39

Re: Dynamic character stats

Post by Wizard1200 »

Cool :) Thanks again for your help!

Post Reply