Problem while removing actors in Battle

Greetings, I'm havind trouble when using the engine. Whenever an actor is removed through an event or through the escape skill tag while in battle, the game crashes with the following error message:

"Script 'Battle Luna line 1194: NoMethodError ocurred.
Error ocurred, check the debug console for more information."

And these are the contents of line 1190-1195.
#--------------------------------------------------------------------------
# faceset_name
#--------------------------------------------------------------------------
def faceset_name
[@battler.face_name, @battler.face_index]
end

This is tested in a Luna Engine Base game.

My project involves actors leaving the party at give moments during battle. Is there a workaround or a way to fix this? Thanks in advance!
Can you give us a screenshot of the debug console?
That message sounds as if you installed one of the backtracer scripts to help with bughunting, and then we need to see its complete output. You need to show the console through the menu option before starting the play test.
I'm not familiar with entire Luna Engine and how it works, but maybe a little silly patch might help?
Code:
class SpriteHUD_Face < Sprite_Base
  def faceset_name
    [@battler.face_name, @battler.face_index] rescue ['', 0]
  end
end
I believe once the battler is removed through event, it makes the @battler variable nil, thus no method error occured
A proper fix should be done though, but in meantime, u can try my patch above, put on a new slot below Battle Luna. Though I won't guarantee if it does not break some functionality since I haven't tested it yet. Anyway, lemme know how it turns out.
Can you give us a screenshot of the debug console?
That message sounds as if you installed one of the backtracer scripts to help with bughunting, and then we need to see its complete output. You need to show the console through the menu option before starting the play test.

Didnt work, unfortunately. :/

Here's the Debug SS.

Thanks for the help, guys!
Try disabling yanfly's battle engine, then start a new game and test again.
Yanfly's battle scripts have a problem with removing or adding actors during battle as they're not written with that option in mind. If that is the cause, then you'll need a special script or patch to enable summoning with them.
Try disabling yanfly's battle engine, then start a new game and test again.
Yanfly's battle scripts have a problem with removing or adding actors during battle as they're not written with that option in mind. If that is the cause, then you'll need a special script or patch to enable summoning with them.

Seems like that wasn't it. By the way, it works OK when I add an actor. The problem happens only when they're removed, it seems.
I don't think Yanfly's script has anything to do with it, since it works fine when I remove an actor using that and not using Luna Engine.

Btw, GTG Sleep for now, be back in a few hours!
To be fair, the error changed once you put my patch, indicating it's "worked". We just need to put some patches on some holes on the script. And it turned out to be more troublesome than I thought. Please be my guest on trying to test the patch.

I've added few more lines on the patch.
Code:
class SpriteHUD_Face < Sprite_Base
  def faceset_name
    [@battler.face_name, @battler.face_index] rescue ['', 0]
  end
end

class Spriteset_HUD
 
  alias patch_luna_screen_x screen_x
  def screen_x
    return 0 unless @battler
    return patch_luna_screen_x
  end

  alias patch_luna_screen_y screen_y
  def screen_y
    return 0 unless @battler
    return patch_luna_screen_y
  end
 
end

class SpriteHUD_Name < Sprite
  alias patch_luna_update update
  def update
    return unless @battler
    return patch_luna_update
  end
end
To be fair, the error changed once you put my patch, indicating it's "worked". We just need to put some patches on some holes on the script. And it turned out to be more troublesome than I thought. Please be my guest on trying to test the patch.

I've added few more lines on the patch.
Code:
class SpriteHUD_Face < Sprite_Base
  def faceset_name
    [@battler.face_name, @battler.face_index] rescue ['', 0]
  end
end

class Spriteset_HUD
 
  alias patch_luna_screen_x screen_x
  def screen_x
    return 0 unless @battler
    return patch_luna_screen_x
  end

  alias patch_luna_screen_y screen_y
  def screen_y
    return 0 unless @battler
    return patch_luna_screen_y
  end
 
end

class SpriteHUD_Name < Sprite
  alias patch_luna_update update
  def update
    return unless @battler
    return patch_luna_update
  end
end

Yay, looks like that fixed some of it! 🙂
Should I try repeating the same for all these errors?
Yes please. Updated the patch
Code:
class SpriteHUD_Face < Sprite_Base
  def faceset_name
    [@battler.face_name, @battler.face_index] rescue ['', 0]
  end
 
  alias patch_luna_update update
  def update
    return unless @battler
    return patch_luna_name_change?
  end
end

class Spriteset_HUD
 
  alias patch_luna_screen_x screen_x
  def screen_x
    return 0 unless @battler
    return patch_luna_screen_x
  end

  alias patch_luna_screen_y screen_y
  def screen_y
    return 0 unless @battler
    return patch_luna_screen_y
  end
 
end

class SpriteHUD_Name < Sprite
  alias patch_luna_update update
  def update
    return unless @battler
    return patch_luna_name_change?
  end
end
Yes please. Updated the patch
Code:
class SpriteHUD_Face < Sprite_Base
  def faceset_name
    [@battler.face_name, @battler.face_index] rescue ['', 0]
  end
 
  alias patch_luna_update update
  def update
    return unless @battler
    return patch_luna_name_change?
  end
end

class Spriteset_HUD
 
  alias patch_luna_screen_x screen_x
  def screen_x
    return 0 unless @battler
    return patch_luna_screen_x
  end

  alias patch_luna_screen_y screen_y
  def screen_y
    return 0 unless @battler
    return patch_luna_screen_y
  end
 
end

class SpriteHUD_Name < Sprite
  alias patch_luna_update update
  def update
    return unless @battler
    return patch_luna_name_change?
  end
end

Oh nooo now the battle won't even start xD
Ahhh sorry I'm so lost. 🙁

Original thread: https://forums.rpgmakerweb.com/threads/problem-while-removing-actors-in-battle.93716/