RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Help with using script for changing graphics.

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 85
Is there to change the graphic of an event on the map screen with a script? If so how would that command be written?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
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.

**
Rep: +0/-0Level 85
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.

***
Rep:
Level 90
Skilled Scripter, Shitty Mapper, Decent Writer.
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?

**
Rep: +0/-0Level 85
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.

***
Rep:
Level 90
Skilled Scripter, Shitty Mapper, Decent Writer.
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.

**
Rep: +0/-0Level 85
Its a system of randomly populating a map with interactable people using event as dummys and pasting graphic onto them.