楼主: ⑨姐姐

[原创发布] 【RGD】使用 DirectX 驱动的 RMVA Game.exe(v1.6)

 火 [复制链接]
梦石
0
星屑
124
在线时间
15 小时
注册时间
2008-1-25
回帖
778
发表于 2018-9-1 17:55:40 | 显示全部楼层
牛逼……
回复

使用道具 举报

梦石
28
星屑
10170
在线时间
4673 小时
注册时间
2011-8-22
回帖
1216

开拓者

 楼主| 发表于 2018-9-2 16:47:55 | 显示全部楼层
更新:2018/9/2 - 1.2.1
增加Controller模块识别XBOX360手柄操作。
修复一些BUG。
回复

使用道具 举报

梦石
0
星屑
3557
在线时间
2337 小时
注册时间
2015-8-25
回帖
928

开拓者

发表于 2018-9-3 11:19:36 | 显示全部楼层
⑨姐姐 发表于 2018-9-1 06:39
抱歉之前漏掉了这条回复没看到……

多种颜色的光照图片是没问题的。只要在发光图本身带上多种颜色就可以 ...

你好。
唔 其实之前我已经放弃了在一张图片上显示多种颜色的这类的视觉效果了,所以收到你的回复的时候没有再测试。

不过后来闲着就试了。
关于在一张图片上显示多种颜色这个功能,唔,实际上,我这边是实现不了的。

设置是这样的:
{
        :visibility   => "light" ,#这个是默认的视野
        :illumination => "lightQ-illum", #这是一张红色的长方形图片
        :zoom         => 1.0,
        :power          => 1.0,
        :color          => [255, 255, 255],
}

这样应该是显示不出图片原来的色彩的,只会是白色,我这边操作应该没有问题吧?

--
最后顺带一提。。
视野毕竟是相当于在黑色遮罩上削了一块出来。
换言之。。。
实际上现在调整光亮度的时候是会出现,当你把黑暗度调得越高,你的视野就会显得越明亮,而发光反而会变得越不显眼,这种微妙的视觉上的不和谐。

点评

嗯 感谢对应。  发表于 2018-9-3 18:23
发现了,确实是代码的BUG引起的,现在已经修正,之后再发的时候会更新。  发表于 2018-9-3 16:02
好的,晚上回去我测试一下。  发表于 2018-9-3 11:49
回复

使用道具 举报

梦石
0
星屑
1944
在线时间
404 小时
注册时间
2015-8-30
回帖
322
发表于 2018-9-3 20:54:29 | 显示全部楼层
发现bug一枚:拖动视窗,使得Graphics的一部分在显示器范围之外,再拖回来,只要鼠标不松开,刚刚超过显示器边界的部分就是黑的

点评

会黑一瞬间,拖回去松开鼠标就好了。这应该不是bug,是directx的渲染决定的。  发表于 2018-9-3 21:22
小仙女一枚~
回复

使用道具 举报

梦石
0
星屑
3557
在线时间
2337 小时
注册时间
2015-8-25
回帖
928

开拓者

发表于 2018-9-5 22:47:38 | 显示全部楼层
遇到一个这样的现象,也不知道算不算是bug(如果本来就属于不打算兼容的内容的话。)
不过实际上我也没有完全锁定原因。。。
但是还是拿出来报告一下。
因为之后我自己也不打算修复这个功能,但想着也许以后楼主会可以参考得上,所以写出来了。


其实用的是以前的一个工程,心血来潮试试用一下RGD,原本是个不太流畅的ARPG。

发现这个工程挺高概率在RGD下导致程序显示,已经停止运行,程序已经关闭。

大概估计原因是:
cacao有个脚本叫做:  <拡張> ピクチャの操作
如果通过这个脚本拓展了图片的操作之后。
例如运行到这个操作的时候:   
for i in 1..5 do
  Pictures[i].erase
end

就会有可能崩溃。


不过之所以说不能锁定原因,是因为单独抽这部分出来的时候却不能再现错误。。

除此之外,
一些很明显的问题是会出现各种图片显示的奇怪之处。
比如一些特殊的效果,会变得很奇怪。

点评

