Closed pmer closed 7 years ago
Actually the third way seems cleanest to me. You can then add the handler once you need it without having to edit every map file.
The bonus of the first two though is that you can see all the functions that will get called on an area being loaded by reading it's JSON descriptor. "It's more local" which enhanses readability.
I like the idea of a registry of global trigger callbacks.
A map author might want to have a global script that runs on each game area (doing some common post-processing of the map), and then also run a specific one-off script for some areas (running area-specific code).
This can be fixed by any of:
on_focus
to take a list of functions.on_focus
handler.