Game Over caused by a Variable...

I have a Morality status in my game and when it reaches -10 I want my character to lose his sanity and it will result in a Game Over.
But how?
Just to be certain, is this for MV or for VX? Your profile states you use VX, but you posted this in the MV forum.
Ah sorry!! I use MV right now...
What I would do here is go to the database and make a common event with Trigger: None, containing a conditional branch to check the variable value, e.g.
Code:
◆If:Sanity ≤ -10
  ◆Text:None, Window, Bottom
  :    :You have gone insane...
  ◆Game Over
  ◆
:Else
  ◆If:Sanity ≤ -8
    ◆Text:None, Window, Bottom
    :    :Your sanity is dangerously low!
    ◆
  :End
  ◆
:End
Then wherever you decrease the associated variable, just add a Common Event command to check for a game over, e.g.
Code:
◆Control Variables:#0001 Sanity -= 1
◆Common Event:Sanity Check
This way if you want to add any special effects or extra checks later on, you only need to edit the common event. ^_^
Contro Variables (set sub 1)
Conditional Branch
if variable (morality) <= -10 then
Game Over
end

Step 1
Spoiler
sss1.jpg

Setp 2
Spoiler
sss2.jpg

Step 3
Spoiler
sss3.jpg

And set this event whatever you want.
What I would do here is go to the database and make a common event with Trigger: None, containing a conditional branch to check the variable value, e.g.
Code:
◆If:Sanity ≤ -10
  ◆Text:None, Window, Bottom
  :    :You have gone insane...
  ◆Game Over
  ◆
:Else
  ◆If:Sanity ≤ -8
    ◆Text:None, Window, Bottom
    :    :Your sanity is dangerously low!
    ◆
  :End
  ◆
:End
Then wherever you decrease the associated variable, just add a Common Event command to check for a game over, e.g.
Code:
◆Control Variables:#0001 Sanity -= 1
◆Common Event:Sanity Check
This way if you want to add any special effects or extra checks later on, you only need to edit the common event. ^_^

This looks very good, thank you!

Contro Variables (set sub 1)
Conditional Branch
if variable (morality) <= -10 then
Game Over
end

Step 1
Spoiler
sss1.jpg

Setp 2
Spoiler
sss2.jpg

Step 3
Spoiler
sss3.jpg

And set this event whatever you want.
Thanks for the help dude!

Original thread: https://forums.rpgmakerweb.com/threads/game-over-caused-by-a-variable.106118/