Actor Voices in Battle

  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  # * TOO MANY ENEMIES?  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  TOO_MANY_ENEMIES = {  # <= Do Not Touch This Line     # If The enemy troop in battle has this many MORE members than you do,    # an actor will say something about how you are outnumbered    :ratio => 2 ,        # "SE Filename", Volume, Pitch, Frames_to_Wait,    #       Repeat if you want more voices       # What Actor One Will Say    1 => [           "Encounter Too Many Enemies1", 80, 100, 0,           "Encounter Too Many Enemies2", 80, 100, 0,         ],      # What Actor Two Will Say    2 => [           "Encounter Too Many Enemies1", 80, 100, 0,           "Encounter Too Many Enemies2", 80, 100, 0,         ],
Yes this is a feature of the script already 😀

The Numbers associated with the voice triggers refer to the Actor/Enemy (depending on the script) ID.

Basically Eric by default would be number 1, and all voices listed inside that chart belong to Eric. The same is true for Natalie who is Actor Number 2, all voices listed in the chart with the number 2 belong to her.

As can be seen in the code, new lines are added per voice to use 🙂

Additionally if you want to include anymore actors, you only simply have to copy a previous entry and change the ID to the Actor you wish to give voices to.

This here will add an entry for Ernest, who is Actor Number 4.

Code:
    # What Actor Four Will Say    4 => [           "Encounter Too Many Enemies1", 80, 100, 0,           "Encounter Too Many Enemies2", 80, 100, 0,           "Encounter Too Many Enemies3", 80, 100, 0,         ],
Spoiler
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  # * TOO MANY ENEMIES?  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  TOO_MANY_ENEMIES = {  # <= Do Not Touch This Line     # If The enemy troop in battle has this many MORE members than you do,    # an actor will say something about how you are outnumbered    :ratio => 2 ,        # "SE Filename", Volume, Pitch, Frames_to_Wait,    #       Repeat if you want more voices       # What Actor One Will Say    1 => [           "Encounter Too Many Enemies1", 80, 100, 0,           "Encounter Too Many Enemies2", 80, 100, 0,         ],      # What Actor Two Will Say    2 => [           "Encounter Too Many Enemies1", 80, 100, 0,           "Encounter Too Many Enemies2", 80, 100, 0,         ],
Spoiler
Yes this is a feature of the script already 😀

The Numbers associated with the voice triggers refer to the Actor/Enemy (depending on the script) ID.

Basically Eric by default would be number 1, and all voices listed inside that chart belong to Eric. The same is true for Natalie who is Actor Number 2, all voices listed in the chart with the number 2 belong to her.

As can be seen in the code, new lines are added per voice to use 🙂

Additionally if you want to include anymore actors, you only simply have to copy a previous entry and change the ID to the Actor you wish to give voices to.

This here will add an entry for Ernest, who is Actor Number 4.

    # What Actor Four Will Say    4 => [           "Encounter Too Many Enemies1", 80, 100, 0,           "Encounter Too Many Enemies2", 80, 100, 0,           "Encounter Too Many Enemies3", 80, 100, 0,         ],
Awesome. Glad to see it can handle a non-default party size, too. I definitely think I'll be using these scripts.

Looks like I don't have anything to worry about other than getting the voice acting done.
So I'm pretty sure I understand most of the script except for one thing. I noticed there is an option to use if your game has character creation and then a voice would be applied depending on gender. My game however gives a sort of questionnaire at the beginning and depending on your answers, you're assigned a character. There are 6 possible characters, 3 male and 3 female. How would I go about making sure the right voice is given to the right characters? This may be a situation where my brain is just messing with me but I can't figure it out.
Do you allow these characters to be given a custom name?
Do you allow these characters to be given a custom name?
Yes, after the character is selected I use name processing to change the name. I feel like I might just be over thinking this and the solution is very simple, but I'm just confused.

::Edit::

