Problem while removing actors in Battle

rafaelzimrp

Villager
Member
Joined
Apr 7, 2018
Messages
5
Reaction score
6
First Language
Portuguese
Primarily Uses
RMVXA
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!
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,260
Reaction score
7,138
First Language
German
Primarily Uses
RMMV
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.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,268
Reaction score
6,013
First Language
Indonesian
Primarily Uses
RMVXA
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.
 

rafaelzimrp

Villager
Member
Joined
Apr 7, 2018
Messages
5
Reaction score
6
First Language
Portuguese
Primarily Uses
RMVXA
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!
 

Attachments

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
30,260
Reaction score
7,138
First Language
German
Primarily Uses
RMMV
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.
 

rafaelzimrp

Villager
Member
Joined
Apr 7, 2018
Messages
5
Reaction score
6
First Language
Portuguese
Primarily Uses
RMVXA
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!
 
Last edited:

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,268
Reaction score
6,013
First Language
Indonesian
Primarily Uses
RMVXA
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
 

rafaelzimrp

Villager
Member
Joined
Apr 7, 2018
Messages
5
Reaction score
6
First Language
Portuguese
Primarily Uses
RMVXA
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?
 

Attachments

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,268
Reaction score
6,013
First Language
Indonesian
Primarily Uses
RMVXA
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
 

rafaelzimrp

Villager
Member
Joined
Apr 7, 2018
Messages
5
Reaction score
6
First Language
Portuguese
Primarily Uses
RMVXA
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. :(
 

Attachments

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I need to remember that if i want to learn to map like a pro, I need to spend hours doing it like a noob again and again… also, a cool map sometimes has hours/even days of work behind. I need to remember that too.
Yo there how's it going rpg community.
It's raining non stop since yesterday. The sound of the rain is so soothing.
I really miss the old style disney animated movies. I guess the last one was The Princess and the Frog from 2009. Now I am trying to collect every single one I can get on BD or DVD.
What I've seen from the MZ tiles looks pretty inconsistent, bleh. Every plant seems to be drawn in a different style.

Forum statistics

Threads
99,291
Messages
963,911
Members
130,902
Latest member
STARFALL
Top