Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

2 Pages V   1 2 >  
Closed TopicStart new topic
> Super Simple Journal
amaranth
post Dec 21 2008, 07:05 PM
Post #1


Level 6
Group Icon

Group: Member
Posts: 78
Type: Developer
RM Skill: Masterful




I'm moving all of my scripts from rmxp.org to this site. I like it here better.

Introduction
If you want a very simple journal, this is the script for you. This script creates a new journal screen for you that contains a list of quests that your character needs to complete. The player can scroll through the list, and that's it. You define your journal entries in the script, and then use switches to turn the entries on and off in your game. Easy!

Create Window_Journal

In this section, we will create the journal and its window.

1. Open your game and script editor.

2. Add a new script called Window_Journal below Window_Menu in your script list.

3. In Window_Journal, add the following code:

CODE
#==============================================================================
# ** Journal
#------------------------------------------------------------------------------
#  This window displays a journal.
#==============================================================================

class Window_Journal < Window_Selectable
# ------------------------
def initialize
   super(0, 32, 460, 330)
   @column_max = 1
   refresh
   self.index = 0
end


#--------------------------------------------------------------------------
# * Draw the contents of the item window
#--------------------------------------------------------------------------
def refresh
   if self.contents != nil
     self.contents.dispose
     self.contents = nil
   end
  
   # variables
   @journal_height = (2)*32   # y coord of entire journal (# of entries - 1) * 32
   @n = 0                     # y coord for each entry
   @item_max = 0              # max items to dispaly
  
   # draw the bitmap. the text will appear on this bitmap
   self.contents = Bitmap.new(width - 32, height+@journal_height)
      
   # populate your journal with entries. Each entry must match its switch number!
   @data = []
   @data[1] = "Task 1"
   @data[2] = "Task 2"
   @data[3] = "Task 3"
  
   for i in 1..3
     if $game_switches[i] == true
       draw_item(i)
       @item_max += 1
     end
   end        
  
end
  
#--------------------------------------------------------------------------
# * Draw an individual item in the window
#     index : Index of the item to be drawn
#--------------------------------------------------------------------------

def draw_item(index)
      item = @data[index]
      rect = Rect.new(10, @n, 640, 32)
      self.contents.fill_rect(rect, Color.new(0,0,0,0))        
      self.contents.draw_text(10, @n, 640, 32, "●", 0)
      self.contents.draw_text(25, @n, 640, 32, item, 0)
      @n += 32
      
end

end



Create Scene_Journal

In this section, we will create the scene that will contain our journal window. The scene determines where the journal window will appear to users and what happens when keys are pressed.

1. Open your game and script editor.

2. Add a new script called Scene_Journal below Scene_Menu in your script list.

3. In Scene_Journal, add the following code:

CODE
#==============================================================================
# ■ Scene_Status
#------------------------------------------------------------------------------
#  This class contains the windows for the character status menu that can be
#   accessed from the main menu.
#==============================================================================

class Scene_Journal
  #--------------------------------------------------------------------------
  # ● Initialize the Status menu
  #--------------------------------------------------------------------------
  def main

    @journal_window = Window_Journal.new
    @journal_window.x = 90
    @journal_window.y = 70
    
    Graphics.transition

    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end  
    end

    Graphics.freeze
    @journal_window.dispose

  end
  #--------------------------------------------------------------------------
  # ● Draw the Status menu
  #--------------------------------------------------------------------------
  def update
    @journal_window.update
    if @journal_window.active
      update_item
      return
    end
  end

  #--------------------------------------------------------------------------
  # ● Update menu after player makes a selection
  #--------------------------------------------------------------------------
  def update_item
  
    # Cancel key pressed (go to menu)
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(5)
      return
    end
    
  end
  
end



Update Window_Menu

In this section, we will add Journal to the main menu. It will appear at the bottom of the menu after Quit.

Note: This section assumes that you now have 7 items in your main menu, and the journal is the 7th item.

1. Open the Window_Menu script.

2. Find @item_max and add 1 to it. (@item_max = 7)

