Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I know Python and the format for ES Python scripts looks somewhat magical. Whats going on?

0
Posted

I know Python and the format for ES Python scripts looks somewhat magical. Whats going on?

0

Using Python’s powerful introspection abilities, EventScripts treats a module loaded via “es_load” differently than a normal Python module. ES automatically scans the addon for functions and adds them as “blocks” in EventScripts. In addition, event functions are also registered as “events” so they can get event notifications from the addon manager. This is a little too “magical” if you have a huge script with a lot of internal methods you don’t want to expose. Eventually ES will allow you to have granular control of this, but for now we’re focusing on ease of use. You can tell EventScripts not to reference a method in your addon if you prefix it with an underscore. This will indicate to everyone that the function is private.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.