Quest Log Script - Need some Help.

Keniisu

YouTuber
Veteran
Joined
May 15, 2014
Messages
324
Reaction score
141
First Language
English
Primarily Uses
RMMV
Hi

I'm currently making a quest log script and am wondering how to set-up the following...

  1. If Statements - Like..If [questid001] is complete, then activate this option of dialogue.
  2. Quest Info - ID, Quest Name, Description, Giver, and Location.
  3. Quest Start and End Commands - accept.questid001 or something similar.
  4. Icon for Quest - How to add an icon next to a Quest's name.
  5. Window Boxes - How to make more window boxes to fit the rest of the screen 
Those are the main things I need to know for now. Thanks and have a wonderful day. Bye-Bye! ;)

My Script:

class MyCustomScene < Scene_Base#--------------------------------------------------------------------------# * Start Processing#--------------------------------------------------------------------------def startsuper()@my_window = Window_Help.new()@my_array = []@my_array[0] = "Quests"@my_window.set_text(@my_array[rand (1)])end#--------------------------------------------------------------------------# * Post-Start Processing#--------------------------------------------------------------------------def post_startsuper()end#--------------------------------------------------------------------------# * Frame Update#--------------------------------------------------------------------------def updatesuper()return_scene() if Input.trigger?:)A)end#--------------------------------------------------------------------------# * Pre-Termination Processing#--------------------------------------------------------------------------def pre_terminateend#--------------------------------------------------------------------------# * Termination Processing#--------------------------------------------------------------------------def terminatesuper()@my_window.dispose()endend#==============================================================================# ** Window_MenuCommand#------------------------------------------------------------------------------# This command window appears on the menu screen.#==============================================================================class Window_MenuCommand < Window_Command#--------------------------------------------------------------------------# * For Adding Original Commands#--------------------------------------------------------------------------alias dp3_custscene_windowmenucommand_addorigcommand_023fj add_original_commands#--------------------------------------------------------------------------def add_original_commandsdp3_custscene_windowmenucommand_addorigcommand_023fj()add_command("Quest Log", :custscene, true)endend#==============================================================================# ** Scene_Menu#------------------------------------------------------------------------------# This class performs the menu screen processing.#==============================================================================class Scene_Menu < Scene_MenuBase#--------------------------------------------------------------------------# * Create Command Window#--------------------------------------------------------------------------alias dp3_custscene_scenemenu_createcommandwindow_023fj create_command_window#--------------------------------------------------------------------------def create_command_windowdp3_custscene_scenemenu_createcommandwindow_023fj()@command_window.set_handler:)custscene, method:)command_custscene))enddef command_customsceneSceneManager.call(MyCustomScene)endend  
Here's my screenshots of progress:





Game 2015-03-28 21-21-39-461.jpg

Game 2015-03-28 21-21-42-905.jpg
 
Last edited by a moderator:

Warpmind

Twisted Genius
Veteran
Joined
Mar 13, 2012
Messages
936
Reaction score
578
First Language
Norwegian
Primarily Uses
So what does the, y'know, quest script actually look like?
 

Keniisu

YouTuber
Veteran
Joined
May 15, 2014
Messages
324
Reaction score
141
First Language
English
Primarily Uses
RMMV
So what does the, y'know, quest script actually look like?
Sorry. 

This is it:

