Page 1 of 1

Editing variables at runtime for debugging

Posted: Sat Sep 07, 2019 6:19 pm
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!

Re: Editing variables at runtime for debugging

Posted: Sat Sep 07, 2019 6:44 pm
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.

Re: Editing variables at runtime for debugging

Posted: Sat Sep 07, 2019 7:02 pm
by diviocity
Perfect! Thank you for the quick response as always!