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

Showing animation in script

Question

How do you make skill animations appear using a script, as I was going to put in the skill menu, but I have no clue how to script that.

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

To display an animation you need 2 things: An object that either is a RPG::Sprite or a subclass of RPG::Sprite and the animation's ID.

 

Once you have an object that is of the RPG::Sprite type, you can call

sprite_object.animation( id, hit )

id is the Animation ID

hit is either true or false, and represents whether the "hit" or "miss" animation is displayed. true will be handled as a hit.

 

if you set the id to nil, the animation will stop.

 

Also, there is:

sprite_object.loop_animation( id )

This will cause the animation to continuously loop, until stopped

 

RPG::Sprite#update will update any existing animations set to the sprite.

 

Hope this is what you were looking for :)

Share this post


Link to post
Share on other sites
  • 0

Not to steal the topic but would that mean i can use this to target a picture in the script?

EX: i have the player sprite shown in the skill menu and when i press P it will show what skill i have selected on the player sprite.

Share this post


Link to post
Share on other sites
  • 0

Yes and no. You would be able to do this, however, the way that RPG Maker's default menu is set up; it draws the player's sprite onto the window's bitmap; and there isn't a way to target that window or it's bitmap. (Neither are of the RPG::Sprite type)

 

2 (simple) ways to get around this (there are many ways, these are probably easiest to implement in an existing menu):

 

1. Create an empty RPG::Sprite, and position it to the same location as where the player's sprite is drawn, then call the animation.

2. Change the existing code to create the player's sprite AS a RPG::Sprite instead of drawing it to the bitmap, and position it in the right place; then call the animation.

 

Lemme know if you need more help/example on how to do this.

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...