How to change Animation Speed (For an EVENT)

Hello! I needed help with Animation Speed, as in the frames, not how fast it is moving across the screen.


For example: I have a giant character, except when it walks it looks really idiotic as it flails its legs underneath it really fast.


So I want the legs to move slower, by slowing the animation speed while keeping the original movement speed in tact.


NOW HERE'S THE CATCH. All the topics I have seen about this were for the PLAYER themselves. But I want to change the EVENTS animation speed, because it is a part of


a cutscene in which the Giant is contained. Maybe there is a script? This seems complicated (to me since I'm new to this) so if anyone helps it will be MUCH MUCH appreciated. Thank you! 
I wrote script for this a moment ago. Hopefully it helps.

Spoiler
#==============================================================================
# Adjust Animation Speed
#------------------------------------------------------------------------------
# This tiny bit code allows the developer to adjust the animation speed of
# of events, followers, and the player.
#---------------------------------------
# >> Change Log:
#---------------------------------------
# @ [07/13/2016] - Completed
#
#---------------------------------------
# >> Script Calls:
#---------------------------------------
# 1. $game_map.events[event_id].anime_speed = value
# 2. $game_player.anime_speed = value
# 3. $game_player.followers[follower_id].anime_speed = value
#-
# Values lower than the default increase animation speed.
# Values higher than the default increase animation speed.
#
#==============================================================================
module RINOBI module AnimeSpeed # <= DO NOT MODIFY
#=========================================================================
# >> Default Animation Speed
#-------------------------------------------------------------------------
# 18 by default. Higher values decrease animation speed while lower values
# increase it. This adjusts the animation speed of all which inherits from
# the Character Base class, so be careful with it.
#=========================================================================
Animation_Speed = 18

end end # <= DO NOT MODIFY
#==============================================================================
# ** Game_BattlerBase
#------------------------------------------------------------------------------
# This base class handles battlers. It mainly contains methods for calculating
# parameters. It is used as a super class of the Game_Battler class.
#==============================================================================
class Game_CharacterBase
attr_accessor :anime_speed
#--------------------------------------------------------------------------
# * Alias Method: Initialize Public Member Variables
#--------------------------------------------------------------------------
alias :rinit_public_members :init_public_members
def init_public_members
rinit_public_members
@anime_speed = RINOBI::AnimeSpeed::Animation_Speed
end # init_public_members
#--------------------------------------------------------------------------
# * Overwrite Metod: Update Walking/Stepping Animation
#--------------------------------------------------------------------------
def update_animation
update_anime_count
if @anime_count > @anime_speed - real_move_speed * 2
update_anime_pattern
@anime_count = 0
end #-
end # update_animation
end # Game_CharacterBase
#==============================================================================
# @@@@@ @ @ @@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@ @@@@@ @@@@ @@@@@
# @ @@ @ @ @ @ @ @ @ @ @ @ @ @ @ @
# @@@@@ @ @ @ @ @ @ @ @@@@ @@@@@ @ @@@@ @ @@@@ @
# @ @ @@ @ @ @ @ @ @ @ @ @ @ @ @
# @@@@@ @ @ @@@@ @@@@@ @ @@@@@ @@@@@ @ @ @@@@@ @ @
#==============================================================================

Examples

Spoiler
ani_speed_00.PNG
You don't need a script.  The Speed setting is how fast the event (or player) moves from one tile to another.  The Frequency setting is how fast it animates while doing so.  So just adjust the Frequency value and see how it goes.
You don't need a script.  The Speed setting is how fast the event (or player) moves from one tile to another.  The Frequency setting is how fast it animates while doing so.  So just adjust the Frequency value and see how it goes.

Actually, frequency controls the interval between movements. A high frequency setting shortens the movement cycle, while a lower setting extends it. If you want events to move smoothly from one tile to next without pause, you use a higher frequency. Adjusting the speed setting does have an impact on animation speed, but as the op wants to keep the event's movement speed in tact.
I wrote script for this a moment ago. Hopefully it helps.

Spoiler
#==============================================================================
# Adjust Animation Speed
#------------------------------------------------------------------------------
# This tiny bit code allows the developer to adjust the animation speed of
# of events, followers, and the player.
#---------------------------------------
# >> Change Log:
#---------------------------------------
# @ [07/13/2016] - Completed
#
#---------------------------------------
# >> Script Calls:
#---------------------------------------
# 1. $game_map.events[event_id].anime_speed = value
# 2. $game_player.anime_speed = value
# 3. $game_player.followers[follower_id].anime_speed = value
#-
# Values lower than the default increase animation speed.
# Values higher than the default increase animation speed.
#
#==============================================================================
module RINOBI module AnimeSpeed # <= DO NOT MODIFY
#=========================================================================
# >> Default Animation Speed
#-------------------------------------------------------------------------
# 18 by default. Higher values decrease animation speed while lower values
# increase it. This adjusts the animation speed of all which inherits from
# the Character Base class, so be careful with it.
#=========================================================================
Animation_Speed = 18

end end # <= DO NOT MODIFY
#==============================================================================
# ** Game_BattlerBase
#------------------------------------------------------------------------------
# This base class handles battlers. It mainly contains methods for calculating
# parameters. It is used as a super class of the Game_Battler class.
#==============================================================================
class Game_CharacterBase
attr_accessor :anime_speed
#--------------------------------------------------------------------------
# * Alias Method: Initialize Public Member Variables
#--------------------------------------------------------------------------
alias :rinit_public_members :init_public_members
def init_public_members
rinit_public_members
@anime_speed = RINOBI::AnimeSpeed::Animation_Speed
end # init_public_members
#--------------------------------------------------------------------------
# * Overwrite Metod: Update Walking/Stepping Animation
#--------------------------------------------------------------------------
def update_animation
update_anime_count
if @anime_count > @anime_speed - real_move_speed * 2
update_anime_pattern
@anime_count = 0
end #-
end # update_animation
end # Game_CharacterBase
#==============================================================================
# @@@@@ @ @ @@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@ @@@@@ @@@@ @@@@@
# @ @@ @ @ @ @ @ @ @ @ @ @ @ @ @ @
# @@@@@ @ @ @ @ @ @ @ @@@@ @@@@@ @ @@@@ @ @@@@ @
# @ @ @@ @ @ @ @ @ @ @ @ @ @ @ @
# @@@@@ @ @ @@@@ @@@@@ @ @@@@@ @@@@@ @ @ @@@@@ @ @
#==============================================================================

Examples




Hello Rinobi, When I try to use your script it says (as an error message)


Scipt " line 54: NoMethodError occured.


undefined method `-' for nil:NilClass


EDIT: I solved the error by replacing the dash in line 54 with an equals ( = ).


I used the This event part of your script call, the fourth one in your picture, but every number I enter, negative or positive, the animation speed is REALLY fast, like super speed. How do I slow it down? 

You don't need a script.  The Speed setting is how fast the event (or player) moves from one tile to another.  The Frequency setting is how fast it animates while doing so.  So just adjust the Frequency value and see how it goes.



Also, Shaz, Your suggestion did not work. Thanks though!
Hello Rinobi, When I try to use your script it says (as an error message)


Scipt " line 54: NoMethodError occured.


undefined method `-' for nil:NilClass


EDIT: I solved the error by replacing the dash in line 54 with an equals ( = ).


I used the This event part of your script call, the fourth one in your picture, but every number I enter, negative or positive, the animation speed is REALLY fast, like super speed. How do I slow it down? 

Use a larger number, something above 18. Anything below that will increase the speed. Try something around 36 to start.


Also, you can't just replace subtraction with an equals symbol and expect the script to work the same way (or at all). It's probably going super fast because you set the @anime_speed instance variable to real_move_speed * 2, which would likely return a value of 10 or less. That's 1/6th of a second no matter what script call you use (so change it back). You can get an error like that one you mentioned when you use the script call in the wrong place. Using @event_id within a move route for example  (should just be id) will throw a NoMethodError.
Use a larger number, something above 18. Anything below that will increase the speed. Try something around 36 to start.


Also, you can't just replace subtraction with an equals symbol and expect the script to work the same way (or at all). It's probably going super fast because you set the @anime_speed instance variable to real_move_speed * 2, which would likely return a value of 10 or less. That's 1/6th of a second no matter what script call you use (so change it back). You can get an error like that one you mentioned when you use the script call in the wrong place. Using @event_id within a move route for example  (should just be id) will throw a NoMethodError.



So you want me to change the Equals back to a Minus / dash? 


Also, I have an autorun event that tells the Giant to move, and I placed the script call inside the Giant's event, should I do the script call during the Move Route from the autorun Event? I will mess around with it, but I'd like to have more information. Thank you for helping me though, that's awesome! 
Yes, you should definitely undo any changes you've made to the script itself.


Your 'giant' event has an ID displayed in the upper left corner of that event's page above the name. (Edit Event - ID: id number here.)


Within your auto-run event, use: $game_map.events[id number].anime_speed = 36(or anything above 18).


For example: If the giant's event id was 004, you use this script within your autorun event. $game_map.events[4].anime_speed = 36.
Yes, you should definitely undo any changes you've made to the script itself.


Your 'giant' event has an ID displayed in the upper left corner of that event's page above the name. (Edit Event - ID: id number here.)


Within your auto-run event, use: $game_map.events[id number].anime_speed = 36(or anything above 18).


For example: If the giant's event id was 004, you use this script within your autorun event. $game_map.events[4].anime_speed = 36.



I still get the Error.


Scipt " line 54: NoMethodError occured.


undefined method `-' for nil:NilClass


I tried putting the script call in every place I could think, In the Giants Event, in the move route event, in the AutoRun event. The Giant event is 001 so I put a 1 in the brackets. 


What should I do about this error? It only seemed to let me into the game when I changed it. 
Here's my test. If you've done the same (or very similar) and are still getting an error, there's probably script conflict. Before jumping to such a conclusion though, I need to see your autorun, and giant event page, to see if there's anything within your setup that could be causing be causing this issue.

Spoiler
ani_speed_01.PNGani_speed_02.PNG


ani_speed_03.PNG
Here's my test. If you've done the same (or very similar) and are still getting an error, there's probably script conflict. Before jumping to such a conclusion though, I need to see your autorun, and giant event page, to see if there's anything within your setup that could be causing be causing this issue.




HERE IS THE GIANTS EVENT:


DSCN0786.JPG


HERE IS THE AUTORUN EVENT:


DSCN0789.JPG
I can think of a few ways to troubleshoot this. All require a little
patience so if you're convinced it's not worth it, don't bother.


First would be making sure that there is indeed a script conflict. The
fast way to test this would be to try my script in a unmodified project.



The slow way would be to disable/remove scripts one by one until the error
stops happening.


The third way is what I usually do.


Go to your script editor...


Use: Ctrl + Shift + F
Type: init_public_members in the text box.


You should see a list containing:


Game_CharacterBase (39)
Game_Characterbase (45)
Game_Character  (31)


Along with four results from my own code. If there are any other custom
scripts there it's possible that they're creating a conflict.


Use: Ctrl + Shift + F
Type: update_animation


You should list containing:


Game_Characterbase  (276)
Game_CharacterBase  (313)
Sprite_Base  (34)
Sprite_Base  (156)


Along with two results from my own code. If there are any other custom
scrpts there, it's possible that they're creating a conflict.


Use: Ctrl + Shift + F
Type: def initialize


This will be a long list of things. Scroll down to Window_DebugRight as
that's when the last default initialize method is called. If you see
anything other than my own script listed below that. Click on it, and
scroll up until you see class in blue letters. If class is followed by:
Game_CharacterBase, link that script's webpage.


And finally... an alternate version of this script written just now.
If none of this works, I'm not sure what more I can do... (Use values less than 1.5 or 1.0 to slow down events)

Spoiler
#==============================================================================
# >> Script Calls:
#---------------------------------------
# 1. $game_map.events[event_id].ani_speed_stand = value
# 2. $game_map.events[event_id].ani_speed_walk = value
# 3. $game_player.ani_speed_stand = value
# 4. $game_player.ani_speed_walk = value
# 5. $game_player.followers[follower_id].ani_speed_stand = value
# 6. $game_player.followers[follower_id].ani_speed_walk = value
#-
#
#==============================================================================
module RINOBI module AnimeSpeed # <= DO NOT MODIFY
#=========================================================================
# >> Default Animation Speed
#-------------------------------------------------------------------------
# This adjusts the animation speed of all which inherits from
# the Character Base class, so be careful with it.
#=========================================================================
Animation_Walk = 1.5
Animation_Stand = 1.0

end end # <= DO NOT MODIFY
class Game_CharacterBase
attr_accessor :ani_speed_walk
attr_accessor :ani_speed_stand
#--------------------------------------------------------------------------
# * Alias Method: Initialize Public Member Variables
#--------------------------------------------------------------------------
alias :rinit_public_members :init_public_members
def init_public_members
rinit_public_members
@ani_speed_walk = RINOBI::AnimeSpeed::Animation_Walk
@ani_speed_stand = RINOBI::AnimeSpeed::Animation_Stand
end # init_public_members
#--------------------------------------------------------------------------
# * Overwrite Method: Update Animation Count
#--------------------------------------------------------------------------
def update_anime_count
if moving? && @walk_anime
@anime_count += @ani_speed_walk
elsif @step_anime || @pattern != @original_pattern
@anime_count += @ani_speed_stand
end
end
end # Game_CharacterBase


ani_speed_04.PNG
I can think of a few ways to troubleshoot this. All require a little
patience so if you're convinced it's not worth it, don't bother.


First would be making sure that there is indeed a script conflict. The
fast way to test this would be to try my script in a unmodified project.



The slow way would be to disable/remove scripts one by one until the error
stops happening.


The third way is what I usually do.


Go to your script editor...


Use: Ctrl + Shift + F
Type: init_public_members in the text box.


You should see a list containing:


Game_CharacterBase (39)
Game_Characterbase (45)
Game_Character  (31)


Along with four results from my own code. If there are any other custom
scripts there it's possible that they're creating a conflict.


Use: Ctrl + Shift + F
Type: update_animation


You should list containing:


Game_Characterbase  (276)
Game_CharacterBase  (313)
Sprite_Base  (34)
Sprite_Base  (156)


Along with two results from my own code. If there are any other custom
scrpts there, it's possible that they're creating a conflict.


Use: Ctrl + Shift + F
Type: def initialize


This will be a long list of things. Scroll down to Window_DebugRight as
that's when the last default initialize method is called. If you see
anything other than my own script listed below that. Click on it, and
scroll up until you see class in blue letters. If class is followed by:
Game_CharacterBase, link that script's webpage.


And finally... an alternate version of this script written just now.
If none of this works, I'm not sure what more I can do... (Use values less than 1.5 or 1.0 to slow down events)

Spoiler
#==============================================================================
# >> Script Calls:
#---------------------------------------
# 1. $game_map.events[event_id].ani_speed_stand = value
# 2. $game_map.events[event_id].ani_speed_walk = value
# 3. $game_player.ani_speed_stand = value
# 4. $game_player.ani_speed_walk = value
# 5. $game_player.followers[follower_id].ani_speed_stand = value
# 6. $game_player.followers[follower_id].ani_speed_walk = value
#-
#
#==============================================================================
module RINOBI module AnimeSpeed # <= DO NOT MODIFY
#=========================================================================
# >> Default Animation Speed
#-------------------------------------------------------------------------
# This adjusts the animation speed of all which inherits from
# the Character Base class, so be careful with it.
#=========================================================================
Animation_Walk = 1.5
Animation_Stand = 1.0

end end # <= DO NOT MODIFY
class Game_CharacterBase
attr_accessor :ani_speed_walk
attr_accessor :ani_speed_stand
#--------------------------------------------------------------------------
# * Alias Method: Initialize Public Member Variables
#--------------------------------------------------------------------------
alias :rinit_public_members :init_public_members
def init_public_members
rinit_public_members
@ani_speed_walk = RINOBI::AnimeSpeed::Animation_Walk
@ani_speed_stand = RINOBI::AnimeSpeed::Animation_Stand
end # init_public_members
#--------------------------------------------------------------------------
# * Overwrite Method: Update Animation Count
#--------------------------------------------------------------------------
def update_anime_count
if moving? && @walk_anime
@anime_count += @ani_speed_walk
elsif @step_anime || @pattern != @original_pattern
@anime_count += @ani_speed_stand
end
end
end # Game_CharacterBase


View attachment 42789



AH, Okay. That you SO SO much for taking the time to help me, that is wonderful. It worked with the alternative script. Don't know why it was happening, it just goofed up. Thank you for guiding me! What a nice community this is. Seeya!


THREAD CLOSED
🙂  You actually need to report the thread and let the moderators know it's been solved, in order for the thread to be closed.  Saying it's closed doesn't do the trick. 


Glad you got something that works.  I think you could have done it without a script though.  The frequency setting should have done it for you, but obviously doesn't allow as high a number as you wanted.  In that case, you should have been able to do a move route with a script call to set @anime_speed to the value you were after.
🙂  You actually need to report the thread and let the moderators know it's been solved, in order for the thread to be closed.  Saying it's closed doesn't do the trick. 


Glad you got something that works.  I think you could have done it without a script though.  The frequency setting should have done it for you, but obviously doesn't allow as high a number as you wanted.  In that case, you should have been able to do a move route with a script call to set @anime_speed to the value you were after.



Uh... How do I report a thread? Also, I will try your suggestion and see hoe it goes. 🙂
on your very first post, the very first line (immediately above what you actually typed) has a Report post link.
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/how-to-change-animation-speed-for-an-event.65253/