Need help with global events

I have no idea how to type after the image on this forums. Sometimes it allows me, but this time no matter if i press with mous or with directional arrows, i can't type bellow images, only above.

So the first two images are the global events that do not work for me for reasons unknown.
Hopefully you can explain.
The 3-nd picture shows and event built in exactly same way, but it works fine.
I am either missing something obvious, or it's some kind of a bug...
ev2.jpg
ev3.jpg
ev1.jpg
I think "Break loop" only works when you have a "Loop", that is an event command. Making everything as a Common Event doesn't count as a loop.

"Exit Event Processing" quits the current event; I think that's the one you were looking for.
not sure why there is 2 checks of left atrium, but placing below image
require to press enter after the image to make space below it.

checking a condition if you have atrium and another are both true if you have 1.

you can make the check more if it has atrium == 1 and a atrium > 1 (so you have 2).
otherwise, it can break the condition and behave incorrectly.
There would be an easier way to do this :

For the 3rd image :
Code:
♦ If party has left atrium
  ♦ If party has right atrium
    left atrium -1
    right atrium -1
    heart + 1
  ♦ else
    text : You need a second part
  ♦ end
♦ end

There is no need to make it harder than needed, it reads :
If the party has a left part and if the party has a right part, take away 1 left and 1 right and give 1 heart
else, you need a second part.

You could potentially write it like this, if that's easier to understand :

Code:
♦ Control variables #0001 Atrium = 0
♦ If party has left atrium
  ♦ Control variables #0001 Atrium += 1
♦ End
♦ If party has right atrium
  ♦ Control variables #0001 Atrium += 1
♦ End

♦ If variables #0001 Atrium = 2
  ♦ Heart + 1
  ♦ left atrium -1
  ♦ right atrium -1
♦ else if variables #0001 Atrium = 1
  ♦ Text : you need a second part
♦ End

♦ Exit Event Processing

The second image should work fine, it checks if party has an item named Heart, and if it does pops a message
However, since this is a common event, it needs a trigger
You probably run it with trigger set to none, you should use a switch to trigger its usage or directly call that event where needed :
Code:
♦ If party has left atrium
  ♦ If party has right atrium
    left atrium -1
    right atrium -1
    heart + 1
    ♦ Common event #0007
  ♦ else
    text : You need a second part
  ♦ end
♦ end

The first image is a bit confusing, but what you probably try to do is :
Code:
♦ If Party has left Atrium
  ♦ If Party has left Atrium
    ♦ Text : So now I have two left...
    ♦ Exit Event Processing
  ♦ End
♦ End

The same can be done for the right
Code:
♦ If Party has right Atrium
  ♦ If Party has right Atrium
    ♦ Text : So now I have two right...
    ♦ Exit Event Processing
  ♦ End
♦ End


You need to understand common events are not events that run automatically, you need to either call them in your event (map event), or you need to set a trigger (with a switch) that runs in parrallel or automatically.

