Jump to content

Announcing our new website

To find out the latest about our new website, visit Game Dev Unlimited

* * * * * 1 votes

Mission/Quest Menu script.


  • You cannot reply to this topic
43 replies to this topic

#31 Maulth

    Member

  • Member
  • 35 posts

Posted 09 September 2009 - 03:02 AM

View PostThubanus, on 08 September 2009 - 03:21 PM, said:

I just figured out how to use this script. It is really awesome, thank you.


I was wondering if there was a way to separate quests into chapters of the story, or if that would make it too complicated? (If not, then maybe set the numbers back to "1" after each chapter is completed?)
You could do it so that when you ended a chapter, you could call this script:

 $game_party.mission[0] = 1 

With the [0] being the ID of your mission, inside of an event, right before a cutscene, or immediately after.

#32 KatReverie

    Newbie

  • Member
  • 7 posts

Posted 10 September 2009 - 05:36 AM

I'm sorry to be a bother, but I'm having an issue with the script.
I get two different errors when I try to call up
$scene = Scene_MissionMenu.new

They are as follows:

Calling from an item- "Name error occurred while running script. undefined local variable or method for #<interpreter:0x3980ef8>"
( Screenshot for reference: http://img269.images...errorinitem.png )
Calling from a sign (event) - "Script 'quests' line 305: nomethoderroroccurred. Undefined method 'keys' for nil:NilClass"
(Screenshot for reference: http://img42.imagesh...errorinsign.png )

Note, quests is what I named the script.
Line 305 is
for i in 0...$game_party.mission.keys.size
in a *Refresh part.

Also, when I try to change event status ( by calling - $game_party.mission[1] = 2 from a mailbox [just as a test to see what would happen after the other events]) I get the following message- "Name error occurred while running script. undefined method `[]=' for nil:Nilclass"
(Screenshot for reference - http://img193.images...gquestknown.png )


The only things I've modified is changing Mission_setup to false and the text for mission id 0.

I'm very, very confused since I'm new (to say the least) at working with any sort of code. I've googled the errors and gotten nothing I can decipher with my very limited understanding of scripting.

Thank you for your time, and I hope someone could inform me what I'm doing wrong.

#33 Maulth

    Member

  • Member
  • 35 posts

Posted 10 September 2009 - 06:02 AM

View PostKatReverie, on 10 September 2009 - 05:36 AM, said:

I'm sorry to be a bother, but I'm having an issue with the script.
I get two different errors when I try to call up
$scene = Scene_MissionMenu.new

They are as follows:

Calling from an item- "Name error occurred while running script. undefined local variable or method for #<interpreter:0x3980ef8>"
( Screenshot for reference: http://img269.images...errorinitem.png )
Calling from a sign (event) - "Script 'quests' line 305: nomethoderroroccurred. Undefined method 'keys' for nil:NilClass"
(Screenshot for reference: http://img42.imagesh...errorinsign.png )

Note, quests is what I named the script.
Line 305 is
for i in 0...$game_party.mission.keys.size
in a *Refresh part.

Also, when I try to change event status ( by calling - $game_party.mission[1] = 2 from a mailbox [just as a test to see what would happen after the other events]) I get the following message- "Name error occurred while running script. undefined method `[]=' for nil:Nilclass"
(Screenshot for reference - http://img193.images...gquestknown.png )


The only things I've modified is changing Mission_setup to false and the text for mission id 0.

I'm very, very confused since I'm new (to say the least) at working with any sort of code. I've googled the errors and gotten nothing I can decipher with my very limited understanding of scripting.

Thank you for your time, and I hope someone could inform me what I'm doing wrong.
Before we try and figure out anything, we need to know 2 things.
A) Are you using a Legit copy of RPG XP, because Postality knights or w/e has a lot of problems with scripts
B) are you using the SDK?

#34 KatReverie

    Newbie

  • Member
  • 7 posts

Posted 10 September 2009 - 07:10 AM

View PostMaulth, on 10 September 2009 - 06:02 AM, said:

Before we try and figure out anything, we need to know 2 things.
A) Are you using a Legit copy of RPG XP, because Postality knights or w/e has a lot of problems with scripts
B) are you using the SDK?

A) Well, I got it off of the official RPG maker xp site, so I'm going to assume it's legit.

B) I'm not using the SDK. I'm just using the maker as it came aside from editing tile sets and sprites, and two scripts aside from this one. A pause script by Zeriab and "Stat Influence Script/Barehands" by Leon.

#35 Lizzie S

    Legendary

  • RMXPU Legend
  • PipPipPipPipPipPipPip
  • 1,624 posts

Posted 11 September 2009 - 03:24 AM

Question number 3: Did you load up a save file from before installing this game, or is it from a new game?

#36 Kiriashi

    Activity Whore

  • RMXPU Legend
  • PipPipPipPipPipPipPipPipPipPip
  • 4,486 posts

Posted 11 September 2009 - 06:56 AM

That's probably the problem as that happened with me when I tried this out and I fixed it by starting a new game.

This is why the Switch and Variable Managers and the Control key are useful while play-testing!

#37 KatReverie

    Newbie

  • Member
  • 7 posts

Posted 11 September 2009 - 09:17 AM

Ah! Thank you so much.

It was from a load state. I didn't realize that it could cause a problem if it was from a previously saved state. I feel rather silly now, since that makes sense.

I just played it from a new game state (Hurray for f9 and temporary teleports placed in decorations on the first map!) and it worked. I'll be sure to test things on a new game state from now on!

Once again, thank you so very much!

#38 Chiyoi

    Newbie

  • Member
  • 2 posts