Code:
class MyCustomScene < Scene_Base  #--------------------------------------------------------------------------  # * Start Processing  #--------------------------------------------------------------------------  def start    super()    @my_window = Window_Help.new()    @my_array = []    @my_array[0] = "Quests"    @my_window.set_text(@my_array[rand (1)])      end  #--------------------------------------------------------------------------  # * Post-Start Processing  #--------------------------------------------------------------------------  def post_start    super()  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    super()    return_scene() if Input.trigger?(:A)      end  #--------------------------------------------------------------------------  # * Pre-Termination Processing  #--------------------------------------------------------------------------  def pre_terminate  end  #--------------------------------------------------------------------------  # * Termination Processing  #--------------------------------------------------------------------------  def terminate    super()    @my_window.dispose()  endend#==============================================================================# ** Window_MenuCommand#------------------------------------------------------------------------------#  This command window appears on the menu screen.#============================================================================== class Window_MenuCommand < Window_Command    #--------------------------------------------------------------------------  # * For Adding Original Commands  #--------------------------------------------------------------------------  alias dp3_custscene_windowmenucommand_addorigcommand_023fj add_original_commands  #--------------------------------------------------------------------------  def add_original_commands    dp3_custscene_windowmenucommand_addorigcommand_023fj()    add_command("Quest Log", :custscene, true)  endend#==============================================================================# ** Scene_Menu#------------------------------------------------------------------------------#  This class performs the menu screen processing.#============================================================================== class Scene_Menu < Scene_MenuBase    #--------------------------------------------------------------------------  # * Create Command Window  #--------------------------------------------------------------------------   alias dp3_custscene_scenemenu_createcommandwindow_023fj create_command_window  #--------------------------------------------------------------------------  def create_command_window       dp3_custscene_scenemenu_createcommandwindow_023fj()    @command_window.set_handler(:custscene, method(:command_custscene))  end    def command_customscene    SceneManager.call(MyCustomScene)  endend  
 
Last edited by a moderator:

Quxios

Veteran
Veteran
Joined
Jan 8, 2014
Messages
1,055
Reaction score
785
First Language
English
Primarily Uses
RMMV
1. If Statements

Not sure what you mean by "then activate this option of dialogue."

But the if statement would look like:

if @quest_variable_here == true # do stuff hereend2. Quest Info

I'd recommend learning about Hash. Then you can set up an array like:

@quest_log = []@quest_log[0] = { :name => "Quest Name", :desc => "Description", :giver => "Giver", :loc => "Location", :complete => false}( added the complete option )

Then you can use that hash to grab the information, for example to check if a quest is complete

if @quest_log[ID][:complete] == true p "Quest is complete"else p "Quest is not complete"end3. Quest Start and End Commands

You can add another option inside the quest log hash call :enabled or :accepted and set it to a boolean

4. Icon for Quest

Same as above, add another option inside the hash and call it :icon and set it to the icon id. Then you can use the Window_Base method draw_icon()

index = @quest_log[ID][:icon]draw_icon(index, x, y) # set x and y to numbers< draw_icon() only works inside Window_Base and childs of Window_Base>

5. Window Boxes

class Custom_Window < Window_Base def initialize super(X, Y, Width, Height) # Change X, Y, Width, Height to real numbers refresh end def refresh contents.clear # do stuff here endendAnd then inside your scene create the window like:

Code:
@custom_window = Custom_Window.new
 
Last edited by a moderator:

Keniisu

YouTuber
Veteran
Joined
May 15, 2014
Messages
324
Reaction score
141
First Language
English
Primarily Uses
RMMV
I am in need a bit of assistance again.  :)  

How would I do the following things?

  • How would I display the  full "@quest_log" array in one window?
  • How would I do I display/make a selection for the "@quest_log" array? (Like it displays only the name section of the array and when I click the name, it displays the full array in another window. See picture for the other window.)
This the current, updated script.  :D  

