Editing variables at runtime for debugging

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
diviocity
Posts: 22
Joined: Sun Feb 25, 2018 12:50 am

Editing variables at runtime for debugging

Post by diviocity »

Hi Tony,

I was wondering if there was any functionality in Dialogue System that would allow me to change variable values during Play Mode in the editor. There are many instances where I find myself changing the database itself to test certain things which I'd think is a bad practice due to the possibility of forgetting to set it back.

I've looked around a bit to no avail, so I thought I'd ask here!
Thanks!
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Editing variables at runtime for debugging

Post by Tony Li »

Hi,

Yes, there are a couple of ways:

1. Use the Dialogue Editor's Watches section. During play mode, the Template section changes into the Watches section.

2. Or add a Lua Console to the scene (e.g., on the Dialogue Manager). Then press ~+L to open the Lua Console, and enter commands such as:

Code: Select all

Variable["Gold"] = 3
to set a variable or:

Code: Select all

return Variable
To show the values of all variables.

The advantage of this over the Watches section is that you can use it in builds.
diviocity
Posts: 22
Joined: Sun Feb 25, 2018 12:50 am

Re: Editing variables at runtime for debugging

Post by diviocity »

Perfect! Thank you for the quick response as always!
Post Reply