I have a character that you have to name during the game, but now I can't refer to that actor's name at all in scripting. I tried using their character_name (the name of the spritesheet) but that also breaks once the character is renamed for some reason. Other stuff like the id just flat out doesn't work. I just need a way to refer to the actor that isn't dependent on its name AND actually works, unlike id for some reason. (For reference, I am using a script that uses images to display character pictures in the menu, and the way I am having them show up is by using their name in the filename of the image then using actor.name to have the pictures show up. Obviously this doesn't work because the name will change, causing the picture to disappear on the menu.) If anyone knows how to fix this please help!! I don't want to have to remove the naming feature but I also want the menus to work correctly!
[SOLVED] [XP] Character renaming breaks a lot of things
RPG Maker XP SupportWell, you should never rely on an actor's name, use his ID instead.
Anyway, we can only guess here what you can try to fix your problem because you didn't provide any actual code here.
actor = $game_actors[ActorID]Anyway, we can only guess here what you can try to fix your problem because you didn't provide any actual code here.
Sorry, here is the code I am having issues with.
It is from Moghunter's Scene_Menu script. I just want the face to be specifically drawn for the actors instead of relying on the name, but i'm having trouble fixing the code myself. Thank you for your response!
Then you should definitely use actor.character_name and make sure you use no scripts that call the graphic assets by the actor's actual name.
So if the actor #1's battler or character sprite is called 001-Fighter01, the face you wanna use should be called 001-Fighter01_fc. File extensions can be omitted in your scripts.
So if the actor #1's battler or character sprite is called 001-Fighter01, the face you wanna use should be called 001-Fighter01_fc. File extensions can be omitted in your scripts.
That's something I tried already though. For some reason, once the actor is renamed, the sprite disappears in the menu. I cannot understand why this happens and was hoping there was an alternate solution
Are you sure you didn't include another script that alters the character_name?
Use Ctrl+Shift+F to search for that and please post a screenshot of the list of lines where it appears according to the script editor.
Use Ctrl+Shift+F to search for that and please post a screenshot of the list of lines where it appears according to the script editor.
Only used in this line i edited from before. And this is a test project that i'm using to make sure this works before i put it in my game fully, so it can't be any other scripts.
I'd suggest you search for
character_name as kyonides instructed - it doesn't necessarily need to be attached to a variable called actorI did- same result. Unless i'm misunderstanding? I searched for the one with actor in the screenshot and without actor and it's still the only line that shows up.
Show me your name change script please if it's a custom one or a default script you've modified on your own. Perhaps the issue can be found there.
EDIT
If you have none or you don't remember what you might have altered in the last couple of weeks, you could send me your Scripts.rxdata file. This would be voluntary, you don't have to do that if you don't want to.
EDIT
If you have none or you don't remember what you might have altered in the last couple of weeks, you could send me your Scripts.rxdata file. This would be voluntary, you don't have to do that if you don't want to.
If by name change script you mean how i'm renaming the actor, it's just the default event command "Name Input Processing". The scene is the default "Scene_Name", i can send that if you want. I can also just send over the rxdata file if that's more helpful.
What if you track the value of character_name, for example, draw it on the screen to see what value it becomes?
I really hope that character_name doesn't get the new actor's name but that might be the case here...
The other option would be that character_name gets an empty string, i.e. "", instead of a normal filename.
The other option would be that character_name gets an empty string, i.e. "", instead of a normal filename.
Original thread: https://forums.rpgmakerweb.com/threads/solved-xp-character-renaming-breaks-a-lot-of-things.172762/