How to force specify and restore the state of the step animation?

Status
Not open for further replies.

alexncf125

Veteran
Veteran
Joined
Mar 21, 2016
Messages
32
Reaction score
0
First Language
English
Primarily Uses
Mining system (I can't find its original release place)

I want the character to show the step animation when mining
After mining, it will return to its original state

def anime_step(x) copied from https://rpg.blue/thread-220484-1-1.html
alias _minerals_old_update comes from the mining system

Ruby:
    class Game_Player < Game_Character
      def anime_step(x)
        if x == 0
          begin
            @step_anime = @old_step_anime
          rescue
            @step_anime = false
          ensure
            @old_step_anime = nil
          end
        else
          if @old_step_anime == nil && @old_step_anime == nil
            @old_step_anime = @step_anime
          end
          @step_anime = true
        end
      end
    
      alias _minerals_old_update update
      def update *args, &block
        _minerals_old_update *args, &block
    
        if is_mining?
          anime_step(1)
        elsif mining_complete?
          anime_step(0)
        end
    
        update_mining if is_mining?
        @mining.mine! if mining_complete?
        visible_item_popups.each &:update
      end
    end
Now there are two problems

1. Mining first, and then using the command "set moving route-step animation on", the command will be invalid
2. First use the "set movement route-step animation on" command, the character shows the step animation, and then go to mining,
After mining, the character's step status will be off and will not return to the original status (on)

Directly use events on the map to execute "set movement route-step animation on/off" and "set movement route-script-anime_step(0/1)" in different ways. It seems that there is no problem, so is it because I wrote the wrong part of update ??
 

alexncf125

Veteran
Veteran
Joined
Mar 21, 2016
Messages
32
Reaction score
0
First Language
English
Primarily Uses
Bump
Solved
It should be
Ruby:
if @old_step_anime == nil && is_mining?

  anime_step(1)

elsif @old_step_anime != nil && !is_mining?

  anime_step(0)

end
 
Last edited:

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
3,729
Reaction score
4,682
First Language
English
Primarily Uses
RMMZ

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.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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.

Forum statistics

Threads
105,868
Messages
1,017,090
Members
137,586
Latest member
Usagiis
Top