恩  发表于 2018-9-6 21:15
等我下个版本再发吧,因为可能还有别的地方需要更新(今天还有人反馈了其他问题,之后一次性上传吧)。  发表于 2018-9-6 20:50
唔 。。话说能不能麻烦一下楼主发一下已经修整过的灯光脚本代码呢。。其实还是想试一试。  发表于 2018-9-6 20:44
或者之后我整理一下再抽个案例出来,不过大概要等一段时间,工程比较杂。  发表于 2018-9-6 20:43
如果有例子就好了……有可能是Bitmap的bug,但是不确定。  发表于 2018-9-5 23:23
回复

使用道具 举报

梦石
0
星屑
2870
在线时间
1074 小时
注册时间
2015-11-1
回帖
261
发表于 2018-9-8 18:11:01 | 显示全部楼层
mog有个脚本叫做图片效果。
如果用RGD的时候,波动效果就一定会变得很快,和一般工程的速度不一致。

再现的方法:
在事件脚本中输入:
picture_effect(1,6,5,20)
然后事件命令:
随意显示一张编号为1号的图片,就可以观察到波动的速度效果。

另外想问下,这个脚本实现图片效果的方式其实算是bitmap还是sprite呢?

附上脚本:
脚本[pre lang="ruby"]
#==============================================================================
# +++ MOG - 图片效果 (v1.0) +++
#==============================================================================
# By Moghunter
# https://atelierrgss.wordpress.com/
#==============================================================================
# 本脚本添加了一些图片的表现效果,其复杂而高效。同时还可以设定图片的位置是相对
# 画面还是事件的。
#==============================================================================
# 效果类型
#==============================================================================
# 0 - 震动 A
# 1 - 震动 B
# 2 - 呼吸
# 3 - 循环放大缩小
# 4 - 循环淡入淡出
# 5 - 滚动(朝两个方向)
# 6 - 波动
# 7 - 一帧帧播放的,类似GIF的动画效果(下面有解释)
#
# 你可以对一张图片同时使用多个甚至全部效果.
#
#==============================================================================
# 使用方法
#==============================================================================
# 在事件中使用脚本:
#
# picture_effect(图片ID,效果类型,强度,速度)
#
# 图片ID = 应用效果的图片的ID
# 效果类型 = 效果的类型(0 到 7)
# 强度 = 效果的强度
# SPEED = 效果的速度
#
# 例子:
#
# picture_effect(1,5,10,50)
#
#==============================================================================
# 按帧播放的效果. (效果类型7)
#==============================================================================
# 需要以此规律命名播放的图片。
#
# Picture_Name.png  
# Picture_Name0.png
# Picture_Name1.png
# Picture_Name2.png
# Picture_Name3.png
# Picture_Name4.png
# ...
#
#==============================================================================
# 图片特殊位置
#==============================================================================
# 设置图片特殊位置的脚本:
#
# picture_position(图片ID, 目标ID)
#
# 其中目标ID有以下选择:
#
# 0        = 普通位置
# 1..999   = 事件处 (ID).
# -1       = 玩家处.
# -2       = 固定.
#
#==============================================================================
# 消除图片
#==============================================================================
# 你可以通过事件指令"消除图片"或以下脚本来消除图片:
#
# picture_effects_clear(图片ID)
#
#==============================================================================
module MOG_PICURE_EFFECTS
  # 设置图片的默认Z坐标.
  # 在游戏过程中也可以使用脚本"set_picture_z(数值)"来改变图片的Z坐标
  DEFAULT_SCREEN_Z = 100
end

$imported = {} if $imported.nil?
$imported[:mog_picture_effects] = true

#==============================================================================
# ■ Game Picture
#==============================================================================
class Game_Picture
  attr_accessor :effect_ex
  attr_accessor :anime_frames
  attr_accessor :position
  
  #--------------------------------------------------------------------------
  # ● Init Basic
  #--------------------------------------------------------------------------
  alias mog_picture_ex_init_basic init_basic
  def init_basic
      init_effect_ex
      mog_picture_ex_init_basic
  end

  #--------------------------------------------------------------------------
  # ● Erase
  #--------------------------------------------------------------------------
  alias mog_picture_ex_erase erase
  def erase
      init_effect_ex
      mog_picture_ex_erase
  end

  #--------------------------------------------------------------------------
  # ● Init Effect EX
  #--------------------------------------------------------------------------
  def init_effect_ex
      @effect_ex = [] ; @anime_frames = [] ; @position = [0,nil,0,0]
  end
   
