Help Scene (Custom Encyclopedia)

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by IneptAttoney_08, Jun 23, 2019.

  1. IneptAttoney_08

    IneptAttoney_08 MMORPG! Veteran

    Messages:
    67
    Likes Received:
    10
    Location:
    Here!
    First Language:
    Indonesia
    Primarily Uses:
    RMVXA
    Help Scene
    by: IneptAttorney
    Introduction:
    This script can create scene "Help" which contains guidance on your game. maybe you can abbreviate the tutorial so we only need to define a little of our game features and the rest can be defined in the scene Help

    Instruction:
    Place above ▼ Main Process and below ▼ Materials. Set the configuration in the script and make the script call
    SceneManager.call(Scene_Help) to access the help scene

    Screenshot:
    I'm sorry I have not included this!

    Script:
    Code:
    #HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
    #                                 Help Scene
    #HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
    =begin
    ▼ Writer: IneptAttorney
    ▼ Date  : 22, June, 2019
    ▼ Engine: RMVX Ace
    ▼ Name  : Help Scene
    -------------------------------------[+]----------------------------------------
    ▼ Instruction
      This script will make the Help Scene for your game. you can call it Custom
      Encyclopedia if you want.
    -------------------------------------[+]----------------------------------------
    ▼ Instruction
      Place above ▼ Main Process and below ▼ Materials. Set the configuration below
      and testplay your game!
      Make script call to open help scene
      =====================================
      =   SceneManager.call(Scene_Help)   =
      =====================================
    -------------------------------------[+]----------------------------------------
    ▼ Terms
      Credit me (if you want)
      Repost? free! but don't claiming this script!
    -------------------------------------[+]----------------------------------------
    =end
    module INPTATTRNY
      module HELP
        ENTRY = [] #<----- Don't click!
        TEXT  = [] #<----- Don't click!
    #...............................................................................
    # Write List here!
    # the format like this:
    # TEXT[x] = [
    #            "Title",
    #            "Line 1",
    #            "Line 2",
    #            "Line 3",
    #            "Line 4",
    #           ]
    # Where x is Text ID. You add more lines if you want (Max is 14 lines)
    #...............................................................................
        TEXT[0] = ["Movement",                       #<-- Title
                  "Use Arrow keys to move",          #<-- Line 1
                  "Press 'A' for use weapon",      #<-- Line 2
                  "You can click any place to move", #<-- Line 3
                  "Press 'Enter' to Talk with NPC",  #<-- Line 4
                  "Press & Hold 'Shift' to dash character"
                  ]
        
        TEXT[1] = [
                   "Title",
                   "Line1",
                   "Line2",
                   "Line3",
                   "Line4",
                   "Line5",
                   "Line6",
                   ]
    #...............................................................................
    # Entry settings!
    # Format:
    # ENTRY[x] = ["string1", "String2", "Switch Required 1"]
    #...............................................................................
        ENTRY[0] = ["Entry0(1)","Entry0(2)",1]
        ENTRY[1] = ["Entry1(1)","Entry1(2)",2]
        
    #...............................................................................
    # Additional Settings
    #...............................................................................
        UNICON = 238            #Icon for unknown entries
        ICON   = 237            #Icon for known entries
        NOTEXT = "No Data"      #Text for unknown data
        NOT    = "Nil"          #Text for unknown title
        
        FOOTER = "Help Scene"   #Footer Text
        FOOT_X = 0              #X possision for Footer Text
        FOOT_Y = 0              #Y possision for Footer Text
    #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    #                          End of configuration!
    # Don't edit the text below or your PC will burn up!
    #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      end
    end
    #...............................................................................
    # Scene Help
    #...............................................................................
    class Scene_Help < Scene_MenuBase
      def start
        super
        create_entry_list
        create_info
        create_footer
      end
     
      def create_entry_list
        @entry_list = Window_EntryList.new(0, 0, 170, 366)
        @entry_list.viewport = @viewport
        @entry_list.activate
        @entry_list.set_handler(:cancel, method(:return_scene))
        $Entryindex = @entry_list.index
      end
     
      def create_footer
        @footer_window = Window_HelpDesc.new(0, 363, 544, 54)
        @footer_window.viewport = @viewport
      end
     
      def create_info
        @info_window = Window_HelpInfo.new(170, 0, Graphics.width - 170, Graphics.height - 50)
        @info_window.viewport = @viewport
      end
     
    end
    #...............................................................................
    # Footer Window
    #...............................................................................
    class Window_HelpDesc < Window_Base 
      def initialize( x, y, window_width, window_height)
        super
        refresh
      end
     
      def refresh
        contents.clear
        draw_text_ex(INPTATTRNY::HELP::FOOT_X, INPTATTRNY::HELP::FOOT_Y, INPTATTRNY::HELP::FOOTER)
      end
     
    end   
    #...............................................................................
    # Info Window
    #...............................................................................
    class Window_HelpInfo < Window_Base 
      def initialize(x, y, window_width, window_height)
        super
        update
      end 
     
      def update
        contents.clear
        if $game_switches[INPTATTRNY::HELP::ENTRY[$Entryindex][3]] == true
          draw_text(1,0,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][1])
          draw_text(1,25,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][2])
          draw_text(1,50,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][3])
          draw_text(1,75,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][4])
          draw_text(1,100,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][5])
          draw_text(1,125,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][6])
          draw_text(1,150,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][7])
          draw_text(1,175,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][8])
          draw_text(1,200,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][9])
          draw_text(1,225,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][10])
          draw_text(1,250,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][11])
          draw_text(1,275,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][12])
          draw_text(1,300,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][13])
          draw_text(1,325,350,30,INPTATTRNY::HELP::TEXT[$Entryindex][14])
        else
          draw_text(1,0,350,30,INPTATTRNY::HELP::NOTEXT)
        end
      end 
    end 
    #...............................................................................
    # Entry List Window
    #...............................................................................
    class Window_EntryList < Window_Selectable
      def initialize( x, y, window_width, window_height)
        super
        @data = []
        refresh
        select(0)
      end
     
      def item_max
        @data ? @data.size : 1
      end
     
      def item
        @data && index >= 0 ? @data[index] : nil
      end
     
      def make_item_list
        @data = INPTATTRNY::HELP::ENTRY
      end
     
      def draw_item(index)
        item = @data[index]
        rect = item_rect(index)
        if $game_switches[INPTATTRNY::HELP::ENTRY[$Entryindex][3]] == true
          draw_text(32, rect.y, 200, line_height, INPTATTRNY::HELP::TEXT[index][0])
          draw_icon(INPTATTRNY::HELP::ICON, 4, rect.y )
        else
          draw_text(32, rect.y, 200, line_height, INPTATTRNY::HELP::NOT )
          draw_icon(INPTATTRNY::HELP::UNICON, 4, rect.y )
        end
      end
        
      def refresh
        make_item_list
        create_contents
        draw_all_items
      end
     
      def update
        process_cursor_move
        process_handling
      end
     
      def process_cursor_move
        return unless cursor_movable?
        last_index = @index
        cursor_down (Input.trigger?(:DOWN))  if Input.repeat?(:DOWN)
        cursor_up   (Input.trigger?(:UP))    if Input.repeat?(:UP)
        cursor_right(Input.trigger?(:RIGHT)) if Input.repeat?(:RIGHT)
        cursor_left (Input.trigger?(:LEFT))  if Input.repeat?(:LEFT)
        cursor_pagedown   if !handle?(:pagedown) && Input.trigger?(:R)
        cursor_pageup     if !handle?(:pageup)   && Input.trigger?(:L)
        Sound.play_cursor if @index != last_index
        $Entryindex = @index #@data[index]
      end
    end #End of script! 0=0)/
    

    Credits:
    • IneptAttorney
    • Enterbrain
     
    #1
    BCj and Ebanyle like this.
  2. Marsigne

    Marsigne Sephiroth Veteran

    Messages:
    1,805
    Likes Received:
    4,548
    Location:
    Jenova
    First Language:
    Other
    Primarily Uses:
    N/A
    Looks cool. :)
     
    #2
  3. IneptAttoney_08

    IneptAttoney_08 MMORPG! Veteran

    Messages:
    67
    Likes Received:
    10
    Location:
    Here!
    First Language:
    Indonesia
    Primarily Uses:
    RMVXA
    Thanks for the kind word! :kaojoy:
     
    #3
    Marsigne likes this.
  4. noajb

    noajb Villager Member

    Messages:
    21
    Likes Received:
    18
    First Language:
    English
    Primarily Uses:
    RMVXA
    Perfect! It feels like I've been looking for something like this forever
     
    #4
  5. BCj

    BCj Veteran Veteran

    Messages:
    1,435
    Likes Received:
    676
    Location:
    NL
    First Language:
    Dutch
    Primarily Uses:
    N/A
    Note to self to check this one out later :)
     
    #5
  6. Tw0Face

    Tw0Face Chief Executive Officer Veteran

    Messages:
    217
    Likes Received:
    273
    First Language:
    German
    Primarily Uses:
    RMVXA
    This script errors at line 187. It's the following line:
    Code:
    if $game_switches[INPTATTRNY::HELP::ENTRY[$Entryindex][3]] == true
     
    #6
  7. BCj

    BCj Veteran Veteran

    Messages:
    1,435
    Likes Received:
    676
    Location:
    NL
    First Language:
    Dutch
    Primarily Uses:
    N/A
    Same for me, sadly.
     
    #7
  8. Roninator2

    Roninator2 Gamer Veteran

    Messages:
    1,633
    Likes Received:
    362
    Location:
    Canada
    First Language:
    English
    Primarily Uses:
    RMVXA
    @Tw0Face , @BCj
    Change line 187 (the error) to this
    Code:
        switch = @data[index][2].to_i
        if $game_switches[switch] == true
    
    at least this works

    and at line 141 change the 3 to a 2
     
    Last edited: Aug 25, 2019
    #8
    Thefirelion and Tw0Face like this.

Share This Page