Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Playing Animations in script

Ok, I know I'll smack my forehead when I hear the answer, but how do you play an animation from the database on a sprite in a script?
 

knmt

Member

No need to smack your forehead , I think you should kick something...

anyway , change the "animation_id" of a sprite to the id of the animation in the database you want .

gotta kick something now..haa...
 
Actually, it's the Game_Character that have the animation_id attribute... close enough ^^

Haven't tested that, but this should work :

$game_map.events[event_id].animation_id = animation_id

or

$game_player.animation_id = animation_id
 
Yes, I know, but rmxp.org went down when I was editing the message >_<

In a separate script, if sprite is a RPG::Sprite, you can use this :

sprite.animation( $data_animations[animation_id], true)
 
The sprite is a Sprite sprite, not RPG::Sprite.
From the people I've been talking too, it looks like there's no way to do what I want to do. It looks like I'll have to script my own Advanced Animation script.
 
DeM0nFire, Sprite is the parent class of RPG::Sprite. Just replace "Sprite" with "RPG::Sprite" and it will work the same way, with added functions, including animation. No need to reinvent the wheel...
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top