Main Menu
  • Welcome to The RPG Maker Resource Kit.

Help with using script for changing graphics.

Started by fag0mop, July 10, 2009, 04:55:30 AM

0 Members and 1 Guest are viewing this topic.

fag0mop

Is there to change the graphic of an event on the map screen with a script? If so how would that command be written?

modern algebra

Quote from: fag0mop on July 10, 2009, 04:55:30 AM
Is there to change the graphic of an event on the map screen with a script? If so how would that command be written?

That would be an event command. Go to Set Move Route, set it to the event you want to change, and hit the change graphic button. Alternatively you could make a second page with the new graphic conditioned on a switch and turn that switch on.

fag0mop

Thanks Algebra but I need to know how to use RGSS to change the graphics because the graphic name is stored in an array that I cant use an event to change.

Shinami

You've perked my interest. What would having the graphic names in an array accomplish for changing graphics that the use of an event command can't?

fag0mop

Its not that its impossible to do the same things with an event but its alot less practical. if I have an array ["fighter1","fighter2",Ect..." I can pick one out and assign it to an Event using in one line of code. To do the same thing with events you would have to make an entire move route for each graphic and multiply it by each event you want use. Its entirly impractical and would make the program lag if you swapped out the graphics often.

Shinami

Very interesting. Since hashes are something I'm not familiar with, you're pretty much on your own. Thing is though, the event data for each entire map is stored in the manner of a hash within a public variable. I hope you're a programming wizard because I'm stumped on how do something like this. That doesn't mean I can't point you in the right direction though.

Look inside the Interpreter class. That handles the event commands. Obviously, the change sprite command that you can use in the Move Route event command is a part of this class. That should show you how sort out the events to get the specific event ID you want so you can change the graphic through a script call instead of an event command. This most likely isn't what you were wanting to hear since it is most likely the same "inefficient" manner that you're trying to avoid but it should still give you an idea or two.

What the heck are you doing though that requires so many graphical changes? That would take quite a few changes per second to make the game lag.

fag0mop

Its a system of randomly populating a map with interactable people using event as dummys and pasting graphic onto them.