OnEvent() is a function in Shrek 2 that is called from certain actors under certain circumstances. This function is typically used to allow for programmers to easily make shortcuts in their code. This function is used by various actors in the game, and they allow for hard-coded events to occur from within certain actors.
On the right is an example of OnEvent() from within Engine.Actor, which is the first declaration of the function. As you may have guessed, if we passed 'EnableSpellTarget' through OnEvent(), it would change the variable bProjTarget=true on the actor OnEvent() was called on. By understanding which OnEvent() fires work on which pawns, you can gain more control over a map.
Below is a list of lists of all native OnEvent() calls that can be done. Each list is given a package and a class, and it's there to let you know if an OnEvent() call would be valid within a specific class's case. This is to say that an OnEvent() call will fail on an actor in a certain way if the actor is either not the parent or the child class of the class that contains the OnEvent() call.
Engine.Actor
'EnableSpellTarget' - Sets bProjTarget=true
'DisableSpellTarget' - Sets bProjTarget=false
Engine.Trigger
'Activate' - Activates the Trigger
'Deactivate' - De-activates the Trigger
'ProcessTrigger' - Acts as if the Trigger was triggered
'GotoStateNormalTrigger' - Makes the Trigger go to the state NormalTrigger
KWGame.KWPawn
'Restart' - Sets the health of the pawn to full health
'DestroyCutController' - If the pawn is being possessed by a CutScript, then the Sequence will be abruptly Terminated
'StartConstantRotation' - Makes the pawn constantly rotate ('StopConstantRotation' stops the rotating, but this only works once started)
'Destroy' - Destroys the pawn
KWGame.KWHeroController
'Restart' - If the controller is either in the state StateNoPawnMove or is not in a state, then the controller will go to the state PlayerWalking
SHGame.AppleTree
'StopProps' - Disables the AppleTree
'StartProps' - Enables the AppleTree
SHGame.Catapult
'StartCatapult' - Enables the Catapult
'StopCatapult' - Disables the Catapult
SHGame.Donkey
'SecretArea' - Makes Donkey say a random dialog from the BumpSet DNK_DonkeySecret
'Snapdragon' - Makes Donkey say the dialog PC_DNK_SNAPDRAGINTRO_2
SHGame.ExplodingObject
'StopProps' - Disables the ExplodingObject
'StartProps' - Enables the ExplodingObject
SHGame.GenericGeyser
'StopGeyser' - Disables the GenericGeyser
'StartGeyser' - Enables the GenericGeyser
SHGame.PushButton
'ButtonDown' - Simulates the PushButton being activated
'ButtonUp' - Simulates the PushButton being temporarily de-activated
SHGame.SearchLight
'StartSearching' - Enables the SearchLight
'StopSearching' - Disables the SearchLight
SHGame.ShEnemy
'StopEnemies' - Disables the ShEnemy
'StartEnemies' - Enables the ShEnemy
SHGame.Shrek
'HamletBellows1' - Makes Shrek say the dialog PC_SHK_BUMPLINE_2783
'HamletBellows2' - Makes Shrek say the dialog PC_SHK_BUMPLINE_2784
'AttachPib' - If Shrek is currently in the state StateIdle, attaches PIB to Shrek's hand
'DetachPib' - If Shrek is currently in the state stateAttachPib, detaches PIB from Shrek's hand
SHGame.SuperSoaker
'StartMilkSprayer' - Enables the SuperSoaker
'StopMilkSprayer' - Disables the SuperSoaker
SHGame.Switch
'SwitchOn' - Simulates the Switch being activated
'SwitchOff' - Simulates the Switch being temporarily de-activated