RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Need Help With Battle Events

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 87
i am confusd by the way it is set i am trying to make something like say i want my hero to get fully healed in the party then the music changes till my health gose below 20% Can somebody help me please  :'( :Edit: Its allright i got it working now :Edit:
« Last Edit: May 03, 2007, 10:32:26 PM by DrHojo »

pokeball :)OfflineMale
********
Cheese
Rep:
Level 95
?
?_?

well to do anything with hp below 20% do this:

Set varible 1 to actor's hp
Set varible 2 to actor's max hp

Control varible 2 * 20 (times 20)
Control varible 2 / 100 (diided by 100)

then condtiontional branch varible 1 is equal to or less then variable 2
Watch out for: HaloOfTheSun

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
I am confused by the question.

From what I understand, you want different music for when your health is below 20%?

The trouble you are having is that if the hero is healed from below 20%, the music doesn't change back to regular?

Well, I'm not sure, but I think the easiest way would be to have two variables calculate what percent health you are at. This can easily be done by setting one variable to equal your current HP (found in Control Variables -> Actor -> HP) and one set to your max HP (found in Control Variables -> Actor -> maxHP) and then multiply the variable containing current HP by 100 and dividing it by the variable which contains your max HP. This will come up with the percentage of health you have left. Then, you can condition the change Battle BGM on that. So, the event would look like this:

Control Variables: [XXX: % HP] = actor [YYY: <Hero>]'s HP
Control Variables: [ZZZ: max HP] = actor [YYY: <Hero>]'s maxHP
Control Variables: [XXX: % HP] * 100
Control Variables: [XXX: % HP] / Variable [ZZZ:max HP]
Conditional Branch: [XXX: % HP] <= 20
     Change Battle BGM: [Critical Health]
Else
     Change Battle BGM: [Normal Health]
Branch END


I think that should work, but there might be a way built into the battle events database, I'm not sure.

If it doesn't work, post back.

EDIT:

Stop your posting before me, Nouman  ;8
« Last Edit: May 03, 2007, 10:37:47 PM by modern algebra »