Lua: Modifying script settings programmatically

amirchev

Member
What is the best way to access script properties and settings outside of a button callback? Specifically, I want to do it from a hotkey callback, but it would be ideal to be able to get script properties and modify them from anywhere within a Lua script.
 
One can argue on it being the best way, but I find global variables a common practice within the scripts around here.
 
Not sure this is where to ask about my challenge: In a news style livestream where names of reporters need to be displayed as they change, what is the easiest way to do that. Currently, I use a rudimentary scene with each name that displays the name in a banner at bottom of current camera scene. But as cameras change (i use 4 cams) I would have to display the name in every possible camera scene. There must be a better way. Is there an environment variable I can set for the name "field", so that I can dynamically change across camera scenes and display the current reporters name?
 
Not sure this is where to ask about my challenge: In a news style livestream where names of reporters need to be displayed as they change, what is the easiest way to do that. Currently, I use a rudimentary scene with each name that displays the name in a banner at bottom of current camera scene. But as cameras change (i use 4 cams) I would have to display the name in every possible camera scene. There must be a better way. Is there an environment variable I can set for the name "field", so that I can dynamically change across camera scenes and display the current reporters name?
If you create a Text(GDI+) source, you can put it in as many scenes as you want (Create Source, Add existing...)
Changing the text in the source will affect all scenes that contain the source.
- You could use Lua or Python to change the string in the Text source, which will update the visible text immediately
- or you could set the Text source to get its text from a file, and change the text in the file. In this case update may take a second or two.
 
Back
Top