Page 1 of 1

Player Stat system

Posted: Tue Jun 10, 2025 11:59 pm
by Arctichorse9
Is it possible to set up a player stat system that can be displayed on screen? Using Lua?

Re: Player Stat system

Posted: Wed Jun 11, 2025 7:59 am
by Tony Li
Yes, others have done that before. One person even used a conversation with a custom dialogue UI to act like a stat point allocation menu, although I think it would be more straightforward to write a short C# script to do that.

You can store the stats in Lua, access them in C# using the DialogueLua class, and even use [var=variable] tags in text such as:

Code: Select all

// Variables "HP" and "MaxHP" are player stats. Show them in this UI:
textMeshProHP.text = FormattedText.ParseCode("[var=HP] / [var=MaxHP]");

Re: Player Stat system

Posted: Wed Jun 11, 2025 12:40 pm
by Arctichorse9
Thank you so much!

Re: Player Stat system

Posted: Wed Jun 11, 2025 2:26 pm
by Tony Li
Glad to help!