Hurt Sounds

● ARCHIVED · READ-ONLY
Started by Mr. Trivel 15 posts View original ↗
  1. Name: Hurt Sounds


    Version: 1.2


    Author: Mr. Trivel


    Created: 2015-11-26


     


    What does it do?


    Makes actors and enemies play a sound when they get hit.


     


    Screenshots:


    Nothing to show.


     


    How to use?


    Use following note tag in Actors or Enemies note fields:


    <Hurt: [SFX], [VOL], [PITCH]>


    [VOL] - Volume, by default 90


    [PITCH] - Pitch, by default 100


    E.g.: <Hurt:Siren, 90, 100>


     


    In case of multiple tags on same Enemy or Actor - random sound from them will be picked to play.


     



    Plugin: <Link: Github>


    How to download the Plugin. Click the link above, there will be a button named Raw, press Right Click -> Save As.


     




    Terms of Use:


    Don't remove the header or claim that you wrote this plugin.


    Credit Mr. Trivel if using this plugin in your project.


    Free for non-commercial projects.


    For commercial use contact Mr. Trivel.
  2. What are your terms for commercial games? Could you please edit all your plugins and add that as well? Whether it's not for commercial use, payment required for commercial use, whatever.
  3. This is great! I was waiting for this script for quite a while! It works fantastically.  :guffaw:

    Just as a suggestion, do you think it would be possible to have a sound play from a pool of sounds? Like, if we could put multiple tags and have one chosen at random when damaged? Just so there is a bit more variety in what a character can say or yelp.

    If not, this is still a great script and surprised it hasn't gained some attention. Thanks.
  4. Hexiiso, +1

     

    And what about the individual sound of death for the enemies?
  5. Update v1.1
    - Picking a random sound if multiple tags are on the same enemy or actor.


    @PTS, custom collapse sounds? I'll see.
  6. Mr. Trivel said:
    Update v1.1
    - Picking a random sound if multiple tags are on the same enemy or actor.


    @PTS, custom collapse sounds? I'll see.



    it sooooo wonderful! tnx!!!


    PS: yes, collapse sound, bcs at the moment of sounds of "death" more like a collapse of the galactic black hole
  7. Mr. Trivel said:
    Update v1.1
    - Picking a random sound if multiple tags are on the same enemy or actor.


    @PTS, custom collapse sounds? I'll see.



    Strange, but i have problem.


    Add tag (enemy note)


    <Hurt: Bandithit1, 80, 100>


    and after start battle i see TypeError (see file attach)

    error.png
  8. Update v1.2- Crash fix when attacking enemies/actors without hurt notes
  9. Very nice plugin!


    Works for me, and with no issues.
  10. Mr. Trivel said:
    Update v1.2- Crash fix when attacking enemies/actors without hurt notes



    Tnx Mr. Trivel! Now the plugin works well!


    If you have the desire and time, I ask you to consider the possibility of extending the functionality of the plugin. For example:
    - random collapse sound (with multiple tags) for characters & enemys


    - random attack sound (with multiple tags) for characters & enemys
  11. PTS said:
    - random collapse sound (with multiple tags) for characters & enemys



    You mean this?
  12. Mr. Trivel said:
    Update v1.1
    - Picking a random sound if multiple tags are on the same enemy or actor.


    @PTS, custom collapse sounds? I'll see.

    This works fantastic. Thanks again for the script, great job.
  13. I downloaded this plugin and it works. Kinda. Whenever I have this plugin on, and an enemy attacks the player mid-battle, it will instantly give me an error screen that says:

    "TypeError
    Cannot read properly 'length' of undefined."

    Why is this happening and how do I fix it?Capture.JPG
  14. Hetti said:
    I downloaded this plugin and it works. Kinda. Whenever I have this plugin on, and an enemy attacks the player mid-battle, it will instantly give me an error screen that says:

    "TypeError
    Cannot read properly 'length' of undefined."

    Why is this happening and how do I fix it?View attachment 77472

    I get this error as well. Particularly when I use Yanfly's party system plug in. Something to do with using 5 battlers, doesn't seem to like it.
  15. Hope this isn't a necro, but I wanted to contribute a change I made:

    JavaScript:
        var _GameAction_executeDamage = Game_Action.prototype.executeDamage;
        Game_Action.prototype.executeDamage = function(target, value) {
            _GameAction_executeDamage.call(this, target, value);
            if (value > 0 && target._hurtSounds.length > 0 && target.hp > 0 && value < target.hp)    //added checks for dead or getting killed
            {
                var sound = AudioManager.makeEmptyAudioObject();
                var randomHurtSound = target._hurtSounds[Math.floor(Math.random()*target._hurtSounds.length)];
                sound.name = randomHurtSound[0];
                sound.volume = randomHurtSound[1];
                sound.pitch = randomHurtSound[2];
                AudioManager.loadStaticSe(sound);
                AudioManager.playStaticSe(sound);
            }

    I added two conditions to the original: target.hp > 0 && value < target.hp
    For anyone not versed in this stuff, the first addition makes the hurt sound not play if hitting the target after it dies (IE with multi-hit attacks).
    The second addition makes the hurt sound not play if the target is killed by the attack.
    Both of these are great when pairing this plugin with Mr. Trivel's other plugin for death sounds, as it will make hurt sounds not overlap with it (you can still get overlap if you have lots of multi-hits leading up to a killing blow).