Posted 01 January 2010 - 01:00 PM

Hey, sorry for bumping this topic but I really need to ask a question, I hope it will be answered.

I know completely now how to use this script, but I have one question.
Is there a way that when I press O for example, the quest menu opens?

#39 Marked

    I administrate

  • Admin
  • 3,351 posts

Posted 01 January 2010 - 01:21 PM

This sounds like something I did in a horrible, horrible script I made back in 2006.

Try this:

Add the following line to Game_Temp, around line 17(or amongst the rest of them, you'll see):
attr_accessor :quest_calling       # Quest Menu calling flag

Next, goto Scene_Map. Add the following:
  #--------------------------------------------------------------------------
  # * If the L button(Q button) is pressed, the quest menu will appear. 
  #--------------------------------------------------------------------------
    if Input.trigger?(Input::L)
      # If event is running, or menu is not forbidden
      unless $game_system.map_interpreter.running? or
             $game_system.menu_disabled
        # Set menu calling flag or beep flag
        $game_temp.quest_calling = true
        $game_temp.menu_beep = true
      end
    end
Directly below(starts around line 122:
    # If B button was pressed
    if Input.trigger?(Input::B)
      # If event is running, or menu is not forbidden
      unless $game_system.map_interpreter.running? or
             $game_system.menu_disabled
        # Set menu calling flag or beep flag
        $game_temp.menu_calling = true
        $game_temp.menu_beep = true
      end
    end

Still in Scene_Map, add the following:
  #--------------------------------------------------------------------------
  # * Makes the Quest menu appear if the player is not moving
  #--------------------------------------------------------------------------
      elsif $game_temp.quest_calling
        call_quest
Directly below:(around line 167, but moved because you added the code above):
      elsif $game_temp.debug_calling
        call_debug

Next, still in Scene_Map, add the following:
 #--------------------------------------------------------------------------
  # * Quest Call
  #--------------------------------------------------------------------------
  def call_quest
    # Clear menu call flag
    $game_temp.quest_calling = false
    # If menu beep flag is set
    if $game_temp.menu_beep
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Clear menu beep flag
      $game_temp.menu_beep = false
    end
    # Straighten player position
    $game_player.straighten
    # Switch to menu screen
    $game_system.se_play($data_system.save_se)
    $scene = Scene_MissionMenu.new
  end
Directly below(around line 217):
  #--------------------------------------------------------------------------
  # * Menu Call
  #--------------------------------------------------------------------------
  def call_menu
    # Clear menu call flag
    $game_temp.menu_calling = false
    # If menu beep flag is set
    if $game_temp.menu_beep
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Clear menu beep flag
      $game_temp.menu_beep = false
    end
    # Straighten player position
    $game_player.straighten
    # Switch to menu screen
    $scene = Scene_Menu.new
  end



OR, I'll do the edits for you, and you can add the scripts into your game. But this will cause errors if you have previously edited these scripts.

Replace Game_Temp with:
Spoiler

Replace Scene_Map with:
Spoiler

You press the Q key on the map. And I did test this, so it should work.

#40 Chiyoi

    Newbie

  • Member
  • 2 posts

Posted 01 January 2010 - 01:25 PM

Thank you so very much!
It completely works now, I love you :lol:

Thanks again.

#41 Marked

    I administrate

  • Admin
  • 3,351 posts

Posted 01 January 2010 - 01:27 PM

No problem :)

Thanks for giving me something to do while my download finishes. I think I'll write a tutorial for this tomorrow for others who want to do the same with other scripts.

#42 dakillasms

    Newbie

  • Member
  • 1 posts

Posted 13 January 2010 - 01:59 AM

Hey Im new and umm im never incorporated scripts before
so i have no knowledge on the subject could someone here help me out
or direct me to a tutorial. I just made a basic quest off of youtube:

alright thats the quest I made so now how do I incorporate that into you script or if its easier from a new project or a demo.
thank you

#43 Karanum

    Newbie

  • Member
  • 1 posts

Posted 14 November 2010 - 07:07 PM

I've been playing around with your script but I can't get it to work somehow.
I quickly added 3 missions and added 'Quests' to the menu.
Whenever I try to open it through the menu I get the following error:

Script 'Scene_MissionMenu' line 311: TypeError occurred.
cannot convert nil into String

  def draw_item(index)
    mis = Mission_Menu
    mission_name = @data[index]
    x = 4
    y = index * 32
    rect = Rect.new(x, y, self.width - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    if $game_party.mission[mission_name] == 3
      self.contents.font.color = Color.new(40, 250, 40, 255)
      self.contents.draw_text(x, y, 228, 32, mis::Mission_Name[mission_name])
    else
      self.contents.font.color = normal_color
      self.contents.draw_text(x, y, 228, 32, mis::Mission_Name[mission_name]) #<----- It's this line over here
    end
  end

I started a new game and called $game_party.mission[0] = 2

I've tried a few things but I can't seem to solve it by myself.
Does anyone know how to solve this problem?

Edited by Karanum, 14 November 2010 - 07:09 PM.


#44 mxmmix

    Newbie

  • Member
  • 17 posts

Posted 11 December 2011 - 03:39 PM

Hmm this is a great script! Exactly what i need!

I understand how it works (i think) but i cant get it to work.
I got a serie of quests set up but i cant activate them. O_o

This is what i did:
I changed the first quest into one im gonna use.
I created an event and in that event the player gets the quest using: a comment where is written: $game_party.mission[0] = 2
But it still wont work Dx

Could somebody help me out please?





0 user(s) are reading this topic

members, guests, anonymous users