Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Closed TopicStart new topic
> Continuous Player animation
Rukiri
post Jan 14 2012, 06:42 AM
Post #1


emerge -avt awesome! Wait... it brings me.... HERE?!
Group Icon

Group: Revolutionary
Posts: 1,723
Type: Scripter
RM Skill: Advanced





Continuous Player Animation
Continually plays the step animation while there is keyboard input

Common Event
Since there was lag with doing this in the actual script, it was easier to just create a common event to handle the switch operations.

CODE
Conditional Branch > Script > Input.press?(Input::DOWN)||Input.press?(Input::LEFT)||Input.press?(Input::RIGHT)||Input.press?(Input::UP)
Switch Operations: Turn Switch 002 ON
else
Switch Operations: Turn Switch 002 OFF
end


Script
CODE
class Game_Player
#--------------------------------------------------------------------------
# continuously play the step animation
#--------------------------------------------------------------------------
    alias :xeilsoft_ani_update :update
    def update
      xeilsoft_ani_update
      if actor && $game_switches[2] == true
        @walk_anime = true
        @step_anime = true
      else
        @step_anime = false
      end
    end
  end
  
class Game_CharacterBase
  #--------------------------------------------------------------------------
  # ● Update
  #--------------------------------------------------------------------------
  def update_anime_count
    if moving? && @walk_anime
      @anime_count += 1.4 # smaller numbers equal smoother animation
    elsif @step_anime || @pattern != @original_pattern
      @anime_count += 1
    end
  end
end


Enjoy



__________________________
Xeilsoft
- Follow your dreams to the very end..

Kits that I'm working on.
[Unity3D 4.0] LTTP/Minish Cap - I don't have time for custom gfx like what the pze folks are doing but I will try and work on some enhanced LTTP graphics.

Main PC
Core i7 3820 overclocked @ 4.8GHZ
Galaxy: Nvidia Geforce GTX 680 GDDR5 2GB
Asrock X79 Extreme9 w' creative sound
64GB corsair platinum @ 1600MHZ
Muchkin 128GB SSD(boot), OZKIN 2TB SSD, Western Digital GREEN 1TB HDD.
Rosewill Lightning 1000W PSU
OS: Funtoo Linux, Windows 8 (Virtual Machine)

iMac (March 2013)
3.4GHz Quad-core Intel Core i7, Turbo Boost up to 3.9GHz
16GB 1600MHz DDR3 SDRAM - 2X8GB
1TB Serial ATA Drive @ 7200 rpm
NVIDIA GeForce GTX 680MX 2GB GDDR5
Go to the top of the page
 
+Quote Post
   

Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 23rd May 2013 - 02:40 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker