Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Face display problem from changing character name!

Edit: I might have posted in the wrong forum. If so please move this to the script help section thanks!

In scripts that draw character face's from the string of the filename, there's one serious problem. When you change the character names, the filename of the face picture will Also need to change or it will not call the face picture and return an error & end game. Is there a good solution to this? I have tried many things with scripts but they all failed.

The script to call face filenames is this:
bitmap = RPG::Cache.face(actor.name, actor.character_hue)

I tried many stuff including this which works in theory but does not because it needs to refresh and I dont know how to do that correctly.

I put $game_variables[25] = $data_actors[1].name in a script after you input the Player's name. Actor[1] is the player.
And I tried this code in the def draw_actor_face script. But it doesn't refresh obviously and only defines it once, so all the character's faces are now the player's
Code:
    if actor_name = $game_variables[25]

       bitmap = RPG::Cache.face("player", actor.character_hue)

    else

       bitmap = RPG::Cache.face(actor.name, actor.character_hue)

     end

What I probably need is something to get the cached indexes of the characters and then output those instead as strings. I tried something like this but it also crashed with errors :
@actor_id_no = $data_actors[@actor_id]
bitmap = RPG::Cache.face(@actor_id_no, actor.character_hue)
If you know anything please help thanks
 
Try using actor.character_name instead of actor.name. Then you just need a faceset to go with each character set (same name) e.g. Images/Characters/001-Fighter01.png -> Images/Faces/001-Fighter01.png
 
Thanks. Ok i decided it was not worth it to use character_name because there's too many scripts in my game that use actor.name, too many variables to change. Cause if the name is changed, all the actor.name scripts will not work as they should.
Any other ways like the ID method...? then again that will make it need to change all the actor.name too right? Hmm if thats the case then i guess its not worth the effort.
 
Why isn't it worth it to use actor.character_name? Actor.name is the name of the actor in-game, while actor.character_name is the name of the actor's sprite, and only changes if you change the actor's image.
 
Theres like 20 instances in my scripts that uses actor.name, do you think its worth while to change all of them to character_name? i am afraid it might cause errors... so yeah.
 
If you are going to change the actors name, or let the player change the name, then using the character_set filename (character_name) would be worth while.

If you use the actor id, (naming your face sets 1.png, 2.png) you still need to edit all of the methods that draw faces.

Use the Cntl-Shift-F (global search) to find all of the instances of actor.name, then only change it where it's being used to draw a face. Shouldn't take too long.
 
yeahh thats what i wanted to do but i wasnt sure if its possible. Set filename. What would be the whole syntax of that, and where do you think i should call it? In the events of the game where after you set the name of character? And since there are various actor_indexes doesnt it need to be an array? in your example it's not.
Also won't you also recommend filename over changing the actor.name?
Thanks a lot
 
lucky i backed up because i did that and it screwed a lot of stuff up lol.
unless theres another way of doing it i think i would say its too much of a bother, although it will be good for my sandbox rpg >.>
 
I think this thread was heavily wronglead, so let's start again...

What you want is display faces independently of the character's name, right? Either script displaying faces by the character names are not well thought through, so let's change 'em all up. ;) What you have to do is use actor.id, which you will already have prepared in status windows of any sort. Just call your character's face bitmap like this:
Code:
bitmap = RPG::Cache.face(actor.id.to_s, actor.character_hue)
Now, you need to have an image ready in the respective folder being named exactly "1", "2", ... for how many actors you'll need. For labeling reasons, you can change it to "Actor_" + actor.id.to_s or something.

Side note, storing text in $game_variables only works in RMXP, not in RMVX.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top