设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 3452|回复: 2
打印 上一主题 下一主题

[已经解决] 求高手帮忙修改一下标题图形脚本

[复制链接]

Lv1.梦旅人

梦石
0
星屑
82
在线时间
77 小时
注册时间
2011-10-23
帖子
37
跳转到指定楼层
1
 楼主| 发表于 2013-1-31 13:03:28 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
本帖最后由 hcm 于 2013-2-14 14:10 编辑

之前有人帮我弄了一个脚本但是我觉的不怎么好所以想换一下标题图形,只显示一个图形而不是几张图片随机播放..表示不怎么喜欢求高手帮忙一下
  1. #==============================================================================
  2. # ■ Scene_Title
  3. #------------------------------------------------------------------------------
  4. #  处理标题画面的类。
  5. #==============================================================================

  6. class Scene_Title
  7.   #--------------------------------------------------------------------------
  8.   # ● 住处理
  9.   #--------------------------------------------------------------------------
  10.   def main
  11.     # 战斗测试的情况下
  12.     if $BTEST
  13.       battle_test
  14.       return
  15.     end
  16.     # 载入数据库
  17.     $data_actors        = load_data("Data/Actors.rxdata")
  18.     $data_classes       = load_data("Data/Classes.rxdata")
  19.     $data_skills        = load_data("Data/Skills.rxdata")
  20.     $data_items         = load_data("Data/Items.rxdata")
  21.     $data_weapons       = load_data("Data/Weapons.rxdata")
  22.     $data_armors        = load_data("Data/Armors.rxdata")
  23.     $data_enemies       = load_data("Data/Enemies.rxdata")
  24.     $data_troops        = load_data("Data/Troops.rxdata")
  25.     $data_states        = load_data("Data/States.rxdata")
  26.     $data_animations    = load_data("Data/Animations.rxdata")
  27.     $data_tilesets      = load_data("Data/Tilesets.rxdata")
  28.     $data_common_events = load_data("Data/CommonEvents.rxdata")
  29.     $data_system        = load_data("Data/System.rxdata")
  30.     sfzx = false
  31.     f = File.open("Game.ini", "r")
  32.     $lines = f.readlines
  33.     f.close
  34.     for i in 0..$lines.size
  35.       if "#{$lines[i]}"[/true/] == "true" and "#{$lines[i]}"[/online=/] == "online="
  36.         sfzx = true
  37.       else
  38.         #.
  39.       end
  40.     end
  41.     #gg =
  42.     f = File.open("Data/Related.rxdata", "r")
  43.     $lines = f.readlines
  44.     f.close
  45.     if sfzx == true
  46.     gg = EasyConv.s2u(Win32API.new('dll.dll','HTTP',%w(p),'p').call($lines[1]))
  47.     else
  48.     gg = ""
  49.     end
  50.     #p $lines[0]
  51.     #p $lines[1]
  52.     #[url]http://marssq.360baba.com/pokemon/gg.txt[/url]
  53.     # 生成系统对像
  54.     $game_system = Game_System.new
  55.     # 生成标题图形
  56.     temp_sjs = rand(11)
  57.     @Backdrop = Sprite.new
  58.     @Backdrop.bitmap = RPG::Cache.title("title_#{temp_sjs}")
  59.     @logo = Sprite.new
  60.     @logo.bitmap = RPG::Cache.title("logo")
  61.     @logo.ox = @logo.bitmap.width/2
  62.     @logo.oy = @logo.bitmap.height/2
  63.     @logo.x = 640/2
  64.     @logo.y = 480/2-120
  65.     [url=home.php?mod=space&uid=114926]@sprite[/url] = Sprite.new
  66.     @Backdrop.opacity = 10
  67.     @sprite.bitmap = RPG::Cache.title($data_system.title_name)
  68.     @sprite.ox = @sprite.bitmap.width/2
  69.     @sprite.oy = @sprite.bitmap.height/2
  70.     @sprite.x = 640/2
  71.     @sprite.y = 480/2+120
  72.     @new_game = Sprite.new
  73.     #显示公告
  74.     wenzi_text = Sprite.new
  75.     wenzi_text.bitmap =  Bitmap.new(640,480)
  76.     wenzi_text.bitmap.font.size = 18
  77.     wenzi_text.bitmap.font.color = Color.new(0, 0, 0, 255)

  78.     wenzi_text.bitmap.draw_text(248,59,640,480,"#{gg}")

  79.     #@continue_game = Sprite.new
  80.     #@quit_game = Sprite.new
  81.     #@Discuss_game = Sprite.new
  82.     @new_game.bitmap = RPG::Cache.title("button/Game_0.png")
  83.     @new_game.ox = @new_game.bitmap.width/2
  84.     @new_game.oy = @new_game.bitmap.height/2
  85.     @new_game.x = 640/2-140
  86.     @new_game.y = 480/2+120
  87.     # 生成命令窗口
  88.     s1 = "  开始游戏"
  89.     s2 = "  继续游戏"
  90.     s3 = "  离开游戏"
  91.     s4 = "  讨论游戏"
  92.     @command_window = Window_Command.new(192, [s1, s2, s3,s4])
  93.     @command_window.visible = false#back_opacity = 0
  94.     @command_window.x = 0 #320- @command_window.width / 2
  95.     @command_window.y = 0#320
  96.     # 判定继续的有效性
  97.     # 存档文件一个也不存在的时候也调查
  98.     # 有効为 @continue_enabled 为 true、無効为 false
  99.     @continue_enabled = false
  100.     for i in 0..3
  101.       if FileTest.exist?("savefile.rxdata")
  102.         @continue_enabled = true
  103.       end
  104.     end
  105.     # 继续为有效的情况下、光标停止在继续上
  106.     # 无效的情况下、继续的文字显示为灰色
  107.     if @continue_enabled
  108.       @command_window.index = 1
  109.     else
  110.       @command_window.disable_item(1)
  111.     end
  112.     # 演奏标题 BGM
  113.     $game_system.bgm_play($data_system.title_bgm)
  114.     # 停止演奏 ME、BGS
  115.     Audio.me_stop
  116.     Audio.bgs_stop
  117.     # 执行过渡
  118.     Graphics.transition
  119.     @rb_loop = 1
  120.     @rb_loop_wait = 0
  121.     # 主循环
  122.     loop do
  123.       # 刷新游戏画面
  124.       Graphics.update
  125.       # 刷新背景图
  126.       refresh_Backdrop
  127.       # 刷新输入信息
  128.       Input.update
  129.       # 刷新画面
  130.       update
  131.       # 如果画面被切换就中断循环
  132.       if $scene != self
  133.         break
  134.       end
  135.     end
  136.     # 装备过渡
  137.     Graphics.freeze
  138.     # 释放命令窗口
  139.     @command_window.dispose
  140.     # 释放标题图形
  141.     @sprite.bitmap.dispose
  142.     @sprite.dispose
  143.     @Backdrop.bitmap.dispose
  144.     @Backdrop.dispose
  145.     @new_game.dispose
  146.     @new_game.bitmap.dispose
  147.     @logo.dispose
  148.     @logo.bitmap.dispose
  149.     wenzi_text.dispose
  150.   end
  151.   #--------------------------------------------------------------------------
  152.   # ● 刷新画面
  153.   #--------------------------------------------------------------------------
  154.   def update
  155.     # 刷新命令窗口
  156.     @command_window.update
  157.     @new_game.bitmap = RPG::Cache.title("button/Game_#{@command_window.index}.png")
  158.     # 按下 C 键的情况下
  159.     if Input.trigger?(Input::C)
  160.       # 命令窗口的光标位置的分支
  161.       case @command_window.index
  162.       when 0  # 新游戏
  163.         command_new_game
  164.       when 1  # 继续
  165.         command_continue
  166.       when 2  # 退出
  167.         command_shutdown
  168.       when 3
  169.         command_ximxi
  170.       end
  171.     end
  172.   end
  173.   #--------------------------------------------------------------------------
  174.   # ● 刷新 : 背景图
  175.   #--------------------------------------------------------------------------
  176.   def refresh_Backdrop
  177.       if @rb_loop_wait == 80
  178.         @rb_loop_wait = 0
  179.         @Backdrop.opacity = 10
  180.         #@sprite.bitmap = RPG::Cache.title("title_#{@rb_loop}.png")
  181.         @Backdrop.bitmap = RPG::Cache.title("title_#{@rb_loop}")
  182.         if @rb_loop >= 10
  183.            @rb_loop = 0
  184.         else
  185.            @rb_loop += 1
  186.         end
  187.       elsif @rb_loop_wait <= 80
  188.         @rb_loop_wait += 1
  189.         @Backdrop.opacity += 10
  190.       end
  191.   end
  192.   #--------------------------------------------------------------------------
  193.   # ● 命令 : 相关信息
  194.   #--------------------------------------------------------------------------
  195.   def command_ximxi
  196.    $marssq_com = Win32API.new('shell32.dll','ShellExecuteA',%w(p p p p p i),'i')
  197.    $marssq_com.call(0, 'open',$lines[0],0, 0, 1)
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # ● 命令 : 新游戏
  201.   #--------------------------------------------------------------------------
  202.   def command_new_game
  203.     # 演奏确定 SE
  204.     $game_system.se_play($data_system.decision_se)
  205.     # 停止 BGM
  206.     Audio.bgm_stop
  207.     # 重置测量游戏时间用的画面计数器
  208.     Graphics.frame_count = 0
  209.     # 生成各种游戏对像
  210.     $game_temp          = Game_Temp.new
  211.     $game_system        = Game_System.new
  212.     $game_switches      = Game_Switches.new
  213.     $game_variables     = Game_Variables.new
  214.     $game_self_switches = Game_SelfSwitches.new
  215.     $game_screen        = Game_Screen.new
  216.     $game_actors        = Game_Actors.new
  217.     $game_party         = Game_Party.new
  218.     $game_troop         = Game_Troop.new
  219.     $game_map           = Game_Map.new
  220.     $game_player        = Game_Player.new
  221.     # 设置初期同伴位置
  222.     $game_party.setup_starting_members
  223.     # 设置初期位置的地图
  224.     $game_map.setup($data_system.start_map_id)
  225.     # 主角向初期位置移动
  226.     $game_player.moveto($data_system.start_x, $data_system.start_y)
  227.     # 刷新主角
  228.     $game_player.refresh
  229.     # 执行地图设置的 BGM 与 BGS 的自动切换
  230.     $game_map.autoplay
  231.     # 刷新地图 (执行并行事件)
  232.     $game_map.update
  233.     # 切换地图画面
  234.     $scene = Scene_Map.new
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ● 命令 : 继续
  238.   #--------------------------------------------------------------------------
  239.   def command_continue
  240.     # 继续无效的情况下
  241.     unless @continue_enabled
  242.       # 演奏无效 SE
  243.       $game_system.se_play($data_system.buzzer_se)
  244.       return
  245.     end
  246.     #========================================================================
  247.     # 演奏确定 SE
  248.     $game_system.se_play($data_system.decision_se)
  249.     # 停止 BGM
  250.     Audio.bgm_stop
  251.     # 重置测量游戏时间用的画面计数器
  252.     Graphics.frame_count = 0
  253.     # 生成各种游戏对像
  254.     $game_temp          = Game_Temp.new
  255.     $game_system        = Game_System.new
  256.     $game_switches      = Game_Switches.new
  257.     $game_variables     = Game_Variables.new
  258.     $game_self_switches = Game_SelfSwitches.new
  259.     $game_screen        = Game_Screen.new
  260.     $game_actors        = Game_Actors.new
  261.     $game_party         = Game_Party.new
  262.     $game_troop         = Game_Troop.new
  263.     $game_map           = Game_Map.new
  264.     $game_player        = Game_Player.new
  265.     # 读取存档
  266.     file = File.open("savefile.rxdata", "rb")
  267.     read_save_data(file)
  268.     file.close
  269.     # 还原 BGM、BGS
  270.     $game_system.bgm_play($game_system.playing_bgm)
  271.     $game_system.bgs_play($game_system.playing_bgs)
  272.     # 刷新地图 (执行并行事件)
  273.     $game_map.update
  274.     # 切换到地图画面
  275.     $scene = Scene_Map.new
  276.     #========================================================================
  277.   end
  278.   #--------------------------------------------------------------------------
  279.   # ● 命令 : 退出
  280.   #--------------------------------------------------------------------------
  281.   def command_shutdown
  282.     # 演奏确定 SE
  283.     $game_system.se_play($data_system.decision_se)
  284.     # BGM、BGS、ME 的淡入淡出
  285.     Audio.bgm_fade(800)
  286.     Audio.bgs_fade(800)
  287.     Audio.me_fade(800)
  288.     # 退出
  289.     $scene = nil
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # ● 命令 : 相关
  293.   #--------------------------------------------------------------------------
  294.   def command_look
  295.     # 继续无效的情况下
  296.     unless @continue_enabled
  297.       # 演奏无效 SE
  298.       $game_system.se_play($data_system.buzzer_se)
  299.       return
  300.     end
  301.     #========================================================================
  302.     # 演奏确定 SE
  303.     $game_system.se_play($data_system.decision_se)
  304.     # 停止 BGM
  305.     Audio.bgm_stop
  306.     # 重置测量游戏时间用的画面计数器
  307.     Graphics.frame_count = 0
  308.     # 生成各种游戏对像
  309.     $game_temp          = Game_Temp.new
  310.     $game_system        = Game_System.new
  311.     $game_switches      = Game_Switches.new
  312.     $game_variables     = Game_Variables.new
  313.     $game_self_switches = Game_SelfSwitches.new
  314.     $game_screen        = Game_Screen.new
  315.     $game_actors        = Game_Actors.new
  316.     $game_party         = Game_Party.new
  317.     $game_troop         = Game_Troop.new
  318.     $game_map           = Game_Map.new
  319.     $game_player        = Game_Player.new
  320.     # 读取存档
  321.     file = File.open("savefile.rxdata", "rb")
  322.     read_save(file)
  323.     file.close
  324.     # 还原 BGM、BGS
  325.     $game_system.bgm_play($game_system.playing_bgm)
  326.     $game_system.bgs_play($game_system.playing_bgs)
  327.     # 刷新地图 (执行并行事件)
  328.     $game_map.update
  329.     # 切换到地图画面
  330.     $scene = Scene_Map.new
  331.   end
  332.   #--------------------------------------------------------------------------
  333.   # ● 战斗测试
  334.   #--------------------------------------------------------------------------
  335.   def battle_test
  336.     # 载入数据库 (战斗测试用)
  337.     $data_actors        = load_data("Data/BT_Actors.rxdata")
  338.     $data_classes       = load_data("Data/BT_Classes.rxdata")
  339.     $data_skills        = load_data("Data/BT_Skills.rxdata")
  340.     $data_items         = load_data("Data/BT_Items.rxdata")
  341.     $data_weapons       = load_data("Data/BT_Weapons.rxdata")
  342.     $data_armors        = load_data("Data/BT_Armors.rxdata")
  343.     $data_enemies       = load_data("Data/BT_Enemies.rxdata")
  344.     $data_troops        = load_data("Data/BT_Troops.rxdata")
  345.     $data_states        = load_data("Data/BT_States.rxdata")
  346.     $data_animations    = load_data("Data/BT_Animations.rxdata")
  347.     $data_tilesets      = load_data("Data/BT_Tilesets.rxdata")
  348.     $data_common_events = load_data("Data/BT_CommonEvents.rxdata")
  349.     $data_system        = load_data("Data/BT_System.rxdata")
  350.     # 重置测量游戏时间用的画面计数器
  351.     Graphics.frame_count = 0
  352.     # 生成各种游戏对像
  353.     $game_temp          = Game_Temp.new
  354.     $game_system        = Game_System.new
  355.     $game_switches      = Game_Switches.new
  356.     $game_variables     = Game_Variables.new
  357.     $game_self_switches = Game_SelfSwitches.new
  358.     $game_screen        = Game_Screen.new
  359.     $game_actors        = Game_Actors.new
  360.     $game_party         = Game_Party.new
  361.     $game_troop         = Game_Troop.new
  362.     $game_map           = Game_Map.new
  363.     $game_player        = Game_Player.new
  364.     # 设置战斗测试用同伴
  365.     $game_party.setup_battle_test_members
  366.     # 设置队伍 ID、可以逃走标志、战斗背景
  367.     $game_temp.battle_troop_id = $data_system.test_troop_id
  368.     $game_temp.battle_can_escape = true
  369.     $game_map.battleback_name = $data_system.battleback_name
  370.     # 演奏战斗开始 BGM
  371.     $game_system.se_play($data_system.battle_start_se)
  372.     # 演奏战斗 BGM
  373.     $game_system.bgm_play($game_system.battle_bgm)
  374.     # 切换到战斗画面
  375.     $scene = Scene_Battle.new
  376.   end
  377.   #--------------------------------------------------------------------------
  378.   # ● 读取存档数据
  379.   #     file : 读取用文件对像 (已经打开)
  380.   #--------------------------------------------------------------------------
  381.   def read_save_data(file)
  382.     # 读取描绘存档文件用的角色数据
  383.     characters = Marshal.load(file)
  384.     # 读取测量游戏时间用画面计数
  385.     Graphics.frame_count = Marshal.load(file)
  386.     # 读取各种游戏对像
  387.     $game_system        = Marshal.load(file)
  388.     $game_switches      = Marshal.load(file)
  389.     $game_variables     = Marshal.load(file)
  390.     $game_self_switches = Marshal.load(file)
  391.     $game_screen        = Marshal.load(file)
  392.     $game_actors        = Marshal.load(file)
  393.     $game_party         = Marshal.load(file)
  394.     $game_troop         = Marshal.load(file)
  395.     $game_map           = Marshal.load(file)
  396.     $game_player        = Marshal.load(file)
  397.     # 魔法编号与保存时有差异的情况下
  398.     # (加入编辑器的编辑过的数据)
  399.     if $game_system.magic_number != $data_system.magic_number
  400.       # 重新装载地图
  401.       $game_map.setup($game_map.map_id)
  402.       $game_player.center($game_player.x, $game_player.y)
  403.     end
  404.     # 刷新同伴成员
  405.     $game_party.refresh
  406.   end

  407.   #--------------------------------------------------------------------------
  408.   # ● 读取存档数据2
  409.   #     file : 读取用文件对像 (已经打开)
  410.   #--------------------------------------------------------------------------
  411.     def read_save(file)
  412.     # 读取描绘存档文件用的角色数据
  413.     characters = Marshal.load(file)
  414.     # 读取测量游戏时间用画面计数
  415.     Graphics.frame_count = Marshal.load(file)
  416.     # 读取各种游戏对像
  417.     $game_system        = Marshal.load(file)
  418.     $game_switches      = Marshal.load(file)
  419.     $game_variables     = Marshal.load(file)
  420.     $game_self_switches = Marshal.load(file)
  421.     $game_screen        = Marshal.load(file)
  422.     $game_actors        = Marshal.load(file)
  423.     $game_party         = Marshal.load(file)
  424.     $game_troop         = Marshal.load(file)
  425.     $game_map           = Marshal.load(file)
  426.     $game_player        = Marshal.load(file)
  427.     # 魔法编号与保存时有差异的情况下
  428.     # (加入编辑器的编辑过的数据)
  429.     if $game_system.magic_number != $data_system.magic_number
  430.       # 重新装载地图
  431.       $game_map.setup(292)
  432.       $game_player.center($game_player.x, $game_player.y)
  433.     end
  434.     # 刷新同伴成员
  435.     $game_party.refresh
  436.   end
  437.   #========================================================================
  438. end
复制代码

Lv5.捕梦者

梦石
0
星屑
32013
在线时间
5081 小时
注册时间
2012-11-19
帖子
4877

开拓者

2
发表于 2013-1-31 14:01:44 | 只看该作者
只显示一张图片的话用默认的标题场景就可以了啊
xp vx va mv  va mz 各类型脚本/插件定制
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
82
在线时间
77 小时
注册时间
2011-10-23
帖子
37
3
 楼主| 发表于 2013-1-31 14:04:52 | 只看该作者
芯☆淡茹水 发表于 2013-1-31 14:01
只显示一张图片的话用默认的标题场景就可以了啊

谢谢我已经弄好了 虽然有点麻烦不过现在已经没问题了
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-5-4 23:33

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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