Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
Sign in to follow this  
Enigma

[EASY]Stop Animation for Player

Recommended Posts

I need a script that will show stop animation for a character and when a character moves switches to another sprite set for movement

Share this post


Link to post
Share on other sites

I done things like this a few times. Do you want this for all characters or just the player?

 

Or if you wanted it could be scripted for a 5 frame animation, switching to only the walking animations for movement, and save you on having 2 sets for every character hmmmm>?

Share this post


Link to post
Share on other sites

Just the player, and the idle animation should have an animation too

I already have both the sets anyway so I might as well use this. I only plan to use it for one character anyway

Share this post


Link to post
Share on other sites

k cool, that should be easy then. I am off to work for 5 hrs though, so it may be a lil bit before it's done.

 

EDIT:

 

Finito, I wasn't sure if you wanted the stop animation all the time, so it is setup so you can turn it on or off.

 

To do this:

$game_player.step_anime = true # turn ON
$game_player.step_anime = false # turn OFF

 

All you have to do, is name the stopped character set whatever you want, and the walking character set must have the same name as the stopped charset, except with "walk_" in the front.

 

ex.

hero_one.png

walk_hero_one.png

 

SCRIPT (before main, as per usual; this should work with any other script...although you never know)


class Game_Character
 attr_accessor :step_anime
end

class Game_Player

 def initialize
   super
   @walk_character_name = ''
   @stop_character_name = ''
 end

 alias :new_ref_stop_anim :refresh unless method_defined?(:new_ref_stop_anim)

 def refresh
   actor = $game_party.actors[0]
   @stop_character_name = actor.character_name
   if File.exist?('Graphics/Characters/walk_' + actor.character_name + '.png')
     @walk_character_name = 'walk_' + actor.character_name
   else
     @walk_character_name = actor.character_name
   end

   new_ref_stop_anim
 end

 alias :new_upd_stop_anim :update unless method_defined?(:new_upd_stop_anim)

 def update
   new_upd_stop_anim

   @character_name = Input.dir4 > 0 ? @walk_character_name : @stop_character_name
 end

end

Share this post


Link to post
Share on other sites

I got an error

 

I think your missing an argument here

 



 def initialize
   super "in here  :o  "
   @walk_character_name = ''
   @stop_character_name = ''
 end

 

Script 'Kellessdee's thing' line 22: Argument Error occurred

wrong number of arguments(0 of 1)

Share this post


Link to post
Share on other sites

WHOA: TOTALLY FORGOT:

 

Game_Player should look like this:

class Game_Player < Game_Character

 

although that probably isn't the issue

 

Which line is your line 22? that?

 

my line 22 is an end.

 

Either way, you shouldn't get an argument error in this script (none of the default scripts modified require any arguments)

 

so you must be using a script that already modifies game_player or something.

 

Let me know bro, because this script works in a fresh project.

 

hint: Ctrl+shift+f, type in: class Game_Player

 

if more than the default/my script show up, lemme know

Share this post


Link to post
Share on other sites

I don't have team view anymore, what line is the line that is giving you the error? (line 22)

 

hmm haa OOHhh

 

i think i know.

 

class Game_Character
 attr_accessor :step_anime
end

class Game_Player

 alias :new_init_stop_anim :initialize unless method_defined(:new_init_stop_anim)

 def initialize
   new_init_stop_anim
   @walk_character_name = ''
   @stop_character_name = ''
 end

 alias :new_ref_stop_anim :refresh unless method_defined?(:new_ref_stop_anim)

 def refresh
   actor = $game_party.actors[0]
   @stop_character_name = actor.character_name
   if File.exist?('Graphics/Characters/walk_' + actor.character_name + '.png')
     @walk_character_name = 'walk_' + actor.character_name
   else
     @walk_character_name = actor.character_name
   end

   new_ref_stop_anim
 end

 alias :new_upd_stop_anim :update unless method_defined?(:new_upd_stop_anim)

 def update
   new_upd_stop_anim

   @character_name = Input.dir4 > 0 ? @walk_character_name : @stop_character_name
 end

end

 

if you get the same error, try putting this script DIRECTLY below the Game_Player script mmmkay?

 

EDIT: I am pretty sure this will HAVE to go DIRECTLY after the Game_Player script, that way any "added" arguments to game_player will be ignored during this portion of the code.

Share this post


Link to post
Share on other sites

hmmm ha....

 

okay try the first script I gave you, except DIRECTLY below the Game_Player I forgot, if it is RIGHT below Game_Player alias won't work as Game_Player doesn't have an initialize method.

Share this post


Link to post
Share on other sites

well no errors this time but I can't observe any animation

 

It should make the hero resemble an event when you turn stop animation on

events have this option where it makes it looks like they are walking even though they are standing in the same place

 

Im not getting any results care to upload a demo

Share this post


Link to post
Share on other sites

Ctrl-shift-f

 

class Game_Player

 

find EVERY non-default class Game_Player script and post them here, so I can see which script is causing incompatibility.

 

If you are too lazy to do that, then just upload your Scripts.rxdata and I WILL look through it.

Share this post


Link to post
Share on other sites

Well I looked through it, It's definitely because of blizzABS... mainly because of the way it works, he uses various extra classes to control the Player/actors on map... I will see if I can look through this and get it to work, but it may take a bit; essentially I will have to learn how he handles the player control EXACTLY so I can write a working script.

 

I will let you know if I figure it out.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...