Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Lucern7 on November 04, 2018, 10:52:26 pm

Title: [XP] Changing Animation Graphic file on the fly via scripts.
Post by: Lucern7 on November 04, 2018, 10:52:26 pm
Simply but I have some animations that have the same timing, and sound effects and stuff, but different animation sheets, it'd save a lot of time and space if I could just swap the files with scripts, but I can't seem to find a path from the help files and such for that specific datatype.

I feel like it'd be one line of code, but I can't seem to work it out.
Title: Re: [XP] Changing Animation Graphic file on the fly via scripts.
Post by: KK20 on November 04, 2018, 11:14:19 pm
In the help file for RPG::Animation
Quoteanimation_name
The animation's graphic file name.

When playing an animation on a sprite, it calls RPG::Sprite#animation, as also shown in the help file

    def animation(animation, hit)
      dispose_animation
      @_animation = animation
      return if @_animation == nil
      @_animation_hit = hit
      @_animation_duration = @_animation.frame_max
      animation_name = @_animation.animation_name #<== This right here

So what you most likely want is a rewritten RPG::Sprite#animation method that takes in 3 parameters where this new third parameter tells the game what file graphic to use instead of what is defined in the database.

Then again, I don't know what it is exactly you need this feature for that could be done by simply copy-pasting animations.
Title: Re: [XP] Changing Animation Graphic file on the fly via scripts.
Post by: LiTTleDRAgo on November 05, 2018, 01:15:36 pm
$data_animations[id].animation_name = "001-Action01"