查看: 79|回复: 0

[转载发布] 【电影模式对话】不妨碍原有对话模式

[复制链接]
  • TA的每日心情
    开心
    2 小时前
  • 签到天数: 37 天

    连续签到: 3 天

    [LV.5]常住居民I

    2028

    主题

    32

    回帖

    7260

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    0
    卡币
    5184
    OK点
    16
    积分
    7260
    发表于 同元一千年八月五日(秋) | 显示全部楼层 |阅读模式
    某侠为做R剧和电影剧情的同仁们写的脚本,不需要导入任何素材,只有一点脚本。
    默认50号开关是打开电影模式的开关,50号变量是电影模式中对话不按空格自动进行的等待时间。
    本电影模式与RM原本的对话模式不冲突,可以随时随意的转换,甚至可以做好了的剧情分歧一下就变成了电影的回忆剧情,至于用法亲们自己研究吧,下面是贴图:


    没有找到插入脚本!!:L
    脚本如下:
    1. #==============================================================================# ■ Window_MSGMovie#------------------------------------------------------------------------------#  电影模式下显示文章的信息窗口。#==============================================================================# 电影模式开关  默认为 50号开关$movie_switches = 50# 电影模式下等待关闭文字 默认 50号变量$close_speak = 50class Window_MSGMovie < Window_Base  #--------------------------------------------------------------------------  # ● 初始化状态  #--------------------------------------------------------------------------  def initialize    super(0,400,640,80)    self.contents = Bitmap.new(width, height)    self.windowskin = Bitmap.new(30,30)    $game_temp.message_window_showing = false    self.z = 199  end  #--------------------------------------------------------------------------  # ● 处理信息结束  #--------------------------------------------------------------------------  def end_MSG    self.active = false    self.pause = false    self.contents.clear    # 呼叫信息调用    if $game_temp.message_proc != nil      $game_temp.message_proc.call    end    # 清除文章、选择项、输入数值的相关变量    $game_temp.message_text = nil    $game_temp.message_proc = nil    $game_temp.choice_start = 99    $game_temp.choice_max = 0    $game_temp.choice_cancel_type = 0    $game_temp.choice_proc = nil    $game_temp.num_input_start = 99    $game_temp.num_input_variable_id = 0    $game_temp.num_input_digits_max = 0  end  #--------------------------------------------------------------------------  # ● 刷新  #--------------------------------------------------------------------------  def refresh    self.contents.clear    x = 0    if $game_temp.message_text != nil      temp_text = $game_temp.message_text.clone      movie_text = $game_temp.message_text.clone      # 模拟执行(计算文字位置)      text = ""      # 转换字符      temp_text.gsub!(/\\\\/) { "\000" }      temp_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }      temp_text.gsub!(/\\[Vv]\[([0-9]+)\]/) { "\002[#{$1}]" }      temp_text.gsub!(/\\[Nn]\[([0-9]+)\]/) { "\003[#{$1}]" }      while((c = temp_text.slice!(/./m)) != nil)        if c == "\000"          c = "\"        end        if c == "\001"          # 更改文字色          temp_text.sub!(/\[([0-9]+)\]/, "")          color = $1.to_i          c = ""          text += c          next        end        if c == "\002"          c = $game_variables[$1.to_i].to_s          temp_text.sub!(/\[([0-9]+)\]/, "")          text += c          next        end        if c == "\003"          temp_text.sub!(/\[([0-9]+)\]/, "")          c = $game_actors[$1.to_i] != nil ? $game_actors[$1.to_i].name : ""          text += c          next        end        if c == "\n"          c = ""          text += c          next        end        text += c      end      # 计算文字居中位置      move_x = (640 - self.contents.text_size(text).width) / 2 -20      # 执行 (显示文字)      movie_text.gsub!(/\\\\/) { "\000" }      movie_text.gsub!(/\\[Cc]\[([0-9]+)\]/) { "\001[#{$1}]" }      movie_text.gsub!(/\\[Vv]\[([0-9]+)\]/) { "\002[#{$1}]" }      movie_text.gsub!(/\\[Nn]\[([0-9]+)\]/) { "\003[#{$1}]" }      while((m = movie_text.slice!(/./m)) != nil)        if m == "\000"          m = "\"        end        if m == "\001"          # 更改文字色          movie_text.sub!(/\[([0-9]+)\]/, "")          color = $1.to_i          if color >= 0 and color = 2      $game_variables[$close_speak] -= 1    end    if $game_variables[$close_speak] == 1      $game_variables[$close_speak] = 0      end_MSG    end    # 当C键按下时    if Input.trigger?(Input::C) and $game_variables[$close_speak] == 0      end_MSG    end    # 显示文字    if $game_temp.message_text != nil      refresh      return    end  endend# --重定义Scene_Map类class Scene_Map  #--------------------------------------------------------------------------  # ● 主处理  #--------------------------------------------------------------------------  def main    # 生成活动块    @spriteset = Spriteset_Map.new    # 生成信息窗口    @message_window = Window_Message.new    # 生成电影模式对话窗口    @MSG_Movie_Window = Window_MSGMovie.new    # 电影模式黑框    @black = Sprite.new    @black.bitmap = Bitmap.new(640,480)    @black.bitmap.fill_rect(0,0,640,50,Color.new(25,25,25,255))    @black.bitmap.fill_rect(0,400,640,80,Color.new(25,25,25,255))    @black.opacity = 0    # 执行过渡    Graphics.transition    # 主循环    loop do      # 刷新游戏画面      Graphics.update      # 刷新输入信息      Input.update      # 刷新画面      update      # 如果画面切换的话就中断循环      if $scene != self        break      end    end    # 准备过渡    Graphics.freeze    # 释放活动块    @spriteset.dispose    # 释放信息窗口    @message_window.dispose    # 释放信息窗口    @MSG_Movie_Window.dispose    # 标题画面切换中的情况下    if $scene.is_a?(Scene_Title)      # 淡入淡出画面      Graphics.transition      Graphics.freeze    end  end  #--------------------------------------------------------------------------  # ● 刷新画面  #--------------------------------------------------------------------------  def update    # 循环    loop do      # 按照地图、实例、主角的顺序刷新      # (本更新顺序不会在的满足事件的执行条件下成为给予角色瞬间移动      #  的机会的重要因素)      $game_map.update      $game_system.map_interpreter.update      $game_player.update      # 系统 (计时器)、画面刷新      $game_system.update      $game_screen.update      # 如果主角在场所移动中就中断循环      unless $game_temp.player_transferring        break      end      # 执行场所移动      transfer_player      # 处理过渡中的情况下、中断循环      if $game_temp.transition_processing        break      end    end    # 刷新活动块    @spriteset.update    # 选择刷新    if $game_switches[$movie_switches] == false      # 刷新信息窗口      @message_window.update      # 电影模式的黑框      @black.opacity = 0    else      # 刷新电影模式信息      @MSG_Movie_Window.update      # 电影模式的黑框      @black.opacity = 250    end    # 游戏结束的情况下    if $game_temp.gameover      # 切换的游戏结束画面      $scene = Scene_Gameover.new      return    end    # 返回标题画面的情况下    if $game_temp.to_title      # 切换到标题画面      $scene = Scene_Title.new      return    end    # 处理过渡中的情况下    if $game_temp.transition_processing      # 清除过渡处理中标志      $game_temp.transition_processing = false      # 执行过渡      if $game_temp.transition_name == ""        Graphics.transition(20)      else        Graphics.transition(40, "Graphics/Transitions/" +          $game_temp.transition_name)      end    end    # 显示信息窗口中的情况下    if $game_temp.message_window_showing      return    end    # 遇敌计数为 0 且、且遇敌列表不为空的情况下    if $game_player.encounter_count == 0 and $game_map.encounter_list != []      # 不是在事件执行中或者禁止遇敌中      unless $game_system.map_interpreter.running? or             $game_system.encounter_disabled        # 确定队伍        n = rand($game_map.encounter_list.size)        troop_id = $game_map.encounter_list[n]        # 队伍有效的话        if $data_troops[troop_id] != nil          # 设置调用战斗标志          $game_temp.battle_calling = true          $game_temp.battle_troop_id = troop_id          $game_temp.battle_can_escape = true          $game_temp.battle_can_lose = false          $game_temp.battle_proc = nil        end      end    end    # 按下 B 键的情况下    if Input.trigger?(Input::B)      # 不是在事件执行中或菜单禁止中      unless $game_system.map_interpreter.running? or             $game_system.menu_disabled        # 设置菜单调用标志以及 SE 演奏        $game_temp.menu_calling = true        $game_temp.menu_beep = true      end    end    # 调试模式为 ON 并且按下 F9 键的情况下    if $DEBUG and Input.press?(Input::F9)      # 设置调用调试标志      $game_temp.debug_calling = true    end    # 不在主角移动中的情况下    unless $game_player.moving?      # 执行各种画面的调用      if $game_temp.battle_calling        call_battle      elsif $game_temp.shop_calling        call_shop      elsif $game_temp.name_calling        call_name      elsif $game_temp.menu_calling        call_menu      elsif $game_temp.save_calling        call_save      elsif $game_temp.debug_calling        call_debug      end    end  endend#=============================================================================# 本脚本来自66RPG,如使用请保留此信息#[癫狂侠客]书写脚本#=============================================================================复制代码
    复制代码
                 本帖来自P1论坛作者癫狂侠客,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=206814  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。

    本帖子中包含更多资源

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

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

    使用道具 举报

    ahome_bigavatar:guest
    ahome_bigavatar:welcomelogin
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

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

    GMT+8, 2024-5-10 12:20 , Processed in 0.064085 second(s), 44 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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