So I got the voices to work for each intended character regardless of which is chosen, my problem however comes in when changing the character name. Allowing the player to change the name means the actor name will no longer match the SE Folder name for that character and I always get an error message telling me exactly that... that it couldn't find the folder with that name (The name the player input for the actor).

Is there a solution to this?
I updated the script: http://pastebin.com/raw.php?i=WLYHhbcm

So get that and you can copy your existing editable region into it.

What's new is that you can use:

set_actor_voice_name(id, name)

In a script call which will change where the actors voices will be read from.

So if you were to grant your player actor 6, then you'd simply use

set_actor_voice_name(6, "Default Actor Name")
I'm in need of help with this.

Last night, I spent more than seven hours trying to get this to the point of not crashing my game.

This has become a dealbreaker for me. I'm so exhausted and ready to give up on the idea of making a game.

No matter what I do, I've been getting this error and my battletest crashes. "line 1277; NoMethodError"

The play testing won't even start, it just crashes.

All I need is an attack yell and damage yell per actor, and to be able to link up actors voices to skills within the database.

I don't need comments about loot, ah that battle was tough bro, nothing else.

So, I left big sections blank because I have no need for my characters to comment on every single moment.

The problem with your script is that I can't just ignore the extra elements or remove them. They are game crashers either way. Do I need to subsitue a blank mp3 for every spot I don't want to use?

Please don't tell me to watch your video tutorial. I already have. Trust me.

Maybe it's only because I've had RPG Maker for a week, but I can't work around this.

Please help.

A simplified script or point me in the direction of something usable.
You don't need to post and PM me in multiple places, I'll get your message either way.

I responded to you on VXAce.net by the way.

However you explained yourself a bit more clearly here.

The script is designed to allow you to remove those things you don't need. Based on your question, I'll assume you tried removing the entire section rather than the contents.

You CAN do the following:

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * WEAK ENEMIES? #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ }; WEAK_ENEMIES = { # <= Do Not Touch This Line # Same as Very Weak Enemies, but should be higher :ratio => 80 , # What Actor One Will Say 1 => [ "Encounter Weak Enemies1", 80, 100, 0, ], # What Actor Two Will Say 2 => [ "Encounter Weak Enemies1", 80, 100, 0, "Encounter Weak Enemies2", 80, 100, 0, ], #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # * EQUAL ENEMIES? #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Remove the contents:
Code:
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * WEAK ENEMIES?#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}; WEAK_ENEMIES = { # <= Do Not Touch This Line        #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# * EQUAL ENEMIES?#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and it will work just fine. You CANNOT however remove the lines that have that "Do Not Touch This Line" comment. They are required to be there.

So yes, you can just ignore them if you wish. And no you don't need to substitute a blank mp3 at all... ever.

As for your actual issue, I haven't encountered it. I don't even know where it's occurring (because you've edited the voices, the line 1277 for you is not line 1277 for me) I would guess perhaps a script incompatibility.

But I can't do anything about an issue when I don't have an issue. If you could pass along your project with this game breaking problem I'd be more helpful.
You didn't reply overnight, so I made the assumption that you're on one board more. Sorry about that.

No, of course I didn't remove the 'do not touch' lines, but gutted the material in between.

The error comes from a line that doesn't exist (my script isn't that long).

When I get home, I'll check and see if it's a compatibility issue with something else I'm running (Victor engine and a few scripts with it).

EDIT:

Everything works fine after I removed Victor Scripts' Parallax lock.

You might have a huge incompatibility there. Please check it out for yourself. It would be helpful with your next script update.
You didn't reply overnight, so I made the assumption that you're on one board more. Sorry about that.

No, of course I didn't remove the 'do not touch' lines, but gutted the material in between.

The error comes from a line that doesn't exist (my script isn't that long).

When I get home, I'll check and see if it's a compatibility issue with something else I'm running (Victor engine and a few scripts with it).

EDIT:

Everything works fine after I removed Victor Scripts' Parallax lock.

