Script calls for turning stepping animation on/off for a specific actor?

Status
Not open for further replies.

Cuddlebuns

Veteran
Veteran
Joined
May 5, 2019
Messages
35
Reaction score
4
First Language
English
Primarily Uses
RMVXA
The title is self-explanatory. I've searched everywhere but can't find a script call for this. I am aware of how to do this with Move Route, but after experiencing inconsistent and unreliable results with it, I wish to use a script call instead. Perhaps a script call would prove to be more efficacious than a Move Route.

Any help is appreciated!
 

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
Could you elaborate a bit more what you are trying to accomplish and what happens when you trigger the walking/stepping animation on/off for actors using move route? It might sound weird but what the move route does is just changing the value of @walk_anime and @step_anime. Both are used to update characters sprites.

Since changing those values is exactly what you would do with a script call, I think the problem lies elsewhere. Knowing more of what you are trying to achieve might help us finding a solution.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
What do you mean by "specific actor" though? Do you mean followers? or events?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If you mean followers, I have this for MV:
https://forums.rpgmakerweb.com/index.php?threads/actor-stepping-animation.46740/

It's a very short plugin, and would be quite easy to convert to Ace. Anyone is welcome to do so.

Although it's set by a note tag in the Actor's tab. You don't turn it on and off during the game. So if you want stepping animation sometimes but not others, this would not be suitable.
 

Cuddlebuns

Veteran
Veteran
Joined
May 5, 2019
Messages
35
Reaction score
4
First Language
English
Primarily Uses
RMVXA
Basically, I have this common event:
RPGVXAce_40opN7pp64.png RPGVXAce_40opN7pp642.png
I want the stepping animation to always be ON when Flight = ON. However, if I enter and then exit the pause menu, the stepping animation stops for some reason. I have no idea how or why the pause menu has anything to do with stepping animations. I want the stepping animation to continue after exiting the pause screen.

(Ignore the cursor, it's not pointing at anything specifically. I accidentally got it in the screenshot.)
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Is it JUST the party leader? Or do you have followers, and do you sometimes want it to be the leader, but sometimes one (or more) of the followers?

Do you want stepping animation ONLY when that switch is on? Or do you want it to be independent of the switch sometimes as well?


Okay - try not to do it through a move route. When you change maps I know a move route on the player will be cancelled/undone (took me a while to figure out why my character who was swimming, suddenly started walking on water when they transferred to a new map). Just try a script call:
$game_player.step_anime = true
$game_player.step_anime = false
 

Cuddlebuns

Veteran
Veteran
Joined
May 5, 2019
Messages
35
Reaction score
4
First Language
English
Primarily Uses
RMVXA
It's JUST Actor 2. Actor 2 should have step animation on if and only if:
- Actor 2 is the leader and the switch is on
- Actor 2 is a follower and the switch is off

Basically, Actor 2 walks on the ground when leading the party, flies when the switch is on, but is still shown flying by default if Actor 2 is a follower. I figured I could use a script call and a conditional branch to turn the step animation on and off when necessary because it doesn't always work with a move route.

Also, I'm getting this error from the game interpreter when attempting to run $game_player.step_anime = true:
Game_uj0U94ApDj.png
I tried to make it not read-only using a similar method from another thread I posted, but it's still not working.
 

Attachments

Last edited:

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
$game_player.step_anime = true
$game_player.step_anime = false
Unfortunately you cannot do that as both are read-only attributes. You have to use this:
Code:
$game_player.instance_variable_set(:@step_anime, true) # or false
$game_player.instance_variable_set(:@move_anime, true) # or false
However, opening the menu should still reset that value.

@Cuddlebuns One thing you could do is adding this to your scripts:
Code:
class Game_Player < Game_Character
  alias hrk_update_old_fly_anime update
  def update
    @step_anime = ($game_switches[7] && (actor == $game_actors[2]))
    hrk_update_old_fly_anime
  end
end
This sets the stepping animation to true when flight is on. You can set it to true for any vehicle as well, just use "in_boat?", "in_ship?" or "in_airship?" instead of "$game_switches[7]" (I cannot say if that flight switch is related to the airship vehicle so I listed that possibility as well).

EDIT: as a side note, keep in mind that within the Game_CharacterBase class there is no call to step_anime as a method, it is always used as an instance variable. This makes things more annoying to deal with because a simple alias to the step_anime getter method does not work.

This is the main reason why I changed its value before calling the update method, even so, if you change any of the methods called in the original update method so that they change that value, that one is not guaranteed to work either.

If none of those methods has access to that variable, this one should do the trick.

It's JUST Actor 2. Actor 2 should have step animation on if and only if:
- Actor 2 is the leader and the switch is on
- Actor 2 is a follower and the switch is off
I completely missed this part. Followers automatically copy the stepping animation of the first party member ($game_player). On top of it, the update method for followers does that before calling the update method of the parent class. This means that you cannot solve that with just the code above when actor 2 is not the leader. You need something different.
Code:
class Game_Follower < Game_Character
  def update
    @move_speed     = $game_player.real_move_speed
    @transparent    = $game_player.transparent
    @walk_anime     = $game_player.walk_anime
    if $game_switches[7]
      @step_anime     = $game_player.step_anime
    else
      @step_anime = (actor == $game_actors[2])
    end
    @direction_fix  = $game_player.direction_fix
    @opacity        = $game_player.opacity
    @blend_type     = $game_player.blend_type
    super
  end
end
This might cause compatibility issues if you have other methods that change how the follower update method works. Be sure to place this last one above any other script that changes that.
 
Last edited:

Heirukichi

Veteran
Veteran
Joined
Sep 24, 2015
Messages
1,421
Reaction score
596
First Language
Italian
Primarily Uses
RMVXA
@Shaz well, as far as I know it has been quite a few years since you moved to MV, nobody would remember every little detail about Ace after not using it for such a long time, no need to worry.

@Cuddlebuns I take this chance to notify you that I made a small change in the code I provided. It is hardly noticeable, but it is there. If you already copied it, be sure to use the new one instead.
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP

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 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,083
Members
137,583
Latest member
write2dgray
Top