end

#==============================================================================
# ■ Game System
#==============================================================================
class Game_System
  attr_accessor :picture_screen_z

  #--------------------------------------------------------------------------
  # ● Initialize
  #--------------------------------------------------------------------------
  alias mog_picture_ex_initialize initialize
  def initialize
      @picture_screen_z = MOG_PICURE_EFFECTS::DEFAULT_SCREEN_Z
      mog_picture_ex_initialize      
  end
  
end

#==============================================================================
# ■ Game Interpreter
#==============================================================================
class Game_Interpreter

  #--------------------------------------------------------------------------
  # ● Set Pictures
  #--------------------------------------------------------------------------
  def set_pictures
      return $game_troop.screen.pictures if SceneManager.scene_is?(Scene_Battle)
      return $game_map.screen.pictures if SceneManager.scene_is?(Scene_Map)
  end  

  #--------------------------------------------------------------------------
  # ● Picture Effect
  #--------------------------------------------------------------------------
  def picture_effect(id,type, power = nil,speed = nil,misc = nil)
      pictures = set_pictures
      return if pictures.nil?
      power = set_standard_power(type) if power == nil
      power = 1 if type == 4 and power < 1
      speed = set_standard_speed(type) if speed == nil
      pictures[id].effect_ex[0] = nil if type == 1
      pictures[id].effect_ex[1] = nil if type == 0
      pictures[id].effect_ex[type] = [power,speed,0]
      pictures[id].effect_ex[type] = [0,0,0,power * 0.00005,speed, 0,0] if [2,3].include?(type)
      pictures[id].effect_ex[type] = [255,0,0,255 / power, power,speed,0] if type == 4
      pictures[id].effect_ex[type] = [0,0,power,speed,0] if type == 5
      pictures[id].effect_ex[type] = [true,power * 10,speed * 100] if type == 6   
      pictures[id].anime_frames = [true,[],power,0,0,speed,0] if type == 7
  end

  #--------------------------------------------------------------------------
  # ● Set Standard Power
  #--------------------------------------------------------------------------
  def set_standard_power(type)
      return 6   if type == 2
      return 30  if type == 3
      return 120 if type == 4
      return 10
  end   
  
  #--------------------------------------------------------------------------
  # ● Set Standard Speed
  #--------------------------------------------------------------------------
  def set_standard_speed(type)
      return 3 if [0,1].include?(type)
      return 0 if [2,3,4].include?(type)
      return 2 if type == 5
      return 0 if type == 7
      return 10
  end  
   
  #--------------------------------------------------------------------------
  # ● Picture Position
  #--------------------------------------------------------------------------
  def picture_position(id,target_id)
      pictures = set_pictures
      return if pictures.nil?
      pictures[id].position = [0,nil,0,0] if [-2,0].include?(pictures[id].position[0])
      pictures[id].effect_ex.clear
      target = 0 ; target = $game_player if target_id == -1
      if target_id > 0
      $game_map.events.values.each do |e| target = e if e.id == target_id end
      end
      pictures[id].position[0] = target_id
      pictures[id].position[1] = target
  end  

  #--------------------------------------------------------------------------
  # ● Set Picture Z
  #--------------------------------------------------------------------------
  def set_picture_z(value)
      $game_system.picture_screen_z = value
  end
   
  #--------------------------------------------------------------------------
  # ● Picture Effects Clear
  #--------------------------------------------------------------------------
  def picture_effects_clear(id)
      pictures = set_pictures
      return if pictures.nil?
      pictures[id].effect_ex.clear ; pictures[id].anime_frames.clear
      pictures[id].position = [0,nil,0,0]
  end   
  
end

#==============================================================================
# ■ Game Map
#==============================================================================
class Game_Map
  
  #--------------------------------------------------------------------------
  # ● Setup
  #--------------------------------------------------------------------------
  alias mog_picture_ex_setup setup
  def setup(map_id)
      mog_picture_ex_setup(map_id)
      clear_picture_position rescue  nil
  end
  
  #--------------------------------------------------------------------------
  # ● Clear Picture Position
  #--------------------------------------------------------------------------
  def clear_picture_position
      pictures = $game_troop.screen.pictures if SceneManager.scene_is?(Scene_Battle)
      pictures = $game_map.screen.pictures if SceneManager.scene_is?(Scene_Map)
      return if pictures == nil
      pictures.each {|p|
      p.position = [-1000,nil,0,0] if p.position[0] > 0 or p.position[1] == nil}   
  end
  
