event_perform_object

Performs a given event of the specified object.

Syntax:

event_perform_object(obj, type, numb);


Argument Description
obj The object that should have its event triggered.
type The type of event to perform. See below.
numb The specific event, if one is necessary (otherwise, just use 0).


Returns: N/A


Description

This functions works the same as event_perform() except that this time you can specify events from another object. There are many options here which allow complete simulation of all possible events, but note that this literally just performs all the code in the event and the game will not modify anything to make it trigger itself manually, for example if you choose to perform a keyboard press event, the event will be triggered but the relevant key will not be recognised as having been pressed. Or if you perform an alarm event, the alarm counter will not be set to -1 but rather continue to count down. You can find a complete list of the available constants this function requires from the the page for the function event_perform.

NOTE: Actions in the event called with this function are applied to the current instance, and not to instances of the given object.


Example

event_perform_object(obj_Player, ev_keypress, ord("W"));

This would perform the event associated with Keyboard Check Pressed > W key from the object "obj_Player" in the current instance.


Back: Generating Events
Next: event_user
© Copyright YoYo Games Ltd. 2018 All Rights Reserved