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

Project1

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

[已经过期] 菜单脚本常量未定义? 求解 .

[复制链接]

Lv1.梦旅人

梦石
0
星屑
190
在线时间
84 小时
注册时间
2009-11-29
帖子
44
跳转到指定楼层
1
发表于 2010-7-31 14:58:09 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 summerxud 于 2010-7-31 14:59 编辑

工程下载 Project3.rar (597.71 KB, 下载次数: 65)
脚本原地址:http://wiki.pockethouse.com/index.php?title=Final_Fantasy_13_Main_Menu
  1. #===============================================================================
  2. #
  3. # Shanghai Simple Script - Final Fantasy 13 Main Menu
  4. # Last Date Updated: 2010.06.02
  5. # Level: Normal
  6. #
  7. # NOTE! This requires Yanfly Engine Melody's Main Menu Melody script to be
  8. # installed and located above this script to work. This makes your main menu
  9. # ordered like Final Fantasy 13's.
  10. #===============================================================================
  11. # Instructions
  12. # -----------------------------------------------------------------------------
  13. # To install this script, open up your script editor and copy/paste this script
  14. # to an open slot below ▼ Materials but above ▼ Main. Remember to save.
  15. #
  16. #===============================================================================

  17. $imported = {} if $imported == nil
  18. $imported["FinalFantasy13Menu"] = true

  19. module SSS
  20.   # This is the image file for the menu background. Place this inside of the
  21.   # Graphics\System folder.
  22.   MENU_BACK_IMAGE = "MenuBack"

  23.   # This is the image file used for the back of each of the menu items. This
  24.   # image must be 160x24 pixels and placed inside of the Graphics\System folder.
  25.   MENU_BACK_ITEM_IMAGE = "MenuBackItem"

  26.   # This sets the menu help window's text color.
  27.   MENU_HELP_TEXT_COLOR = Color.new(0, 0, 0)

  28.   # This is the text format used to write out the current map.
  29.   MENU_LOCATION = "Location: %s"

  30.   # This hash sets the image files for your actors. These images must be placed
  31.   # inside of the Graphics\System folder and they have to be 104x288 pixels.
  32.   MENU_ACTOR_IMAGES ={
  33.     1 => "MenuRalph",
  34.     2 => "MenuUlrika",
  35.     3 => "MenuBennett",
  36.     4 => "MenuYlva",
  37.   } # Remove this and perish.

  38.   # This hash sets what colors belong to which class when drawn.
  39.   MENU_CLASS_COLORS ={
  40.     1 => 2,
  41.     2 => 6,
  42.     3 => 4,
  43.     4 => 5,
  44.   } # Remove this and perish.

  45.   # This sets the help window descripts for the menu commands.
  46.   MENU_HELP_WINDOW ={
  47.     "Item"     => "View and manage your party's items.",
  48.     "Status"   => "View a party member's status.",
  49.     "Skill"    => "Manage a party member's skills.",
  50.     "Equip"    => "Manage a party member's equipment.",
  51.     "Save"     => "Save your current progress.",
  52.     "Game End" => "End the current game.",
  53.     "System"   => "Adjust the game's options.",
  54.   } # Remove this and perish.
  55. end

  56. #==============================================================================
  57. # ** Window_Base
  58. #==============================================================================

  59. class Window_Base < Window
  60.   #--------------------------------------------------------------------------
  61.   # * Object Initialization
  62.   #--------------------------------------------------------------------------
  63.   alias initialize_sss_ff13_menu_window_base initialize unless $@
  64.   def initialize(x, y, width, height)
  65.     initialize_sss_ff13_menu_window_base(x, y, width, height)
  66.     self.opacity = 0 if $scene.is_a?(Scene_Menu)
  67.   end
  68. end

  69. #==============================================================================
  70. # ** Window_MenuHelp
  71. #==============================================================================

  72. class Window_MenuHelp < Window_Help
  73.   #--------------------------------------------------------------------------
  74.   # * Set Text
  75.   #--------------------------------------------------------------------------
  76.   def set_text(text, align = 0)
  77.     if text != @text or align != @align
  78.       self.contents.clear
  79.       self.contents.font.shadow = false
  80.       self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  81.       self.contents.draw_text(4, 0, self.width - 40, WLH, text, align)
  82.       @text = text
  83.       @align = align
  84.     end
  85.   end
  86. end

  87. #==============================================================================
  88. # ** Window_MainMenuParty
  89. #==============================================================================

  90. class Window_MainMenuParty < Window_Selectable
  91.   #--------------------------------------------------------------------------
  92.   # * Object Initialization
  93.   #--------------------------------------------------------------------------
  94.   def initialize(x, y)
  95.     super(x-24, y, Graphics.width-x+32, Graphics.height-y)
  96.     self.active = false
  97.     @column_max = [4, $game_party.members.size].max
  98.     @spacing = 0
  99.     refresh
  100.   end
  101.   #--------------------------------------------------------------------------
  102.   # * Refresh
  103.   #--------------------------------------------------------------------------
  104.   def refresh
  105.     self.contents.clear
  106.     @data = $game_party.members
  107.     @item_max = @data.size
  108.     create_contents
  109.     for i in 0...@item_max
  110.       draw_item(i)
  111.     end
  112.   end
  113.   #--------------------------------------------------------------------------
  114.   # * Draw Item
  115.   #--------------------------------------------------------------------------
  116.   def draw_item(index)
  117.     rect = item_rect(index)
  118.     self.contents.clear_rect(rect)
  119.     actor = @data[index]
  120.     unless actor.nil?
  121.       draw_actor_image(actor, rect)
  122.       draw_actor_name(actor, rect)
  123.       draw_actor_state(actor, rect.x, WLH*5/2, 96)
  124.       draw_actor_class(actor, rect)
  125.       draw_actor_level(actor, rect)
  126.       draw_actor_hp(actor, rect)
  127.       draw_actor_mp(actor, rect)
  128.     end
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # * Draw Actor Image
  132.   #--------------------------------------------------------------------------
  133.   def draw_actor_image(actor, rect)
  134.     filename = SSS::MENU_ACTOR_IMAGES[actor.id]
  135.     return if filename.nil?
  136.     bitmap = Cache.system(filename)
  137.     image_rect = Rect.new(2, 2, rect.width-4, 284)
  138.     self.contents.blt(rect.x+2, rect.y+2, bitmap, image_rect)
  139.   end
  140.   #--------------------------------------------------------------------------
  141.   # * Draw Actor Name
  142.   #--------------------------------------------------------------------------
  143.   def draw_actor_name(actor, rect)
  144.     name = actor.name
  145.     self.contents.font.size = Font.default_size
  146.     self.contents.font.color = normal_color
  147.     self.contents.draw_text(rect.x+4, WLH*3/2, rect.width-8, WLH, name)
  148.   end
  149.   #--------------------------------------------------------------------------
  150.   # * Draw Actor Class
  151.   #--------------------------------------------------------------------------
  152.   def draw_actor_class(actor, rect)
  153.     name = actor.class.name
  154.     self.contents.font.size = Font.default_size - 4
  155.     color_id = SSS::MENU_CLASS_COLORS[actor.class.id].to_i
  156.     self.contents.font.color = text_color(color_id)
  157.     self.contents.draw_text(rect.x+4, WLH*0, rect.width-8, WLH, name, 2)
  158.   end
  159.   #--------------------------------------------------------------------------
  160.   # * Draw Actor Level
  161.   #--------------------------------------------------------------------------
  162.   def draw_actor_level(actor, rect)
  163.     self.contents.font.size = Font.default_size - 4
  164.     self.contents.font.color = power_up_color
  165.     yy = 288 - WLH*7/2 - 8
  166.     self.contents.draw_text(rect.x+4, yy, rect.width-8, WLH, Vocab.level_a, 0)
  167.     yy += WLH/2
  168.     self.contents.font.color = normal_color
  169.     self.contents.font.size += 2
  170.     self.contents.draw_text(rect.x+4, yy, rect.width-8, WLH, actor.level, 2)
  171.   end
  172.   #--------------------------------------------------------------------------
  173.   # * Draw Actor HP
  174.   #--------------------------------------------------------------------------
  175.   def draw_actor_hp(actor, rect)
  176.     self.contents.font.size = Font.default_size - 4
  177.     self.contents.font.color = hp_gauge_color2
  178.     yy = 288 - WLH*5/2 - 4
  179.     self.contents.draw_text(rect.x+4, yy, rect.width-8, WLH, Vocab.hp, 0)
  180.     yy += WLH/2
  181.     self.contents.font.color = normal_color
  182.     self.contents.font.size += 2
  183.     self.contents.draw_text(rect.x+4, yy, rect.width-8, WLH, actor.hp, 2)
  184.   end
  185.   #--------------------------------------------------------------------------
  186.   # * Draw Actor MP
  187.   #--------------------------------------------------------------------------
  188.   def draw_actor_mp(actor, rect)
  189.     self.contents.font.size = Font.default_size - 4
  190.     self.contents.font.color = mp_gauge_color2
  191.     yy = 288 - WLH*3/2
  192.     self.contents.draw_text(rect.x+4, yy, rect.width-8, WLH, Vocab.mp, 0)
  193.     yy += WLH/2
  194.     self.contents.font.color = normal_color
  195.     self.contents.font.size += 2
  196.     self.contents.draw_text(rect.x+4, yy, rect.width-8, WLH, actor.mp, 2)
  197.   end
  198.   #--------------------------------------------------------------------------
  199.   # * Item Rect
  200.   #--------------------------------------------------------------------------
  201.   def item_rect(index)
  202.     rect = Rect.new(0, 0, 0, 0)
  203.     rect.width = (contents.width + @spacing) / @column_max - @spacing
  204.     rect.height = 288
  205.     rect.x = index % @column_max * (rect.width + @spacing)
  206.     rect.y = index / @column_max * WLH
  207.     return rect
  208.   end
  209. end

  210. #==============================================================================
  211. # ** Window_MenuTimer
  212. #==============================================================================

  213. class Window_MenuTimer < Window_Base
  214.   #--------------------------------------------------------------------------
  215.   # * Object Initialization
  216.   #--------------------------------------------------------------------------
  217.   def initialize
  218.     super(0, Graphics.height - 60, 120, 56)
  219.     self.contents.font.size = Font.default_size - 4
  220.     self.contents.font.shadow = false
  221.     self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  222.     refresh
  223.   end
  224.   #--------------------------------------------------------------------------
  225.   # * Refresh
  226.   #--------------------------------------------------------------------------
  227.   def refresh
  228.     self.contents.clear
  229.     format = "%03d:%02d:%02d"
  230.     @game_time = Graphics.frame_count / Graphics.frame_rate
  231.     hours = @game_time / 3600
  232.     minutes = @game_time / 60 % 60
  233.     seconds = @game_time % 60
  234.     text = sprintf(format, hours, minutes, seconds)
  235.     self.contents.draw_text(0, 0, contents.width-4, WLH, text, 2)
  236.   end
  237.   #--------------------------------------------------------------------------
  238.   # * Update
  239.   #--------------------------------------------------------------------------
  240.   def update
  241.     super
  242.     refresh if @game_time != (Graphics.frame_count / Graphics.frame_rate)
  243.   end
  244. end

  245. #==============================================================================
  246. # ** Window_MenuGold
  247. #==============================================================================

  248. class Window_MenuGold < Window_Base
  249.   #--------------------------------------------------------------------------
  250.   # * Object Initialization
  251.   #--------------------------------------------------------------------------
  252.   def initialize
  253.     super(100, Graphics.height - 60, 120, 56)
  254.     self.contents.font.size = Font.default_size - 4
  255.     self.contents.font.shadow = false
  256.     self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  257.     refresh
  258.   end
  259.   #--------------------------------------------------------------------------
  260.   # * Refresh
  261.   #--------------------------------------------------------------------------
  262.   def refresh
  263.     self.contents.clear
  264.     text = sprintf("%d%s", $game_party.gold, Vocab.gold)
  265.     self.contents.draw_text(0, 0, contents.width-4, WLH, text, 0)
  266.   end
  267. end

  268. #==============================================================================
  269. # ** Window_MenuLocation
  270. #==============================================================================

  271. class Window_MenuLocation < Window_Base
  272.   #--------------------------------------------------------------------------
  273.   # * Object Initialization
  274.   #--------------------------------------------------------------------------
  275.   def initialize
  276.     super(Graphics.width/2-16, Graphics.height - 60, Graphics.width/2+16, 56)
  277.     self.contents.font.size = Font.default_size - 4
  278.     self.contents.font.shadow = false
  279.     self.contents.font.color = SSS::MENU_HELP_TEXT_COLOR
  280.     refresh
  281.   end
  282.   #--------------------------------------------------------------------------
  283.   # * Refresh
  284.   #--------------------------------------------------------------------------
  285.   def refresh
  286.     self.contents.clear
  287.     text = sprintf(SSS::MENU_LOCATION, $game_map.map_name)
  288.     self.contents.draw_text(4, 0, contents.width, WLH, text, 0)
  289.   end
  290. end

  291. #===============================================================================
  292. # Override Main Menu Melody Settings
  293. #===============================================================================

  294. YEM::MENU::USE_ICONS = false
  295. YEM::MENU::MENU_RIGHT_SIDE = false
  296. YEM::MENU::ON_SCREEN_MENU = false
  297. YEM::MENU::USE_MULTI_VARIABLE_WINDOW = false

  298. #==============================================================================
  299. # ** Scene_Menu
  300. #==============================================================================

  301. class Scene_Menu < Scene_Base
  302.   #--------------------------------------------------------------------------
  303.   # * Start processing
  304.   #--------------------------------------------------------------------------
  305.   alias start_sss_ff13_menu start unless $@
  306.   def start
  307.     start_sss_ff13_menu
  308.     start_ff13_menu_style
  309.   end
  310.   #--------------------------------------------------------------------------
  311.   # * Termination Processing
  312.   #--------------------------------------------------------------------------
  313.   alias terminate_sss_ff13_menu terminate unless $@
  314.   def terminate
  315.     @help_window.dispose
  316.     @location_window.dispose
  317.     @menu_timer_window.dispose
  318.     @menubackitem_sprite.bitmap.dispose
  319.     @menubackitem_sprite.dispose
  320.     terminate_sss_ff13_menu
  321.   end
  322.   #--------------------------------------------------------------------------
  323.   # * Create Background for Menu Screen
  324.   #--------------------------------------------------------------------------
  325.   def create_menu_background
  326.     @menuback_sprite = Sprite.new
  327.     @menuback_sprite.bitmap = Cache.system(SSS::MENU_BACK_IMAGE)
  328.     update_menu_background
  329.   end
  330.   #--------------------------------------------------------------------------
  331.   # * Update Background for Menu Screen
  332.   #--------------------------------------------------------------------------
  333.   def update_menu_background
  334.     super
  335.     @menubackitem_sprite.update unless @menubackitem_sprite.nil?
  336.     @menu_timer_window.update unless @menu_timer_window.nil?
  337.   end
  338.   #--------------------------------------------------------------------------
  339.   # * Create Menu Back Items
  340.   #--------------------------------------------------------------------------
  341.   def create_menu_back_items
  342.     @menubackitem_sprite = Sprite.new
  343.     width = 160
  344.     height = @command_window.height-32
  345.     @menubackitem_sprite.bitmap = Bitmap.new(width, height)
  346.     bitmap = Cache.system(SSS::MENU_BACK_ITEM_IMAGE)
  347.     rect = Rect.new(0, 0, 160, 24)
  348.     y = 0
  349.     loop do
  350.       break if y >= height
  351.       @menubackitem_sprite.bitmap.blt(0, y, bitmap, rect)
  352.       y += 24
  353.     end
  354.     @menubackitem_sprite.y = @command_window.y+16
  355.   end
  356.   #--------------------------------------------------------------------------
  357.   # * Start Final Fantasy 13 Menu Style
  358.   #--------------------------------------------------------------------------
  359.   def start_ff13_menu_style
  360.     @gold_window.dispose
  361.     @gold_window = Window_MenuGold.new
  362.     @menu_timer_window = Window_MenuTimer.new
  363.     @location_window = Window_MenuLocation.new
  364.     @help_window = Window_MenuHelp.new
  365.     @help_window.x += 48
  366.     @help_window.width -= 48
  367.     @help_window.create_contents
  368.     @help_window.contents.font.size = Font.default_size - 4
  369.     @command_window.y = @help_window.height - 9
  370.     @status_window.dispose
  371.     x = @command_window.width
  372.     y = @help_window.height-9
  373.     @status_window = Window_MainMenuParty.new(x, y)
  374.     @command_window.x -= 4
  375.     @help_window.y += 12
  376.     update_help_window
  377.     create_menu_back_items
  378.   end
  379.   #--------------------------------------------------------------------------
  380.   # * Update Command Selection
  381.   #--------------------------------------------------------------------------
  382.   alias update_command_selection_sss_ff13_menu update_command_selection unless $@
  383.   def update_command_selection
  384.     update_help_window
  385.     update_command_selection_sss_ff13_menu
  386.   end
  387.   #--------------------------------------------------------------------------
  388.   # * Update Help Window
  389.   #--------------------------------------------------------------------------
  390.   def update_help_window
  391.     return if @help_window_index == @command_window.index
  392.     @help_window_index = @command_window.index
  393.     commands = @command_window.commands
  394.     text = SSS::MENU_HELP_WINDOW[commands[@help_window_index]].to_s
  395.     @help_window.set_text(text)
  396.   end
  397. end

  398. #===============================================================================
  399. #
  400. # END OF FILE
  401. #
  402. #===============================================================================