end

#==============================================================================
# ■ Sprite Picture
#==============================================================================
class Sprite_Picture < Sprite  
  
  #--------------------------------------------------------------------------
  # ● Dispose
  #--------------------------------------------------------------------------
  alias mog_picture_ex_dispose dispose
  def dispose
      mog_picture_ex_dispose
      @picture.effect_ex[6][0] = true if @picture.effect_ex[6]
      @picture.anime_frames[0] = true if @picture.effect_ex[7]
      dispose_pic_frames if !@picture.effect_ex[7]
  end  
  
  #--------------------------------------------------------------------------
  # ● Dispose Pic Frames
  #--------------------------------------------------------------------------
  def dispose_pic_frames
      return if @pic_frames.nil?
      @pic_frames.each {|picture| picture.dispose } ; @pic_frames = nil
  end
  
  #--------------------------------------------------------------------------
  # ● Update Bitmap
  #--------------------------------------------------------------------------
  alias mog_picture_ex_update_bitmap update_bitmap
  def update_bitmap
      refresh_effect_ex if @old_name_ex != @picture.name
      if !@picture.anime_frames.empty? and self.bitmap
         update_picture_animation ; return
      end
      mog_picture_ex_update_bitmap
      create_picture_animation if can_create_frame_picture?
      set_wave_effect if can_set_wave_effect?
  end

  #--------------------------------------------------------------------------
  # ● Refresh effect EX
  #--------------------------------------------------------------------------
  def refresh_effect_ex
     (self.wave_amp = 0 ; self.wave_length = 1 ; self.wave_speed = 0) if !@picture.effect_ex[6]
      @old_name_ex = @picture.name
      create_picture_animation if @picture.effect_ex[7]
      set_wave_effect if can_set_wave_effect?
  end
  
  #--------------------------------------------------------------------------
  # ● Can Create Frame Picture
  #--------------------------------------------------------------------------
  def can_create_frame_picture?
      return false if !@picture.anime_frames[0]
      return false if !self.bitmap
      return true
  end
  
  #--------------------------------------------------------------------------
  # ● Update Picture Animation
  #--------------------------------------------------------------------------
  def update_picture_animation
      return if @pic_frames == nil
      if @picture.anime_frames[6] > 0 ; @picture.anime_frames[6] -= 1 ; return
      end
      @picture.anime_frames[4] += 1
      return if @picture.anime_frames[4] < @picture.anime_frames[2]
      self.bitmap = @pic_frames[@picture.anime_frames[3]]
      @picture.anime_frames[4] = 0 ; @picture.anime_frames[3] += 1
      if @picture.anime_frames[3] >= @pic_frames.size  
         @picture.anime_frames[3] = 0 ; @picture.anime_frames[6] = @picture.anime_frames[5]
      end   
  end  
  
  #--------------------------------------------------------------------------
  # ● Create Picture Animation
  #--------------------------------------------------------------------------
  def create_picture_animation
      dispose_pic_frames ; @pic_frames = [] ; @picture.anime_frames[0] = false     
      for index in 0...999
          @pic_frames.push(Cache.picture(@picture.name + index.to_s)) rescue nil
          break if @pic_frames[index] == nil
      end
      if @pic_frames.size <= 1
         dispose_pic_frames ; @pic_frames = nil ; @picture.anime_frames.clear
         @picture.effect_ex[7] = nil ; return
      end  
      self.bitmap = @pic_frames[@picture.anime_frames[3]]
      update_picture_animation
  end
  
  #--------------------------------------------------------------------------
  # ● Update Position
  #--------------------------------------------------------------------------
  def update_position      
      self.z = @picture.number + $game_system.picture_screen_z
      if @picture.effect_ex[0] ; update_shake_effect(0) ; return ; end
      if @picture.effect_ex[1] ; update_shake_effect(1) ; return ; end  
      self.x = pos_x ; self.y = pos_y ; set_oxy_correction      
  end

  #--------------------------------------------------------------------------
  # ● Pos X
  #--------------------------------------------------------------------------
  def pos_x
      return @picture.x
  end
  
  #--------------------------------------------------------------------------
  # ● Pos Y
  #--------------------------------------------------------------------------
  def pos_y
      return @picture.y
  end

  #--------------------------------------------------------------------------
  # ● Set Oxy Correction
  #--------------------------------------------------------------------------
  def set_oxy_correction
      return if @picture.position[0] == -2
      self.x += self.ox if @picture.effect_ex[3] or @picture.effect_ex[5]
      self.y += self.oy if @picture.effect_ex[2] or @picture.effect_ex[3] or @picture.effect_ex[5]
  end
  
  #--------------------------------------------------------------------------
  # ● Update Position
  #--------------------------------------------------------------------------
  def update_shake_effect(type)
      @picture.effect_ex[type][2] += 1
      return if @picture.effect_ex[type][2] < @picture.effect_ex[type][1]
      @picture.effect_ex[type][2] = 0
      self.x = pos_x + shake_effect(type)
      self.y = @picture.effect_ex[1] ? pos_y + shake_effect(type) : pos_y
      set_oxy_correction
  end

  #--------------------------------------------------------------------------
  # ● Shake Effect
  #--------------------------------------------------------------------------
  def shake_effect(type)
      -(@picture.effect_ex[type][0] / 2) +  rand(@picture.effect_ex[type][0])
  end

  #--------------------------------------------------------------------------
  # ● Update Other
  #--------------------------------------------------------------------------
  def update_other
      if @picture.effect_ex[4] ; update_opacity_ex
      else ; self.opacity = @picture.opacity
      end
      self.blend_type = @picture.blend_type
      if @picture.effect_ex[5] ; update_angle_ex
      else ; self.angle = @picture.angle
      end   
      self.tone.set(@picture.tone)
  end  

  #--------------------------------------------------------------------------
  # ● Update Angle EX
  #--------------------------------------------------------------------------
  def update_angle_ex
      @picture.effect_ex[5][4] += 1
      return if @picture.effect_ex[5][4] < @picture.effect_ex[5][3]
      @picture.effect_ex[5][4] = 0 ; @picture.effect_ex[5][1] += 1
      case @picture.effect_ex[5][1]
        when 0..@picture.effect_ex[5][2]
             @picture.effect_ex[5][0] += 1
        when @picture.effect_ex[5][2]..(@picture.effect_ex[5][2] * 3)
             @picture.effect_ex[5][0] -= 1
        when (@picture.effect_ex[5][2] * 3)..(-1 + @picture.effect_ex[5][2] * 4)
             @picture.effect_ex[5][0] += 1
        else ; @picture.effect_ex[5][0] = 0 ; @picture.effect_ex[5][1] = 0
      end
      self.angle = @picture.angle + @picture.effect_ex[5][0]
  end
  
  #--------------------------------------------------------------------------
  # ● Update Opacity EX
  #--------------------------------------------------------------------------
  def update_opacity_ex
      @picture.effect_ex[4][6] += 1
      return if @picture.effect_ex[4][6] < @picture.effect_ex[4][5]
      @picture.effect_ex[4][6] = 0 ; @picture.effect_ex[4][2] += 1
      case @picture.effect_ex[4][2]
        when 0..@picture.effect_ex[4][4]
          @picture.effect_ex[4][0] -= @picture.effect_ex[4][3]
        when @picture.effect_ex[4][4]..(-1 + @picture.effect_ex[4][4] * 2)
          @picture.effect_ex[4][0] += @picture.effect_ex[4][3]         
        else
          @picture.effect_ex[4][0] = 255 ; @picture.effect_ex[4][2] = 0
      end
      self.opacity = @picture.effect_ex[4][0]
  end
  
  #--------------------------------------------------------------------------
  # ● Update Origin
  #--------------------------------------------------------------------------
  def update_origin
      return if !self.bitmap
      if force_center_oxy?
         self.ox = @picture.effect_ex[2] ? n_ox : (bitmap.width / 2) + n_ox
         self.oy = (bitmap.height / 2) + n_oy
         if @picture.position[0] > 0 or @picture.position[0] == -1
            execute_move(0,@picture.position[2],-@picture.position[1].screen_x) rescue nil
            execute_move(1,@picture.position[3],-@picture.position[1].screen_y) rescue nil
         end  
         return
      end
      if @picture.effect_ex[2] ; self.oy = (bitmap.height + n_oy) ; return ; end
      if @picture.origin == 0
         self.ox = n_ox ; self.oy = n_oy
      else
         self.ox = (bitmap.width / 2) + n_ox
         self.oy = (bitmap.height / 2) + n_oy
      end      
  end

  #--------------------------------------------------------------------------
  # ● Force Center Oxy
  #--------------------------------------------------------------------------
  def force_center_oxy?
      return false if @picture.position.empty?
      return true if @picture.position[0] == -1
      return true if @picture.position[0] > 0
      return true if @picture.effect_ex[3]
      return true if @picture.effect_ex[5]
      return false
  end
  
  #--------------------------------------------------------------------------
  # ● N Ox
  #--------------------------------------------------------------------------
  def n_ox
      return @picture.position[2] if @picture.position[0] > 0 and @picture.position[2]
      return @picture.position[2] if @picture.position[0] == -1 and @picture.position[2]
      return $game_map.display_x * 32 if @picture.position[0] == -2
      return 1000 if @picture.position[0] == -1000
      return 0
  end
  
  #--------------------------------------------------------------------------
  # ● N Oy
  #--------------------------------------------------------------------------
  def n_oy
      return @picture.position[3] if @picture.position[0] > 0 and @picture.position[3]
      return @picture.position[3] if @picture.position[0] == -1 and @picture.position[3]
      return $game_map.display_y * 32 if @picture.position[0] == -2
      return 1000 if @picture.position[0] == -1000
      return 0
  end
  
  #--------------------------------------------------------------------------
  # ● Execute Move
  #--------------------------------------------------------------------------      
  def execute_move(type,cp,np)
      sp = 5 + ((cp - np).abs / 5)
      if cp > np ;    cp -= sp ; cp = np if cp < np
      elsif cp < np ; cp += sp ; cp = np if cp > np
      end     
      @picture.position[2] = cp if type == 0
      @picture.position[3] = cp if type == 1
  end   
  
  #--------------------------------------------------------------------------
  # ● Update Zoom
  #--------------------------------------------------------------------------
  alias mog_picture_ex_update_zoom update_zoom
  def update_zoom
      if @picture.effect_ex[2] ;  update_breath_effect ; return ; end
      if @picture.effect_ex[3] ;  update_auto_zoom_effect ; return ; end
      mog_picture_ex_update_zoom
  end   
     
  #--------------------------------------------------------------------------
  # ● Update Breath Effect
  #--------------------------------------------------------------------------
  def update_breath_effect
      self.zoom_x = @picture.zoom_x / 100.0
      self.zoom_y = @picture.zoom_y / 101.0 + auto_zoom(2)
  end  

  #--------------------------------------------------------------------------
  # ● Update Auto Zoom Effect
  #--------------------------------------------------------------------------
  def update_auto_zoom_effect
      self.zoom_x = @picture.zoom_x / 100.0 + auto_zoom(3)
      self.zoom_y = @picture.zoom_y / 100.0 + auto_zoom(3)
  end
  
  #--------------------------------------------------------------------------
  # ● Auto Zoom
  #--------------------------------------------------------------------------
  def auto_zoom(type)
      if @picture.effect_ex[type][6] == 0
         @picture.effect_ex[type][6] = 1
         @picture.effect_ex[type][0] = rand(50)
      end
      if @picture.effect_ex[type][5] < @picture.effect_ex[type][4]
         @picture.effect_ex[type][5] += 1
         return @picture.effect_ex[type][1]
      end   
      @picture.effect_ex[type][5] = 0
      @picture.effect_ex[type][2] -= 1
      return @picture.effect_ex[type][1] if @picture.effect_ex[type][2] > 0
      @picture.effect_ex[type][2] = 2 ; @picture.effect_ex[type][0] += 1
      case @picture.effect_ex[type][0]
         when 0..25 ; @picture.effect_ex[type][1] += @picture.effect_ex[type][3]         
         when 26..60 ; @picture.effect_ex[type][1] -= @picture.effect_ex[type][3]
         else ; @picture.effect_ex[type][0] = 0 ; @picture.effect_ex[type][1] = 0
      end
      @picture.effect_ex[type][1] = 0 if @picture.effect_ex[type][1] < 0
      @picture.effect_ex[type][1] = 0.25 if @picture.effect_ex[type][1] > 0.25 if type == 2
      return @picture.effect_ex[type][1]
  end

  #--------------------------------------------------------------------------
  # ● Can Set Wave Effect?
  #--------------------------------------------------------------------------
  def can_set_wave_effect?
      return false if !@picture.effect_ex[6]
      return false if !@picture.effect_ex[6][0]
      return false if !self.bitmap
      return true
  end

  #--------------------------------------------------------------------------
  # ● Set Wave Effect
  #--------------------------------------------------------------------------
  def set_wave_effect
      @picture.effect_ex[6][0] = false
      self.wave_amp = @picture.effect_ex[6][1]
      self.wave_length = self.bitmap.width
      self.wave_speed = @picture.effect_ex[6][2]
  end  
   
