Well there are many ways to do this. What I would suggest is that you set two variables. One could something like "ActionNeeded" and set it to true. So if "ActionedNeeded" is tru then check any other variables that may require attention.

For example, "Loot", "SecretDoor" "UserMessage" etc

if any action/event requires processing you set the variable "ActionNeeded" which gets check either, every tick or once every 0.5s3econds or whatever and then process accordingly.

I am trying to do something along those lines OP. see: scirra.com/forum/topic75112.html where I try to get help. So far, I'm just using what seems to be an inefficient workaround.

If you wanted a simple implementation, the way I would do it is like this:

Trigger: On Death

-> select DeadEnemy| Action: set lootVar to round(random(1,3)

-> if lootVar = 1|Action: DeadEnemy: create Loot1

-> if lootVar = 2|Action: DeadEnemy: create Loot2

-> if lootVar = 3|Action: DeadEnemy: create Loot3

As in my own problem however, the more Enemy types you have and the more Loot types you have, you'll have to find another way of doing it or you'll end up with a whole lot of events. Anything beyond the simplest Function is beyond me right now, so can't help there. Also when you want different chances for different loot (common, rare, etc), as I did, things become even more complicated.

Is there no way to just check a local variable? In the SYSTEM actions it says global and local variables, but when you try to use it to call or check a variable it only allows you to select globals.Something's wrong in your event sheet. Might want to share it?

Here's an example using local variable:

+ System | On start of layout
Local number lootVar = 0
+ (empty event) -> System | Set lootVar to round(random(1, 3))
Text | Set text to lootVar
+ System | lootVar = 1 -> Text | Set text to "loot"

I did understand what you said earlier and therefor showed how local variables are used. The "check local variables" is the last line in my example (System | lotVar = 1). As soon as the local variable is created it can be used for comparison.

But it is crucial to understand the "philosophy" (sorry, I lack the right words here) of variables.

There are three different kinds of variables in C2. Global, local and instance. They differ mainly in their scope.

A global variable is valid all over the layout, visible and usable for every event and object.

An instance variable can be accessed from anywhere in the event sheet, but is not unique. It shares its name (and access rule) with all other instances, and lives with an object.

A local variable is only generable within subevents and only lives for the time the subevent is executed. So to access it you need to create a subevent in the same subevent level, where the local variable was created.

Start of layout

Local variable

Local variable = some value -> do something

Trying something like this:

Start of layout

Local variable

Enemy died

local variable = some value -> do something

is impossible. The local variable created in Start of layout doesn't exist anymore when "Enemy died" happens. Therefor you can't find any option to compare the local variable of "Start of layout" in the "enemy died" event.