(RPGMaker VX Ace) Playing a BGM when actor's HP is low... OUTSIDE of battle?

Simon D. Aelsi

Voice Actor/Composer
Veteran
Joined
Feb 22, 2014
Messages
4,838
Reaction score
1,394
First Language
Hylian
Primarily Uses
RMVXA
Hello!

I've been playing around with events but I just can't seem to get past this one thing: Playing a BGM when Actor's HP falls below a threshold OUTSIDE of battle... or normal BGM resumes when HP goes above. 

I've combed the forums and google but seemingly to no avail. I've tried conditional branches, variables and  still nothing seems to work.

I'd assume I'd need to create a common parallel process event for this...

Am I missing something here...?

I hope this is specific enough. Thanks for your time and thanks in advance!

Edit: There's no battle system in the game so the HP would stay the same--well, the so-called 'danger zone' would be the same, anyway.  The max HP isn't anything astronomical, like 30 HP if that. Hope this helps!
 
Last edited by a moderator:

Mevo

Veteran
Veteran
Joined
Jan 6, 2014
Messages
35
Reaction score
2
First Language
English
Primarily Uses
Well,Actually i just tried something and i find a solution

So,Let's say the Actor's HP Is 562HP

And you will fight 2 slimes

So what i did was make some npc and i will fight 2 slimes and turned the switch on after the fight



And i made an event which auto runs when HP Music on switch is on

So

the event contained that it controlled a variable Which Is singe in HP And its operation is adding and game data is Actor : Eric's HP

then u make a condtional branch and choose variable HP Less than or equal to the hp u want when the music is played

so i will play the music when hp is constant 550 then i  added the function where i play the music i want then erase event

then leave the ELSE Blank

Simply,what i did is in this picture



i think in second picture u can actually disable the variable idk why i enabled it o_O

I Hope u understand anything, i am not really good in explaining

~Mevo
 
Last edited by a moderator:

Simon D. Aelsi

Voice Actor/Composer
Veteran
Joined
Feb 22, 2014
Messages
4,838
Reaction score
1,394
First Language
Hylian
Primarily Uses
RMVXA
The good news is... that takes care of HALF my problem! :)

The bummer news...

Now, I'm trying to figure out how to set the BGM back to normal when HP goes back up to a decent number. I can't select just one BGM because there are several... so this situation seems a bit dicey still.
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
Here's my idea:
Make event be a Parallel Process.

>Loop
>Change Variable to be Hero's HP, multiply for 100 then divide for MaxHP
>Conditional Branch: Variable less or equal to 25
>>Conditional Branch: Switch LowHP is OFF

>>>Save BGM

>>>Play BGM (yourmusichere)

>>>Switch LowHP On

>else
>>Conditional Branch: Switch LowHP is ON

>>>Replay BGM

>>>Switch LowHP Off
>Wait 5 frames
>endLoop

This is my version, but as you can see it isn't in english...

 

Mevo

Veteran
Veteran
Joined
Jan 6, 2014
Messages
35
Reaction score
2
First Language
English
Primarily Uses
The good news is... that takes care of HALF my problem! :)

The bummer news...

Now, I'm trying to figure out how to set the BGM back to normal when HP goes back up to a decent number. I can't select just one BGM because there are several... so this situation seems a bit dicey still.
I Think it goes the same idea

U Make the condtional thing,so when HP Is what ever u want when its normal,lets say it was 100 when its bad and on 500 its good u play the BGM.

How do u play the bgm?

Make that when the condtional branch of the actor is 500 it turns on a switch that plays back another bgm and make that another event when the switch is turned on it turns on,easy :D

if you cant do it just add me on  skype : mevoleproductions 
 

Simon D. Aelsi

Voice Actor/Composer
Veteran
Joined
Feb 22, 2014
Messages
4,838
Reaction score
1,394
First Language
Hylian
Primarily Uses
RMVXA
Thanks again, guys. I'll go ahead and try it out. I'll edit this post later and tell you how it worked.

EDIT:

@Waterguy, I copied the event exactly and the game froze! o_o  Not permanently, though...

Whenever I start a new game, the screen goes black and freezes.

Oh dear...

EDIT 2: I'm an IDIOT! 

I figured out what I did wrong. I put the ELSE in the wrong conditional branch.  Also, I did everything without a loop.    

Now... the final test: Putting this as a parallel common event. If this works, I'll report the thread as solved! Here goes...

EDIT 3: Taking it out of the loop and putting it as a parallel common event doesn't work... Let's try it INSIDE the loop now...

=======================================

EDIT 4: It works FLAWLESSLY, just as you put....      ...However, it only works as an event, not as a comment Parallel process COMMON event... So, when I leave one room, the event doesn't trigger... only when I'm in that certain room will it trigger...

Is there a way to successfully put this as a common event, or will I need to add the event to every room/field of the RPG where there will be enemies?
 
Last edited by a moderator:

Mevo

