Project1

标题: 有没有一个站着时,角色做动作的脚本 [打印本页]

作者: 凯凯星    时间: 2015-4-24 23:20
标题: 有没有一个站着时,角色做动作的脚本
站着不动很无趣有没有
作者: duchen5779    时间: 2015-4-26 09:39
各种战斗方式都有啊。有默认竖版,有能动的横版(当然是十分耗美工的),还有大拿们搞出来的ACT的,战棋的,不知道楼主说的是什么意思。
作者: zeldafd    时间: 2015-4-26 10:01
這個我都在想怎樣做,哈哈
可能透過角色坐標沒改變去達成吧,晚一點能用電腦時我試試弄給你
作者: 凯凯星    时间: 2015-4-26 12:22
duchen5779 发表于 2015-4-26 09:39
各种战斗方式都有啊。有默认竖版,有能动的横版(当然是十分耗美工的),还有大拿们搞出来的ACT的,战棋的 ...

在地图上站着时,角色可以蹦蹦跳跳脚本
作者: 凯凯星    时间: 2015-4-26 12:23
zeldafd 发表于 2015-4-26 10:01
這個我都在想怎樣做,哈哈
可能透過角色坐標沒改變去達成吧,晚一點能用電腦時我試試弄給你 ...

恩恩,谢谢
作者: zeldafd    时间: 2015-4-26 15:04
你試一下這個會不會和你想要的效果相似吧
雖然只是簡單的位圖縮放, 而且我都是剛剛才下載回VX, 對RGSS2不太熟悉
但起碼可以不用額外的素材吧
希望能夠幫到你
RUBY 代码复制
  1. #===============================================================================
  2. # Character Motion Stop For VX
  3. #-------------------------------------------------------------------------------
  4. # Author: RedSuns S.H.Chan(zeldafd@66rpg)
  5. # Description: make the action of character more diersification
  6. # Version: 1.0 - Beta
  7. #===============================================================================
  8.  
  9. #===============================================================================
  10. # Constant: ENABLE_CUSTOM_CHARACTER_ACTION
  11. #-------------------------------------------------------------------------------
  12. # Type: Boolean
  13. #-------------------------------------------------------------------------------
  14. # Description:
  15. #   Set it to true if you want to enable this system
  16. #===============================================================================
  17. ENABLE_CUSTOM_CHARACTER_ACTION = true
  18.  
  19. #===============================================================================
  20. # Class: Game_Character
  21. #-------------------------------------------------------------------------------
  22. # Description:
  23. #   Define the action of the character which on the map
  24. #===============================================================================
  25. class Game_Character
  26.  
  27. #===============================================================================
  28. # Public member: sprite
  29. #-------------------------------------------------------------------------------
  30. # Type: Sprite_Character
  31. #-------------------------------------------------------------------------------
  32. # Description:
  33. #   Store the instance of character sprite
  34. #===============================================================================
  35.   attr_accessor :sprite
  36.  
  37. #=============================================================================
  38. # Method: initialize(void)
  39. #-----------------------------------------------------------------------------
  40. # Description:
  41. #   Initialize all public member
  42. #-----------------------------------------------------------------------------
  43. # return: void
  44. #=============================================================================
  45.   def initialize
  46.     @id = 0
  47.     @x = 0
  48.     @y = 0
  49.     @real_x = 0
  50.     @real_y = 0
  51.     @tile_id = 0
  52.     @character_name = ""
  53.     @character_index = 0
  54.     @opacity = 255
  55.     @blend_type = 0
  56.     @direction = 2
  57.     @pattern = 1
  58.     @move_route_forcing = false
  59.     @priority_type = 1
  60.     @through = false
  61.     @bush_depth = 0
  62.     @animation_id = 0
  63.     @balloon_id = 0
  64.     @transparent = false
  65.     @original_direction = 2               # Original direction
  66.     @original_pattern = 1                 # Original pattern
  67.     @move_type = 0                        # Movement type
  68.     @move_speed = 4                       # Movement speed
  69.     @move_frequency = 6                   # Movement frequency
  70.     @move_route = nil                     # Move route
  71.     @move_route_index = 0                 # Move route index
  72.     @original_move_route = nil            # Original move route
  73.     @original_move_route_index = 0        # Original move route index
  74.     @walk_anime = true                    # Walking animation
  75.     @step_anime = false                   # Stepping animation
  76.     @direction_fix = false                # Fixed direction
  77.     @anime_count = 0                      # Animation count
  78.     @stop_count = 0                       # Stop count
  79.     @jump_count = 0                       # Jump count
  80.     @jump_peak = 0                        # Jump peak count
  81.     @wait_count = 0                       # Wait count
  82.     @locked = false                       # Locked flag
  83.     @prelock_direction = 0                # Direction before lock
  84.     @move_failed = false                  # Movement failed flag
  85.     @index = 0
  86.     @stop_action = false
  87.   end
  88.  
  89. #=============================================================================
  90. # Method: update_stop(void)
  91. #-----------------------------------------------------------------------------
  92. # Description:
  93. #   Auto call while character is not jumping or moving
  94. #-----------------------------------------------------------------------------
  95. # return: void
  96. #=============================================================================
  97.   alias vx_update_stop update_stop
  98.   def update_stop
  99.     if ENABLE_CUSTOM_CHARACTER_ACTION
  100.       vx_update_stop
  101.       if ! moving? && ! jumping?
  102.         @index += 1
  103.         if @index > 50
  104.           @index = 0
  105.           if ! @stop_action
  106.             @stop_action = true
  107.           else
  108.             @stop_action = false
  109.           end
  110.         end
  111.         if @stop_action
  112.           self.sprite.zoom_y = 1.09
  113.         else
  114.           self.sprite.zoom_y = 1
  115.         end
  116.       end
  117.     else
  118.       vx_update_stop
  119.     end
  120.   end
  121. end
  122.  
  123. #===============================================================================
  124. # Class: Spriteset_Map
  125. #-------------------------------------------------------------------------------
  126. # Description:
  127. #   Define the create activity of character's sprite class instance
  128. #===============================================================================
  129. class Spriteset_Map
  130.  
  131. #=============================================================================
  132. # Method: create_characters(void)
  133. #-----------------------------------------------------------------------------
  134. # Description:
  135. #   Auto call by Spriteset_Map to create all character sprite
  136. #-----------------------------------------------------------------------------
  137. # return: void
  138. #=============================================================================
  139.   alias vx_create_characters create_characters
  140.   def create_characters
  141.     if ENABLE_CUSTOM_CHARACTER_ACTION
  142.       @character_sprites = []
  143.       for i in $game_map.events.keys.sort
  144.         $game_map.events[i].sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
  145.         @character_sprites.push($game_map.events[i].sprite)
  146.       end
  147.       for vehicle in $game_map.vehicles
  148.         vehicle.sprite = Sprite_Character.new(@viewport1, vehicle)
  149.         @character_sprites.push(vehicle.sprite)
  150.       end
  151.       $game_player.sprite = Sprite_Character.new(@viewport1, $game_player)
  152.       @character_sprites.push($game_player.sprite)
  153.     else
  154.       vx_create_chracters
  155.     end
  156.   end
  157.  
  158. end

作者: 凯凯星    时间: 2015-4-26 18:17
zeldafd 发表于 2015-4-26 15:04
你試一下這個會不會和你想要的效果相似吧
雖然只是簡單的位圖縮放, 而且我都是剛剛才下載回VX, 對RGSS2不太 ...

可以用,又是再完美一点就好了{:2_275:}
作者: 凯凯星    时间: 2015-4-26 18:18
zeldafd 发表于 2015-4-26 15:04
你試一下這個會不會和你想要的效果相似吧
雖然只是簡單的位圖縮放, 而且我都是剛剛才下載回VX, 對RGSS2不太 ...

有没有RGSS3的呢?
作者: 上贺茂润    时间: 2015-4-28 10:26
踏步动画
作者: 结城照美    时间: 2015-5-3 23:49
https://rpg.blue/forum.php?mod=viewthread&tid=2511




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1