The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Tenraah on June 15, 2011, 03:03:02 AM

Title: [XP] 2 quick scripting questions
Post by: Tenraah on June 15, 2011, 03:03:02 AM
I've got a couple questions about scripts in rmxp that I can't figure out.
First one: How do you change an event's graphic with a script?  If possible, I'd like to change an event's page 2 graphic from page 1's commands.  I looked through game_event, game_character, interpreter, and nothing I tried worked.
Second one: How do you make a sprite object appear above a window?  I tried messing with the z values of everything related but somehow it won't show the sprite above the window.
Searching on google and this site's search didn't help either -_-
Title: Re: [XP] 2 quick scripting questions
Post by: ForeverZero on June 15, 2011, 04:46:16 AM
For instances of Game_Character, such as $game_player and $game_map.events, you can change the graphic by changing the @character_name. This value is read by the Sprite_Character class, and will change accordingly.

As for your other problem, the Z value only applies to sprites that use the same viewport. Viewports have their own Z values. A sprite with a z value of 10000 will still show below another with a z value of 0 if the viewport it uses has a higher z than the other one's viewport.
Title: Re: [XP] 2 quick scripting questions
Post by: Tenraah on June 16, 2011, 05:56:43 PM
Thanks for the help.  I fixed problem 2 completely, but I still can't figure out how to change an event's page 2 graphic from page 1.  I'll just have to have another event change the graphics instead of having the events fix themselves, but that's fine.  The graphic change is only temporary too :( so I have to fix it every time the player enters the zone.