Sujet: mettre choix "quete" menu Lun 23 Mai 2011 - 19:10
bonjour a tous et a toutes, donc voila, je vous demande, si quelqu'un aurait la gentilesse de m'éxpliquer comment mettre ce script de quete:
Spoiler:
=begin ########################## Breadlord's Quets Script modifié par Skillo ############################ Ceci est un script pour quête vous permettant d'avoir une large description des quêtes et de multiples tâches (entend par là plusieurs à truc à faire pour la même quête hein). Tu met les quêtes sous forme d'evenement c'est à dire sous ce format :
$quests['nom de la quête'] = Quest.new([' ligne de description 1', 'ligne de description 2, ...], ['tâche 1 description', 'tâche 2 description',...])
Dans ce format 'nom de la quête' correspond au nom de la quête, 'ligne de description N' est la N ème ligne de la description de la quête et 'tâche N description' est la description de la N eme tâche
Pour completer une tâche dans un evenement utilisez $quests['nom de la quête'].complete_sub('tâche description'), et pour échouer une tâche utilisez $quests['nom de la quête'].fail_sub('tâche description'). Si toutes les tâches sont complétées/échouées alors le status de la quête deviendra complétée/échouée. Pour mettre une quête en complétée utilisez $quests['nom de la quête'].complete_all, et échouée utilisez $quests['nom de la quête'].fail_all
Pour vérifier si une quête est complétée utilisez $quests['nom de la quête'].complete?, et pour vérifier si elle est échouée utilisez $quests['nom de la quête'].failed?. Pour vérifier si une tâche est complétée utilisez $quests['nom de la quête'].sub_complete?('tâche description') et pour vérifier si elle est échouée utilisez $quests['nom de la quête'].sub_failed?('tâche description')
Pour definir une quete secondaire il suffit de rajouter true après les taches : $quests['nom de la quête'] = Quest.new([' ligne de description 1', 'ligne de description 2, ...], ['tâche 1 description', 'tâche 2 description',...], true)
Enfin pour vérifier que la quête existe utilisez $quests['nom de la quête'] != nil Pour appeler le menu de quête utilisez $scene = Scene_Quest.new Et pour lancer le menu quête sur un onglet précis il suffit de $scene = Scene_Quest.new(index de l'onglet) 0<= index de l'onglet <= 3
# Ici seront defini les 3 icones correspondant aux tri des quêtes # QUEST_ICONS = [icone des quetes en cours, icone des quetes complétées, icone des quete echouées] QUEST_ICONS = [188, 179, 150, 112]
# Ici sera defini l'image apparaissant dans le menu # QUEST_PICTURE = "nom de l'image" QUEST_PICTURE = "Quest"
# Ici sera defini la hauteur des fenêtre et par consequence la place laisser à l'image # QUEST_WINDOWHEIGHT = hauteur QUEST_WINDOWHEIGHT = 293 # 293
# Ici sera defini l'image apparaissant lorsqu'une quête est completée # QUEST_COMPLETE = "nom de l'image" QUEST_COMPLETE = "Complete"
# Ici sera defini l'image apparaissant lorsqu'une quête est échouée # QUEST_FAILED = "nom de l'image" QUEST_FAILED = "Failed"
# Ici sera defini le message apparaissant dans la fenetre de description lors d'une quête secondaire # QUEST_SECOND = "message" QUEST_SECOND = "Quête secondaire" # Ici seront defini les 3 icones correspondant aux états des quêtes et des tâches principales # VALIDATEICONS = [icone des taches en cours, icone des taches complétées, icone des taches echouées] VALIDATEICONS = [99, 101, 97]
# Ici seront defini les 3 icones correspondant aux états des quêtes et des tâches secondaires # VALIDATEICONS = [icone des taches en cours, icone des taches complétées, icone des taches echouées] VALIDATESECONDICONS = [100, 102, 96]
#Ici sera defini le nom apparaissant dans le menu de base # MENUNAME = nom du menu MENUNAME = 'Quêtes'
#Ici sera defini le nom apparaissant dans la description de l'onglet des quêtes principales # QUEST_NAMEPRINCIP = nom QUEST_NAMEPRINCIP = "Quêtes Principales"
#Ici sera defini le nom apparaissant dans la description de l'onglet des quêtes secondaires # QUEST_NAMESECOND = nom QUEST_NAMESECOND = "Quêtes Secondaires"
#Ici sera defini le nom apparaissant dans la description de l'onglet des quêtes réussies # QUEST_NAMECOMP = nom QUEST_NAMECOMP = "Quêtes Réussies"
#Ici sera defini le nom apparaissant dans la description de l'onglet des quêtes échouées # QUEST_NAMEFAIL = nom QUEST_NAMEFAIL = "Quêtes Ratés"
# Ici sera defini à titre indicatif le numero du menu quête dans le menu de base (comptez à partir de 0) # cela n'aura aucune influance sur sa position. # MENU_NUMBER = umero du menu quête dans le menu de base MENU_NUMBER = 4
# Ici sera defini l'interrupteur definissant si un tache échoué fais echoué la quête ou non. # FAILSUB_FAILCOMPLETE = true/false FAILSUB_FAILCOMPLETE = true
end
#============================================================================== # ** Quest #------------------------------------------------------------------------------ # Cette classe permet de definir des quêtes # Elle est appelée par $quests #============================================================================== class Quest
attr_accessor :desc, :sub, :comp, :sub_text, :pic
#-------------------------------------------------------------------------- # * Quête Initialization # desc : tableau des descriptions # sub : tableau des tâches # pic : window width #-------------------------------------------------------------------------- def initialize(desc = [''], sub = [''], second = false) @desc = desc @sub = {} @second = second for i in 0..sub.size - 1 # pour chaque tache @sub[sub[i]] = 'prog' #construit une clef du nom de la tache avec la valeur prog end @comp = 'prog' @sub_text = [] for i in 0..sub.size - 1 @sub_text.push(sub[i]) # pour chaque tache end end
#-------------------------------------------------------------------------- # * Completer une Tâche # sub : tâche #-------------------------------------------------------------------------- def second? return @second end #-------------------------------------------------------------------------- # * Completer une Tâche # sub : tâche #-------------------------------------------------------------------------- def complete_sub(sub) @sub[sub] = 'comp' test_complete end #-------------------------------------------------------------------------- # * Tester si la Quête est devenue complete # sub : tâche #-------------------------------------------------------------------------- def test_complete @a = true for i in 0..@sub.keys.size - 1 if @sub[@sub.keys[i]] == 'comp' @a = (@a and true) else @a = (@a and false) end end if @a == true complete_all end end #-------------------------------------------------------------------------- # * Echouer une Tâche # sub : tâche #-------------------------------------------------------------------------- def fail_sub(sub) if QUEST_CONFIG::FAILSUB_FAILCOMPLETE fail_all else @sub[sub] = 'fail' end end
#-------------------------------------------------------------------------- # *Compeleter toutes les Tâches #-------------------------------------------------------------------------- def complete_all @comp = 'comp' for i in @sub.keys @sub[i] = 'comp' end end
#-------------------------------------------------------------------------- # *Echouer à toutes les Tâches #-------------------------------------------------------------------------- def fail_all @comp = 'fail' for i in @sub.keys @sub[i] = 'fail' end end
#-------------------------------------------------------------------------- # *Tester si une Tâches est complete #-------------------------------------------------------------------------- def sub_complete?(sub) return @sub[sub] == 'comp'? true : false end
#-------------------------------------------------------------------------- # *Tester si une Quête est complete #-------------------------------------------------------------------------- def complete? return @comp == 'comp'? true : false end
#-------------------------------------------------------------------------- # *Tester si une Tâches est échouée #-------------------------------------------------------------------------- def sub_failed?(sub) return @sub[sub] == 'fail'? true : false end
#-------------------------------------------------------------------------- # *Tester si une Quête est échouée #-------------------------------------------------------------------------- def failed? return @comp == 'fail'? true : false end end
#============================================================================== # ** Window_Quest_Type #------------------------------------------------------------------------------ # Cette fenetre affiche les differents états des quêtes. #============================================================================== class Window_Quest_Type < Window_Selectable
#-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh create_contents @item_max = @icons.size for i in 0...@item_max rect = item_rect(i) rect.x -= 2 icon = @icons[i] draw_icon(icon, rect.x, rect.y) end end end
#============================================================================== # ** Window_Quest_Title #------------------------------------------------------------------------------ # Cette fenetre affiche les descriptions des quêtes. #============================================================================== class Window_Quest_Title < Window_Base
#============================================================================== # ** Window_Quest_Desc #------------------------------------------------------------------------------ # Cette fenetre affiche lee contenue des quêtes. #============================================================================== class Window_Quest_Desc < Window_Base
#-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(index = nil) super( 160, 416 - QUEST_CONFIG::QUEST_WINDOWHEIGHT, 384, QUEST_CONFIG::QUEST_WINDOWHEIGHT) @status = Sprite.new if index != nil if $quests[index].complete? @status.bitmap = Cache.picture(QUEST_CONFIG::QUEST_COMPLETE) elsif $quests[index].failed? @status.bitmap = Cache.picture(QUEST_CONFIG::QUEST_FAILED) end @status.z = 201 for i in 0..$quests[index].desc.size - 1 a = $quests[index].desc[i] self.contents.draw_text(0, WLH*i, self.width - 40, WLH, a, 1) end a = $quests[index].sub_text for i in 0..a.size - 1 b = a[i] if $quests[index].sub[b] == 'prog' if $quests[index].second? ic = QUEST_CONFIG::VALIDATESECONDICONS[0] else ic = QUEST_CONFIG::VALIDATEICONS[0] end elsif $quests[index].sub[b] == 'comp' if $quests[index].second? ic = QUEST_CONFIG::VALIDATESECONDICONS[1] else ic = QUEST_CONFIG::VALIDATEICONS[1] end else if $quests[index].second? ic = QUEST_CONFIG::VALIDATESECONDICONS[2] else ic = QUEST_CONFIG::VALIDATEICONS[2] end end draw_icon(ic, 4, WLH*(i + $quests[index].desc.size + 1)) self.contents.draw_text(0, WLH*(i + $quests[index].desc.size + 1), self.width - 40, WLH, b, 1) end if $quests[index].second? self.contents.draw_text(0, QUEST_CONFIG::QUEST_WINDOWHEIGHT - 3*WLH, self.width - 40, WLH, QUEST_CONFIG::QUEST_SECOND, 1) end end end #-------------------------------------------------------------------------- # * Dispose #-------------------------------------------------------------------------- def dispose super @status.dispose end end
#============================================================================== # ** Window_Quest_Type #------------------------------------------------------------------------------ # Cette fenetre affiche lee contenue des quêtes. #============================================================================== class Window_Select_Quest < Window_Selectable
attr_accessor :c_items
#-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize(type = 1) super(0, 416 - QUEST_CONFIG::QUEST_WINDOWHEIGHT, 160, QUEST_CONFIG::QUEST_WINDOWHEIGHT) @type = type self.index = 0 self.active = false @items = $quests.keys a = @items @c_items = [] for it in 0...@items.size if include?(a[it]) @c_items.push(a[it]) end end @column_max = 1 @commands = @c_items @item_max = @commands.size create_contents refresh end
#-------------------------------------------------------------------------- # * Refresh #-------------------------------------------------------------------------- def refresh self.contents.clear for it in 0...@item_max draw_opt(it) end end
#-------------------------------------------------------------------------- # * Include ? # key : nom d'une quête #-------------------------------------------------------------------------- def include?(key) case @type when 1 if !$quests[key].complete? and !$quests[key].failed? and !$quests[key].second? return true end when 2 unless $quests[key].complete? or $quests[key].failed? return $quests[key].second? end when 3 return $quests[key].complete? when 4 return $quests[key].failed? end end
#-------------------------------------------------------------------------- # * Draw Opt # itemm : quête #-------------------------------------------------------------------------- def draw_opt(itemm) a = @c_items rect = item_rect(itemm) self.contents.clear_rect(rect) if $quests[@c_items[itemm]].complete? if $quests[@c_items[itemm]].second? draw_icon(QUEST_CONFIG::VALIDATESECONDICONS[1],rect.x, rect.y) else draw_icon(QUEST_CONFIG::VALIDATEICONS[1],rect.x, rect.y) end elsif $quests[@c_items[itemm]].failed? if $quests[@c_items[itemm]].second? draw_icon(QUEST_CONFIG::VALIDATESECONDICONS[2],rect.x, rect.y) else draw_icon(QUEST_CONFIG::VALIDATEICONS[2],rect.x, rect.y) end else if $quests[@c_items[itemm]].second? draw_icon(QUEST_CONFIG::VALIDATESECONDICONS[0],rect.x, rect.y) else draw_icon(QUEST_CONFIG::VALIDATEICONS[0],rect.x , rect.y) end end string = @c_items[itemm] rect.width -= 4 self.contents.draw_text(rect.x, rect.y, rect.width, WLH, string, 2) end end
#============================================================================== # ** Scene_Quest #------------------------------------------------------------------------------ # Cette classe fere le menu de quêtes #============================================================================== class Scene_Quest < Scene_Base
#-------------------------------------------------------------------------- # * Object Initialization # #-------------------------------------------------------------------------- def initialize(index = 0, menu = false) @menu = menu @index = index end
#-------------------------------------------------------------------------- # * Return to Original Screen #-------------------------------------------------------------------------- def return_scene if @menu $scene = Scene_Menu.new(QUEST_CONFIG::MENU_NUMBER) else $scene = Scene_Map.new end end
#-------------------------------------------------------------------------- # * Update Frame #-------------------------------------------------------------------------- def update super update_menu_background @type.update @quests.update if @type.active update_type_selection elsif @quests.active update_quests_selection else update_desc_selection end if Input.trigger?(Input::A) Sound.play_cancel return_scene end end
#-------------------------------------------------------------------------- # * Update Type Selection #-------------------------------------------------------------------------- def update_type_selection if Input.trigger?(Input::B) Sound.play_cancel return_scene elsif Input.trigger?(Input::C) a = @type.index Sound.play_cursor @type.active = false @quests.dispose @quests = Window_Select_Quest.new(a + 1) @quests.active = true @quests.index = 0 elsif Input.trigger?(Input::LEFT) or Input.trigger?(Input::RIGHT) a = @type.index @quests.dispose @quests = Window_Select_Quest.new(a + 1) @quests.index = -1 update_desc end end
#-------------------------------------------------------------------------- # * Update Quests Decription #-------------------------------------------------------------------------- def update_desc case @type.index when 0 @title.dispose @title = Window_Quest_Title.new(QUEST_CONFIG::QUEST_NAMEPRINCIP) when 1 @title.dispose @title = Window_Quest_Title.new(QUEST_CONFIG::QUEST_NAMESECOND) when 2 @title.dispose @title = Window_Quest_Title.new(QUEST_CONFIG::QUEST_NAMECOMP) when 3 @title.dispose @title = Window_Quest_Title.new(QUEST_CONFIG::QUEST_NAMEFAIL) end end #-------------------------------------------------------------------------- # * Update Quests Selection #-------------------------------------------------------------------------- def update_quests_selection if Input.trigger?(Input::B) Sound.play_cancel Sound.play_cursor @type.active = true @quests.active = false @quests.index = -1 update_desc @desc_window.dispose @desc_window = Window_Quest_Desc.new elsif Input.trigger?(Input::C) if @quests.c_items[@quests.index] == nil Sound.play_buzzer else Sound.play_decision @desc_window.dispose @desc_window = Window_Quest_Desc.new(@quests.c_items[@quests.index]) @title.dispose @title = Window_Quest_Title.new(@quests.c_items[@quests.index]) @quests.active = false @type.active = false end end end
#-------------------------------------------------------------------------- # * Update Desc Selection #-------------------------------------------------------------------------- def update_desc_selection if Input.trigger?(Input::B) Sound.play_cancel Sound.play_cursor @quests.active = true update_desc @desc_window.dispose @desc_window = Window_Quest_Desc.new end end end
#============================================================================== # ** Scene_Title #------------------------------------------------------------------------------ # This class performs the title screen processing. #============================================================================== class Scene_Title < Scene_Base
alias startupquest command_new_game #-------------------------------------------------------------------------- # * Command: New Game #-------------------------------------------------------------------------- def command_new_game startupquest $quests = {} end end
#============================================================================== # ** Scene_File #------------------------------------------------------------------------------ # This class performs the save and load screen processing. #============================================================================== class Scene_File < Scene_Base
alias savequest write_save_data #-------------------------------------------------------------------------- # * Write Save Data # file : write file object (opened) #-------------------------------------------------------------------------- def write_save_data(file) savequest(file) Marshal.dump($quests, file) end
alias loadquest read_save_data #-------------------------------------------------------------------------- # * Read Save Data # file : file object for reading (opened) #-------------------------------------------------------------------------- def read_save_data(file) loadquest(file) $quests = Marshal.load(file) end end
dans ce menu:
Spoiler:
#=============================================================================== # # Yanfly Engine RD - Scene Menu ReDux + KGC Custom Menu Command # Last Date Updated: 2009.06.22 # Level: Normal, Hard, Lunatic # # This is more or less a revision of the menu scene. Included in the script are # a couple of features. Note that I will NOT take credit for KGC's custom menu # command script as all I did was merely import it into this script and finished # up the excluded functions that he's left behind. Everything else I did add # to the script. # # COMMAND CONTROL - by KGC # Add, remove, and re-order commands akin to KGC's CustomMenuCommands. Akin to # this feature will include what KGC's original script was missing and that was # easy functionality to include custom menu commands without hassling the core # script itself. Also added is the ability to launch common events from the # main menu itself for those who wish to event unique commands. # # REDUX MENUS # The redux menus are completely optional and are mostly nothing other than # visual changes to the menu scene. You can add icons to the command window, # display more than just gold on the main menu screen, and added experience # bars to the party window. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.06.22 - Fixed time calculation. # o 2009.06.10 - Added Time, Steps, and Map Name to MultiVariable Window. # o 2009.06.06 - Finished script. # o 2009.06.05 - Started script. #=============================================================================== # Instructions #=============================================================================== # # Note that the placement of this script is extremely important. # # 1. Place all of the non-KGC and non-Yanfly scripts that have new scenes above # this script. That way, they will not alter the menu. # 2. Place all KGC and Yanfly scripts below this script to develop compatibility # amongst all of the scripts. # # Note that the special rules other scripts may use to disable their respective # commands will not follow those rules. You'll have to mimic them through usage # of switches. Make sure you understand how and when those scripts disable their # own commands before toggling your switches. # # Scroll down to MENU_COMMANDS to add/remove/reorder your own menu commands. # Adjust any of the ReDux menu options if desired. # #=============================================================================== # # Compatibility # - Works With: KGC scripts, Yanfly scripts, etc. # - Alias: Game_Temp, initialize # - Overwrites: Scene_Menu: anything regarding command window # - Overwrites: Scene_Equip, Scene_Skill, and Scene_Status's return_scene # #=============================================================================== # Credits: # All credits will go to KGC as I did not write the majority of this code. # KGC for Custom Menu Command base coding and pretty much everything. #===============================================================================
$imported = {} if $imported == nil $imported["SceneMenuReDux"] = true
module YE module REDUX module MENU
#----------------------------------------------------------------------- # BASIC MENU FUNCTIONS #-----------------------------------------------------------------------
# This adjusts the input button used to call the main menu. By default, # the input command is Input::B. MENU_BUTTON = Input::B
# The following determines which option the menu will place the cursor # at whenever launched. START_INDEX = 0
# This will place the command window on the right hand side and all the # rest on the left hand side if set to true. RIGHT_SIDE_COMMAND = false
#----------------------------------------------------------------------- # Instructions on how to set up the MENU_COMMANDS order. #------------------------------------------------------------------------ # This array will let you determine how you want your menu command list # to be ordered. Each command is assigned a number and these are the # following numbers. The following are the default menu commands: # # 0..Items 1..Skills 2..Equipment 3..Status 4..Save 5..System # # The following are imports from KGC's original CustomMenuCommand. # # 10: Party .............. KGC_LargeParty # 11: View AP ............ KGC_EquipLearnSkill # 12: Skill Slots ........ KGC_SkillCPSystem # 13: Difficulty ......... KGC_BattleDifficulty # 14: Level Up ........... KGC_DistributeParameter # 15: Bestiary ........... KGC_MonsterGuide # 16: Outline ............ KGC_Outline # # The following are menu items for Yanfly Engine ReDux scripts. # # 51: Change Class ....... Yanfly's Subclass Selection System # 52: Learn Skill ........ Yanfly's Subclass Selection System # 53: Skill Slots ........ Yanfly's Equip Skill Slots # 54: Bestiary ........... Yanfly's Bestiary + Display Scanned Enemy # # For commands 101 to 200, common events can be bound. Make sure you # set up the COMMON_EVENTS hash to get the right common events you want. # # From command 201 and onward, custom scripted scenes can be launched. # Already imported are a few rather popular scripts found throughout the # RPG Maker VX community. # # 201: Quest Journal ..... Modern Algebra's Quest Journal # 202: Factions .......... SojaBird's Factions # 203: Rows .............. originalwij's Row Changer # 204: Record Window ..... Stilleas' Record Window # 205: Crafting .......... Cmpsr2000's Crafting Scene # # If you wish to add your own commands, you'll need to register them # under the lunatic mode portion of the script. #----------------------------------------------------------------------- MENU_COMMANDS =[ # Make sure you've read the instructions above. 0, # Items 1, # Skills 2, # Equipment 3, # Status 54, # Bestiary 101, # Common-Event 9 102, # Common-Event 10 4, # Save 5, # System ] # Do not remove this
# The following determines the maximum number of displayed rows for the # customized command window. MAX_ROWS = 10
#----------------------------------------------------------------------- # How to Use: Lunatic Mode - Menu Command - Common Events #----------------------------------------------------------------------- # The following allows you to bind common events to the menu commands. # When a common event is selected, it will exit the menu, go back to the # map screen, and launch the common event there. Bind these ID's from # 101 to 200. Here is what each of the categories mean: # # HideSw - Switch used to hide the command. Set to nil if not used. # DisbSw - Switch used to disable the command. Set to nil if not used. # Debug? - Only appears in test mode. Does not appear in normal play. # CEvent - The ID of the common event that will be launched. # Title - The title text that appears for the event. # # After binding your common events to ID's, go back to MENU_COMMANDS # and insert the proper command ID at the proper location. #----------------------------------------------------------------------- COMMON_EVENTS ={ # These can only be from 101 to 199. # -ID => [HideSw, DisbSw, Debug?, CEvent, Title Name] 101 => [ nil, nil, true, 9, "Debug"], 102 => [ nil, nil, false, 10, "Camp"], } # Do not remove this.
#----------------------------------------------------------------------- # How to Use: Lunatic Mode - Menu Command - Imported Scripts #----------------------------------------------------------------------- # The following is what KGC originally was going to have in his script # but was actually missing it in his publicized script. This will regain # functionality and also lift the "limit" of only 100 extra commands. # The following will explain how to set up the individual options. # # HideSw - Switch used to hide the command. Set to nil if not used. # DisbSw - Switch used to disable the command. Set to nil if not used. # Actor? - Does this select an actor. Set to true if it does. # Title - The title text that appears for the event. # Scene - The scene used to launch the respective scene. # # Note that this does not automatically detect what will and will not # disable the command ingame. You must understand and create a work # around with them (if they do disable the commands) with switches. # After binding your imported commands, go back to MENU_COMMANDS and # insert the proper command ID at the proper location. #----------------------------------------------------------------------- IMPORTED_COMMANDS ={ # These can only be from 201 onward. # -ID => [HideSw, DisbSw, Actor?, Title Name, Scene Name.new] 201 => [ 8, 9, false, "Quests", "Scene_Quest"], 202 => [ 10, 11, false, "Factions", "Scene_Factions"], 203 => [ nil, nil, false, "Rows", "Scene_Row"], 204 => [ nil, nil, false, "Records", "Scene_Record"], 205 => [ nil, nil, false, "Crafting", "Scene_Crafting"], } # Do not remove this.
#----------------------------------------------------------------------- # REDUX MENU FUNCTIONS #-----------------------------------------------------------------------
# For those who would like to add icons to their commands, set this to # true, then go to ICON_SETS and bind text to the icon desired. COMMAND_ICONS = true
# Match the ingame command names with the icons. The reason this isn't # implemented together with the index numbers is because this can allow # for varying icons dependent on the command name (such as difficulty). ICON_SETS ={ # "Unlisted" must exist for the unlisted commands. "Unlisted" => 176, # -----Vocab----- => Icon "Bestiary" => 141, "Camp" => 77, "Class Change" => 131, "Equip" => 44, "Item" => 144, "Learn Skills" => 133, "Quests" => 193, "Save" => 149, "Shutdown" => 154, "Slots" => 103, "Skill" => 159, "Status" => 137, "System" => 134, } # Do not remove this.
# This part will trigger usage of the "new" party status window. Set it # to false if you do not wish to use it. The "new" status window simply # adds the experience bar to the menu and raises the coordinates of the # various status items by a little bit. USE_REDUX_STATUS = true
# This part will adjust the font size for the text shown in the Redux # Status Menu. Affects all text. REDUX_FONT_SIZE = 20
# The following determines how things are shown on the Redux Status Menu. DRAWN_ACTOR_SETUP = 0 # 0 - Face only, 1 - Sprite only, 2 - Both SPRITE_OFFSET = 32 # Sets the y offset for actor sprites FACE_OPACITY = 128 # Sets the face opacity for setting 2
# The following adjusts the EXP bar. Fill out the info properly. EXP_TEXT = "EXP" # Text used for EXP PERCENT_EXP = "%#.04g%%" # Text format used for EXP percentage EXP_GAUGE_1 = 28 # Colour 1 for the EXP Gauge EXP_GAUGE_2 = 29 # Colour 2 for the EXP Gauge
# This part adjusts the multi-variable window. It will replace the gold # window and allows you to display multiple variables (including gold) in # the small bow at the bottom of the screen. USE_MULTI_VARIABLE_WINDOW = true
# Variables will be shown in this order. Use 0 to show gold. Adjust the # following information as seen necessary. VARIABLES_SHOWN = [-5, -1, -2, 0, 1] VARIABLES_ICONS = true VARIABLES_HASH ={ # Note that value zero must exist. # VarID => [Icon, Text] -5 => [ 153, "Map"], -2 => [ 48, "Steps"], -1 => [ 188, "Time"], 0 => [ 205, "Gold"], 1 => [ 200, "Jewels"], }# Do not remove this.
end end end
#=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #===============================================================================
#-------------------------------------------------------------------------- # create_command_list #-------------------------------------------------------------------------- def create_command_list commands = [] @ex_cmds = {} index_list = {} YE::REDUX::MENU::MENU_COMMANDS.each_with_index { |c, i| case c when 0 # Items index_list[:item] = commands.size commands.push(Vocab.item)
when 1 # Skills index_list[:skill] = commands.size commands.push(Vocab.skill)
when 2 # Equip index_list[:equip] = commands.size commands.push(Vocab.equip)
when 3 # Status index_list[:status] = commands.size commands.push(Vocab.status)
when 4 # Save index_list[:save] = commands.size commands.push(Vocab.save)
when 5 # System index_list[:game_end] = commands.size commands.push(Vocab.game_end)
when 10 # KGC's Large Party next unless $imported["LargeParty"] index_list[:partyform] = commands.size @__command_partyform_index = commands.size commands.push(Vocab.partyform)
when 11 # KGC's AP Viewer next unless $imported["EquipLearnSkill"] index_list[:ap_viewer] = commands.size @__command_ap_viewer_index = commands.size commands.push(Vocab.ap_viewer)
when 12 # KGC's CP Skill System next unless $imported["SkillCPSystem"] index_list[:set_battle_skill] = commands.size @__command_set_battle_skill_index = commands.size commands.push(Vocab.set_battle_skill)
when 13 # KGC's Battle Difficulty next unless $imported["BattleDifficulty"] index_list[:set_difficulty] = commands.size @__command_set_difficulty_index = commands.size commands.push(KGC::BattleDifficulty.get[:name])
when 14 # KGC's Distribute Parameter next unless $imported["DistributeParameter"] index_list[:distribute_parameter] = commands.size @__command_distribute_parameter_index = commands.size commands.push(Vocab.distribute_parameter)
when 15 # KGC's Enemy Guide next unless $imported["EnemyGuide"] index_list[:enemy_guide] = commands.size @__command_enemy_guide_index = commands.size commands.push(Vocab.enemy_guide)
when 16 # KGC's Outline next unless $imported["Outline"] index_list[:outline] = commands.size @__command_outline_index = commands.size commands.push(Vocab.outline)
when 51 # Yanfly Subclass Class Change next unless $imported["SubclassSelectionSystem"] next unless YE::SUBCLASS::MENU_CLASS_CHANGE_OPTION next unless $game_switches[YE::SUBCLASS::ENABLE_CLASS_CHANGE_SWITCH] index_list[:classchange] = commands.size @command_class_change = commands.size commands.push(YE::SUBCLASS::MENU_CLASS_CHANGE_TITLE)
when 52 # Yanfly Subclass Learn Skill next unless $imported["SubclassSelectionSystem"] next unless YE::SUBCLASS::USE_JP_SYSTEM and YE::SUBCLASS::LEARN_SKILL_OPTION next unless $game_switches[YE::SUBCLASS::ENABLE_LEARN_SKILLS_SWITCH] index_list[:learnskill] = commands.size @command_learn_skill = commands.size commands.push(YE::SUBCLASS::LEARN_SKILL_TITLE)
when 53 # Yanfly Equip Skill System next unless $imported["EquipSkillSlots"] next unless $game_switches[YE::EQUIPSKILL::ENABLE_SLOTS_SWITCH] index_list[:equipskill] = commands.size @command_equip_skill = commands.size commands.push(YE::EQUIPSKILL::MENU_TITLE)
when 54 # Yanfly Bestiary next unless $imported["DisplayScannedEnemy"] next unless $game_switches[YE::MENU::MONSTER::BESTIARY_SWITCH] index_list[:bestiary] = commands.size @command_bestiary = commands.size commands.push(YE::MENU::MONSTER::BESTIARY_TITLE)
when 101..200 next unless YE::REDUX::MENU::COMMON_EVENTS.include?(c) common_event = YE::REDUX::MENU::COMMON_EVENTS[c] next if !$TEST and common_event[2] next if common_event[0] != nil and $game_switches[common_event[0]] index_list[c] = commands.size @ex_cmds[c] = commands.size commands.push(common_event[4])
else next unless YE::REDUX::MENU::IMPORTED_COMMANDS.include?(c) command_array = YE::REDUX::MENU::IMPORTED_COMMANDS[c] next if command_array[0] != nil and $game_switches[command_array[0]] index_list[c] = commands.size @ex_cmds[c] = commands.size commands.push(command_array[3])
end } # Do not remove this. $game_temp.menu_command_index = index_list return commands end
#-------------------------------------------------------------------------- # set_command_enabled #-------------------------------------------------------------------------- def set_command_enabled disable_items = [] @disabled_command_index = [] # If zero party members are present if $game_party.members.size == 0 disable_items.push(:item, :skill, :equip, :status, :partyform, :ap_viewer, :set_battle_skill, :distribute_parameter, :classchange, :learnskill, :equipskill) end # If saving has been disabled if $game_system.save_disabled disable_items.push(:save) end # If party changing is disabled if $imported["LargeParty"] and !$game_party.partyform_enable? disable_items.push(:partyform) end for key in YE::REDUX::MENU::COMMON_EVENTS next unless $game_temp.menu_command_index.has_key?(key[0]) next if key[1][1] == nil disable_items.push(key[0]) if $game_switches[key[1][1]] end for key in YE::REDUX::MENU::IMPORTED_COMMANDS next unless $game_temp.menu_command_index.has_key?(key[0]) next if key[1][1] == nil disable_items.push(key[0]) if $game_switches[key[1][1]] end # Disable each of the items. disable_items.each { |i| if $game_temp.menu_command_index.has_key?(i) index = $game_temp.menu_command_index[i] @command_window.draw_item(index, false) @disabled_command_index.push(index) end } end
#-------------------------------------------------------------------------- # overwrite update_command_selection #-------------------------------------------------------------------------- def update_command_selection if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::C) index = @command_window.index unless command_enabled?(index) Sound.play_buzzer return end Sound.play_decision case index # Item Command when $game_temp.menu_command_index[:item] $scene = Scene_Item.new # Skill, Equip, and Status Commands when $game_temp.menu_command_index[:skill], $game_temp.menu_command_index[:equip], $game_temp.menu_command_index[:status] start_actor_selection # Save Command when $game_temp.menu_command_index[:save] $scene = Scene_File.new(true, false, false) # System Command when $game_temp.menu_command_index[:game_end] $scene = Scene_End.new else # Custom Commands return_check = true for key in @ex_cmds if @ex_cmds[key[0]] == index return_check = false found_key = key[0] break end end return if return_check if found_key >= 101 and found_key <= 200 # Play a common event common_event = YE::REDUX::MENU::COMMON_EVENTS[found_key] $game_temp.common_event_id = common_event[3] $scene = Scene_Map.new else # Play an imported scene menu_command = YE::REDUX::MENU::IMPORTED_COMMANDS[found_key] if menu_command[2] start_actor_selection else $scene = eval(menu_command[4] + ".new") end end # End found_key end # End case check end end
#-------------------------------------------------------------------------- # overwrite update_actor_selection #-------------------------------------------------------------------------- def update_actor_selection if Input.trigger?(Input::B) Sound.play_cancel end_actor_selection elsif Input.trigger?(Input::C) $game_party.last_actor_index = @status_window.index Sound.play_decision case @command_window.index when $game_temp.menu_command_index[:skill] # Skill Command $scene = Scene_Skill.new(@status_window.index) when $game_temp.menu_command_index[:equip] # Equip Command $scene = Scene_Equip.new(@status_window.index) when $game_temp.menu_command_index[:status] # Status Command $scene = Scene_Status.new(@status_window.index) else # Custom Commands return_check = true for key in @ex_cmds if @ex_cmds[key[0]] == @command_window.index return_check = false found_key = key[0] break end end return if return_check menu_command = YE::REDUX::MENU::IMPORTED_COMMANDS[found_key] $scene = eval(menu_command[4] + ".new(@status_window.index)") end end end
#-------------------------------------------------------------------------- # command_enabled? #-------------------------------------------------------------------------- def command_enabled?(index) if $game_system.save_disabled and index == $game_temp.menu_command_index[:save] return false end if $game_party.members.size == 0 and @disabled_command_index.include?(index) return false end for key in @ex_cmds if @ex_cmds[key[0]] == index return false if @disabled_command_index.include?(index) end end return true end
#-------------------------------------------------------------------------- # alias start #-------------------------------------------------------------------------- alias start_menurd start unless $@ def start start_menurd if YE::REDUX::MENU::USE_REDUX_STATUS @status_window.dispose @status_window = Window_ReDuxMenuStatus.new(160, 0) end if YE::REDUX::MENU::USE_MULTI_VARIABLE_WINDOW @gold_window.dispose @gold_window = Window_MultiVariableWindow.new end if YE::REDUX::MENU::RIGHT_SIDE_COMMAND @status_window.x = 0 @command_window.x = Graphics.width - 160 @gold_window.x = Graphics.width - 160 end end
#-------------------------------------------------------------------------- # overwrite update_call_menu #-------------------------------------------------------------------------- def update_call_menu if Input.trigger?(YE::REDUX::MENU::MENU_BUTTON) return if $game_map.interpreter.running? return if $game_system.menu_disabled $game_temp.menu_beep = true $game_temp.next_scene = "menu" end end
end # Scene_Map
#============================================================================== # Imported from KGC's Custom Menu Command # to improve compatibility amongst KGC scripts #============================================================================== $imported["CustomMenuCommand"] = true class Game_Temp attr_accessor :menu_command_index attr_accessor :next_scene_actor_index
alias initialize_KGC_CustomMenuCommand initialize unless $@ def initialize initialize_KGC_CustomMenuCommand
@menu_command_index = {} @next_scene_actor_index = 0 end end
module KGC module Commands module_function def call_item return if $game_temp.in_battle $game_temp.next_scene = :menu_item $game_temp.next_scene_actor_index = 0 $game_temp.menu_command_index = {} end def call_skill(actor_index = 0) return if $game_temp.in_battle $game_temp.next_scene = :menu_skill $game_temp.next_scene_actor_index = actor_index $game_temp.menu_command_index = {} end def call_equip(actor_index = 0) return if $game_temp.in_battle $game_temp.next_scene = :menu_equip $game_temp.next_scene_actor_index = actor_index $game_temp.menu_command_index = {} end def call_status(actor_index = 0) return if $game_temp.in_battle $game_temp.next_scene = :menu_status $game_temp.next_scene_actor_index = actor_index $game_temp.menu_command_index = {} end end end
class Game_Interpreter include KGC::Commands end
class Scene_Map < Scene_Base alias update_scene_change_KGC_CustomMenuCommand update_scene_change unless $@ def update_scene_change return if $game_player.moving? case $game_temp.next_scene when :menu_item call_menu_item when :menu_skill call_menu_skill when :menu_equip call_menu_equip when :menu_status call_menu_status else update_scene_change_KGC_CustomMenuCommand end end def call_menu_item $game_temp.next_scene = nil $scene = Scene_Item.new end def call_menu_skill $game_temp.next_scene = nil $scene = Scene_Skill.new($game_temp.next_scene_actor_index) $game_temp.next_scene_actor_index = 0 end def call_menu_equip $game_temp.next_scene = nil $scene = Scene_Equip.new($game_temp.next_scene_actor_index) $game_temp.next_scene_actor_index = 0 end def call_menu_status $game_temp.next_scene = nil $scene = Scene_Status.new($game_temp.next_scene_actor_index) $game_temp.next_scene_actor_index = 0 end end
class Scene_Item < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:item) $scene = Scene_Menu.new($game_temp.menu_command_index[:item]) else $scene = Scene_Map.new end end end
unless $imported["SceneSkillReDux"] class Scene_Skill < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:skill) $scene = Scene_Menu.new($game_temp.menu_command_index[:skill]) else $scene = Scene_Map.new end end end end
unless $imported["SceneEquipReDux"] class Scene_Equip < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:equip) $scene = Scene_Menu.new($game_temp.menu_command_index[:equip]) else $scene = Scene_Map.new end end end end
unless $imported["SceneStatusReDux"] class Scene_Status < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:status) $scene = Scene_Menu.new($game_temp.menu_command_index[:status]) else $scene = Scene_Map.new end end end end
class Scene_File < Scene_Base alias return_scene_KGC_CustomMenuCommand return_scene unless $@ def return_scene if @from_title || @from_event return_scene_KGC_CustomMenuCommand elsif $game_temp.menu_command_index.has_key?(:save) $scene = Scene_Menu.new($game_temp.menu_command_index[:save]) else $scene = Scene_Map.new end end end
class Scene_End < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:game_end) $scene = Scene_Menu.new($game_temp.menu_command_index[:game_end]) else $scene = Scene_Map.new end end end
#-------------------------------------------------------------------------- # map name #-------------------------------------------------------------------------- unless method_defined?(:map_name) def map_name data = load_data("Data/MapInfos.rvdata") text = data[@map_id].name.gsub(/\[.*\]/) { "" } return text end end
#-------------------------------------------------------------------------- # Now Exp - The experience gained for the current level. #-------------------------------------------------------------------------- def now_exp return @exp - @exp_list[@level] end
#-------------------------------------------------------------------------- # Next Exp - The experience needed for the next level. #-------------------------------------------------------------------------- def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end
#-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh @item_max = $game_party.members.size create_contents fill_stand_by_background if $imported["LargeParty"] for actor in $game_party.members draw_rd_menu_actor(actor) x = 104 y = actor.index * 96 draw_actor_name(actor, x, y) draw_actor_class(actor, x + 120, y) draw_actor_level(actor, x, y + WLH * 1) draw_actor_state(actor, x, y + WLH * 2) draw_actor_hp(actor, x + 120, y + WLH * 1, 120) draw_actor_mp(actor, x + 120, y + WLH * 2, 120) draw_rd_menu_exp(actor, x + 120, y + WLH * 3, 120) end end
#-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh @data = [] for i in YE::REDUX::MENU::VARIABLES_SHOWN next unless YE::REDUX::MENU::VARIABLES_HASH.include?(i) @time_index = @data.size if i == -1 @data.push(i) end @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end
#-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) sw = self.width - 32 dy = WLH * index self.contents.clear_rect(rect) i = @data[index] case i when -5 # Draw Map Name self.contents.draw_text(0, dy, sw, WLH, $game_map.map_name, 1)
when -2 # Draw Steps if YE::REDUX::MENU::VARIABLES_ICONS text = $game_party.steps self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YE::REDUX::MENU::VARIABLES_HASH[-2][0], sw-24, dy) else text = YE::REDUX::MENU::VARIABLES_HASH[-2][1] value = $game_party.steps cx = contents.text_size(text).width self.contents.font.color = normal_color self.contents.draw_text(0, dy, sw-cx-2, WLH, value, 2) self.contents.font.color = system_color self.contents.draw_text(0, dy, sw, WLH, text, 2) end
when -1 # Draw Time if YE::REDUX::MENU::VARIABLES_ICONS text = game_time self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YE::REDUX::MENU::VARIABLES_HASH[-1][0], sw-24, dy) else self.contents.font.color = normal_color text = game_time self.contents.draw_text(0, dy, sw, WLH, text, 1) end
when 0 # Draw Gold if YE::REDUX::MENU::VARIABLES_ICONS text = $game_party.gold self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YE::REDUX::MENU::VARIABLES_HASH[0][0], sw-24, dy) else draw_currency_value($game_party.gold, 4, dy, 120) end
else # Draw Variables if YE::REDUX::MENU::VARIABLES_ICONS text = $game_variables[i] self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YE::REDUX::MENU::VARIABLES_HASH[i][0], sw-24, dy) else text = YE::REDUX::MENU::VARIABLES_HASH[i][1] value = $game_variables[i] cx = contents.text_size(text).width self.contents.font.color = normal_color self.contents.draw_text(0, dy, sw-cx-2, WLH, value, 2) self.contents.font.color = system_color self.contents.draw_text(0, dy, sw, WLH, text, 2) end end end
#-------------------------------------------------------------------------- # update #-------------------------------------------------------------------------- if YE::REDUX::MENU::VARIABLES_SHOWN.include?(-1) def update if @gametime != (Graphics.frame_count / Graphics.frame_rate) draw_item(@time_index) end end end
end # Window_MultiVariableWindow
#=============================================================================== # # END OF FILE # #===============================================================================
si possible, je voudrais que le choix n'apparaissent pas tout en bas!
merci d'avance!
lyam7777
Habitant Lv.6
Age : 24 Inscrit le : 01/03/2011 Messages : 120
Sujet: Re: mettre choix "quete" menu Mer 25 Mai 2011 - 15:46
Up: si vous plait! je suis nul en script et j'en ai vraiment besoin!
Zangther
Maître des Duels
Age : 32 Inscrit le : 29/07/2009 Messages : 7841
Sujet: Re: mettre choix "quete" menu Mer 25 Mai 2011 - 16:26
C'est marqué dans le script pourtant. Suffit d'essayer un peu de comprendre l'anglais et tu verra comment faire.
Garruk
Aventurier Lv.16
Age : 40 Inscrit le : 03/09/2009 Messages : 1503
Sujet: Re: mettre choix "quete" menu Mer 25 Mai 2011 - 18:55
Comme ça. Par contre je n'ai pas testé, je n'ai pas les images du script.
Code:
#=============================================================================== # # Yanfly Engine RD - Scene Menu ReDux + KGC Custom Menu Command # Last Date Updated: 2009.06.22 # Level: Normal, Hard, Lunatic # # This is more or less a revision of the menu scene. Included in the script are # a couple of features. Note that I will NOT take credit for KGC's custom menu # command script as all I did was merely import it into this script and finished # up the excluded functions that he's left behind. Everything else I did add # to the script. # # COMMAND CONTROL - by KGC # Add, remove, and re-order commands akin to KGC's CustomMenuCommands. Akin to # this feature will include what KGC's original script was missing and that was # easy functionality to include custom menu commands without hassling the core # script itself. Also added is the ability to launch common events from the # main menu itself for those who wish to event unique commands. # # REDUX MENUS # The redux menus are completely optional and are mostly nothing other than # visual changes to the menu scene. You can add icons to the command window, # display more than just gold on the main menu screen, and added experience # bars to the party window. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.06.22 - Fixed time calculation. # o 2009.06.10 - Added Time, Steps, and Map Name to MultiVariable Window. # o 2009.06.06 - Finished script. # o 2009.06.05 - Started script. #=============================================================================== # Instructions #=============================================================================== # # Note that the placement of this script is extremely important. # # 1. Place all of the non-KGC and non-Yanfly scripts that have new scenes above # this script. That way, they will not alter the menu. # 2. Place all KGC and Yanfly scripts below this script to develop compatibility # amongst all of the scripts. # # Note that the special rules other scripts may use to disable their respective # commands will not follow those rules. You'll have to mimic them through usage # of switches. Make sure you understand how and when those scripts disable their # own commands before toggling your switches. # # Scroll down to MENU_COMMANDS to add/remove/reorder your own menu commands. # Adjust any of the ReDux menu options if desired. # #=============================================================================== # # Compatibility # - Works With: KGC scripts, Yanfly scripts, etc. # - Alias: Game_Temp, initialize # - Overwrites: Scene_Menu: anything regarding command window # - Overwrites: Scene_Equip, Scene_Skill, and Scene_Status's return_scene # #=============================================================================== # Credits: # All credits will go to KGC as I did not write the majority of this code. # KGC for Custom Menu Command base coding and pretty much everything. #===============================================================================
$imported = {} if $imported == nil $imported["SceneMenuReDux"] = true
module YE module REDUX module MENU
#----------------------------------------------------------------------- # BASIC MENU FUNCTIONS #-----------------------------------------------------------------------
# This adjusts the input button used to call the main menu. By default, # the input command is Input::B. MENU_BUTTON = Input::B
# The following determines which option the menu will place the cursor # at whenever launched. START_INDEX = 0
# This will place the command window on the right hand side and all the # rest on the left hand side if set to true. RIGHT_SIDE_COMMAND = false
#----------------------------------------------------------------------- # Instructions on how to set up the MENU_COMMANDS order. #------------------------------------------------------------------------ # This array will let you determine how you want your menu command list # to be ordered. Each command is assigned a number and these are the # following numbers. The following are the default menu commands: # # 0..Items 1..Skills 2..Equipment 3..Status 4..Save 5..System # # The following are imports from KGC's original CustomMenuCommand. # # 10: Party .............. KGC_LargeParty # 11: View AP ............ KGC_EquipLearnSkill # 12: Skill Slots ........ KGC_SkillCPSystem # 13: Difficulty ......... KGC_BattleDifficulty # 14: Level Up ........... KGC_DistributeParameter # 15: Bestiary ........... KGC_MonsterGuide # 16: Outline ............ KGC_Outline # # The following are menu items for Yanfly Engine ReDux scripts. # # 51: Change Class ....... Yanfly's Subclass Selection System # 52: Learn Skill ........ Yanfly's Subclass Selection System # 53: Skill Slots ........ Yanfly's Equip Skill Slots # 54: Bestiary ........... Yanfly's Bestiary + Display Scanned Enemy # # For commands 101 to 200, common events can be bound. Make sure you # set up the COMMON_EVENTS hash to get the right common events you want. # # From command 201 and onward, custom scripted scenes can be launched. # Already imported are a few rather popular scripts found throughout the # RPG Maker VX community. # # 201: Quest Journal ..... Modern Algebra's Quest Journal # 202: Factions .......... SojaBird's Factions # 203: Rows .............. originalwij's Row Changer # 204: Record Window ..... Stilleas' Record Window # 205: Crafting .......... Cmpsr2000's Crafting Scene # # If you wish to add your own commands, you'll need to register them # under the lunatic mode portion of the script. #----------------------------------------------------------------------- MENU_COMMANDS =[ # Make sure you've read the instructions above. 0, # Items 1, # Skills 2, # Equipment 3, # Status 54, # Bestiary 101, # Common-Event 9 102, # Common-Event 10 4, # Save 5, # System 6, # Quête ] # Do not remove this
# The following determines the maximum number of displayed rows for the # customized command window. MAX_ROWS = 10
#----------------------------------------------------------------------- # How to Use: Lunatic Mode - Menu Command - Common Events #----------------------------------------------------------------------- # The following allows you to bind common events to the menu commands. # When a common event is selected, it will exit the menu, go back to the # map screen, and launch the common event there. Bind these ID's from # 101 to 200. Here is what each of the categories mean: # # HideSw - Switch used to hide the command. Set to nil if not used. # DisbSw - Switch used to disable the command. Set to nil if not used. # Debug? - Only appears in test mode. Does not appear in normal play. # CEvent - The ID of the common event that will be launched. # Title - The title text that appears for the event. # # After binding your common events to ID's, go back to MENU_COMMANDS # and insert the proper command ID at the proper location. #----------------------------------------------------------------------- COMMON_EVENTS ={ # These can only be from 101 to 199. # -ID => [HideSw, DisbSw, Debug?, CEvent, Title Name] 101 => [ nil, nil, true, 9, "Debug"], 102 => [ nil, nil, false, 10, "Camp"], } # Do not remove this.
#----------------------------------------------------------------------- # How to Use: Lunatic Mode - Menu Command - Imported Scripts #----------------------------------------------------------------------- # The following is what KGC originally was going to have in his script # but was actually missing it in his publicized script. This will regain # functionality and also lift the "limit" of only 100 extra commands. # The following will explain how to set up the individual options. # # HideSw - Switch used to hide the command. Set to nil if not used. # DisbSw - Switch used to disable the command. Set to nil if not used. # Actor? - Does this select an actor. Set to true if it does. # Title - The title text that appears for the event. # Scene - The scene used to launch the respective scene. # # Note that this does not automatically detect what will and will not # disable the command ingame. You must understand and create a work # around with them (if they do disable the commands) with switches. # After binding your imported commands, go back to MENU_COMMANDS and # insert the proper command ID at the proper location. #----------------------------------------------------------------------- IMPORTED_COMMANDS ={ # These can only be from 201 onward. # -ID => [HideSw, DisbSw, Actor?, Title Name, Scene Name.new] 201 => [ 8, 9, false, "Quests", "Scene_Quest"], 202 => [ 10, 11, false, "Factions", "Scene_Factions"], 203 => [ nil, nil, false, "Rows", "Scene_Row"], 204 => [ nil, nil, false, "Records", "Scene_Record"], 205 => [ nil, nil, false, "Crafting", "Scene_Crafting"], } # Do not remove this.
#----------------------------------------------------------------------- # REDUX MENU FUNCTIONS #-----------------------------------------------------------------------
# For those who would like to add icons to their commands, set this to # true, then go to ICON_SETS and bind text to the icon desired. COMMAND_ICONS = true
# Match the ingame command names with the icons. The reason this isn't # implemented together with the index numbers is because this can allow # for varying icons dependent on the command name (such as difficulty). ICON_SETS ={ # "Unlisted" must exist for the unlisted commands. "Unlisted" => 176, # -----Vocab----- => Icon "Bestiary" => 141, "Camp" => 77, "Class Change" => 131, "Equip" => 44, "Item" => 144, "Learn Skills" => 133, "Quests" => 193, "Save" => 149, "Shutdown" => 154, "Slots" => 103, "Skill" => 159, "Status" => 137, "System" => 134, "Quête" => 133, # Icon que tu veux pour ton menu } # Do not remove this.
# This part will trigger usage of the "new" party status window. Set it # to false if you do not wish to use it. The "new" status window simply # adds the experience bar to the menu and raises the coordinates of the # various status items by a little bit. USE_REDUX_STATUS = true
# This part will adjust the font size for the text shown in the Redux # Status Menu. Affects all text. REDUX_FONT_SIZE = 20
# The following determines how things are shown on the Redux Status Menu. DRAWN_ACTOR_SETUP = 0 # 0 - Face only, 1 - Sprite only, 2 - Both SPRITE_OFFSET = 32 # Sets the y offset for actor sprites FACE_OPACITY = 128 # Sets the face opacity for setting 2
# The following adjusts the EXP bar. Fill out the info properly. EXP_TEXT = "EXP" # Text used for EXP PERCENT_EXP = "%#.04g%%" # Text format used for EXP percentage EXP_GAUGE_1 = 28 # Colour 1 for the EXP Gauge EXP_GAUGE_2 = 29 # Colour 2 for the EXP Gauge
# This part adjusts the multi-variable window. It will replace the gold # window and allows you to display multiple variables (including gold) in # the small bow at the bottom of the screen. USE_MULTI_VARIABLE_WINDOW = true
# Variables will be shown in this order. Use 0 to show gold. Adjust the # following information as seen necessary. VARIABLES_SHOWN = [-5, -1, -2, 0, 1] VARIABLES_ICONS = true VARIABLES_HASH ={ # Note that value zero must exist. # VarID => [Icon, Text] -5 => [ 153, "Map"], -2 => [ 48, "Steps"], -1 => [ 188, "Time"], 0 => [ 205, "Gold"], 1 => [ 200, "Jewels"], }# Do not remove this.
end end end
#=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #===============================================================================
#-------------------------------------------------------------------------- # create_command_list #-------------------------------------------------------------------------- def create_command_list commands = [] @ex_cmds = {} index_list = {} YE::REDUX::MENU::MENU_COMMANDS.each_with_index { |c, i| case c when 0 # Items index_list[:item] = commands.size commands.push(Vocab.item)
when 1 # Skills index_list[:skill] = commands.size commands.push(Vocab.skill)
when 2 # Equip index_list[:equip] = commands.size commands.push(Vocab.equip)
when 3 # Status index_list[:status] = commands.size commands.push(Vocab.status)
when 4 # Save index_list[:save] = commands.size commands.push(Vocab.save)
when 5 # System index_list[:game_end] = commands.size commands.push(Vocab.game_end)
when 6 index_list[:quest] = commands.size commands.push("Quête")
when 10 # KGC's Large Party next unless $imported["LargeParty"] index_list[:partyform] = commands.size @__command_partyform_index = commands.size commands.push(Vocab.partyform)
when 11 # KGC's AP Viewer next unless $imported["EquipLearnSkill"] index_list[:ap_viewer] = commands.size @__command_ap_viewer_index = commands.size commands.push(Vocab.ap_viewer)
when 12 # KGC's CP Skill System next unless $imported["SkillCPSystem"] index_list[:set_battle_skill] = commands.size @__command_set_battle_skill_index = commands.size commands.push(Vocab.set_battle_skill)
when 13 # KGC's Battle Difficulty next unless $imported["BattleDifficulty"] index_list[:set_difficulty] = commands.size @__command_set_difficulty_index = commands.size commands.push(KGC::BattleDifficulty.get[:name])
when 14 # KGC's Distribute Parameter next unless $imported["DistributeParameter"] index_list[:distribute_parameter] = commands.size @__command_distribute_parameter_index = commands.size commands.push(Vocab.distribute_parameter)
when 15 # KGC's Enemy Guide next unless $imported["EnemyGuide"] index_list[:enemy_guide] = commands.size @__command_enemy_guide_index = commands.size commands.push(Vocab.enemy_guide)
when 16 # KGC's Outline next unless $imported["Outline"] index_list[:outline] = commands.size @__command_outline_index = commands.size commands.push(Vocab.outline)
when 51 # Yanfly Subclass Class Change next unless $imported["SubclassSelectionSystem"] next unless YE::SUBCLASS::MENU_CLASS_CHANGE_OPTION next unless $game_switches[YE::SUBCLASS::ENABLE_CLASS_CHANGE_SWITCH] index_list[:classchange] = commands.size @command_class_change = commands.size commands.push(YE::SUBCLASS::MENU_CLASS_CHANGE_TITLE)
when 52 # Yanfly Subclass Learn Skill next unless $imported["SubclassSelectionSystem"] next unless YE::SUBCLASS::USE_JP_SYSTEM and YE::SUBCLASS::LEARN_SKILL_OPTION next unless $game_switches[YE::SUBCLASS::ENABLE_LEARN_SKILLS_SWITCH] index_list[:learnskill] = commands.size @command_learn_skill = commands.size commands.push(YE::SUBCLASS::LEARN_SKILL_TITLE)
when 53 # Yanfly Equip Skill System next unless $imported["EquipSkillSlots"] next unless $game_switches[YE::EQUIPSKILL::ENABLE_SLOTS_SWITCH] index_list[:equipskill] = commands.size @command_equip_skill = commands.size commands.push(YE::EQUIPSKILL::MENU_TITLE)
when 54 # Yanfly Bestiary next unless $imported["DisplayScannedEnemy"] next unless $game_switches[YE::MENU::MONSTER::BESTIARY_SWITCH] index_list[:bestiary] = commands.size @command_bestiary = commands.size commands.push(YE::MENU::MONSTER::BESTIARY_TITLE)
when 101..200 next unless YE::REDUX::MENU::COMMON_EVENTS.include?(c) common_event = YE::REDUX::MENU::COMMON_EVENTS[c] next if !$TEST and common_event[2] next if common_event[0] != nil and $game_switches[common_event[0]] index_list[c] = commands.size @ex_cmds[c] = commands.size commands.push(common_event[4])
else next unless YE::REDUX::MENU::IMPORTED_COMMANDS.include?(c) command_array = YE::REDUX::MENU::IMPORTED_COMMANDS[c] next if command_array[0] != nil and $game_switches[command_array[0]] index_list[c] = commands.size @ex_cmds[c] = commands.size commands.push(command_array[3])
end } # Do not remove this. $game_temp.menu_command_index = index_list return commands end
#-------------------------------------------------------------------------- # set_command_enabled #-------------------------------------------------------------------------- def set_command_enabled disable_items = [] @disabled_command_index = [] # If zero party members are present if $game_party.members.size == 0 disable_items.push(:item, :skill, :equip, :status, :partyform, :ap_viewer, :set_battle_skill, :distribute_parameter, :classchange, :learnskill, :equipskill) end # If saving has been disabled if $game_system.save_disabled disable_items.push(:save) end # If party changing is disabled if $imported["LargeParty"] and !$game_party.partyform_enable? disable_items.push(:partyform) end for key in YE::REDUX::MENU::COMMON_EVENTS next unless $game_temp.menu_command_index.has_key?(key[0]) next if key[1][1] == nil disable_items.push(key[0]) if $game_switches[key[1][1]] end for key in YE::REDUX::MENU::IMPORTED_COMMANDS next unless $game_temp.menu_command_index.has_key?(key[0]) next if key[1][1] == nil disable_items.push(key[0]) if $game_switches[key[1][1]] end # Disable each of the items. disable_items.each { |i| if $game_temp.menu_command_index.has_key?(i) index = $game_temp.menu_command_index[i] @command_window.draw_item(index, false) @disabled_command_index.push(index) end } end
#-------------------------------------------------------------------------- # overwrite update_command_selection #-------------------------------------------------------------------------- def update_command_selection if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::C) index = @command_window.index unless command_enabled?(index) Sound.play_buzzer return end Sound.play_decision case index # Item Command when $game_temp.menu_command_index[:item] $scene = Scene_Item.new # Skill, Equip, and Status Commands when $game_temp.menu_command_index[:skill], $game_temp.menu_command_index[:equip], $game_temp.menu_command_index[:status] start_actor_selection # Save Command when $game_temp.menu_command_index[:save] $scene = Scene_File.new(true, false, false) when # Quest $game_temp.menu_command_index[:quest] $scene = Scene_Quest.new # System Command when $game_temp.menu_command_index[:game_end] $scene = Scene_End.new else # Custom Commands return_check = true for key in @ex_cmds if @ex_cmds[key[0]] == index return_check = false found_key = key[0] break end end return if return_check if found_key >= 101 and found_key <= 200 # Play a common event common_event = YE::REDUX::MENU::COMMON_EVENTS[found_key] $game_temp.common_event_id = common_event[3] $scene = Scene_Map.new else # Play an imported scene menu_command = YE::REDUX::MENU::IMPORTED_COMMANDS[found_key] if menu_command[2] start_actor_selection else $scene = eval(menu_command[4] + ".new") end end # End found_key end # End case check end end
#-------------------------------------------------------------------------- # overwrite update_actor_selection #-------------------------------------------------------------------------- def update_actor_selection if Input.trigger?(Input::B) Sound.play_cancel end_actor_selection elsif Input.trigger?(Input::C) $game_party.last_actor_index = @status_window.index Sound.play_decision case @command_window.index when $game_temp.menu_command_index[:skill] # Skill Command $scene = Scene_Skill.new(@status_window.index) when $game_temp.menu_command_index[:equip] # Equip Command $scene = Scene_Equip.new(@status_window.index) when $game_temp.menu_command_index[:status] # Status Command $scene = Scene_Status.new(@status_window.index) when $game_temp.menu_command_index[:quest] # Quête Command $scene = Scene_Quest.new(@status_window.index) else # Custom Commands return_check = true for key in @ex_cmds if @ex_cmds[key[0]] == @command_window.index return_check = false found_key = key[0] break end end return if return_check menu_command = YE::REDUX::MENU::IMPORTED_COMMANDS[found_key] $scene = eval(menu_command[4] + ".new(@status_window.index)") end end end
#-------------------------------------------------------------------------- # command_enabled? #-------------------------------------------------------------------------- def command_enabled?(index) if $game_system.save_disabled and index == $game_temp.menu_command_index[:save] return false end if $game_party.members.size == 0 and @disabled_command_index.include?(index) return false end for key in @ex_cmds if @ex_cmds[key[0]] == index return false if @disabled_command_index.include?(index) end end return true end
#-------------------------------------------------------------------------- # alias start #-------------------------------------------------------------------------- alias start_menurd start unless $@ def start start_menurd if YE::REDUX::MENU::USE_REDUX_STATUS @status_window.dispose @status_window = Window_ReDuxMenuStatus.new(160, 0) end if YE::REDUX::MENU::USE_MULTI_VARIABLE_WINDOW @gold_window.dispose @gold_window = Window_MultiVariableWindow.new end if YE::REDUX::MENU::RIGHT_SIDE_COMMAND @status_window.x = 0 @command_window.x = Graphics.width - 160 @gold_window.x = Graphics.width - 160 end end
#-------------------------------------------------------------------------- # overwrite update_call_menu #-------------------------------------------------------------------------- def update_call_menu if Input.trigger?(YE::REDUX::MENU::MENU_BUTTON) return if $game_map.interpreter.running? return if $game_system.menu_disabled $game_temp.menu_beep = true $game_temp.next_scene = "menu" end end
end # Scene_Map
#============================================================================== # Imported from KGC's Custom Menu Command # to improve compatibility amongst KGC scripts #============================================================================== $imported["CustomMenuCommand"] = true class Game_Temp attr_accessor :menu_command_index attr_accessor :next_scene_actor_index
alias initialize_KGC_CustomMenuCommand initialize unless $@ def initialize initialize_KGC_CustomMenuCommand
@menu_command_index = {} @next_scene_actor_index = 0 end end
module KGC module Commands module_function def call_item return if $game_temp.in_battle $game_temp.next_scene = :menu_item $game_temp.next_scene_actor_index = 0 $game_temp.menu_command_index = {} end def call_skill(actor_index = 0) return if $game_temp.in_battle $game_temp.next_scene = :menu_skill $game_temp.next_scene_actor_index = actor_index $game_temp.menu_command_index = {} end def call_equip(actor_index = 0) return if $game_temp.in_battle $game_temp.next_scene = :menu_equip $game_temp.next_scene_actor_index = actor_index $game_temp.menu_command_index = {} end def call_status(actor_index = 0) return if $game_temp.in_battle $game_temp.next_scene = :menu_status $game_temp.next_scene_actor_index = actor_index $game_temp.menu_command_index = {} end end end
class Game_Interpreter include KGC::Commands end
class Scene_Map < Scene_Base alias update_scene_change_KGC_CustomMenuCommand update_scene_change unless $@ def update_scene_change return if $game_player.moving? case $game_temp.next_scene when :menu_item call_menu_item when :menu_skill call_menu_skill when :menu_equip call_menu_equip when :menu_status call_menu_status else update_scene_change_KGC_CustomMenuCommand end end def call_menu_item $game_temp.next_scene = nil $scene = Scene_Item.new end def call_menu_skill $game_temp.next_scene = nil $scene = Scene_Skill.new($game_temp.next_scene_actor_index) $game_temp.next_scene_actor_index = 0 end def call_menu_equip $game_temp.next_scene = nil $scene = Scene_Equip.new($game_temp.next_scene_actor_index) $game_temp.next_scene_actor_index = 0 end def call_menu_status $game_temp.next_scene = nil $scene = Scene_Status.new($game_temp.next_scene_actor_index) $game_temp.next_scene_actor_index = 0 end end
class Scene_Item < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:item) $scene = Scene_Menu.new($game_temp.menu_command_index[:item]) else $scene = Scene_Map.new end end end
unless $imported["SceneSkillReDux"] class Scene_Skill < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:skill) $scene = Scene_Menu.new($game_temp.menu_command_index[:skill]) else $scene = Scene_Map.new end end end end
unless $imported["SceneEquipReDux"] class Scene_Equip < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:equip) $scene = Scene_Menu.new($game_temp.menu_command_index[:equip]) else $scene = Scene_Map.new end end end end
unless $imported["SceneStatusReDux"] class Scene_Status < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:status) $scene = Scene_Menu.new($game_temp.menu_command_index[:status]) else $scene = Scene_Map.new end end end end
class Scene_File < Scene_Base alias return_scene_KGC_CustomMenuCommand return_scene unless $@ def return_scene if @from_title || @from_event return_scene_KGC_CustomMenuCommand elsif $game_temp.menu_command_index.has_key?(:save) $scene = Scene_Menu.new($game_temp.menu_command_index[:save]) else $scene = Scene_Map.new end end end
class Scene_End < Scene_Base def return_scene if $game_temp.menu_command_index.has_key?(:game_end) $scene = Scene_Menu.new($game_temp.menu_command_index[:game_end]) else $scene = Scene_Map.new end end end
#-------------------------------------------------------------------------- # map name #-------------------------------------------------------------------------- unless method_defined?(:map_name) def map_name data = load_data("Data/MapInfos.rvdata") text = data[@map_id].name.gsub(/\[.*\]/) { "" } return text end end
#-------------------------------------------------------------------------- # Now Exp - The experience gained for the current level. #-------------------------------------------------------------------------- def now_exp return @exp - @exp_list[@level] end
#-------------------------------------------------------------------------- # Next Exp - The experience needed for the next level. #-------------------------------------------------------------------------- def next_exp return @exp_list[@level+1] > 0 ? @exp_list[@level+1] - @exp_list[@level] : 0 end
#-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh @item_max = $game_party.members.size create_contents fill_stand_by_background if $imported["LargeParty"] for actor in $game_party.members draw_rd_menu_actor(actor) x = 104 y = actor.index * 96 draw_actor_name(actor, x, y) draw_actor_class(actor, x + 120, y) draw_actor_level(actor, x, y + WLH * 1) draw_actor_state(actor, x, y + WLH * 2) draw_actor_hp(actor, x + 120, y + WLH * 1, 120) draw_actor_mp(actor, x + 120, y + WLH * 2, 120) draw_rd_menu_exp(actor, x + 120, y + WLH * 3, 120) end end
#-------------------------------------------------------------------------- # refresh #-------------------------------------------------------------------------- def refresh @data = [] for i in YE::REDUX::MENU::VARIABLES_SHOWN next unless YE::REDUX::MENU::VARIABLES_HASH.include?(i) @time_index = @data.size if i == -1 @data.push(i) end @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end
#-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index) rect = item_rect(index) sw = self.width - 32 dy = WLH * index self.contents.clear_rect(rect) i = @data[index] case i when -5 # Draw Map Name self.contents.draw_text(0, dy, sw, WLH, $game_map.map_name, 1)
when -2 # Draw Steps if YE::REDUX::MENU::VARIABLES_ICONS text = $game_party.steps self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YE::REDUX::MENU::VARIABLES_HASH[-2][0], sw-24, dy) else text = YE::REDUX::MENU::VARIABLES_HASH[-2][1] value = $game_party.steps cx = contents.text_size(text).width self.contents.font.color = normal_color self.contents.draw_text(0, dy, sw-cx-2, WLH, value, 2) self.contents.font.color = system_color self.contents.draw_text(0, dy, sw, WLH, text, 2) end
when -1 # Draw Time if YE::REDUX::MENU::VARIABLES_ICONS text = game_time self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YE::REDUX::MENU::VARIABLES_HASH[-1][0], sw-24, dy) else self.contents.font.color = normal_color text = game_time self.contents.draw_text(0, dy, sw, WLH, text, 1) end
when 0 # Draw Gold if YE::REDUX::MENU::VARIABLES_ICONS text = $game_party.gold self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YE::REDUX::MENU::VARIABLES_HASH[0][0], sw-24, dy) else draw_currency_value($game_party.gold, 4, dy, 120) end
else # Draw Variables if YE::REDUX::MENU::VARIABLES_ICONS text = $game_variables[i] self.contents.draw_text(0, dy, sw-24, WLH, text, 2) draw_icon(YE::REDUX::MENU::VARIABLES_HASH[i][0], sw-24, dy) else text = YE::REDUX::MENU::VARIABLES_HASH[i][1] value = $game_variables[i] cx = contents.text_size(text).width self.contents.font.color = normal_color self.contents.draw_text(0, dy, sw-cx-2, WLH, value, 2) self.contents.font.color = system_color self.contents.draw_text(0, dy, sw, WLH, text, 2) end end end
#-------------------------------------------------------------------------- # update #-------------------------------------------------------------------------- if YE::REDUX::MENU::VARIABLES_SHOWN.include?(-1) def update if @gametime != (Graphics.frame_count / Graphics.frame_rate) draw_item(@time_index) end end end
end # Window_MultiVariableWindow
#=============================================================================== # # END OF FILE # #===============================================================================