end
[/pre]
回复

使用道具 举报

梦石
28
星屑
10170
在线时间
4673 小时
注册时间
2011-8-22
回帖
1216

开拓者

 楼主| 发表于 2018-9-8 23:07:41 | 显示全部楼层

Game.zip (214.79 KB, 下载次数: 75)
试一下这个exe吧,希望能解决那个bug。
另外这份脚本的实现是用的Sprite。RM默认的Sprite有wave_amp, wave_speed, wave_length和wave_phase四个参数,用来控制波动的效果。

评分

参与人数 1赞 +1 收起 理由
 眠  + 1 谢谢 实测没有问题了。

查看全部评分

回复

使用道具 举报

梦石
0
星屑
4628
在线时间
1208 小时
注册时间
2016-4-7
回帖
944

开拓者

发表于 2018-9-10 19:06:31 | 显示全部楼层
突然想到一个功能 不知道会不会做
就是提供一个文本输入框

点评

当然是指游戏里的输入文本啦  发表于 2018-9-10 22:28
如果说的是在游戏里输入文本,之后可能会扩展Input,配合脚本能完成  发表于 2018-9-10 21:46
改编辑器的事情这边应该不会做……  发表于 2018-9-10 21:45
附庸的附庸不是我的附庸,女儿的女儿还是我的女儿。CK2沉迷ing
回复