class MyCustomScene < Scene_Base #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start super() @my_window = Window_Help.new() @my_array = [] @my_array[0] = "Quests" @my_array[1] = "Quests" @custom_window = Choice_Window.new @custom_window2 = Info_Window.new end #-------------------------------------------------------------------------- # * Post-Start Processing #-------------------------------------------------------------------------- def post_start super() end #-------------------------------------------------------------------------- # * Frame Update #-------------------------------------------------------------------------- def update super() return_scene() if Input.trigger?:)A) @my_window.set_text(@my_array[rand (2)]) end #-------------------------------------------------------------------------- # * Pre-Termination Processing #-------------------------------------------------------------------------- def pre_terminate end #-------------------------------------------------------------------------- # * Termination Processing #-------------------------------------------------------------------------- def terminate super() @my_window.dispose() endend #=========================================================================== # * Customize #========================================================================== # Customizable Section #==========================================================================@quest_log = []@quest_log[0] = { :name => "Quest Name", :desc => "Description", :giver => "Giver", :loc => "Location", :complete => false}#==============================================================================# ** Window_MenuCommand#------------------------------------------------------------------------------# This command window appears on the menu screen.#============================================================================== class Window_MenuCommand < Window_Command #-------------------------------------------------------------------------- # * For Adding Original Commands #-------------------------------------------------------------------------- alias dp3_custscene_windowmenucommand_addorigcommand_023fj add_original_commands #-------------------------------------------------------------------------- def add_original_commands dp3_custscene_windowmenucommand_addorigcommand_023fj() add_command("Quests", :custscene, true) endend#==============================================================================# ** Scene_Menu#------------------------------------------------------------------------------# This class performs the menu screen processing.#============================================================================== class Scene_Menu < Scene_MenuBase #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- alias dp3_custscene_scenemenu_createcommandwindow_023fj create_command_window #-------------------------------------------------------------------------- def create_command_window dp3_custscene_scenemenu_createcommandwindow_023fj() @command_window.set_handler:)custscene, method:)command_customscene)) end def command_customscene SceneManager.call(MyCustomScene) endend #-------------------------------------------------------------------------- # * Create Choice Window #-------------------------------------------------------------------------- # The Selection Window #--------------------------------------------------------------------------class Choice_Window < Window_Base # for a window, the parent is normally Window_Base def initialize super(0,70,340,345) # initializing stuff here end def update # update stuff here endend #-------------------------------------------------------------------------- # * Create Info Window #-------------------------------------------------------------------------- # The Information Window #--------------------------------------------------------------------------class Info_Window < Window_Base # for a window, the parent is normally Window_Base def initialize super(338,70,210,345) # initializing stuff here end def update # update stuff here endend 
Thanks for helping me with this in advance, Bye!  ;)  

Also before I forget. Here are the images...



 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,162
Reaction score
822
First Language
Hungarian
Primarily Uses
RMVXA
1. You don't want to display the full array, only the selected quest from it, I guess, so only 1 element from the array at once.


You will need to make a refresh method in your info window for that, and refresh the window each time the player selects a quest to display.


Start your refresh method with a 'contents.clear' call, and make the actual drawing happen after that line.


Pass an argument for the refresh method, which determines which quest info to display, so in this case the argument can be the ID of the quest in the array.


Once you made this, head over to make your second thing on your list.


2. You will need a selectable window for this. So, instead of inheriting from Window_Base, you should inherit from Window_Command.


Than you will need to create a command list for this window. You do this with the 'make_command_list' method. Iterate your @quest_log array in that method, and skip the not unlocked IDs from the array (if there is any). Inside the iteration, you can add a command for each quest with this line:

add_command("quest name",:symbol,enable_state,ext_data)You can add the ID of the quest to be your ext_data, so you can access it easily from your scene class.
Now that you got a command list and a working refresh method in another window, you can create the method which will run upon hitting the OK button on a quest in your command window. This will be done in the scene itself.


After your command window is created in the scene (so somewhere in the start method, or in a method which is in the start method), you can assign a handler to the command. You do this by adding a similar line like this:

@custom_window.set_handler:)ok, method:)refresh_info))After this, make your refresh_info method wherever you want in the scene class (but NOT in another method!).
In this method you can call something like this:

@custom_window2.refresh(@custom_window.current_ext)This will only work if you passed the ID of the quest to be the ext_data of the command buttons!
And you are done, I guess.


But this line:

@my_window.set_text(@my_array[rand (2)])In the update method is a serious performance killer.
You can put this line right after you create your help window, no need to put it in the update method at all.


And there is still no need to dispose any windows manually, so that terminate method in the scene is a waste of space in your editor.


Note that I did not give exact codes for you to copy/paste for a reason. But I think, I gave enough info on how to create what you want the easiest way possible.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,074
Members
137,578
Latest member
JamesLightning
Top