Jump to content

How and where does the game keep track of created radio menues / active timer.scheduleFunction calls?


CakeSorbus

Recommended Posts

Hey,

 

I'm working on a new project, a script that is supposed to unload and reload other scripts in a running mission, without having to return to the mission editor.

My plan is to set up the script in a way so that it tracks the actions of other scripts in the mission and then allows me to reset them.

 

For that the script must be able to detect when a script does one of the following:
-create a new radio menu item

-starts a timer.scheduleFunction call

-adds and activates a group

-creates an Event Handler

 

Groups are not that difficult to track and it's the way that the scripting engine handles event handlers that makes me hopeful that radio menues and timer calls can be tracked as well. All Event handlers are stored in one global table and world.addEventHandler() and world.removeEventHandler() simply add to or remove from that table.

 

My assumption is that timers and radio menues are stored in global tables somewhere as well, but I have no idea what these tables are called, how they are structured or where they are declared. I searched through the "Scripts" folder in my DCS directory in hopes of finding the .lua files in which the functions to add and remove radio menues or timers are defined, but I did not find anything. I looked through the keys in the _G table with env.info as well, but that did not yield any results either.

Anyone here, with intimate knowledge of the scripting engine, who can help me out? Or who can tell me if my approach is even feasible? Even just pointing out to me where the functions of the scripting engine are declared would be a big help already!

Cheers,
Cake

Link to comment
Share on other sites

On 4/1/2021 at 1:13 AM, Gronank said:

I don't know if it is possible to access the information you seek, but the alternative is to create your own wrappers of scheduling and event handler et.c. that tracks what you need before passing it on.

 

 

Thanks for replying! 🙂

Your suggestion would certainly work, the downside is that every other script I want to use my script on, then would have to use my wrappers in order for its actions to become traceable. I do not want to create my own framework, I just want something that I can use to streamline my coding process by not having to jump back into the ME for every small schange I want to make to my scripts.

 

What I'll probably end up doing is coding the script in a way so that it requires the scripts it tracks to be written along certain conventions. That too narrows the applicability, but scripts created with the help of my script will run without the need to load different wrappers first.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...