复制代码

说常量YEM未定义?我并没有修改过脚本..

Lv3.寻梦者

梦石
0
星屑
1210
在线时间
1564 小时
注册时间
2008-7-30
帖子
4418

贵宾

2
发表于 2010-7-31 16:49:23 | 只看该作者
需要yangfly 战斗引擎,8#有完整可用的工程(未汉化,汉化版本可能很快放出):

http://rpg.blue/thread-144299-1-1.html

See FScript Here:https://github.com/DeathKing/fscript
潜心编写URG3中。
所有对URG3的疑问和勘误或者建议,请移步至发布页面。
欢迎萌妹纸催更
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
1 小时
注册时间
2010-7-28
帖子
37
3
发表于 2010-7-31 16:58:03 | 只看该作者
>说常量YEM未定义?我并没有修改过脚本..
YEM::MENU::USE_ICONS = false
在下觉得这个YEM是个module……
For to him that is joined to all the living there is hope; for a living dog is better than a dead lion.
For the living know that they shall die: but the dead know not any thing, neither have they any more a reward; for the memory of them is forgotten.
——Ecclesiastes
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1210
在线时间
1564 小时
注册时间
2008-7-30
帖子
4418

贵宾

4
发表于 2010-8-1 18:59:29 | 只看该作者
同时,这里有整合好的,没有错误的最终幻想13菜单:
http://rpg.blue/thread-145294-1-1.html

See FScript Here:https://github.com/DeathKing/fscript
潜心编写URG3中。
所有对URG3的疑问和勘误或者建议,请移步至发布页面。
欢迎萌妹纸催更
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-1-11 17:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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