Player Stat system

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Arctichorse9
Posts: 78
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Player Stat system

Post by Arctichorse9 »

Is it possible to set up a player stat system that can be displayed on screen? Using Lua?
User avatar
Tony Li
Posts: 23278
Joined: Thu Jul 18, 2013 1:27 pm

Re: Player Stat system

Post 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]");
Arctichorse9
Posts: 78
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Re: Player Stat system

Post by Arctichorse9 »

Thank you so much!
User avatar
Tony Li
Posts: 23278
Joined: Thu Jul 18, 2013 1:27 pm

Re: Player Stat system

Post by Tony Li »

Glad to help!
Post Reply