使用道具 举报

梦石
0
星屑
3557
在线时间
2337 小时
注册时间
2015-8-25
回帖
928

开拓者

发表于 2018-9-11 10:25:25 | 显示全部楼层
本帖最后由 七重 于 2018-9-11 10:33 编辑

最近版本的RGD,
虽然本身提供了toggle_fullscreen方法全屏。
但是我发现如果按ALT+enter全屏,就一定会停止工作。

追记:
正确来说,toggle_fullscreen也是有问题的。
但是如果工程本身带有扩屏脚本,那么调用toggle_fullscreen就不会出错。。

--
另外有个不情之请。
关于着色器方面,自己查阅了相关的资料,对概念也有了一点了解
虽然文档中也有个染红色的文字解说。。

但还是想问一下,比如在这个贴中开始展示的那些视觉效果。
工程能不能打包发上来一下呢,希望作参考之用。

至少希望想知道,让屏幕变灰的shader,具体一点是怎么设置的。。
回复

使用道具 举报

梦石
28
星屑
10170
在线时间
4673 小时
注册时间
2011-8-22
回帖
1216

开拓者

 楼主| 发表于 2018-9-11 10:30:51 | 显示全部楼层
七重 发表于 2018-9-11 10:25
最近版本的RGD,
虽然本身提供了toggle_fullscreen方法全屏。
但是我发现如果按ALT+enter全屏,就一定会停 ...

这边没有遇到崩溃的问题。晚上我再去尝试调试一下吧。

另外工程之前的代码可能已经删了,之后有时间我重新整理一些更方便阅读的范例吧。

点评

感谢。另外请务必配置一个范例工程>_<。。  发表于 2018-9-11 10:35
楼上增加了说明,又或许是电脑环境问题?问题是用空工程试验出来的,应该不是冲突。  发表于 2018-9-11 10:34
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部