Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
Sign in to follow this  
Mikuri

Setting in batch

Question

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 Mikuri

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

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

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 by Mikuri

Share this post


Link to post
Share on other sites
  • 0

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 by ForeverZer0

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...