Help - Search - Members - Calendar
Full Version: [Eventing]Changing Screen Tint Based On HP
RPG RPG Revolution Forums > Game Engines > RPG Maker VX Discussion > RPG Maker VX Tutorials
Fallen-Griever
Should work in any RPGMaker.

You're going to need a variable. Call it "Hero HP".
You're going to need another variable. Call it "Hero Max HP".
You also need a switch called "Cutscene" (you'll see why later).

After setting these up, make an event on every map you need this tinting on that is a "Parallel Process" and has the following eventing:

CODE
If Switch "Cutscene" is OFF Then
   Change Variable [xxxx: Hero HP] = Hero Current HP.
   Change Variable [xxxx: Hero Max HP] = Hero Max HP
   Change Variable [xxxx: Hero HP] * 100
   Change Variable [xxxx: Hero HP] / [xxxx: Hero Max HP]
   If [xxxx: Hero HP] < X Then
      Tint Screen: Red
   Else
      Tint Screen: Normal
   End
End
Wait 0.0 Sec

After setting this up, remeber that the "Cutscene" switch needs to be turned ON at the start of any cutscene and OFF at the end of it. This will allow you to tint the screen during cutscenes without having this event mess around with it!

If you want the same to happen in battles then this is a simpler proposition. First, in every battle, create a battle-event that is triggered by the Hero's HP being between 0% and X%. It should simply look like this:

CODE
Tint Screen: Red

Then make a second battle-event that is triggered by the Hero's HP being between X+1% and 100%. It should look like this:

CODE
Tint Screen: Normal

The X value is the value you want the tinting to change below. It should be set to the percentage you want, not a raw value!
viridev
You could just use a common event script, it would replace the need for adding a new event in every map location. thumbsup.gif
Otherwise great tutorial, it really helped.
LaDestitute
You can also use varying shades of red (or reddish-orange) to make it more gradual and look better.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.