DS variables vs self-implemented flags

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Simon C
Posts: 10
Joined: Sun Mar 09, 2025 6:58 pm

DS variables vs self-implemented flags

Post by Simon C »

Hi Tony,

I have some questions about reading a variable from a game object component as an alternative to DS variables to decide if an entry should be shown.

Currently, I want to implement a singleton that stores all such flags under a game object component. It would be very similar to DS variables. And in the conditions of an entry, I want to call this singleton and check if a flag is satisfied or not.

I know this could be easily done by using DS variables. But I am not sure if this alternative would work or not? If so, how can I make the call in Conditions?
The main motivation is to improve performance. Could you educate me on what's the storage usage of a DS variable? Would it be wise to implement my own system in order to improve storage and read/write efficiency?

Thanks in advance!
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: DS variables vs self-implemented flags

Post by Tony Li »

Hi,

In general, either is fine. But if you're going to be accessing the variable very frequently, such as every frame, it's more efficient to use a C# variable. In this case, please see: How To: Connect C# Variables to Dialogue System's Lua
Post Reply