Veteran
Veteran
Joined
Jan 6, 2014
Messages
35
Reaction score
2
First Language
English
Primarily Uses
Thanks again, guys. I'll go ahead and try it out. I'll edit this post later and tell you how it worked.

EDIT:

@Waterguy, I copied the event exactly and the game froze! o_o  Not permanently, though...

Whenever I start a new game, the screen goes black and freezes.

Oh dear...
What about my solution o_O?
 

Simon D. Aelsi

Voice Actor/Composer
Veteran
Joined
Feb 22, 2014
Messages
4,838
Reaction score
1,394
First Language
Hylian
Primarily Uses
RMVXA
@Mevo, sorry bout that. That was actually the first thing I tried.  The BGM did this weird skipping thing... absolutely terrifying... haha ^_^;;;
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
Did you remember that you have to use a second switch to activate a common-event version?

Although, now that I think about it, it may have an error if you change maps, since it would have saved the bgm as it is in the map you lost your hp at instead of the map's... I think it'd be better to put in each map and change the bgm to the map's instead of saving and replaying the bgm.
Your call though.
 
Last edited by a moderator:

Simon D. Aelsi

Voice Actor/Composer
Veteran
Joined
Feb 22, 2014
Messages
4,838
Reaction score
1,394
First Language
Hylian
Primarily Uses
RMVXA
I suppose I could live with the events being in every map... as long as I didn't have to have a SWITCH in every map.  I'ma try it on two different maps and see how it works. :)

As a common event it doesn't work.  I suppose I can live with that. It works like a charm with two different maps and BGMs. :D     I'm going to copy the event and see if it will work similarly with a guard chase, but that's another thread....

Obrigado, @Waterguy!

Mods, feel free to close this.... unless I'm missing somethin'.
 
Last edited by a moderator:

naruzeldamaster

Veteran
Veteran
Joined
Jun 9, 2014
Messages
70
Reaction score
3
First Language
English
Primarily Uses
Guys I found a simpler way to do this that I'm using in my game, and it requires no advanced scripting.

Step 1: Go to database.

Step 2: Go to the troops page.

Step 3: Select the troop you want to modify

Step 4: On the troop event page, make a If x actor's health is x % for the tab.

Step 5: In the command block put a Change Battle BGM command and for added effect put a tint screen command. For best effect, make the BGM more tense/danger sounding.

Step 6: Create a new event page, this time make it a If x enemy's health is x % for this tab.

Step 7: Make a Change Battle BGM command and have the battle BGM sounding more victorious.

Step 8: Rinse and Repeat steps 4 - 7 for each troop and each enemy in each troop. 

Note: do NOT edit the enemy itself, just edit the troops page!

Note 2: This works for making the Battle BGM change depending on health percent, but I haven't figured out a way to make it revert back to normal if the player is healed.
 

Simon D. Aelsi

Voice Actor/Composer
Veteran
Joined
Feb 22, 2014
Messages
4,838
Reaction score
1,394
First Language
Hylian
Primarily Uses
RMVXA
I see.  Does this work OUTSIDE OF BATTLE too, since that's the main function of this whole thing... and since there's actually no battle system in my game.
 

naruzeldamaster

Veteran
Veteran
Joined
Jun 9, 2014
Messages
70
Reaction score
3
First Language
English
Primarily Uses
I see.  Does this work OUTSIDE OF BATTLE too, since that's the main function of this whole thing... and since there's actually no battle system in my game.
Stick an autorun event (or a parallel process if you already have an autorun) somewhere on the map where the player won't get to.

Conditional Branch: If Actor X's Health = 25% or less

Tint Screen

Else

Blank

It should work, you would also have to add a fix to see if the player's health is above x percent and just have it doing nothing.

I'm still quite new to RPG Maker myself, but I've packed 109 hours into it and gotten about 30 minutes of my game done. 
 

YoraeRasante

Veteran
Veteran
Joined
Jun 6, 2014
Messages
1,643
Reaction score
420
First Language
Portuguese
Primarily Uses
RMMV
There is no such Conditional Branch outside battle event pages. Or  at least I can't find it, please show me if I am wrong.
Also, how does Tint Screen affect sound?
 
Last edited by a moderator:

Simon D. Aelsi

Voice Actor/Composer
Veteran
Joined
Feb 22, 2014
Messages
4,838
Reaction score
1,394
First Language
Hylian
Primarily Uses
RMVXA
Thanks for the alternate ideas, but I'm going to use waterguy's way.  It DOES work outside of battle. :) The tint screen works LIKE A CHARM. <3  If you go to another area where there's different music, it will break...  No way around that. I tried.  HOWEVER, if you leave the map to another map where BGM does not change, the music stays the same. If you go back to that original map where the BGM was saved, it will revert back but the screen will still be tinted.  Upon healing, the screen goes normal and the process repeats again should HP fall below 2.  :)
 

zrk03

Villager
Member
Joined
Jun 9, 2014
Messages
22
Reaction score
5
First Language
English
Primarily Uses
Man this looks really cool! I cant wait to play it!
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,570
Latest member
fgfhdfg
Top