Playing Animation on Map in Javascript

Eilios

Veteran
Veteran
Joined
Nov 13, 2015
Messages
58
Reaction score
2
First Language
English
How would you freeze the player, player an animation, and once it's done either set idle (if it doesn't do it on it's own) all on the map? I'd prefer to understand how instead of being referred to a plugin if possible, as I'm still learning a lot of the API.

I've noticed this:
 

Game_Actor.prototype.startAnimation = function(animationId, mirror, delay) { mirror = !mirror; Game_Battler.prototype.startAnimation.call(this, animationId, mirror, delay);};but it's all I've seen that really 'starts' an animation possibly. I don't see anywhere to set a sprite sheet to do it, only and ID which I have no idea where it comes from if you're trying to play one on the player from a sprite sheet. Is there a more drawn out process for this?

In advance of a response (hopefully), thank you. I know I've asked a few questions in the few days I've been here, and some of them may be dumb or obvious (or maybe I just feel that way). It really is helping me see the way these functions work and learn pretty quickly. So again, thanks!

:)
 

Mellye

Veteran
Veteran
Joined
Oct 24, 2015
Messages
347
Reaction score
279
First Language
Portuguese
How would you freeze the player, player an animation, and once it's done either set idle (if it doesn't do it on it's own) all on the map? I'd prefer to understand how instead of being referred to a plugin if possible, as I'm still learning a lot of the API.

I've noticed this:

Game_Actor.prototype.startAnimation = function(animationId, mirror, delay) { mirror = !mirror; Game_Battler.prototype.startAnimation.call(this, animationId, mirror, delay);};but it's all I've seen that really 'starts' an animation possibly. I don't see anywhere to set a sprite sheet to do it, only and ID which I have no idea where it comes from if you're trying to play one on the player from a sprite sheet. Is there a more drawn out process for this?

In advance of a response (hopefully), thank you. I know I've asked a few questions in the few days I've been here, and some of them may be dumb or obvious (or maybe I just feel that way). It really is helping me see the way these functions work and learn pretty quickly. So again, thanks!

:)
To clarify the terminology: when something in RMMV refers to an "animation", it means one of those visual effects you can set up in the Animations tab of the Database Editor.

In this case, for example, the ID would be the id number of said animation.

Sideview-battle sprites movements are called "motions".

Map sprites don't normally have any other type of movement besides the stepping animation, which simply cycles through the 3 sprites in the current direction row while _stepAnime or _walkAnime are true for the character.
 

Quxios

Veteran
Veteran
Joined
Jan 8, 2014
Messages
1,055
Reaction score
785
First Language
English
Primarily Uses
RMMV
If you want to play a database animation over a character on the map ( event or player ) you can use the .requestAnimation() from Game_CharacterBase

Example:

$gamePlayer.requestAnimation(animation id)// or for event:$gameMap.event(EVENT ID).requestAnimation(animation id)You can also do this with the Event Command, Show Animation. 2nd tab, 1st column under character. 
 

Eilios

Veteran
Veteran
Joined
Nov 13, 2015
Messages
58
Reaction score
2
First Language
English
Thanks for that. :)

I was hoping, however, there was a way to still set a sprite and play it as an animation on the map. Surely this is possible, as people have made action battle and other things like separate run sprites that play. If anyone could at least point me in the right direction for that it'd be absolutely wonderful.
 

Jeremy Cannady

Coldfire
Veteran
Joined
Oct 25, 2015
Messages
449
Reaction score
268
First Language
English
Well lets see here, just call the Sprite_Base startAnimation function to display an animation easily. 

Can you clarify, do you want to run the built in animations or a separate sprite animations?

I think Iavra has made a plugin that you could look at.
 

Eilios

Veteran
Veteran
Joined
Nov 13, 2015
Messages
58
Reaction score
2
First Language
English
I'll check that. I'm trying to make separate sprite animations. From my understanding the built in animations are are not 2d, and wouldn't work. I'm trying to change player, follower, and npc animations on the fly for a ton of different things. Just no idea where to start to even look, and tried digging for a while but it's incredibly time consuming, so I was hoping someone knew already. :)

Where is sprite_base located? I don't see it in core, manager, or objects script. 

Also lavra's animate plugin is a move, or tween plugin it looks like, which can make movement animations, but I don't see where it sets a new sprite animation and plays it.
 
Last edited by a moderator:

Eilios

Veteran
Veteran
Joined
Nov 13, 2015
Messages
58
Reaction score
2
First Language
English
Edit:

Answered this myself. Check character name for the sprite and move commands to play them. I'm sure there are other ways (still researching) but this is a start for anyone wondering where to start.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 1, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,862
Messages
1,017,049
Members
137,569
Latest member
Shtelsky
Top