Parrallel means just what it means, it will run the common event in the background (meaning all the rest will still work)
Automatic means all the rest will stop working while this event is running (meaning you won't be able to move during the process, so make sure you build the automatic event in a way it can exit when finished)
you can make the check more if it has atrium == 1 and a atrium > 1 (so you have 2).
otherwise, it can break the condition and behave incorrectly.
I have no idea how to do that since i can't see any input for amount.
So i just made it to be 2 different items with same names.
You need to understand common events are not events that run automatically, you need to either call them in your event (map event), or you need to set a trigger (with a switch) that runs in parrallel or automatically.
Yeah, that helped, thanks.

Weird, since i have another event that is basicly a condition check for 10+ items in the inventory and nothing else. And somehow it works despite having no trigger.
Weird, since i have another event that is basicly a condition check for 10+ items in the inventory and nothing else. And somehow it works despite having no trigger.
a common event doesnt need a trigger if you manually call it from some event. otherwise, if its supposed to automatically happen in response to something, there must be a trigger and the trigger has to happen
I have no idea how to do that since i can't see any input for amount.
So i just made it to be 2 different items with same names.

Yeah, that helped, thanks.

Weird, since i have another event that is basicly a condition check for 10+ items in the inventory and nothing else. And somehow it works despite having no trigger.
You probably called this event somewhere, or, if you are using a plugin, maybe the plugin calls this common event with a specific conditions.

Common events are triggered :
- By a switch state
- By an event call
- By a plugin on specific conditions
I have no idea how to do that since i can't see any input for amount.
So i just made it to be 2 different items with same names.
you can also do:
control variable = items of left atrium

than a condition with scriptcall
if: script: $gameVariables.value(3) < 1 (to 2 have left atriums)
text: you have 2 left atriums
else
you only have 1 atrium
end

so you can make things easier if you are more comfortable using them.
so it's easier to write, and read what the items you have.
you can also do:
control variable = items of left atrium

than a condition with scriptcall
if: script: $gameVariables.value(3) < 1 (to 2 have left atriums)
text: you have 2 left atriums
else
you only have 1 atrium
end

so you can make things easier if you are more comfortable using them.
so it's easier to write, and read what the items you have.
I tried to copy that but getting "syntax error - unexpected token"

Also in my own method something goes wrong as well - when i am getting one of the left atriums (only first one, second works ok) game starts lag a lot and i can't even move...
"syntax error - unexpected token"
That means there's an extra character somewhere in the script or it's typed wrong
Sadly i don't know code to find out where is the mistake...

Trying to figure out why the first of left atriums causing game to stop, but second does not, and no luck yet. It's not like it is involved in some other events... weird.
It's something you typed in a script box somewhere. The error wasn't there until the engine tried to process a script command you typed.
Sadly i don't know code to find out where is the mistake...
if you shared exactly what you put in the script box, someone else who could see where it is
if you shared exactly what you put in the script box, someone else who could see where it is
if: script: $gameVariables.value(3) < 1 (to 2 have left atriums)
text: you have 2 left atriums
else
you only have 1 atrium
end
(to 2 have left atriums)
you werent meant to include that part
if: script: $gameVariables.value(3) < 1
text: you have 2 left atriums
else
you only have 1 atrium
end
Still same error. I am supposed to input it in global event, right? And trigger it by switch? And how do i add control variable for certain item?
Still same error
not sure why, then. but also you dont need to use the script call for that. the conditional branch window already lets you compare variables, and youve saved the number of items to a variable. you can just compare that variable to 2 directly

And how do i add control variable for certain item?
you already did if you did what ShadowDragon asked
you can also do:
control variable = items of left atrium
I made a mistake of $gameVariables < 1 as it should be > 1 or === 2
as screenshot, as I use === this time, it will be 2 potions (for you "left atrium")
to make the items be true, if you can get 4 left atrium, use > 1 instead.

you can ignore the console.log as it output the number you have and change items
can be ignored as it is a debugging part. variable must be first, than the
conditional branch like below.

change text to - 1 item or -2 atrium.
sample.png



to check also for right, do the control variables (17) for left, (18) for right
than a conditional brance
$gameVariables.value(17) === 2 && $gameVariables.value(18) === 2
and than your stuff.
Sorry, just out of curiosity, why use SCRIPT to check a variable?
About your problem, don't you need to record the quantity of that item in the variable before the IF?

Disregard, has anyone explained this to the OP?
I made a mistake of $gameVariables < 1 as it should be > 1 or === 2
as screenshot, as I use === this time, it will be 2 potions (for you "left atrium")
to make the items be true, if you can get 4 left atrium, use > 1 instead.

you can ignore the console.log as it output the number you have and change items
can be ignored as it is a debugging part. variable must be first, than the
conditional branch like below.

change text to - 1 item or -2 atrium.
View attachment 313624


to check also for right, do the control variables (17) for left, (18) for right
than a conditional brance
$gameVariables.value(17) === 2 && $gameVariables.value(18) === 2
and than your stuff.
Sorry, i barely worked with variables before, and did not know you can attach it to item.

But i still have a problem. If i do it your way (image 3) - the game becomes a slide show forever.

If i do it as on screenshot 1 - it works, but exit event processing is ignored, and message repeated infinitly.

but i also need a check for right atrium, and if player has it, event should not happen at all, but if i add it to entire thing, as on screenshot 2, game gets stuck and little laggy.

By the way, would be grateful if someone will explain how do i switch to write text bellow picture on this forum. Arrow keys do not work. mouse clicks do not work.

at2.jpg
at3.jpg
at1.jpg

Original thread: https://forums.rpgmakerweb.com/threads/need-help-with-global-events.170785/