Mikuri 0 Report post Posted June 26, 2011 (edited) Hello! This is kinda simple, but I'm kinda stuck on it -.- I want to switch the "map visual" of multiples allied caracter at once. All the same. Like hero from ID 1 to 5 become character file "char_exemple". A simple loop is enough. I only need to know the command and the way to designate the new file... Thanks for any help :D! --- EDIT: I also need a way (script) to rename a file (like test.png into test2.png into the pictures folder). Edited June 27, 2011 by Mikuri Share this post Link to post Share on other sites
0 ForeverZer0 44 Report post Posted June 26, 2011 class Interpreter def batch_graphic_set(graphic, *ids) ($game_party.actors.find_all {|actor| ids.include?(actor.id) }).each {|a| a.set_graphic(graphic, a.character_hue, a.battler_name, a.battler_hue) } $game_player.refresh end end Use it like this in a script call: batch_graphic_set("FILENAME", ID, ID, ID, etc) Example: g = "002-Fighter02" batch_graphic_set(g, 1, 2) This will change actors with ID 1 and 2 to "002-Fighter02". You can use as few or as many IDs as you need. Share this post Link to post Share on other sites
0 Mikuri 0 Report post Posted June 26, 2011 (edited) Omg! It works wonder! Thank you very much, it was exactly what I asked for :)! I have one more problem if you or someone else can help: I also need a way (script) to rename a file (like test.png into test2.png into the pictures folder). Thanks <3! Edited June 26, 2011 by Mikuri Share this post Link to post Share on other sites
0 ForeverZer0 44 Report post Posted June 26, 2011 (edited) File.rename("CURRENT_NAME", "NEW_NAME") The name is relative to the working directory, so you will need to include the local path: EXAMPLE: current_name = "Graphics/Pictures/test.png" new_name = "Graphics/Pictures/test2.png" File.rename(current_name, new_name) Edited June 26, 2011 by ForeverZer0 Share this post Link to post Share on other sites
0 Mikuri 0 Report post Posted June 27, 2011 (edited) Wow! So easy! Thank you <3! Edited June 27, 2011 by Mikuri Share this post Link to post Share on other sites
Hello!
This is kinda simple, but I'm kinda stuck on it -.-
I want to switch the "map visual" of multiples allied caracter at once. All the same.
Like hero from ID 1 to 5 become character file "char_exemple".
A simple loop is enough.
I only need to know the command and the way to designate the new file...
Thanks for any help :D!
---
EDIT:
I also need a way (script) to rename a file (like test.png into test2.png into the pictures folder).
Edited by MikuriShare this post
Link to post
Share on other sites