I'd like a way to run lua code when a unit gets created. In a map script. Something like this function:
I've been looking through quite a lot of the FA/FAF lua code and have not found anything providing such functionality. Is there really no way of doing this?
Of course there is one way... which is what I did here https://pastebin.com/KBM72wBv . Having to loop through all units and seeing if there is a new one every tick is quite stupid though, especially if the game already provides a more sane way of reacting to the unit creation event.