设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 113|回复: 0

[转载发布] FG7 - Easy Actor Animations

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9071

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    58883
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    68848

    灌水之王

    发表于 2026-8-2 19:30:46 | 显示全部楼层 |阅读模式
    Easy Actor Animations
    By: FamilyGamer7

    Introduction
                            The easiest way to implement a separate run/idle/overworld animation for the main hero actor.               
    Click to expand...


    Features
                            The ability to have the actor animation change dependent upon what the actor is doing. Each type of animation will have its own specific .png it will pull from to perform the animations. The ability to change the actor animation movement speed has also been added for flexibility.               
    Click to expand...


    Screenshots
                            - Not Needed -               
    Click to expand...


    Demo
                            Provided as an "attachment" for reference purposes (The setup).               
    Click to expand...


    Script
    Spoiler: FG7 - Easy Actor Animations
                    Ruby:       
    1. #==============================================================================
    2. # Title: Easy Actor Animations (Walk/Run/Idle/Overworld)
    3. # Author: FamilyGamer7 (FG7)
    4. # Version: 1.1
    5. # Engine: RPG Maker VX Ace
    6. #==============================================================================
    7. # ** Change Log |
    8. # ---------------
    9. # 1.0 => Created Script
    10. # 1.1 => Ensures main actor walk sprite animation stays when swapped in formation
    11. #==============================================================================
    12. # ** Description |
    13. # ----------------
    14. # The easiest way to implement a separate run/idle/overworld animation
    15. # for the main hero actor.
    16. #==============================================================================
    17. # ** Terms of Use |
    18. # -----------------
    19. # * Free to use in non-commercial projects and commercial projects
    20. # * Feel free to modify and improve the script. Credit is still required.
    21. # * Credit FamilyGamer7
    22. #==============================================================================
    23. # ** Usage |
    24. # ----------
    25. # * NOT Plug & Play (See "Setup" and Module section for script fine tuning)
    26. #==============================================================================
    27. # ** Setup |
    28. # ----------
    29. #
    30. #  ----------------------------------
    31. # | Actor Animation(s) Configuration |
    32. #  ---------------------------------------------------------------------------
    33. # | The Actors name needs to be identical to the name used in the .png image. |
    34. # | (All images need to be placed in -> \Graphics\Characters                  |
    35. #  ---------------------------------------------------------------------------
    36. #
    37. #  Ex: If your hero actor name is Eric....
    38. #
    39. #  Normal:     $Eric.png
    40. #  Run:        $Eric_run.png
    41. #  Idle:       $Eric_idle.png
    42. #  Overworld:  $Eric_overworld.png
    43. #
    44. #==============================================================================
    45. # ** Note(s) |
    46. # -----------
    47. # * I used the "$" for the .png as this provides more freedom than conforming
    48. #   to the generic VX Ace character sets. The goal was more flexibility.
    49. #
    50. # * The "idle" animation does not cycle through the animation constantly, it
    51. #   only runs through once. So the idle animation would need to be something
    52. #   like the actor sits down - that doesn't require constant updating.
    53. #==============================================================================
    54. # ** WARNING! |
    55. # ------------
    56. # * DO NOT MARK "Disable Dashing" ON MAPS THAT ARE NOT OVERWORLD MAPS. IT WILL
    57. #   RENDER THE SCRIPT PARTIALLY USELESS AS THE ANIMATION CHANGE WILL NOT WORK.
    58. #
    59. # * You are free to mark "Disable Dashing" on overworld maps and the script will
    60. #   work as intended.
    61. #==============================================================================
    62. #==============================================================================
    63. # ** Module: FG7::Actor_Animations
    64. #------------------------------------------------------------------------------
    65. #  This modules creates a static variable to be used within the script.
    66. #==============================================================================
    67. module FG7
    68.   module Actor_Animations
    69.   
    70. #==============================================================================
    71. # -------------------- ALLOWED TO EDIT BELOW THIS LINE ---------------------- #
    72. #==============================================================================
    73.   
    74.     # Sets the game variable value to reset the actor animation (when moving)
    75.     # (Use any varaible that is not in use within your game)
    76.     Game_Variable = 10
    77.   
    78.     # Sets the count time for when the "idle" animation should trigger
    79.     # (The higher the count, the longer the wait until idle is triggered)
    80.     Count = 500
    81.   
    82.     # Sets the main actor ID needed for the sprite animation change
    83.     # (Actor ID that you are using within the game database - Ex: 001 = 1)
    84.     Actor_ID = 1
    85.   
    86.     # Sets the map name used for the "overworld" animation trigger
    87.     # (This map display name can be anything - Only for overworld sprite)
    88.     Game_Map_Name = "Overworld"
    89.   
    90.     # Sets the value for the actor sprite animation speed
    91.     # (Decimal values are accepted as incremental - Ex: 0.5)
    92.     Animation_Speed = 1
    93.   
    94. #==============================================================================
    95. # ---------- DO NOT EDIT BELOW THIS LINE (FOR ADVANCED USERS) --------------- #
    96. #==============================================================================
    97.   
    98.   end
    99. end
    100. #==============================================================================
    101. # ** Game_CharacterBase
    102. #------------------------------------------------------------------------------
    103. #  This base class handles characters. It retains basic information, such as
    104. # coordinates and graphics, shared by all characters.
    105. #==============================================================================
    106. class Game_CharacterBase
    107.   #--------------------------------------------------------------------------
    108.   # * Override Method: Update Walking/Stepping Animation
    109.   #--------------------------------------------------------------------------
    110.   def update_animation
    111.     update_anime_count
    112.     if @anime_count > 18 - real_move_speed * FG7::Actor_Animations::Animation_Speed
    113.       update_anime_pattern
    114.       @anime_count = 0
    115.     end
    116.   end
    117. end
    118. #==============================================================================
    119. # ** Game_Player
    120. #------------------------------------------------------------------------------
    121. #  This class handles the player. It includes event starting determinants and
    122. # map scrolling functions. The instance of this class is referenced by
    123. # $game_player.
    124. #==============================================================================
    125. class Game_Player < Game_Character
    126.   #--------------------------------------------------------------------------
    127.   # * Override Method: Get Corresponding Actor
    128.   #--------------------------------------------------------------------------
    129.   def actor
    130.     # Ensures the "Hero" is always the main walking sprite
    131.     $game_actors[FG7::Actor_Animations::Actor_ID]
    132.   end
    133.   #--------------------------------------------------------------------------
    134.   # * Alias Method: Frame Update
    135.   #--------------------------------------------------------------------------
    136.   alias :fg7_easy_actor_animations_update :update
    137.   def update
    138.     fg7_easy_actor_animations_update
    139.     # Add count to $game_variable if on game map and not on game menu
    140.     $game_variables[FG7::Actor_Animations::Game_Variable] += 1 if !$game_map.interpreter.running?
    141.   end
    142.   #--------------------------------------------------------------------------
    143.   # * Alias Method: Execute Player Transfer (For "Overworld" map)
    144.   #--------------------------------------------------------------------------
    145.   alias :fg7_easy_actor_animations_perform_transfer :perform_transfer
    146.   def perform_transfer
    147.     fg7_easy_actor_animations_perform_transfer
    148.     # Check if map is an "overworld" and change player sprite animation
    149.     if $game_map.display_name.include?(FG7::Actor_Animations::Game_Map_Name)
    150.       $game_actors[FG7::Actor_Animations::Actor_ID].set_graphic("$" + $game_actors[FG7::Actor_Animations::Actor_ID].name + "_overworld.png", 0, $game_actors[FG7::Actor_Animations::Actor_ID].face_name, $game_actors[FG7::Actor_Animations::Actor_ID].face_index)
    151.       refresh
    152.     else
    153.       $game_actors[FG7::Actor_Animations::Actor_ID].set_graphic("$" + $game_actors[FG7::Actor_Animations::Actor_ID].name, 0, $game_actors[FG7::Actor_Animations::Actor_ID].face_name, $game_actors[FG7::Actor_Animations::Actor_ID].face_index)
    154.       refresh
    155.     end
    156.   end
    157.   #--------------------------------------------------------------------------
    158.   # * Override Method: Determine if Dashing (For - Walk / Run / Idle)
    159.   #--------------------------------------------------------------------------
    160.   def dash?
    161.     return false if @move_route_forcing
    162.     return false if $game_map.disable_dash?
    163.     return false if vehicle
    164.     return Input.press?(:A) if $game_map.display_name.include?(FG7::Actor_Animations::Game_Map_Name)
    165.     #return true if $game_map.display_name.include?(FG7::Actor_Animations::Game_Map_Name)
    166.     # Change $game_variable back to "0" if player is moving
    167.     $game_variables[FG7::Actor_Animations::Game_Variable] = 0 if moving?
    168.     # Change player sprite animation to "run" if condition is met
    169.     $game_actors[FG7::Actor_Animations::Actor_ID].set_graphic("$" + $game_actors[FG7::Actor_Animations::Actor_ID].name + "_run.png", 0, $game_actors[FG7::Actor_Animations::Actor_ID].face_name, $game_actors[FG7::Actor_Animations::Actor_ID].face_index) if Input.press?(:A)
    170.     # Change player sprite animation to "normal" if condition is met
    171.     $game_actors[FG7::Actor_Animations::Actor_ID].set_graphic("$" + $game_actors[FG7::Actor_Animations::Actor_ID].name, 0, $game_actors[FG7::Actor_Animations::Actor_ID].face_name, $game_actors[FG7::Actor_Animations::Actor_ID].face_index) if !Input.press?(:A)
    172.     # Change player sprite animation to "idle" if condition is met
    173.     $game_actors[FG7::Actor_Animations::Actor_ID].set_graphic("$" + $game_actors[FG7::Actor_Animations::Actor_ID].name + "_idle.png", 0, $game_actors[FG7::Actor_Animations::Actor_ID].face_name, $game_actors[FG7::Actor_Animations::Actor_ID].face_index) if !Input.press?(:A) && $game_variables[FG7::Actor_Animations::Game_Variable] > FG7::Actor_Animations::Count
    174.     # Refresh player sprite animation
    175.     refresh
    176.     # Appended $game_variable and resetting back to "0"
    177.     return Input.press?(:A) && $game_variables[FG7::Actor_Animations::Game_Variable] = 0
    178.   end
    179. end
    复制代码


    How to Use
                            Add this script in the script editor under in the "Materials" section and above "Main Process".
    The instructions and setup for the script are held within the script header itself. No need to repeat here.               
    Click to expand...


    Terms of Use
                            - Free to use in non-commercial projects and commercial projects
    - Feel free to modify and improve the script. Credit is still required.
    - Credit FamilyGamer7               
    Click to expand...




    本贴来自国际rpgmaker官方论坛作者:FG7处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/fg7-easy-actor-animations.144540/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-17 09:25 , Processed in 0.139043 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表