| Teh_Freak's Quest script | ||||||||||||||||||||
| This script is a tricky one to use, for a few reasons. 1. you need to put some edits into a few classes and you need to decide how many normal items you are going to create, because after a certain number, the items all become quest items. So, first off, in "Window_Item" find this: | ||||||||||||||||||||
| def initialize
super(0, 64, 640, 416) @column_max = 2 |
||||||||||||||||||||
| and add this under that: | ||||||||||||||||||||
| @quest_number = 33 #Teh_Freak - this is the item ID of the FIRST quest item | ||||||||||||||||||||
| I used 33, but you'll want to set it higher if you are, or have, making or made custom items. Now, we dont want to be able to sell these items now do we, so we go to 'Window_ShopSell' and add find this: | ||||||||||||||||||||
| def initialize
super(0, 128, 640, 352) @column_max = 2 |
||||||||||||||||||||
| and again, add this underneath that: | ||||||||||||||||||||
| @quest_number = 33 #Teh_Freak - this is the item ID of the FIRST quest item | ||||||||||||||||||||
| Now make a new class above 'Main' and call it Quest Window, then add this to it: | ||||||||||||||||||||
| #==============================================================================
# ? Window_Quest #------------------------------------------------------------------------------ # Based on Window_Item, with several changes #============================================================================== class Window_Quest < Window_Selectable #-------------------------------------------------------------------------- # ? ????????? #-------------------------------------------------------------------------- def initialize super(0, 0, 480, 480) @column_max = 1 @quest_number = 34 #Teh_Freak - this is the item ID of the FIRST quest item refresh self.index = 0 end #-------------------------------------------------------------------------- # ? ??????? #-------------------------------------------------------------------------- def item return @data[self.index] end #-------------------------------------------------------------------------- # ? ?????? #-------------------------------------------------------------------------- def refresh if self.contents != nil self.contents.dispose self.contents = nil end @data = [] for i in @quest_number...$data_items.size if $game_party.item_number(i) > 0 @data.push($data_items[i]) end end # ???? 0 ?????????????????????? @item_max = @data.size if @item_max > 0 self.contents = Bitmap.new(width - 32, row_max * 32) self.contents.font.name = "OldEnglish" self.contents.font.size = 20 for i in 0...@item_max draw_item(i) end end end #-------------------------------------------------------------------------- # ? ????? # index : ???? #-------------------------------------------------------------------------- def draw_item(index) item = @data[index] case item when RPG::Item number = $game_party.item_number(item.id) end if item.is_a?(RPG::Item) and $game_party.item_can_use?(item.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = index y = index * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(item.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, width, 32, item.description, 0) end end |
||||||||||||||||||||
| Now, any item after, Ill use 33 for this jus cuz thats what i use, 33 will now be a quest item. The description will be the quest items description, so make sure you label em right. Also, after you complete a quest, you might wanna make an item call "quests name" complete so that you know its completed. again, thats what i am doing with mine. but dont do that for quest items and such, jus the actual quests, youll see what I mean in the Demo. Now, to be abel to use this, we need to call the menu up. This only works throught the main menu so go to "Scene_Menu" press ctrl + a, come back to here, select all of this: **ONLY REPLACE THIS IF YOU DONT HAVE EDITATIONS TO "SCENE_MENU' ALREADY. IF YOU DO HAVE EDITATIONS, SKIP THIS PART!!!** | ||||||||||||||||||||
| #==============================================================================
# ? Scene_Menu #------------------------------------------------------------------------------ # ??????????????????? #============================================================================== class Scene_Menu #-------------------------------------------------------------------------- # ? ????????? # menu_index : ????????????? #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index end #-------------------------------------------------------------------------- # ? ????? #-------------------------------------------------------------------------- def main # ???????????? s1 = $data_system.words.item s2 = $data_system.words.skill s3 = $data_system.words.equip s4 = "Status" s5 = "Quest" s6 = "Save" s7 = "Exit" @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7]) @command_window.index = @menu_index @command_window.height = (5 * 32) + 64 # Allows scrolling # ??????? 0 ???? if $game_party.actors.size == 0 # ????????????????????? @command_window.disable_item(0) @command_window.disable_item(1) @command_window.disable_item(2) @command_window.disable_item(3) end # ???????? if $game_system.save_disabled # ????????? @command_window.disable_item(4) end # ????????????? @playtime_window = Window_PlayTime.new @playtime_window.x = 0 @playtime_window.y = 224 # ?????????? @steps_window = Window_Steps.new @steps_window.x = 0 @steps_window.y = 320 # ???????????? @gold_window = Window_Gold.new @gold_window.x = 0 @gold_window.y = 416 # ????????????? @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 #Teh_Freak - Quest Window @quest_window = Window_Quest.new @quest_window.visible = false @quest_window.x = 160 @quest_window.y = 0 # ????????? Graphics.transition # ?????? loop do # ???????? Graphics.update # ??????? Input.update # ?????? update # ???????????????? if $scene != self break end end # ????????? Graphics.freeze # ???????? @command_window.dispose @playtime_window.dispose @steps_window.dispose @quest_window.dispose @gold_window.dispose @status_window.dispose end #-------------------------------------------------------------------------- # ? ?????? #-------------------------------------------------------------------------- def update # ???????? @command_window.update @playtime_window.update @steps_window.update @quest_window.update @gold_window.update @status_window.update # ??????????????????: update_command ??? if @command_window.active update_command return end # Teh_Freak - update the quest window if @quest_window.active update_quest return end # ???????????????????: update_status ??? if @status_window.active update_status return end end #-------------------------------------------------------------------------- # ? Teh_Freak - Update Quest #-------------------------------------------------------------------------- def update_quest # If escape is pressed if Input.trigger?(Input::B) # do the sound effect $game_system.se_play($data_system.cancel_se) # switch windows to normal again @command_window.active = true @quest_window.active = false @quest_window.visible = false @status_window.visible = true return end end # END update_quest#-------------------------------------------------------------------------- # ? ?????? (??????????????????) #-------------------------------------------------------------------------- def update_command # B ?????????? if Input.trigger?(Input::B) # ????? SE ??? $game_system.se_play($data_system.cancel_se) # ?????????? $scene = Scene_Map.new return end # C ?????????? if Input.trigger?(Input::C) # ??????? 0 ?????????????????????? if $game_party.actors.size == 0 and @command_window.index < 4 # ??? SE ??? $game_system.se_play($data_system.buzzer_se) return end # ??????????????????? case @command_window.index when 0 # items # ?? SE ??? $game_system.se_play($data_system.decision_se) # ??????????? $scene = Scene_Item.new when 1 # skills # ?? SE ??? $game_system.se_play($data_system.decision_se) # ??????????????????? @command_window.active = false @status_window.active = true @status_window.index = 0 when 2 #equipment # ?? SE ??? $game_system.se_play($data_system.decision_se) # ??????????????????? @command_window.active = false @status_window.active = true @status_window.index = 0 when 3 # Status # ?? SE ??? $game_system.se_play($data_system.decision_se) # ??????????????????? @command_window.active = false @status_window.active = true @status_window.index = 0 when 4 # Teh_Freak - Quests Button $game_system.se_play($data_system.decision_se) @command_window.active = false @status_window.visible = false @quest_window.active = true @quest_window.visible = true when 5 #save # ???????? if $game_system.save_disabled # ??? SE ??? $game_system.se_play($data_system.buzzer_se) return end # ?? SE ??? $game_system.se_play($data_system.decision_se) # ?????????? $scene = Scene_Save.new when 6 # Exit $game_system.se_play($data_system.decision_se) $scene = Scene_End.new end end return end end #-------------------------------------------------------------------------- # ? ?????? (???????????????????) #-------------------------------------------------------------------------- def update_status # B ?????????? if Input.trigger?(Input::B) # ????? SE ??? $game_system.se_play($data_system.cancel_se) # ?????????????????? @command_window.active = true @status_window.active = false @status_window.index = -1 return end # C ?????????? if Input.trigger?(Input::C) # ??????????????????? case @command_window.index when 1 # ??? # ???????????? 2 ????? if $game_party.actors[@status_window.index].restriction >= 2 # ??? SE ??? $game_system.se_play($data_system.buzzer_se) return end # ?? SE ??? $game_system.se_play($data_system.decision_se) # ?????????? $scene = Scene_Skill.new(@status_window.index) when 2 # ?? # ?? SE ??? $game_system.se_play($data_system.decision_se) # ????????? $scene = Scene_Equip.new(@status_window.index) when 3 # ????? # ?? SE ??? $game_system.se_play($data_system.decision_se) # ???????????? $scene = Scene_Status.new(@status_window.index) end return end end #end |
||||||||||||||||||||
| Now, for those of you, who have editations to your 'Scene_Menu' already do this. After the last s# object add S# (where # is the number after the last object. So if you have an s5 this one is s6) = "Quest Window". in the line that has (s1, s2, s3, s4, s5 ect) add the s# from the quest window's line, so, if we continue with it being 6, its (s1, s2, s3, s4, s5, s6). Now, find the @dispose's and @update's in the "Scene_Menu' and add this t the respective group: @quest_window.dispose and @quest_window.update. Now, under: @status_window = Window_MenuStatus.new @status_window.x = 160 @status_window.y = 0 add this: #Teh_Freak - Quest Window @quest_window = Window_Quest.new @quest_window.visible = false @quest_window.x = 160 @quest_window.y = 0 Under this: update_command return end add this: # Teh_Freak - update the quest window if @quest_window.active update_quest return end Under this: if @status_window.active update_status return end end add this: #-------------------------------------------------------------------------- # ? Teh_Freak - Update Quest #-------------------------------------------------------------------------- def update_quest # If escape is pressed if Input.trigger?(Input::B) # do the sound effect $game_system.se_play($data_system.cancel_se) # switch windows to normal again @command_window.active = true @quest_window.active = false @quest_window.visible = false @status_window.visible = true return end end # END update_quest#-------------------------------------------------------------------------- and that should do it. Now, you might get an error in "Scene_Menu" If you do, and the erroring line is the last end in Scene_Menu, then comment it out by putting a # in front of it. |
||||||||||||||||||||