Cannot remove dead followers without error message (Falcao RTB script)

Hi all. I've searched everywhere and can't seem to find anyone with a similar issue.

I'm using Falcao's RTB script (https://falcaorgss.wordpress.com/category/pearl-abs-liquid/) and when my companion dies, the dead pose remains and follows me from screen to screen, and when I add a common event that says "If companion dead, remove party member), I get an error on line 803 of the Pearl Sprites part of the script (it doesn't seem to like having to remove the deadpose when I remove a party member). This only happens when removing a DEAD follower - it happily allows me to change party members in other ways when they are alive.

Any ideas? Thanks in advance.
Uh ... what does the error message say?
This may be too simple an approach, but have you considered modifying your dead pose to be an animation where the last frame is transparent?

That way they don't have to be removed, but it will look that way to the player (and that is all that really matters, right?).

I know this may take them out of sight if they die in battle, but there should be a way to make a different animation for battles and maps when dead. I haven't gotten too far with this program, but I have had to settle for making things look like what I wanted done many times when I could not figure out how to make it really do what I want!
@Shaz
Here is the error message:
- Pearl Sprites:803:in `block in update_dead_characters': undefined method `dead?' for nil:NilClass, NoMethodError
from - Pearl Sprites:801:in `each'
from - Pearl Sprites:801:in `update_dead_characters'
from - Pearl Sprites:665:in `update_pearl_abs_main_sprites'
from follower HUD:75:in `update_pearl_abs_main_sprites'
from - Pearl Sprites:643:in `update'
from - Pearl Life Bars:138:in `update'
from - Pearl Item pop up:96:in `update'
from Scene_Map:65:in `update'
from Scene_Base:14:in `main'
from SceneManager:23:in `run'
from backtracer:10:in `block in <main>'

@Rodak – That might work. I tried removing the 'offending' part of the script, which worked (with a bit of tweaking), but it caused other problems when I get a 2nd follower (it starts deadposing, but with full health etc and won't attack or move (just take damage)). I thought it would be easiest to just turn the follower deadposing to 'false' in the script, but it's not so simple, it seems.
Can you show your common event where you're removing the dead party member?
What if you make the common event remove the dead state and then remove the character from the team?
@Shaz Here's the event.
remove_companion.png


I tried turning this event off completely (Trigger = none) just to see what happens. My original post was from November and I wanted to see if the problem was the same. This time, instead of the deadposing sprite following me around, I get this error:

Sprite_Character:105:in `update_src_rect': undefined method `<' for nil:NilClass, NoMethodError
from - Pearl Sprites:109:in `update_src_rect'
from - Pearl Sprites:241:in `update_src_rect'
from Sprite_Character:37:in `update'
from - Pearl AntiLag:97:in `update'
from Spriteset_Map:224:in `block in update_characters'
from Spriteset_Map:224:in `each'
from Spriteset_Map:224:in `update_characters'
from Spriteset_Map:181:in `update'
from Cooking (scene_Alchemy):638:in `update'
from - Pearl Sprites:644:in `update'
from - Pearl Life Bars:138:in `update'
from - Pearl Item pop up:96:in `update'
from Scene_Map:65:in `update'
from Scene_Base:14:in `main'
from SceneManager:23:in `run'
from backtracer:10:in `block in <main>'

Mostly Pearl Sprite errors, but one "Cooking (Scene_Alchemy)" error, which is weird (This is a separate plug in for crafting – nothing to do with followers, and is a Falcao script, so would expect it to be compatible). That script is here, if it helps:

Just grasping at straws here, but what if you do a Wait 1 Frame after removing the actor from your party?
Thanks, but that didn't work 🙁 same error:

- Pearl Sprites:342:in `update': undefined method `deadposing' for nil:NilClass, NoMethodError
from - Pearl Sprites:802:in `block in update_dead_characters'
from - Pearl Sprites:801:in `each'
from - Pearl Sprites:801:in `update_dead_characters'
from - Pearl Sprites:665:in `update_pearl_abs_main_sprites'
from follower HUD:75:in `update_pearl_abs_main_sprites'
from - Pearl Sprites:643:in `update'
from - Pearl Life Bars:138:in `update'
from - Pearl Item pop up:96:in `update'
from Scene_Map:65:in `update'
from Scene_Base:14:in `main'
from SceneManager:23:in `run'
from backtracer:10:in `block in <main>'


EDIT: FIXED IT!!!

So this is what I did – it's a workaround, but is effective enough.
I made my companion actor resistant to Death. Then I added a conditional branch to the Common Event that, instead of checking for death state, checks for companion HP=0. If it's true, it manually removes the companion and resets all the related switches. This bypasses the whole deadpose part of the script because the companion never becomes "dead" according to that.
1580215262348.png


Thanks to everyone who gave advice – a mixture of your ideas actually got me to a solution.

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/cannot-remove-dead-followers-without-error-message-falcao-rtb-script.115159/