Set an alarm to the given value.


GML Code Example

alarm_set(index, value);

Argument Description
index The alarm index to set, from 0 to 11.
value The value (an integer) to set the alarm to.

Returns: N/A


This function can be used to set an alarm. You supply the alarm number from 0 to 11, and then the value to set the alarm to. The value must be an integer value, and you can set it to -1 to stop the alarm. This is an alternative method to setting the alarm array directly.


GML Code Example

for (var i = 0; i < 12; i++)
    if alarm_get(i) > 0 alarm_set(i, -1);

The above code checks all the alarms in the calling instance and if they are greater than 0 it sets them to -1, stopping them from counting down any further.

Next: alarm_get

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here