hi there i have a question about scripting possibiltys.
i use some scripts which use the actors name for sprite selection (legacy class change as example.)
so i have to give my actors names in database.
but i thought about to give the player the opportunity to select the actors name by their self.
therefore are many scripts out there i know.
but the problem is that the graphics need to be named like the actor....
now my question is, is there a way to create a script which can do the following:
check which name an actor have,
copy a picture from the charaters folder and rename it in the way it needs to be named.
example:
This is how legacy wants to have it for actor 1 = "Aluxes_Warrior.png"
But if i change the name by script, for example to "Peter"
the graphic's name have to be "Peter_Warrior.png" too.
now comes the new script to work
in the characters folder is a grphic named "TEMP1_Warrior.png"
now the script should copy the file and rename it to "Peter_Warrior.png"
like i said i dont request that but i want to know if this is possible ?!
thx in advance
When I come across scrips like this, I tend to edit them to use the actor ID rather than the actor name.
So instead of
BOB_whatever.png
the files just have to be
01_whatever.png
This it don't matter what you name the character as it just goes by what the actor ID is in the database.
well, just use this to rename it:
File.rename( anOldName, aNewName )
the NewName should be the name that the player chooses :P
see you
The ID naming method is better, much less IO access, and no possibility of any type of file access errors. If you want something other than a number, and want actual words, use the name of the character in the database, and reference it not by their name of the $game_actor, but of the $data_actors[ID].name. This value is constant and will not change.
@ForeverZer0
Let me see if I understood what you said xD
$data_actors[ID].name just returns the name of the actor with that id right? lol
@Apidcloud:
Yes, as I just stated it does. It is not changed when an actor name changes. The Game_Actor#name is initialized as this name, but is subject to change. This value will remain the same even if that is changed. lol
Lol I get it now
Well, that's a good way, because just like you said, with that method, IO acess wont be denied or something xD
See ya and ty for the good explanation :)
What F0 explained is literally the actor name that you specified in the editor.
Quote from: Blizzard on August 20, 2011, 06:00:16 am
What F0 explained is literally the actor name that you specified in the editor.
Well, always learning xD
I guess that's logic now, $data is used for database stuff eheh :P
sry i foret about that long ago but thanks for replying so much :shy: