Event Commands "Show Animation" script call equivalent?

TheOddFellow

Overactive Artisan Story Crafter
Veteran
Joined
Jul 3, 2014
Messages
152
Reaction score
67
First Language
English
Primarily Uses
RMMV
I've been looking all over the net for an answer to the topic title above.

Simply put, I'm probably going to be using a lot of animations in the map-part of my game. However, they are random. I know there are plenty of script call equivalents for many event commands, but this one is just shrouded in mystery for me.

Can anyone help, please?

Goal: The player selects from a menu, and that menu stores the skill's id. I believe I can use that id to show the proper skill animation, I'm just not sure how.
 

♥SOURCE♥

Too sexy for your party.
Member
Joined
Mar 14, 2012
Messages
693
Reaction score
410
Primarily Uses
Hello!

You could simply set the animation_id variable for any character. Example:

$game_player.animation_id = 4If you're going to use the Script event command, you could take advantage of the interpreter's get_character method:

get_character(-1).animation_id = 4-1 represents the player, 0 the current event where the script command is being used, and 1 and above represents any map event with that ID number. 

Goal: The player selects from a menu, and that menu stores the skill's id. I believe I can use that id to show the proper skill animation, I'm just not sure how.
Once you get the skill's ID, you can use something like:

get_character(-1).animation_id = $data_skills[SKILL_ID].animation_idSKILL_ID would be the ID number of the skill, or the reference to the variable holding that value. Let's say you saved the skill ID to variable 10:

get_character(-1).animation_id = $data_skills[$game_variables[10]].animation_idLet me know if you need further help. :)
 

TheOddFellow

Overactive Artisan Story Crafter
Veteran
Joined
Jul 3, 2014
Messages
152
Reaction score
67
First Language
English
Primarily Uses
RMMV
I rarely receive such expansive and thorough answers to my questions. Thank you so much.

There is a slight problem. When the base skill "Thunder" is used, it shows the animation. But, not for the base skill "Attack." It skips it. They are unedited skills. So, if you were to start up a new project, it would be Skill 1 I am referring to.
 

Kes

Global Moderators
Global Mod
Joined
Aug 3, 2012
Messages
21,420
Reaction score
10,849
First Language
English
Primarily Uses
RMVXA
The animation for skill #1 is 'Normal Attack' which is not animation id #1 (that's 'Hit: PHysical')

You might try changing the choice of animation for skill #1 on the Skill tab and see what that does when you use this with the new id.

It may be (but this is a guess on my part) that the id for 'Normal Attack' is 0.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
805
First Language
Hungarian
Primarily Uses
RMVXA
If you enter this in a script call:

p $data_skills[1].animation_idAnd check your console afterwards, you will see that it prints out -1 actually.
So the animation ID is -1 for every skill which got 'Normal Attack' Animation setting in the database, I guess.


Simply making a condition check if it's skill 1 or not and setting the animation ID based on that check can solve your issue.


Selecting another animation in the database can solve it too.


As a side note... Why on earth would anyone actually use that 'get_character' method when the character is '$game_player'? Typing in 'get_character(-1)' takes longer, takes more space than simply writing '$game_player', AND it goes through another completely unnecessary method to get the actual character in question. I would not use that ever, that's for sure, not for $game_player, nor for $game_map.events[id]. :p


It sounds to me like writing a new method in Game_Interpreter which is named 'get_skill(id)' and simply returns $data_skills[id]. Pointless, really.
 

♥SOURCE♥

Too sexy for your party.
Member
Joined
Mar 14, 2012
Messages
693
Reaction score
410
Primarily Uses
As a side note... Why on earth would anyone actually use that 'get_character' method when the character is '$game_player'? Typing in 'get_character(-1)' takes longer, takes more space than simply writing '$game_player', AND it goes through another completely unnecessary method to get the actual character in question. I would not use that ever, that's for sure, not for $game_player, nor for $game_map.events[id]. :p

It sounds to me like writing a new method in Game_Interpreter which is named 'get_skill(id)' and simply returns $data_skills[id]. Pointless, really.
Simple: it's easier to remember for non-scripters than $game_map.events[id]. Less chances of syntax errors. When you're doing scripts for non-programmers, ease of use and simplicity are important.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,136
Reaction score
805
First Language
Hungarian
Primarily Uses
RMVXA
If someone wants to use custom scripts but can't memorize a few letters, than I guess using custom scripts is not for him/her.


I would understand if the thing in question would be a longer and somewhat more complex method, but exchanging a one-liner to a one-liner is not something I would do.


But, I guess, it is true that it seems simpler for some people.
 

TheOddFellow

Overactive Artisan Story Crafter
Veteran
Joined
Jul 3, 2014
Messages
152
Reaction score
67
First Language
English
Primarily Uses
RMMV
@Sixth Thank you for your patience is showing me a more efficient way of doing what I asked. I'm not used to ruby and have used C# for a number of years.

@♥SOURCE♥ Thank you so much for your help and your explanation on the differences between the two ways of doing what I asked and were presented with here.

I'm glad to have found such a great community, and I hope this topic helps out other developers as well who had this question.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

So trying our Ultra Mode 7 was a bad idea. How do I not include this in my game? XD
Stumbled upon an RPG Maker game on Steam called 'Boobs vs Zombies' while looking for a zombie themed fantasy RTS. lol
There's a new born faction in my country called "Sunda Empire" claiming they have right to rule over the earth and sun... I don't know what to feel...
Quon is watching you
Quon blessed your good efforts
I have tried, several times to understand how Markiplier is popular. You can't deny his popularity. I can only get through a few minutes of his vids, though. He's cringier than ANY cringe comp I've ever watched. When I was a kid, if you acted like that, 0 friends and 100% no dates for you. Times have changed XD

Forum statistics

Threads
93,546
Messages
913,384
Members
123,079
Latest member
plytha
Top