TROOP QUESTION.

Posts

Pages: 1
When I use *2 to show two of the same enemy in a troop, such as Bats, it only says Bat appears. No mention that there are two, although there is Bat A and Bat B to attack. I tried using a comma; Bat, Bat. That didn't work, either. Thank you.
I would like to see:

Bat appears
Bat appears
Marrend
Guardian of the Description Thread
21806
It might depend on the specific maker you're working with. However, a quick look-up of Ace's structure finds...

class Game_Troop < Game_Unit
  #--------------------------------------------------------------------------
  # * Get Enemy Name Array
  #    For display at start of battle. Overlapping names are removed.
  #--------------------------------------------------------------------------
  def enemy_names
    names = []
    members.each do |enemy|
      next unless enemy.alive?
      next if names.include?(enemy.original_name)
      names.push(enemy.original_name)
    end
    names
  end

...this function. If you comment out the line that says...
next if next if names.include?(enemy.original_name)
...this, it looks like it will list non-unique enemies. Not 100% sure about MV. With MZ, there's...

Game_Troop.prototype.enemyNames = function() {
    const names = [];
    for (const enemy of this.members()) {
        const name = enemy.originalName();
        if (enemy.isAlive() && !names.includes(name)) {
            names.push(name);
        }
    }
    return names;
};

...this function. My best guess is that you could set the condition to...
if (enemy.isAlive() { //&& !names.includes(name)) {
...this for a similar effect?
SunflowerGames
The most beautiful user on RMN!
13323

Copy the bat and call it bats, even though its 1.
Then when you put 2 together it will say bats.

Ta da.
Marrend
Guardian of the Description Thread
21806
author=kory_toombs
Copy the bat and call it bats, even though its 1.
Then when you put 2 together it will say bats.

Ta da.


I could see that working best if the graphics relayed that a singular "Bats" enemy was, itself, a group of bats. Though, at that point, there wouldn't be a "Bat" enemy, there would only be a "Bats" enemy.

On the other hand, copy-pasting for each enemy that could come in multiples just so that the emerge text is technically correct might get a little tedious. To say nothing about the target-window having the plural form, and that possibly making no sense.
author=kory_toombs
Copy the bat and call it bats, even though its 1.
Then when you put 2 together it will say bats.

Ta da.

Thank you both.

I could make more than one Enemy out of it.
Have a simple Bat Enemy for when there
is only one bat in the troop and have a Two Bats Enemy
for when there are two in the troop. No?
Marrend
Guardian of the Description Thread
21806
You could make a "Two Bats" enemy for where there are two bats in a Troop. There's nothing stopping you from doing that. It would probably look something like...

author=Emerge text
Two Bats appear!

author=Target window
Two Bats ATwo Bats B

...this?
author=Marrend
You could make a "Two Bats" enemy for where there are two bats in a Troop. There's nothing stopping you from doing that. It would probably look something like...

author=Emerge text
Two Bats appear!


author=Target window
Two Bats ATwo Bats B



...this?

Exactly. Thanks, Marrend.
Pages: 1