Damage Pop Up and Battle HUD

Hello all,


  So I was wondering if there was a way to show the damage pop up numbers out side of battle. EX, Player strikes a wall, wall takes X damage and shows it like it would if the player was attacking a enemy in a side view battle.


Also another question is there a way to hide the battle HUD?
I create custom animations when trying to show damage outside of battle. It doesn't take that long and you can get creative with it. 


Pausing the yanfly battle core and action sequence packs, you can remove it while attacking but it's a little more involved to remove it all together. 
I just got damage popups working outside battle. It uses the games own system to create damage popups. Right now it's pretty rigid code but I can try working on a standalone version with more customization.
Thats pretty cool, Can I see some of your code to get of idea of how you did it?
The implementation has some major bugs in it right now. In particular when I change scenes everything goes black. I think there's a conflict when updating the sprites on new scene. At any rate I'm rewriting the code in a single script with some handy plugin calls to make it easier to implement.  Once I verify it works I'll send you the code.
I just setup a quick repo for the project.


https://github.com/gilgamar/DamagePopup


Start a new project, add the 3 plugin files GIL_Core > GIL_Setup > GIL_DamagePopup.


Create an event on the map to represent an enemy. Give the event the same name as an enemy name in the database.


Set the event to player touch priority Same.


Add one line plugin command 'ABS battle'


Run game and test how it works.


This setup will only have the player attacking the enemy and showing up the damage on the enemy sprite.


If you want the enemy to hit the player you'll have to edit the script some, just look for GIL.ABS.battle() function in the GIL_DamagePopup script.


If you want to have stuff like walls that can be broken down, just create an enemy to represent the wall and give it some health. Then you can check for health = 0 in the script and have it call a common event or something.


UPDATE:


I just renamed the project to ABS since it's a form of action battle system.


https://github.com/gilgamar/ABS
pretty cool I will try this out either tonight or tommorow. 🙂
Okay I just pushed the latest update to the repository.


It supports basic ABS.


I added $gameEnemies to be synonymous with $gameActors for handling groups of enemies on the map (or traps/walls with health etc).


$gameTroop is initialized on map load and will populate the $gameEnemies by matching event names with enemy names from the database. If an event shares the same name as an enemy in the database it will be tagged as an enemy and added to the troop.


You can use the $gameTroop to check if all the enemies are dead or not on the map.


To create a map battle just add the plugin command 'ABS battle' to the event you want to attack. The event trigger can be in action, player touch or event touch.


If you are familiar with javascript you can dig through the code and find a lot of useful methods and parameters. I haven't exposed everything yet but there are some settings way down in setupDamagePopup for setting the text scaling, tint, offset, etc.


There is a setting for attack delay, erase delay (for when enemy event is dead).


I should point out that there are Game_Battlers and Game_Characters. The battlers are behind the scenes and store all the battle related info. The characters are just the map sprites and you can apply animations to them for damage and attacks.


Sadly this script probably breaks standard battles as it was designed for map battles. It's because of the way I had to monitor the sprites for the damage popups, it needed information about the battlers and I had to reprogram $gameTroop and some other things. So I really don't know if normal battles will still work...
Latest update 1.02 solves the issue of being able to use the original battle system as well as the new one.


I currently overwrite 2 important methods relating to battle stuff so if you use battle plugins they could break.


I will set about to aliasing the methods but they are sort of tricky. I'll probably have to do a check whether or not the player is in battle or on the map and have it branch to the correct version of the method that way it will still support plugins that modify the battle system.
Fixed the overwrite methods, they will now run any prior alias methods if the game is in standard battle and it will run my method if the game is in map battle.
Version 1.04 is out.


https://github.com/gilgamar/ABS


I split the script up further.


GIL_Core > GIL_EventEnemies > GIL_EventDamage > GIL_ABS


is the bare minimum to get it working.


If you prefer less scripts you can probably merge EventEnemies with EventDamage but I separated them for clarity.


EventEnemies adds code to the Game_Event class to register events as enemies (you just have to tag the event with a comment 'Game_Enemy')


It also adds the Game_Enemies class and $gameEnemies object which is somewhat analogous to $gameActors except it is indexed by eventId.


The purpose of this script is to assign a battler to an event so that we can attack it or be attacked and take damage. You can use this to create map battles, hunting games, traps that deal damage with damage popups, walls that can be attacked to break them down. You just have to add a corresponding battler in the enemies database to represent the type of object you are encountering. The enemy does not need to have an image since it uses the event sprite instead of the battler sprite. Finally, this script modifies $gameTroop. It will just add all the enemy events to the $gameTroop for the current map. It doesn't affect $gameTroop for normal battles in the Battle scene so normal battles should work normally.


EventDamage is responsible for the damage popups. It extends the Game_Player Game_CharacterBase and Sprite_Character to support damage popups. I basically borrowed code from Sprite_Battler and Game_Battler with some edits to make the popups appear nicely on the map. All the popup settings are at the top of the script and can be changed to suit your needs. For the damage popups to work there needed to be a battler associated with the event for us to get the damage results from.


GIL_ABS is a rudimentary action battle manager. I really only added the 'battle' command in here. It's accessible from the plugin commands as 'ABS battle'. Just add that plugin command to an event and it will exchange blows with the player. If you want the battle to be one sided you'll have to edit the script. This script is really short and can be easily modified to suit your needs.


GIL_ABS.battle() is the main part of the script.


actor/enemy represent the map actor/enemy event.


a/b represent the associated battlers. We process a/b for damage/actions but we process actor/enemy for animations since they are the visible sprite (battler sprite is hidden).
I put ABS battle and Game_name, but did not work.

@decinbr, please refrain from necro-posting in a thread. Necro-posting is posting in a thread that has not had posting activity in over 30 days. You can review our forum rules here. Thank you.


Please make a new thread with your problem.

Original thread: https://forums.rpgmakerweb.com/threads/damage-pop-up-and-battle-hud.59782/