New account registrations are disabed. This website is now an archive. Read more here.

RPG Maker VX Ace    Posted April 1, 2013 by Leon

Quest/Mission Menu

Introduction

This script allows a good quest log for your game, allowing the player to track quests, see how many they've completed, etc.

Features

  • Keeps a tally of all known quests and how many have been completed.
  • Allows you to add or remove objectives.

Screenshots

    The Code

    License Terms

    Attribution 3.0 Unported - You must attribute the work in the manner specified by the author or licensor. Commerical use allowed.

    Instructions

    • Place the script in the ‘Materials’ section.
    • The script adds the first objective of the first mission automatically.
    • You must input all the information of your missions in the module marked: "Missions" There is an example in place.
    • To call the script, use: SceneManager.call(Scene_Mission)
    • Use the following syntaxes to affect the script:
    • To add a mission: $game_party.add_mis(mission_id)
    • To add an objective: $game_party.add_obj(mission_id, objective_id)
    • To remove an objective: $game_party.rem_obj(mission_id, objective_id)
    • To mark an objective complete: $game_party.add_comp_obj(mission_id, objective_id)
    • To mark a mission as complete: $game_party.comp_mis(mission_id)

    Credits & Thanks

    Moonpearl, for a small pearl of wisdom.
    Marked, for keeping GDUnimited alive
    RGangsta, for ACE.

    Terms & Conditions

    Credit Lizzie S

    Comments (35)

    • When I tried using it, I found that the mission description wasn't being updated when I went down/up over the list, showing always the description of the first mission.

      I corrected this problem (Refresh was not called at all after creating the window), and now it works very nice!

      Is there any way to submit the fix? 😀

    • Hey Lizzie S, the script you posted is really cool and I love the output format. I am experiencing the same issue that the member above was having where the description does not change when you have multiple quests available in the log. I am not very good with the code so I am unable to fix the problem, but he said that a refresh feature was needed. Is there any way that anyone can post this fix? Also, I cannot figure out how to add the quest log to the main menu screen so that the players can view the log at any time. Can you build that in on the next update? I really want to use your code for my game, I have already programmed in multiple quests and it would be a shame to have to start over. They all show up in the log fine, just can't see the different descriptions is all. I am working on an open world sandbox game with VX ACE for the first time and loving it. Keep up the great work!

    • Hi!!

      I will add the fix here as a comment, so Lizzie S can patch the file with it if she wants, and in the meantime any user having this problem can fix it.

      Modifications needed in the script to fix REFRESH issue:
      – Around line 195 you will see this block:
      def mission
      return @data[index]
      end
      You have to add the following code just below that:

      def index=(index)
      super
      @desc_window.refresh(@data[index]) unless @desc_window == nil
      end

      def setDescWindow(descWindow)
      @desc_window = descWindow
      end

      – Around line 343 you will see this block:

      def create_desc_window
      @desc_window = Window_MissionDesc.new
      @desc_window.refresh(@list_window.mission)
      end

      You have to SUBSTITUTE that 4 lines with these ones:

      def create_desc_window
      @desc_window = Window_MissionDesc.new
      @desc_window.refresh(@list_window.mission)
      @list_window.setDescWindow(@desc_window)
      end

      That makes it for the refresh thing(I think). I made a bit more modifications into the script to support more things, so I'm not completely sure this is all, but I hope it is. If someone tries it, please tell me if it works.

    • Pasting the fix here broke some of the tabs. When you put the code in the file, format it in the same way the rest of the code is formated(It's easy).

    • Hi!!

      I will also add how to put it in the menu 🙂

      1) Go to "Window_MenuCommand"
      2) Around line 43 you will see the following:

      #————————————————————————–
      # * Add Main Commands to List
      #————————————————————————–
      def add_main_commands
      add_command(Vocab::item, :item, main_commands_enabled)
      add_command(Vocab::skill, :skill, main_commands_enabled)
      add_command(Vocab::equip, :equip, main_commands_enabled)
      add_command(Vocab::status, :status, main_commands_enabled)
      end

      This block builds the main commands in the menu. We will add the quest log here, so this block will look like:

      #————————————————————————–
      # * Add Main Commands to List
      #————————————————————————–
      def add_main_commands
      add_command(Vocab::item, :item, main_commands_enabled)
      add_command(Vocab::skill, :skill, main_commands_enabled)
      add_command(Vocab::equip, :equip, main_commands_enabled)
      add_command(Vocab::status, :status, main_commands_enabled)
      add_command("Quest Log",:quests, main_commands_enabled)
      end

      3) Now go to "Scene_Menu"
      4) Around line 17 you will see the following:
      #————————————————————————–
      # * Create Command Window
      #————————————————————————–
      def create_command_window
      @command_window = Window_MenuCommand.new
      @command_window.set_handler(:item, method(:command_item))
      @command_window.set_handler(:skill, method(:command_personal))
      @command_window.set_handler(:equip, method(:command_personal))
      @command_window.set_handler(:status, method(:command_personal))
      @command_window.set_handler(:formation, method(:command_formation))
      @command_window.set_handler(:save, method(:command_save))
      @command_window.set_handler(:game_end, method(:command_game_end))
      @command_window.set_handler(:cancel, method(:return_scene))
      end

      This is where we say how to process each command added in the previous block, so we will add our quest log processor here. It will look like this after adding it:
      #————————————————————————–
      # * Create Command Window
      #————————————————————————–
      def create_command_window
      @command_window = Window_MenuCommand.new
      @command_window.set_handler(:item, method(:command_item))
      @command_window.set_handler(:skill, method(:command_personal))
      @command_window.set_handler(:equip, method(:command_personal))
      @command_window.set_handler(:status, method(:command_personal))
      @command_window.set_handler(:quests, method(:command_quests))
      @command_window.set_handler(:formation, method(:command_formation))
      @command_window.set_handler(:save, method(:command_save))
      @command_window.set_handler(:game_end, method(:command_game_end))
      @command_window.set_handler(:cancel, method(:return_scene))
      end

      5) Almost done! Around line 52, you will see the following:
      #————————————————————————–
      # * [Skill], [Equipment] and [Status] Commands
      #————————————————————————–
      def command_personal
      @status_window.select_last
      @status_window.activate
      @status_window.set_handler(:ok, method(:on_personal_ok))
      @status_window.set_handler(:cancel, method(:on_personal_cancel))
      end
      We will add our command just after this, so this piece will look like:
      #————————————————————————–
      # * [Skill], [Equipment] and [Status] Commands
      #————————————————————————–
      def command_personal
      @status_window.select_last
      @status_window.activate
      @status_window.set_handler(:ok, method(:on_personal_ok))
      @status_window.set_handler(:cancel, method(:on_personal_cancel))
      end
      #————————————————————————–
      # * [Quest] Command
      #————————————————————————–
      def command_quests
      SceneManager.call(Scene_Mission)
      end

      6) Done! Now upon opening the menu a new command "Quest Log" should appear, and it should open the quest log when clicking on it.

      I'm using a different menu system, so I may have made some mistake or something. Just as before, if someone tests it, please tell me if it works correctly or fails somewhere 🙂

    • FYI. PERFECT!
      Thank you so much for jumping to the task of getting these script fixes in. You did an amazing job of walking me through finding the pieces of code to alter and everything is working perfectly now. You are my hero.

    • @Lizzie, my fix was only like 7-8 lines, so not much difference with yours in that sense.

      Apart from that, my changes focus on the problem itself which is actually updating the description when the mission index changed.

      What you are doing is overriding all calls to update, and in the case it's a scroll force the refresh, which works, but is less efficient, as you will do the checks for all updates, and not only for the updates that caused an index change(Which is what my fix does, by overriding the index = (index) one.

      My posts were very long, but only because I explained everything putting a lot of code from before so it's clear for everyone, the change itself is very small.

      I found more bugs in the script, but it seems like you don't like/want feedback at all, so I won't go on telling them or fixing them, as I don't want problems with anybody.

    • I said "Override", not "Overwrite". It's not exactly the same, and, in any case, I understood what you did, but what I said is that your check is being done ALL the times update is called. My fix only applies when index changes. Don't you see the difference in efficiency just because of that?

      Also, my solution works for ANY cause of index updating, as it hooks to the index setter. What if the index gets updated but that's not caused by a cursor up or down, but because of a mouse over item, when user has that enabled, for example? Your fix won't work, as the conditions won't be met, thus having the bug again.

      The reason for not reporting more bugs is that you didn't even take the time of looking over my fix, or at least trying to see what I did.. You just made your own, and discreditted me by saying how much easier and simple your solution was.

      Just as context, I'm refering to your post that said this:

      "You know there was a MUCH easier fix, all you have to do is alias update_basic…. I fixed it with like, 6 lines."

      It was "easier" to fix it like that, of course. It's just 6 lines, yes. (I can't see how that makes it better or worse, and actally my solution is just ONE line bigger than yours, so not such a great argument anyways). But does the fact of being an "easier" fix, or having less lines, really make it better? I don't think so.

      I had the intention of telling you all the problems I found, and how I fixed them, and also some updates I made, so you could add the changes you decided to take, but your first post(The one I wrote just before) discouraged me from doing so.

      You can call me petty or whatever you want, but don't forget that you were the one that started laughing about my complex solution without even taking the time to read through it. (I know that because if you just look over it, it seems very large(Thus your comment about yours having only 6 lines), but if you take the time to read it, it becomes clear that most of the code is already there, and is in my posted solution just as a guide for users correcting it manually until the script got updated, and the efective changes are just 7 lines altogether in one place, and one added line in another).

      No real hard feelings or anything, anyways, I like your script, and that is why I took the time of reviewing it and fixing it, instead of switching to another, but , as I said, I just feel like you don't like feedback at all.

    • Hi!
      I thought about that after writing the posts, but I didn't see a button for edit, or even for delete, so I couldn't do it.
      Maybe you can edit it, as you are a Mod? 🙂

    • Can't, I have the same issue you do. We have to wait for marked to add the functions in because the database is pretty new and he's been busy at the moment. That was just a reminder for future reference when you post.

    • Is there any way to "restart" the quest menu?
      i.e. remove all of the quests and act as if none of them were ever active? Meaning that every mission and objective will have to be added to the menu again.

    • I think you would just do that with an event message. The script is just so the player can see what to do next and what they've done and stuff. There's a similar one for XP that I use.

    • [size=3]I'm having the exact same problem as FaithUkwuomah (I think). I'm using Vx Ace and when I try to [b]add a quest[/b] I get a error message that reads, "Script 'Game_Interpreter' line 1411: NameError occurred. uninitialized constant Game_Interpreter::Friend"

      The first mission I had was called "Make A Friend", so that's what I wrote as the mission Id.

      This is the script I used: $game_party.add_mis(mission_Make A Friend)

      I also tried: $game_party.add_mis(mission_1)

      However, interacting with the mission menu works fine. It's the only mission menu/quest board that has worked for me, so I'd be very grateful if you could figure out the problem! :)[/size]

    • @Guest_bu the problem might lie in how you named the quest Make A Friend change it to Make_A_Friend to make sure that there is no spaces when inputting a value. :/

      Um after some more thought you need to put in the mission id so eg. 1, 2 or 3 so on so it would be $game_party.add_mis(1) not $game_party.add_mis(mission_1)

      hope this works for you

    • Hello, first off i may have read over some "important" things and i am a terrible coder (just starting). anyways i don't know how to actually make new quests and of edit them or how to bring up the menu or anything.

    • Amax, all of it is in the script. Read the instructions, which tell you how to use script commands to add new quests, objectives, etc. For example, in the instructions: "[i]To add a mission: $game_party.add_mis(mission_id)[/i]". Simply replace (mission_id) with the number, like 0 or 1, and it will add that mission.

      In the section of the script called "Mission_Names = { mission_id => "Mission_Name"", follow the examples provided for each mission_id. Same with the description, which is directly below.

      This stuff is easy, no actual coding needed… just put in the info you want. and read the instructions and script's comments thoroughly 🙂

    • i appeciate your guys's support in the project makers it really helps. im currently learning as i go so its helpfull when people post bugs or fixes or even script add ons. i read through the scripts to better understand it as well as what im doing so i can write scripts of my own. keep on posting 🙂

    • def update_basic
      liz_mission_self_update
      if Input.trigger?(Input::UP) or Input.trigger?(Input::DOWN)
      @desc_window.refresh(@list_window.mission)
      end
      end

      def scroll_up
      if @desc_window.oy != 0
      @desc_window.oy -= 24
      end
      @list_window.activate
      return
      end
      end
      end
      That was the ending of my code 416-432
      But this error popped up.

      Script(" Insert Here ") line 431: SyntaxError occurred.
      unexpected $end, expecting tASSOC

      This is driving me crazy someone please help. :annoyed:

    • can't really tell without the whole script but judging from the error i think you have too many "End"s in one of the sections. at line 431 the script might be abruptly ended and the game doesn't know what to do with the information.

      my suggestion is try removing the "end" and 431 and see if that corrects it, but the error could also be that the "end" on line 431 is just in the wrong place and you need to relocate it to a different place in the script.

    • The script was working fine for me, but now that I have tried to add a new mission objective I keep getting the same error message again and again: Line 61 (in bold below): SyntaxError occurred. unexpected tIDENTIFIER, expecting keyword_do or '{' or '(' Does anyone know how to fix it? I am completely new to using scripts and it would be a shame to have to abandon this one.
      The only change I have made to the default script is to add objectives:

      #—————————————————————————–
      # Mission_Objectives = {mission_id => {obj_id => "Objective_text",… }
      #—————————————————————————–
      Mission_Objectives = { 0 => {0 => "Speak to Red",
      1 => "Investigate the Gatehouse",
      2 => "Use the Service Tunnels to enter Vimbergh"
      },
                        [b]  1 => {0 => "Gain Access to the Palace",[/b]
                                    1 => "Escape Execution",
                                    2 => "Talk to the Queen.",
      3 => "Talk to Amos."
                                     }
                             }
           
      end

    • I've modified this script a bit and thought I'd share.

      First, I added a method to remove all missions:
      def rem_all_mis
      @missions.clear
      @act_obj.clear
      @comp_obj.clear
      @comp_missions.clear

      return
      end

      You can just paste that in with all the other method definitions around line 250. Call it with $game_party.rem_all_mis

      I was also having an issue where trying to complete an objective or mission that didn't exist would cause the game to crash. Thus, I added checks to the completion methods so that they don't crash the game if I ask them to do the impossible.

      def add_comp_obj(id, obj_n)
      #CHANGED Added this 'if' to abort if about to encounter error
      if !@act_obj[id]
      return
      end
      for i in 0…@act_obj[id].size
      if @act_obj[id][i] == obj_n
      @act_obj[id].delete(obj_n)
      @comp_obj[id].push(obj_n)
      end
      end
      return
      end

      def comp_mis(id)
      if @comp_missions.include?(id)
      return
      end
      #CHANGED Added this 'if' to abort if trying to complete non-existent mission
      if !@missions.include?(id)
      return
      end
      @comp_missions.push(id)
      return
      end

    Leave a Reply

    Leon

    • Posted about 12 years ago

    • Engine
      RPG Maker VX Ace
    • Category
      Window Scripts
    • License
      Attribution 3.0 Unported
    • Version
      1.00

    Stats

    23,484 views

    35 comments

    Tags

    leon leon-westbrook mission quest