Project1

标题: 怎么让人物走路带幻影 [打印本页]

作者: 灬王熙泽灬    时间: 2011-11-19 19:30
标题: 怎么让人物走路带幻影
就像地下城与勇士里的传承武器一样 , 走路后面带幻影 , dsu_plus_rewardpost_czw
作者: MSQ    时间: 2011-11-19 20:27
其实只要把行走图改一下就行了

用公共事件吧~~{:nm_6:}

在公共事件里用条件的分歧——当按下方向键的时候,改变行走图~~OK?
作者: 神秘影子    时间: 2011-11-26 11:07
我记得如果是剧情的话弄幻影很容易
不然的话有点难度

作者: 咚小黑    时间: 2011-11-27 22:22
这个我就不知道,我修改行走图成两个人物,顺便合成减法
作者: 我的米呀    时间: 2011-12-1 13:52
本帖最后由 我的米呀 于 2011-12-1 17:11 编辑

脚本本体:
  1. #==============================================================================
  2. # ★RGSS2
  3. # STR39_キャラクター残像演出VX v0.8 08/07/28
  4. #
  5. # ◇必須スクリプト STEMB_マップエフェクトベース
  6. # ・キャラクタースプライトに残像を発生させます。
  7. # ・連続で発生させる場合は並列処理のイベントに貼り付ける等してください。
  8. #
  9. if false
  10. # 以下をコマンドのスクリプト等に貼り付けて残像発生
  11. ef = $game_temp.streffect
  12. id  = 0      # イベントID(0でプレイヤー)
  13. sp  = 20     # 表示時間(1/60sec)
  14. op  = 192    # 透明度(0で元の透明度の66%)
  15. bl  = 1      # 合成方法(0=通常,1=加算,2=減算)
  16. xyz = [0,0,0]# 座標修正[x,y,z]通常は0
  17. ef.push(CharaShadow00.new(id,sp,op,bl,xyz))

  18. # 解説なしタイプ
  19. id=0;sp=20;op=192;bl=1;xyz=[0,0,0]
  20. ef = $game_temp.streffect
  21. ef.push(CharaShadow00.new(id,sp,op,bl,xyz))

  22. # ここまで
  23. end
  24. #==============================================================================
  25. # ★このスクリプトの機能を有効にする
  26. if true
  27. #==============================================================================
  28. # ■ CharaShadow00
  29. #==============================================================================
  30. class CharaShadow00 < Sprite
  31.   # 透明度を0にした時の透明度修正
  32.   AUTO = 0.66
  33.   #--------------------------------------------------------------------------
  34.   # ● オブジェクト初期化
  35.   #--------------------------------------------------------------------------
  36.   def initialize(id=0,sp=20,op=192,bl=1,xyz=[0,0,0])
  37.     super()
  38.     # 対象のキャラクターの決定
  39.     if id != 0
  40.       chara = $game_map.events[id]
  41.     else
  42.       chara = $game_player
  43.     end
  44.     # XYZ座標の設定
  45.     @rx = chara.real_x
  46.     @ry = chara.real_y_cs
  47.     @xyz = xyz
  48.     @xyz[1] -= 4 unless chara.object?
  49.     self.z = chara.screen_z - 1 + @xyz[2]
  50.     # 透明度・表示時間・合成方法
  51.     if op != 0
  52.       @opacity = op
  53.     else
  54.       @opacity = chara.opacity * AUTO
  55.     end
  56.     self.opacity = @opacity
  57.     @speed = @opacity * 1.0 / sp
  58.     self.blend_type = bl
  59.     # いろいろ設定・更新
  60.     set(chara, self)
  61.     update
  62.   end
  63.   #--------------------------------------------------------------------------
  64.   # ● フレーム更新
  65.   #--------------------------------------------------------------------------
  66.   def update
  67.     self.x = ($game_map.adjust_x(@rx) + 8007) / 8 - 1000 + 16 + @xyz[0]
  68.     self.y = ($game_map.adjust_y(@ry) + 8007) / 8 - 1000 + 32 + @xyz[1]
  69.     self.opacity = @opacity
  70.     @opacity -= @speed
  71.     dispose if self.opacity <= 0 # 透明になったら解放
  72.   end
  73.   #--------------------------------------------------------------------------
  74.   # ● いろいろ設定
  75.   #--------------------------------------------------------------------------
  76.   def set(chara, sprite)
  77.     tile_id = chara.tile_id
  78.     if tile_id > 0
  79.       sprite.bitmap = tileset_bitmap(tile_id)
  80.       sprite.src_rect.set((tile_id / 128 % 2 * 8 + tile_id % 8) * 32,
  81.                            tile_id % 256 / 8 % 16 * 32, 32, 32)
  82.       sprite.ox = 16 ; sprite.oy = 32
  83.     else
  84.       character_name = chara.character_name
  85.       sprite.bitmap = Cache.character(character_name)
  86.       sign = character_name[/^[\!\$]./]
  87.       if sign != nil and sign.include?(')
  88.         cw = sprite.bitmap.width / 3  ; ch = sprite.bitmap.height / 4
  89.       else
  90.         cw = sprite.bitmap.width / 12 ; ch = sprite.bitmap.height / 8
  91.       end
  92.       sprite.ox = cw / 2 ; sprite.oy = ch
  93.       index = chara.character_index
  94.       pattern = chara.pattern < 3 ? chara.pattern : 1
  95.       sprite.src_rect.set((index % 4 * 3 + pattern) * cw,
  96.                           (index / 4 * 4 + (chara.direction - 2) / 2) * ch,
  97.                           cw, ch)
  98.     end
  99.   end
  100.   #--------------------------------------------------------------------------
  101.   # ● 指定されたタイルが含まれるタイルセット画像の取得
  102.   #--------------------------------------------------------------------------
  103.   def tileset_bitmap(tile_id)
  104.     set_number = tile_id / 256
  105.     return Cache.system("TileB") if set_number == 0
  106.     return Cache.system("TileC") if set_number == 1
  107.     return Cache.system("TileD") if set_number == 2
  108.     return Cache.system("TileE") if set_number == 3
  109.     return nil
  110.   end
  111. end
  112. #==============================================================================
  113. # ■ Game_Character
  114. #==============================================================================
  115. class Game_Character
  116.   #--------------------------------------------------------------------------
  117.   # ● 画面 Y 座標の取得(追加)
  118.   #--------------------------------------------------------------------------
  119.   def real_y_cs
  120.     if jumping?
  121.       if @jump_count >= @jump_peak
  122.         n = @jump_count - @jump_peak
  123.       else
  124.         n = @jump_peak - @jump_count
  125.       end
  126.       return @real_y - (@jump_peak * @jump_peak - n * n) * 4
  127.     else
  128.       return @real_y
  129.     end
  130.   end
  131. end
  132. #
  133. end
复制代码
================================================================
事件中用此脚本,并行后出现残影。
  1. id=0;sp=20;op=192;bl=1;xyz=[0,0,0]
  2. ef = $game_temp.streffect
  3. ef.push(CharaShadow00.new(id,sp,op,bl,xyz))
复制代码
========================================================================
忘记了= =补上,在脚本本体前先插入这个脚本
  1. #==============================================================================
  2. # ★RGSS2
  3. # STEMB_マップエフェクトベース v0.8
  4. #
  5. # ・エフェクト表示のための配列定義、フレーム更新、ビューポート関連付け
  6. #
  7. #==============================================================================
  8. # ■ Game_Temp
  9. #==============================================================================
  10. class Game_Temp
  11.   #--------------------------------------------------------------------------
  12.   # ● 公開インスタンス変数
  13.   #--------------------------------------------------------------------------
  14.   attr_accessor :streffect
  15.   #--------------------------------------------------------------------------
  16.   # ● オブジェクト初期化
  17.   #--------------------------------------------------------------------------
  18.   alias initialize_stref initialize
  19.   def initialize
  20.     initialize_stref
  21.     @streffect = []
  22.   end
  23. end
  24. #==============================================================================
  25. # ■ Spriteset_Map
  26. #==============================================================================
  27. class Spriteset_Map
  28.   #--------------------------------------------------------------------------
  29.   # ● エフェクトの作成
  30.   #--------------------------------------------------------------------------
  31.   def create_streffect
  32.     $game_temp.streffect = []
  33.   end
  34.   #--------------------------------------------------------------------------
  35.   # ● エフェクトの解放
  36.   #--------------------------------------------------------------------------
  37.   def dispose_streffect
  38.     for i in 0...$game_temp.streffect.size
  39.       $game_temp.streffect[i].dispose if $game_temp.streffect[i] != nil
  40.     end
  41.     $game_temp.streffect = []
  42.   end
  43.   #--------------------------------------------------------------------------
  44.   # ● エフェクトの更新
  45.   #--------------------------------------------------------------------------
  46.   def update_streffect
  47.     for i in 0...$game_temp.streffect.size
  48.       if $game_temp.streffect[i] != nil
  49.         $game_temp.streffect[i].viewport = @viewport1
  50.         $game_temp.streffect[i].update
  51.         $game_temp.streffect.delete_at(i) if $game_temp.streffect[i].disposed?
  52.       end
  53.     end
  54.   end
  55.   #--------------------------------------------------------------------------
  56.   # ★ エイリアス
  57.   #--------------------------------------------------------------------------
  58.   alias create_parallax_stref create_parallax
  59.   def create_parallax
  60.     create_parallax_stref
  61.     create_streffect
  62.   end
  63.   alias dispose_stref dispose
  64.   def dispose
  65.     dispose_streffect
  66.     dispose_stref
  67.   end
  68.   alias update_stref update
  69.   def update
  70.     update_stref
  71.     update_streffect
  72.   end
  73. end
复制代码

作者: 雷欧亦炫    时间: 2013-12-22 12:32
有没有VA的?其它的版块找不到啊




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