Error Trying to rename character

Whenever I use
◆Change Name:#0004, Dave
The actor in speech and most other ways will be called Dave. When added to the party however the namespace for him is always left blank.
I tried this to fix it with this script but got the same problem.

Code:
  ◆Script:var actorName = "Mikey";
  :      :$gameActors.actor(4).setName(actorName);
don't use script - use the event functions correctly.

If you add a member, you have the option to "initialize" the actor. That means resetting all values to database start.
If you have the actor without a name in your database, rename it before adding and then reinitializing, you'll delete the new name.
It is better to add first with init (you'll need that for the other values, then rename.

and it is much better to give all actors a default name even if they're intended to be renamed, because the events use the database name in displays - if you have several unnamed actors you'll not be able to read the events in the databse correctly because you'll never know which of the unnamed actors is selected at the moment.
oh that makes sense then, I would have to redo the check when they are initialised.
I would have used event functions if I wasn't getting that error. Rename was the only value that changed for that one actor but I will have the default in place.

Original thread: https://forums.rpgmakerweb.com/threads/error-trying-to-rename-character.91085/