Main Menu
  • Welcome to The RPG Maker Resource Kit.

[XP] 2 quick scripting questions

Started by Tenraah, June 15, 2011, 03:03:02 AM

0 Members and 1 Guest are viewing this topic.

Tenraah

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 -_-
"...because, you know, whatever."

ForeverZero

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.

Tenraah

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.
"...because, you know, whatever."