You might have a huge incompatibility there. Please check it out for yourself. It would be helpful with your next script update.


Start a new project, fresh, no other scripts.

Import the Battle voices script from your main project and place your audio files for voices in the relevant folder for the new project.

Run your new project.

Do you still have the error in the new project?

If no error in new project - then it is likely to be a script conflict. (try moving the script up the list of scripts in your main project, this might work)

If the error remains in new project - then you have likely not set the battle voices script correctly or altered something you shouldn't have (most likely imo).

If that is correct then you can post your project here and I'll take a look or you can post your script here (inside a spoiler) and I'll and likely diamondplatinum will take a look for you.

---

If I had to guess, when you gutted the middle of the script you edited out something you shouldn't have touched.
I already figured it out. Please read the edit to my post. I did all the things you mentioned and found it was Victor Scripts parallax fix causing the issue.

But thanks.
I already figured it out. Please read the edit to my post. I did all the things you mentioned and found it was Victor Scripts parallax fix causing the issue.

But thanks.
Ok cool,

well as a tip, if you want to try to keep Victors Parallax Lock Script you could just try moving the battle voices script up the list to be above it, this might allow you to keep both and get rid of the conflict.

😉

Glad you sorted it and goodluck with your game.
Nope, that wouldn't work. it was already higher in the list. I've just switched over to a different parallax lock, so it's no great loss. I appreciate the advice, though.

However, the scriptor needs to examine this compatiblity issue. It's a game-killer. I would have washed my hands of it, and gotten rid of it, but it's one of the few scripts that can do the functions I wanted. Sorta. Well, it's over now and all is well.
Hello DiamondandPlatinum. I've been having a bit of trouble with your script. I was wondering if you could help. 

I had one actor set up with the required voices and ready to test, but upon attacking in a battle, I got an error like so 

Script 'Battle Voices' line 1334: NoMethodError occurred.
undefined method 'item' for nil:NilClass


I'm really hoping you would help with this issue, or let me know if it's some sort of compatibility issue. I'm assuming
it might have something to do with Victor Saints Animated Battle script. I'll provide a list of scripts I'm using if required.

I'd greatly appreciate if you would take a moment to respond. I really like this script and would love to use it if
this problem was resolved. Thanks in advance. 
 
Swap the scripts that you think are conflicting around (i,e, swap the positions of Victor's Animated Battle Script and the Battle Voice script).

And Start a new game rather than loading a save from an old file.

If it still has an issue, please send me a demo containing the issue. 🙂
Hey DP3! First, wonderful script! It's really easy to set up and understand, so thank you!

I'm using YF's Victory Aftermath and already have your patch as well. YF made it so that a random actor says a random quote, and you patched your script so that that same actor says a quote.  My question is this: can there somehow be a way to ensure that if Actor1 says Quote1, then Voice_File1 will play? Or Quote2 and Voice_File2 and so on? 

I feel like it would be odd for the actor quote to randomly read "Good fight, guys!" while the voice says "That was great!"  They should say the same thing, right?

I just want to know if its possible to sync them together like that or if it would be too difficult to implement.

Right now, I am using a script that adds some more dynamism to the VA quotes, too.  With it, I can make Actor 1 say Quote 2 if Actor 1  has hp less that %50, or make them say Quote 4 if they gained a certain item (like a health potion or a revive) in the drops.  Would that help to make it any easier to sync?
*bump
Thread necro.  >_>

So this script is awesome and everything seems to working fine.

The only thing is that none of my actors play a voice file when receiving healing from any source.

Every other instance works fine.

Anyone else having this problem?
Looks like it's not working with Theo Battle System... Whenever game plays sound of getting "light hit" right after that i get that error "Implementation v1.4' line:1839: FiberError occured double resume"


Help please :')
Really cool, definitely need to check this out!

Original thread: https://forums.rpgmakerweb.com/threads/actor-voices-in-battle.6853/