Dynamic character stats

Posted: 27 Jul 2021 15:16
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.


Re: Dynamic character stats

Posted: 28 Jul 2021 11:25
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


Re: Dynamic character stats

Posted: 30 Jul 2021 19:30
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.


Re: Dynamic character stats

Posted: 31 Jul 2021 11:20
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)

Re: Dynamic character stats

Posted: 31 Jul 2021 13:25
by Wizard1200

Thanks again for your help!


Re: Dynamic character stats

Posted: 31 Jul 2021 15:42
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.


Re: Dynamic character stats

Posted: 02 Aug 2021 10:44
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


Re: Dynamic character stats

Posted: 03 Aug 2021 16:20
by Wizard1200

Cool :) Thanks again for your help!