3. Find the data[] array, and add an additional item. (@data[7] = "Journal")

4. Below the data[] array, add 1 to the for loop. (for i in 1..7)


Update Scene_Menu

In this section we will add a link to the journal. This scene controls main menu navigation.

Note: This section assumes that you now have 7 items in your main menu, and the journal is the 7th item.

1. Open the Scene_Menu script.

2. Under def update_command, under case @menu_window.index, add the following line (this assumes that you have 7 items in your menu, and this is the 7th item):

CODE
      when 6  # Journal selected
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Journal.new


Create Journal Entries

Now that you have your Journal set up, you need to add journal entries to it.

1. Go to your Window_Journal script.

2. Find this section:
@data[1] = "Task 1"
@data[2] = "Task 2"
@data[3] = "Task 3"


3. Replace the tasks with your own. For example:
@data[1] = "Find treasure for Jake"
@data[2] = "Get milk for Ma"
@data[3] = "Destroy the world"



Create Journal Switches

Now that your journal entries are added to your journal, turn them on and off with switches.

Note: The number assigned to each data entry needs to match the number assigned to each switch. For example, @data[2] = "Get milk for Ma" | 0002: Help Ma.

1. Add a new event to one of your maps.

2. Open the Event Commands window.

3. Click Control Switches and add the following:
0001: Help Jake
0002: Help Ma
0003: Destroy World



Turn Entries On and Off

To turn entries on and off, simply turn the journal switches on or off in the Event Command window for an event on the map.


How do I add more journal entries?

To add new journal entries, you need to update your list of switches and your list of journal entires in Window_Journal.

1. Open the Window_Journal script and add another entry to the data[] array. (for example, data[4] = "Save the world")

2. In the Window_Journal script, update the journal_height variable. (+1 for each additional journal entry. For example: @journal_height = (3)*32)

3. In the Window_Journal script, update the for loop. (+1 for each additional journal entry. For example: for i in 1..4)

4. Exit the script editor, and open an event on your map. Add a new switch for the journal entry. (for example, 0004: Save World)


I don't want to start with switch 1

If you don't want to start your journal entry with switch 1, simply adjust your for loop in Window_Journal as follows:

Note: The following code assumes that you are starting at switch 100 instead of 1.

for i in 1..3
if $game_switches[i+99] == true
draw_item(i)
@item_max += 1
end
end


__________________________
Go to the top of the page
 
+Quote Post
   
Unnamed
post Dec 29 2008, 11:57 AM
Post #2


Level 1
Group Icon

Group: Member
Posts: 9
Type: Developer
RM Skill: Beginner




I like this idea, but I'm having trouble using it. You say edit Window_menu, but i dont seem to have this script the closest option i have is window_menustatus

Can you tell me where it is infact i need to edit, a line number would also be apperciated

Thanks
Go to the top of the page
 
+Quote Post
   
Giterdone
post Dec 31 2008, 06:42 PM
Post #3


Level 2
Group Icon

Group: Member
Posts: 26
Type: Developer
RM Skill: Beginner




I'm kind of having trouble too. What is the Window_menu? Do you mean Window_Selectable, because that's what it says under the class for the journal.


