Enemy Hp Guage

Jeremy Cannady

Coldfire
Veteran
Joined
Oct 25, 2015
Messages
449
Reaction score
268
First Language
English
EnemyBars.js V1.1
Jeremy Cannady


I know that Yanfly is making a script like this but this has been over in the plugins in development board
for weeks and thought I would put it on this forum for feedback.



Introduction
Adds an hp bar to enemies during battle.

Features
Decide which colors you want to represent the hp.

The hp bars will be below the sprites.

Works with Rexal animated battlers.


Screenshots

How to Use
Download the script place in plugins folder.

Make sure the script is named EnemyBars.js
Place the correct note tag in the enemy.

Note tag:

 * Put <hpBar> in the enemy note tag to activate the hp bar for that enemy

 during battle.

 *Put <hpBarSelectionOnly> to actiavte the hp bar only during selection.

 *Put<hpBarTurnASelection> to actiavet he bar during selection and attack.

 *Put <hpBarTurnOnly> to only show the bar during the attack phase.

 *PLEASE PUT ONLY ONE NOTETAG.

Script

http://pastebin.com/mQmZ5Jy0


Credit and Thanks
-Jeremy Cannady

Terms:

Free and unrestricted access for anyone for any purpose.

No credits necessary.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,084
Reaction score
13,698
First Language
English
Primarily Uses
RMMV
please add terms of use
 

Nohmaan

Veteran
Veteran
Joined
Jul 7, 2012
Messages
180
Reaction score
49
First Language
English
Nice!  Is it possible to have the bar only visible for a short time when the enemy is taking damage or visible when in target mode?
 

DustyCat Media

Indie Game Purrfector
Veteran
Joined
Oct 15, 2012
Messages
115
Reaction score
71
First Language
English
Great plugin, Jeremy!


I use the custom stuff from Yanfly's plugin; specifically wherein the enemy approaches the heroes when they attack. Is there a way to have the bar move along with the enemy itself whenever the enemy moves anywhere?


Thanks!
 

Jeremy Cannady

Coldfire
Veteran
Joined
Oct 25, 2015
Messages
449
Reaction score
268
First Language
English
Which plugin name is that exactly? I should be able to make it track it easily.
 

DustyCat Media

Indie Game Purrfector
Veteran
Joined
Oct 15, 2012
Messages
115
Reaction score
71
First Language
English
Which plugin name is that exactly? I should be able to make it track it easily.
The commands in either of the three "YEP_ActSeqPack"s has something to do with movement both in heroes and enemies. They contain notetags that when used in the Skills would make either the heroes or enemies move away from their initial position. :)
 

Maus Merryjest

Veteran
Veteran
Joined
May 8, 2012
Messages
240
Reaction score
40
First Language
English
Primarily Uses
This version doesn't seem to be compatible with Rexal's stable version (v1.12.11) with the YEP corengine attached. I tried it and I got the following: 

TypeError: Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D': float parameter 1 is non-finite.    at TypeError (native)    at Bitmap.gradientFillRect (file:///C:/Users/Merryjest/Documents/Games/Grinners%20&%20Losers%20Working/js/rpg_core.js:781:24)    at Enemy_Bars.Window_Base.drawGauge (file:///C:/Users/Merryjest/Documents/Games/Grinners%20&%20Losers%20Working/js/plugins/YEP_CoreEngine.js:1208:19)    at Enemy_Bars.drawBar (file:///C:/Users/Merryjest/Documents/Games/Grinners%20&%20Losers%20Working/js/plugins/EnemyBars.js:110:9)    at Enemy_Bars.update (file:///C:/Users/Merryjest/Documents/Games/Grinners%20&%20Losers%20Working/js/plugins/EnemyBars.js:73:10)    at file:///C:/Users/Merryjest/Documents/Games/Grinners%20&%20Losers%20Working/js/rpg_scenes.js:112:19    at Array.forEach (native)    at Scene_Battle.Scene_Base.updateChildren (file:///C:/Users/Merryjest/Documents/Games/Grinners%20&%20Losers%20Working/js/rpg_scenes.js:110:19)    at Scene_Battle.Scene_Base.update (file:///C:/Users/Merryjest/Documents/Games/Grinners%20&%20Losers%20Working/js/rpg_scenes.js:42:10)    at Scene_Battle.Scene_Base.update (file:///C:/Users/Merryjest/Documents/Games/Grinners%20&%20Losers%20Working/js/plugins/gametime.js:433:30)rpg_managers.js:1618 SceneManager.catchExceptionrpg_managers.js:1579 SceneManager.updateTurning off Rexal's animated battlers v1.12.11 makes everything flow smoothly. I haven't moved up to version 1.15.5.1 because it has a lot of crashing bugs and I'm waiting for the next stable release, but I wanted to let you know that it's currently not compatible with the current stable release. I did some double-checking and ran the HP gauge with just the animated battlers plugin active and the same error ("Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D': float parameter 1 is non-finite.") popped up. 

It does works with only the YEP engine   and this plugin active, so the incompatibility occurs when Rexal's v1.12.11 release is present (YEP patch included)
 
Last edited by a moderator:

Jeremy Cannady

Coldfire
Veteran
Joined
Oct 25, 2015
Messages
449
Reaction score
268
First Language
English
I have been using the unstable current version. I will make a patch for the current stable one if I can.
 

10kk

Parallel Process irl
Veteran
Joined
Apr 10, 2013
Messages
209
Reaction score
76
First Language
English
Primarily Uses
RMMV
I'm a big fan of this plugin! Adds a lot of quality to battles, especially boss battles or high HP enemies overall.

My only suggestion would be to add an option between having the bar above or below the enemy sprite. This seems achievable enough by having the choice as a parameter in the plugin menu or as a different notetag like <hpBar2>
 
Last edited by a moderator:

Jeremy Cannady

Coldfire
Veteran
Joined
Oct 25, 2015
Messages
449
Reaction score
268
First Language
English
Oh yeah I just got caught up in making my shop script. 1200 lines of code was not a fun project. I am going to try to look at it today but I think Yanfly is going to release enemy hp bars this weekend. Everyone will use that one so IDK. If anything I will do it just because it is a feature I want as well. I will update later this afternoon. 

Edit: Actually I just tested it and it was really easy to do so I will update it after lunch, that is making it visible during selection. Not sure if you want only visible when selecting the enemy or when damage is being done.
 
Last edited by a moderator:

Nohmaan

Veteran
Veteran
Joined
Jul 7, 2012
Messages
180
Reaction score
49
First Language
English
Oh yeah I just got caught up in making my shop script. 1200 lines of code was not a fun project. I am going to try to look at it today but I think Yanfly is going to release enemy hp bars this weekend. Everyone will use that one so IDK. If anything I will do it just because it is a feature I want as well. I will update later this afternoon. 

Edit: Actually I just tested it and it was really easy to do so I will update it after lunch, that is making it visible during selection. Not sure if you want only visible when selecting the enemy or when damage is being done.
Definitely when selecting the enemy, but if it can also be while damage is being done big plus.
 

Jeremy Cannady

Coldfire
Veteran
Joined
Oct 25, 2015
Messages
449
Reaction score
268
First Language
English
Updated to 4 options:

hp bar always visible

hp visible during selecting enemy

hp visible during selection and attack phase

hp only visible during attack phase

Please only put in one note tag.

Let me know if you experience any bugs!
 

Nohmaan

Veteran
Veteran
Joined
Jul 7, 2012
Messages
180
Reaction score
49
First Language
English
Great! I'll try it out when I get home.  Thanks for circling back around to that.
 

junglechief

Veteran
Veteran
Joined
Nov 9, 2015
Messages
46
Reaction score
3
First Language
English
So I downloaded your current version and the updates from what I was using before are awesome. However I still get issues with Rexals Animated Battlers. I have a fight where I am using a party member as an animated battler. I have them on the other side of the screen, working an everything, but when I turn this plugin on, I get the same error I did with the old version: Failed to execute 'createLinearGradient' on 'CanvasRenderingContext2D': float parameter 1 is not infinite.

http://imgur.com/A9eogeM

here is my console output.

Didn't scroll through all the posts sorry. Looks like this is a similar report to the one above. I guess I'll just confirm that it does indeed not work with the most stable version of Rexal's.
 
Last edited by a moderator:

Jeremy Cannady

Coldfire
Veteran
Joined
Oct 25, 2015
Messages
449
Reaction score
268
First Language
English
I think it is because with the party member as an enemy means its not an actual enemy per how the game decides. 
I will have to test it to figure out how to draw the bars on actors or enemies. 

Can you clarify, the enemy is an actor sprite correct? And not the default enemy pictures.
 

junglechief

Veteran
Veteran
Joined
Nov 9, 2015
Messages
46
Reaction score
3
First Language
English
As far as the game is concerned, it's an enemy. You just take an enemy image and rename it to match the actor icon name and the plugin pulls the sprite data. Shouldn't have any other data associated with it.
 

10kk

Parallel Process irl
Veteran
Joined
Apr 10, 2013
Messages
209
Reaction score
76
First Language
English
Primarily Uses
RMMV
I would love the option for choosing HP bar above or below enemies, and slightly slimmer bars, because they are very large when compared to your screenshot. Otherwise, love the plugin a lot! :)
 
Last edited by a moderator:

Jeremy Cannady

Coldfire
Veteran
Joined
Oct 25, 2015
Messages
449
Reaction score
268
First Language
English
@ 10kk Those options would be easy to do, at first I had the bars on top but everyone didn't like that. I will just make that an option.

I am just working on getting it to work with the animated battlers script first.

@jungle

It seems to work fine with me:

 
Last edited by a moderator:

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

Latest Threads

Latest Profile Posts

My dynamic weather system grows... now with cloud cover influenced by wind speed! (4x playback) (Not final cloud image/map)
Wrote a plugin today that allows you to assign BGM, Battlebacks, and even Battle Entry SE's on a per-troop basis. Introducing a random encounter with a high-pitched Chicken Squeal is worth it all by itself.
Stream will be live shortly with some game development! Feel free to drop by!
Asphodelethe wrote on skybluehair's profile.
Hi! I loe your desert NPCs for adding some variety. I've used them in a free game (The Snow Elf on Itch.io) and I'd love to use them in the new game I'm working on, which I hope to release commercially. I'd love your permission if I could have it!


So I figured out how to put words and pictures in the screen transition. It even wipes away from both the top and bottom. The possibilities are endless! :LZSexcite: I'm going to devise secret messages now for them because I'm a terrible wonderful person like that. :kaopride:

Forum statistics

Threads
105,763
Messages
1,016,244
Members
137,450
Latest member
patriciabrown
Top