EVENT_EGS is triggered when any sprite is spawned on the map. onevent code for this event is executed by the new sprite during the tick in which it is spawned. The gamevar THISACTOR refers to the ID of the sprite that is executing the code.