__________________________
CHECK OUT THE SNEEK PEEK AT MY FIRST GAME, PROJECT X (it doesn't have a name yet) UNDER THE UNDER CONSTRUCTION FORUM


[Show/Hide] STARCRAFT 2...BEST GAME EVER









Add the Dark Druid Nergal to your sig, and help him liberate the world!


CODE
[center][img]http://i75.servimg.com/u/f75/13/35/98/57/books10.png[/img][img]http://www.feplanet.net/media/sprites/7/battle/animations/enemy/critical/nergal_darkdruid_magic.gif[/img][img]http://i75.servimg.com/u/f75/13/35/98/57/books10.png[/img]
Add the Dark Druid Nergal to your sig, and help him liberate the world![/center]
Go to the top of the page
 
+Quote Post
   
Giterdone
post Jan 2 2009, 03:18 PM
Post #4


Level 2
Group Icon

Group: Member
Posts: 26
Type: Developer
RM Skill: Beginner




Does anyone know how to use this journal script?????


__________________________
CHECK OUT THE SNEEK PEEK AT MY FIRST GAME, PROJECT X (it doesn't have a name yet) UNDER THE UNDER CONSTRUCTION FORUM


[Show/Hide] STARCRAFT 2...BEST GAME EVER









Add the Dark Druid Nergal to your sig, and help him liberate the world!


CODE
[center][img]http://i75.servimg.com/u/f75/13/35/98/57/books10.png[/img][img]http://www.feplanet.net/media/sprites/7/battle/animations/enemy/critical/nergal_darkdruid_magic.gif[/img][img]http://i75.servimg.com/u/f75/13/35/98/57/books10.png[/img]
Add the Dark Druid Nergal to your sig, and help him liberate the world![/center]
Go to the top of the page
 
+Quote Post
   
obsorber
post Jan 26 2009, 02:59 PM
Post #5


Level 26
Group Icon

Group: Revolutionary
Posts: 589
Type: Writer
RM Skill: Skilled




I want to use this script but the maker needs to be more specific while explaining it. Sounds like the tutorial to use the script or get it working was rushed. I prefer scripts that you can just copy and paste above main, saves hassle and problems...Overall this script looks like it should be promising...


__________________________

The final release of Project Viral is finally here!


Eden Hall, demo released!
Go to the top of the page
 
+Quote Post
   
brewmeister
post Jan 27 2009, 08:08 PM
Post #6


Paste above Main
Group Icon

Group: Revolutionary
Posts: 408
Type: Scripter
RM Skill: Skilled




Super Simple Journal - V2

I agree this needs to be simplified a bit.
Changes:
* You only need to edit the list of tasks. The scripts will figure out the rest.
* Added a callback so you can use this from the menu, or from the map with the "Q" key
You will return to the map or menu from whence you came. smile.gif
* Added @offset near tasks, to make it easier to specify a starting switch other than 1.
* Include separate Menu & Map mods so you don't have to edit any default scripts
* Added an option to use a custom windowskin for your journal

Introduction
If you want a very simple journal, this is the script for you. This script creates a new journal screen for you that contains a list of quests that your character needs to complete. The player can scroll through the list, and that's it. You define your journal entries in the script, and then use switches to turn the entries on and off in your game. Easy!

Create Window_Journal

In this section, we will create the journal and its window.

1. Open your game and script editor. ( Tools -> Script Editor, Script Editor Icon, or F11 )

2. Right-Click on Main, and select Insert

2. In the name box, type Window_Journal

3. In the code page (right side), copy & paste the following script:

CODE
#==========================================================================
# Window_Journal
#------------------------------------------------------------------------------
#  This window displays a journal.
#==========================================================================
    
class Window_Journal < Window_Selectable
    # ------------------------
    def initialize
       super(0, 32, 460, 330)
      
    #----------------------------------------------------------
    # populate your journal with entries.
       @data = []
       @data[1] = "Help Man"
       @data[2] = "Kill Chicken"
       @data[3] = "Make cow eat"
       @data[4] = "Sniff the Glove"
       @data[5] = "Jump off a bridge after your friends"
      
    # this is the offset for your switches. If you start with switch 100, set
    # @offset = 99
    
    @offset = 0
      
    ### to change the windowskin for the journal
    #   self.windowskin = RPG::Cache.windowskin("RMXP4life_Wood.png")
    
    
    #----------------------------------------------------------
    
       @column_max = 1
       refresh
       self.index = 0
     end
    
    
    #--------------------------------------------------------------------------
    # * Draw the contents of the item window
    #--------------------------------------------------------------------------
     def refresh
       if self.contents != nil
         self.contents.dispose
         self.contents = nil
       end
      
       # variables
       @journal_height = (@data.size - 1)*32   # y coord of entire journal (# of entries - 1) * 32
       @n = 0                     # y coord for each entry
       @item_max = 0              # max items to display
      
       # draw the bitmap. the text will appear on this bitmap
       self.contents = Bitmap.new(width - 32, @journal_height)
          
       for i in 1..@data.size
         if $game_switches[i + @offset] == true
           draw_item(i)
           @item_max += 1
         end
       end        
      
     end
      
    #--------------------------------------------------------------------------
    # * Draw an individual item in the window
    #     index : Index of the item to be drawn
    #--------------------------------------------------------------------------
    
     def draw_item(index)
          item = @data[index]
          rect = Rect.new(10, @n, 640, 32)
          self.contents.fill_rect(rect, Color.new(0,0,0,0))        
          self.contents.draw_text(10, @n, 640, 32, "●", 0)
          self.contents.draw_text(25, @n, 640, 32, item, 0)
          @n += 32
          
     end
    
    end



Create Scene_Journal

In this section, we will create the scene that will contain our journal window. The scene determines where the journal window will appear to users and what happens when keys are pressed.

1. Open your script editor.

2. Add a new script called Scene_Journal below Window_Journal (above Main) in your script list.

3. In Scene_Journal, add the following code:

CODE
#==============================================================================
    # ■ Scene_Status
    #------------------------------------------------------------------------------
    #  This class contains the windows for the character status menu that can be
    #   accessed from the main menu.
#==========================================================================
    
    class Scene_Journal
      #--------------------------------------------------------------------------
      # ● Initialize the Status menu
      #--------------------------------------------------------------------------
      def initialize(callback = 0)  #callback from menu
        @callback = callback
      end
      
      def main
    
        @journal_window = Window_Journal.new
        @journal_window.x = 90
        @journal_window.y = 70
        
        Graphics.transition
    
        loop do
          Graphics.update
          Input.update
          update
          if $scene != self
            break
          end  
        end
    
        Graphics.freeze
        @journal_window.dispose
    
      end
      #--------------------------------------------------------------------------
      # ● Draw the Status menu
      #--------------------------------------------------------------------------
      def update
        @journal_window.update
        if @journal_window.active
          update_item
          return
        end
      end
    
      #--------------------------------------------------------------------------
      # ● Update menu after player makes a selection
      #--------------------------------------------------------------------------
      def update_item
      
        # Cancel key pressed (go to menu)
        if Input.trigger?(Input::B) or Input.trigger?(Input::L)
          $game_system.se_play($data_system.cancel_se)
          if @callback == 0
            $scene = Scene_Menu.new(4)
          else
            $scene = Scene_Map.new
          end
          return
        end
        
      end
      
    end



Create Scene_Menu_Mods (optional)

In this section, we will add Journal to the main menu. It will appear after Status.

1. Open your script editor.

2. Add a new script called Scene_Menu_Mods below Scene_Journal (above Main) in your script list.

3. In Scene_Menu_Mods, add the following code:

CODE
class Scene_Menu
    #--------------------------------------------------------------------------
    # * Object Initialization
    #     menu_index : command cursor's initial position
    #--------------------------------------------------------------------------
    def initialize(menu_index = 0)
      @menu_index = menu_index
    end
    #--------------------------------------------------------------------------
    # * Main Processing
    #--------------------------------------------------------------------------
    def main
      # Make command window
      s1 = $data_system.words.item
      s2 = $data_system.words.skill
      s3 = $data_system.words.equip
      s4 = "Status"
      s5 = "Journal"
      s6 = "Save"
      s7 = "End Game"
      @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
      @command_window.index = @menu_index
      # If number of party members is 0
      if $game_party.actors.size == 0
        # Disable items, skills, equipment, and status
        @command_window.disable_item(0)
        @command_window.disable_item(1)
        @command_window.disable_item(2)
        @command_window.disable_item(3)
      end
      # If save is forbidden
      if $game_system.save_disabled
        # Disable save
        @command_window.disable_item(4)
      end
      # Make play time window
      @playtime_window = Window_PlayTime.new
      @playtime_window.x = 0
      @playtime_window.y = 256
      @playtime_window.height = 96
      # Make steps window
      @steps_window = Window_Steps.new
      @steps_window.x = 0
      @steps_window.y = 352
      # Make gold window
      @gold_window = Window_Gold.new
      @gold_window.x = 0
      @gold_window.y = 416
      @gold_window.height = 64
      # Make status window
      @status_window = Window_MenuStatus.new
      @status_window.x = 160
      @status_window.y = 0
      # Execute transition
      Graphics.transition
      # Main loop
      loop do
        # Update game screen
        Graphics.update
        # Update input information
        Input.update
        # Frame update
        update
        # Abort loop if screen is changed
        if $scene != self
          break
        end
      end
      # Prepare for transition
      Graphics.freeze
      # Dispose of windows
      @command_window.dispose
      @playtime_window.dispose
      @steps_window.dispose
      @gold_window.dispose
      @status_window.dispose
    end

    def update_command
      # If B button was pressed
      if Input.trigger?(Input::B)
        # Play cancel SE
        $game_system.se_play($data_system.cancel_se)
        # Switch to map screen
        $scene = Scene_Map.new
        return
      end
      # If C button was pressed
      if Input.trigger?(Input::C)
        # If command other than save or end game, and party members = 0
        if $game_party.actors.size == 0 and @command_window.index < 4
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Branch by command window cursor position
        case @command_window.index
        when 0  # item
          # Play decision SE
          $game_system.se_play($data_system.decision_se)
          # Switch to item screen
          $scene = Scene_Item.new
        when 1  # skill
          # Play decision SE
          $game_system.se_play($data_system.decision_se)
          # Make status window active
          @command_window.active = false
          @status_window.active = true
          @status_window.index = 0
        when 2  # equipment
          # Play decision SE
          $game_system.se_play($data_system.decision_se)
          # Make status window active
          @command_window.active = false
          @status_window.active = true
          @status_window.index = 0
        when 3  # status
          # Play decision SE
          $game_system.se_play($data_system.decision_se)
          # Make status window active
          @command_window.active = false
          @status_window.active = true
          @status_window.index = 0
        when 4  # journal
          # Play decision SE
          $game_system.se_play($data_system.decision_se)
          # Switch to journal scene
          $scene = Scene_Journal.new
        when 5  # save
          # If saving is forbidden
          if $game_system.save_disabled
            # Play buzzer SE
            $game_system.se_play($data_system.buzzer_se)
            return
          end
          # Play decision SE
          $game_system.se_play($data_system.decision_se)
          # Switch to save screen
          $scene = Scene_Save.new
        when 6  # end game
          # Play decision SE
          $game_system.se_play($data_system.decision_se)
          # Switch to end game screen
          $scene = Scene_End.new
        end
        return
      end
    end
  end
  
  #=============================================================
# ** Window_Steps
#------------------------------------------------------------------------------
#  This window displays step count on the menu screen.
#=============================================================

class Window_Steps < Window_Base
   #--------------------------------------------------------------------------
   # * Object Initialization
   #--------------------------------------------------------------------------
   def initialize
     super(0, 0, 160, 64)
     self.contents = Bitmap.new(width - 32, height - 32)
     refresh
   end
   #--------------------------------------------------------------------------
   # * Refresh
   #--------------------------------------------------------------------------
   def refresh
     self.contents.clear
     self.contents.font.color = system_color
     self.contents.draw_text(0, 0, 50, 32, "Steps")
     self.contents.font.color = normal_color
     self.contents.draw_text(50, 0, 78, 32, $game_party.steps.to_s, 2)
   end
end



Create Scene_Map_Mods (optional)

In this section, we will add a script to enable using the "Q" key to open the journal

1. Open your script editor.

2. Add a new script called Scene_Map_Mods below Scene_Menu_Mods (above Main) in your script list.

3. In Scene_Map_Mods, add the following code:

CODE
class Scene_Map
      alias journal_update update
      
      def update
        journal_update
        if Input.trigger?(Input::L)
          $scene = Scene_Journal.new(1)
        end
      end
    end


Create Journal Entries

Now that you have your Journal set up, you need to add journal entries to it.

1. Go to your Window_Journal script.

2. Find this section:
@data[1] = "Task 1"
@data[2] = "Task 2"
@data[3] = "Task 3"


3. Replace the tasks with your own. For example:
@data[1] = "Find treasure for Jake"
@data[2] = "Get milk for Ma"
@data[3] = "Destroy the world"



Name your Journal Switches

Now that your journal entries are added to your journal, you turn them on and off with switches.
Let's name our switches so we can find them easily while making our game.

Note: The number assigned to each data entry needs to match the number assigned to each switch. For example, @data[2] = "Get milk for Ma" is turned on/off with switch 0002: Help Ma.

1. Add a new event to one of your maps.

2. Open the Event Commands window.

3. Click Control Switches, select the arrow next to Single and add the following by selecting each switch number, and typing in a name below:
0001: Help Jake
0002: Help Ma
0003: Destroy World


4. You can delete this event if you're not using it. Or leave it for an event you'll use. We just used it to add names to the switches.


Turn Entries On and Off

To turn entries on and off, simply turn the journal switches on or off in the Event Command window for an event on the map.


How do I add more journal entries?

To add new journal entries, you need to update your list of switches and your list of journal entires in Window_Journal.

1. Open the Window_Journal script and add another entry to the data[] array. for example, data[4] = "Save the world"

4. Exit the script editor, and open an event on your map. Add a new switch for the journal entry. (for example, 0004: Save World)


I don't want to start with switch 1

If you don't want to start your journal entry with switch 1, simply adjust the @offset variable in Window_Journal as follows:

Note: The following code assumes that you are starting at switch 100 instead of 1.

@offset = 99

I want to use a different windowskin for my journal

You can use a custom windowskin just for your journal window. For example, a parchment or book page, or just a different style of windowskin. You will need to make & place your custom windowskin in the Graphics\Windowskins folder in you project.

1) Right below the @offset variable, uncomment (delete the # sign) the following line:

self.windowskin = RPG::Cache.windowskin("RMXP4life_Wood.png")

2) Change the "RMXP4life_Wood.png" to the name of your custom windowskin.

Enjoy!
And let me know if anything can be explained better, or doesn't work like it should.

This post has been edited by brewmeister: Jan 27 2009, 08:34 PM


__________________________
Go to the top of the page
 
+Quote Post
   
Unnamed
post Jan 29 2009, 07:43 AM
Post #7


Level 1
Group Icon

Group: Member
Posts: 9
Type: Developer
RM Skill: Beginner




Thanks brewmeister this is working perfectly now
Go to the top of the page
 
+Quote Post
   
obsorber
post Jan 31 2009, 03:06 AM
Post #8


Level 26
Group Icon

Group: Revolutionary
Posts: 589
Type: Writer
RM Skill: Skilled




QUOTE (Unnamed @ Jan 29 2009, 03:43 PM) *
Thanks brewmeister this is working perfectly now

Ok brewmeister you are a legend. You've now made the script a super simple journal script haha. I will test this later on but from what I've seen, it looks a lot cleaner and easier to understand. It's now simple and easy for even newbies to understand. Good job my friend laugh.gif


__________________________

The final release of Project Viral is finally here!


Eden Hall, demo released!
Go to the top of the page
 
+Quote Post
   
obsorber
post Jan 31 2009, 03:45 AM
Post #9


Level 26
Group Icon

Group: Revolutionary
Posts: 589
Type: Writer
RM Skill: Skilled




Turn Entries On and Off

(To turn entries on and off, simply turn the journal switches on or off in the Event Command window for an event on the map.)

Ok so far I get everything...I also haven't seen any bugs with this script either apart from lines 82- 93 which I changed and made them green text and not part of the script. How would you turn them off exactly because if you turned of the switches then wouldn't that mess up your game? You need some switches turned on so you can do things...especially when I've already made switches that need to be on as my game has a bit of progression in it. Sorry this script is just really confusing me. It seems easy enough to get it working and use but the turning the script on and off is the bit I'm weary about???


__________________________

The final release of Project Viral is finally here!


Eden Hall, demo released!
Go to the top of the page
 
+Quote Post
   
obsorber
post Jan 31 2009, 05:51 AM
Post #10


Level 26
Group Icon

Group: Revolutionary
Posts: 589
Type: Writer
RM Skill: Skilled




Ok no errors I can find on the script. It is completely clean and neat. Very simple and yet easy to understand and manipulate. For all of you who have made switches which are important in your game to progress through. The maker allows you to start the journal from any switch. You need to do this and go back and re edit it. I was a bit confused but now I'm going to have to redo my game a little again...sad.gif lol I'll sort it out by today...Thanks brewmeister and good job. thanks.gif


__________________________

The final release of Project Viral is finally here!


Eden Hall, demo released!
Go to the top of the page
 
+Quote Post
   
RzrBladeMontage
post Feb 8 2009, 08:34 PM
Post #11


"Hey.. would you say... I became a Hero?" - Zack Fair
Group Icon

Group: Revolutionary
Posts: 773
Type: Event Designer
RM Skill: Advanced




Hey guys I just started using RMXP for a school project and this journal script is exactly what I need. I put everything in correctly and it works just as it's supposed to, but I was wondering if anyone knew how to select something in the journal to read more about it. Like if there was a quest called "Chop Wood" how could I make it so the player could select that option and read information about that quest? Thanks in advance smile.gif.


__________________________





Go to the top of the page
 
+Quote Post
   
obsorber
post Feb 9 2009, 03:03 AM
Post #12


Level 26
Group Icon

Group: Revolutionary
Posts: 589
Type: Writer
RM Skill: Skilled




You can't my friend. Thus the term super simple journal script. Well at least I don't think you can...


__________________________

The final release of Project Viral is finally here!


Eden Hall, demo released!
Go to the top of the page
 
+Quote Post
   
RzrBladeMontage
post Feb 9 2009, 03:24 AM
Post #13


"Hey.. would you say... I became a Hero?" - Zack Fair
Group Icon

Group: Revolutionary
Posts: 773
Type: Event Designer
RM Skill: Advanced




You have a good point, I guess I should of thought of the title before I posted my question.. If anyone else figures out a way to do this please let me know as this is very important. Thanks!


__________________________





Go to the top of the page
 
+Quote Post
   
brewmeister
post Feb 11 2009, 05:11 PM
Post #14


Paste above Main
Group Icon

Group: Revolutionary
Posts: 408
Type: Scripter
RM Skill: Skilled




There are a bunch of other journal or "quest" scripts out there with more functionality.
some have a list of quests on the left, with more detailed descriptions on the right.
Some even have Objectives, for quests with multiple steps.

I'd suggest doing a search.

Be Well


__________________________
Go to the top of the page
 
+Quote Post
   
Bt255
post Feb 14 2009, 04:46 PM
Post #15


Level 4
Group Icon

Group: Member
Posts: 56
Type: Writer
RM Skill: Skilled




Hey everyone. Just started using this script, but I get the following error.

Script 'Window_Journal' line 74: TypeError occured.

cannot convert nil into String

Just wondering how I can resolve this. The Journal Menu comes up when there's no entries in it, but after I turn on the switch for the first entry I get that error. :/


__________________________
Current Projects:

Moonlight Dreams-Paused

Shimmering Darkness-In Progress




Moonlight Dreams Preview <--------Check it out
!!!
Go to the top of the page
 
+Quote Post
   
brewmeister
post Feb 14 2009, 09:38 PM
Post #16


Paste above Main
Group Icon

Group: Revolutionary
Posts: 408
Type: Scripter
RM Skill: Skilled




Post your Window_Journal script from your project.


__________________________
Go to the top of the page
 
+Quote Post
   
Bt255
post Feb 15 2009, 04:36 PM
Post #17


Level 4
Group Icon

Group: Member
Posts: 56
Type: Writer
RM Skill: Skilled




Well here's the script like you asked, if I read your post right. Didn't change much except the offset, which may be my problem? Don't really know, I set it 49 so the first entry is on switch 50.


CODE
#======================================================================
====
# Window_Journal
#------------------------------------------------------------------------------
# This window displays a journal.
#==========================================================================

class Window_Journal < Window_Selectable
# ------------------------
def initialize
super(0, 32, 460, 330)

#----------------------------------------------------------
# populate your journal with entries.
@data = []
@data[50] = "Retrieve 5 Marigolds for Eileen"
@data[51] = "Find Rydan's missing key"
@data[3] = ""
@data[4] = ""
@data[5] = ""

# this is the offset for your switches. If you start with switch 100, set
# @offset = 99

@offset = 49

### to change the windowskin for the journal
self.windowskin = RPG::Cache.windowskin("Silverleaf3-1.png")


#----------------------------------------------------------

@column_max = 1
refresh
self.index = 0
end


#--------------------------------------------------------------------------
# * Draw the contents of the item window
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end

# variables
@journal_height = (@data.size - 1)*32 # y coord of entire journal (# of entries - 1) * 32
@n = 0 # y coord for each entry
@item_max = 0 # max items to display

# draw the bitmap. the text will appear on this bitmap
self.contents = Bitmap.new(width - 32, @journal_height)

for i in 1..@data.size
if $game_switches[i + @offset] == true
draw_item(i)
@item_max += 1
end
end

end

#--------------------------------------------------------------------------
# * Draw an individual item in the window
# index : Index of the item to be drawn
#--------------------------------------------------------------------------

def draw_item(index)
item = @data[index]
rect = Rect.new(10, @n, 640, 32)
self.contents.fill_rect(rect, Color.new(0,0,0,0))
self.contents.draw_text(10, @n, 640, 32, "●", 0)
self.contents.draw_text(25, @n, 640, 32, item, 0)
@n += 32

end

end


Well if this helps you help me figure out what's wrong then thanks. It might just not work with another script, but I somewhat doubt that considering the error was on one of the scripts to make the journal work.


__________________________
Current Projects:

Moonlight Dreams-Paused

Shimmering Darkness-In Progress




Moonlight Dreams Preview <--------Check it out
!!!
Go to the top of the page
 
+Quote Post
   
brewmeister
post Feb 21 2009, 09:37 PM
Post #18


Paste above Main
Group Icon

Group: Revolutionary
Posts: 408
Type: Scripter
RM Skill: Skilled




Change @data[50] & @data[51] back to [1] & [2]

The @offset is only for the switches, not for the @data array.

I would recommend adjusting your @offset to 50, and starting with switch 51. Just to make it a little easier to keep track.
i.e. switch 51 goes with journal entry 1, etc..

Be Well


__________________________
Go to the top of the page
 
+Quote Post
   
Bt255
post Feb 21 2009, 09:43 PM
Post #19


Level 4
Group Icon

Group: Member
Posts: 56
Type: Writer
RM Skill: Skilled




It all works perfectly now; and yeah, it is easier to start on switch 51. Well thanks for all your help! biggrin.gif


__________________________
Current Projects:

Moonlight Dreams-Paused

Shimmering Darkness-In Progress




Moonlight Dreams Preview <--------Check it out
!!!
Go to the top of the page
 
+Quote Post
   
patmi
post Dec 24 2011, 08:07 AM
Post #20


Level 1
Group Icon

Group: Validating
Posts: 7
Type: Event Designer
RM Skill: Beginner




Hello this is very nice, but it worked only with my first quest sad.gif After I got the tonic for the sailor and tried to access the Journal I got an Error in the first script at line 74 - Cannot convert nil into String! sad.gif I am using Enu SBS Tanketai and also Ccoas UMS and the Super Simple Mouse system from Amaranth as well. Can someone tell me pls how can i fix this annying error?

THX
Go to the top of the page
 
+Quote Post
   

2 Pages V   1 2 >
Closed TopicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 07:44 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker