Code won't work in one specific external event? (SOLVED)

Greetings,

To organize and tidy my game project, I’ve been separating my logic into external events. Smooth sailing so far, until now. I’ve encountered an issue which I assume is a bug?

So, as you can see here, in this external event, I want to make it so that if anything in the Entities group has their I-frames variable undefined, then just change it to a default value.

But… it doesn’t work for some reason…?

Like, the debugger is supposed to return 20, but it just returns 0?

What’s stranger, if I copy paste this code outside of the external event, it works as intended. And even stranger, if I copy paste this into a DIFFERENT external event, it also works!

So basically, this code works, but it simply chooses NOT to work in this one specific external event.

Did I mess something up, or is this a bug?

Make sure you have the group Entities defined in the scene in which the external event is referenced.

Also, you don’t need to iterate over each of the Entities object. The event with the conditions and action will update all the relevant Entities in one go.

Thank you for your reply. I removed the for each block.

I’ve got the external event referencing the scene here, and all the other external events work, just not EntityAI:

I’ve even added some dummy code in the EntityAI block to tint the player green, and sure enough, it works everywhere EXCEPT the EntityAI block, implying that NOTHING works in it.

I don’t know what I’m doing wrong, this has never happened before. I’m certain that everything is defined and linked properly…???

Does “Untitled scene” have the group Entitie defined?


Is this an unconditional event, that’s not a subevent?

What happens if you open developer tools, clear the console and preview the game?

How do I “define” a group in a scene, or know that it’s defined?

Yes, the event is unconditional, and not a subevent. The external event link isn’t a subevent either.

I’ve opened the developer tools, cleared everything out, and nothing happened…?

Edit: Alright, I think I just figured it out. I moved the external event around and found out that there was an unnamed external event that I must’ve deleted prior.

It works now, thanks!