1
\$\begingroup\$

I'm working on a small game using Gamemaker Studio 2 and I've noticed that my Parent o_enemy.Alarm[0] Is activating the Child enemy_1.Alarm[0] event.

Both alarms were supposed to be activated under different conditions, (The parent alarm is used for all enemies, but the child alarm is used for the specific enemy) but they seem that they'll activate each other because they share the same name Alarm[0].

I could fix it by setting one of the alarms to Alarm[1], but seeing that I've only a limited amount of 9 Alarms, I think there should be an easier solution to solve this problem.

So far I've tried Event.inherited() on the child alarm, but that didn't solved the problem.

Is there a way that a child's Alarm will ignore the conditions of the parent alarm?

\$\endgroup\$
1
\$\begingroup\$

Instead of

o_enemy.alarm[0] = value;

Try something like this

with o_enemy
{
    if object_index != enemy_1
    {
        alarm[0] = value;
    }
}
\$\endgroup\$
  • \$\begingroup\$ Thank you, I'm gonna give it a try when I get home, but from how the code looks, I can already see that this can be a good solution. \$\endgroup\$ – Steven Dec 6 '17 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.