RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Diary 1.0

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
Diary
Version: 1.0
Author: modern algebra
Date: October 4, 2009

Version History


  • <Version 1.0> 10.04.2009 - Original Release

Description


This script allows you to add entries into a diary, much like the system in Baldur's Gate. It allows you to make any number of entries and add them into the journal at any time, and they will be ordered by the playtime you encountered them in. Unlike Baldur's Gate, you can also set pictures in the entries, to appear to the left, right, or center at the top of the entry. Further, you can use a number of special codes in the script to make the entries more interesting.

This script also has built-in capabilities to add itself to the menu, though it may not be compatible with some custom menu systems.

Features

  • Can keep track of quest progress (or simply a character's reflections on the events) with the personality of the character, rather than a dry list
  • Can include a picture to accentuate the entry, as well as record the playtime the entry was received
  • Can use a lot of special mesage codes to make the entries pretty, such as bolded. italicized, underlined text, and familiar replacement codes such as \\v[] for variables and \\n[] for names and many many more. A full list is included in the script
  • Can customize almost everything about the scene layout, including the graphic used, how many pages to show, where the page numbers go and where the label goes
  • Built in capability to add itself to the menu (though may not work with some CMSes)

Screenshots


A basic book-style journal with multiple entries displayed. The book image is from http://juliacompany.com/images/open-book.jpg


But you don't have to use the base image provided, you can also customize how and where text shows up, how many pages are shown at a time, where they are shown, on what background they are shown, and where the label is shown (and if it is rotated) and much more. The layout is entirely customizable!

The parchment image is from Shutterstock (not included because it has to be paid for), but a useful example

Instructions

Place this script in your project's Script Editor (F11) above Main and below all other custom scripts.

See the header and editable regions of the script for detailed instructions on configuration and use.

Script


Note that this script requires the Paragraph Formatter v. 2.0, as well as the Special Codes Formatter that is attached at the bottom of that post. The Formatter has to be Version 2.0 ~ it will not work with earlier versions of the Paragraph Formatter, but the new paragraph formatter will still work with any other scripts you might have that uses an earlier version of the Paragraph Formatter.

Please see the demo or attached text document

Also, attached is the "Diary Back" image used in the demo. It was taken and edited from http://juliacompany.com/images/open-book.jpg. While that particular graphic is not necessary, you will probably want to find some image to use as a backdrop for the text.

Addons

Spoiler for Multiple Diaries Addon:
While always possible to have multiple diaries in the script, this addon gives an easy way to create and access them for the non-scripter. They are not accessible through the menu, only through events. So you can use items to call them, for instance, or a common event on key press. Detailed instructions are included in the header and the editable region:

Code: [Select]
#==============================================================================
#    Multiple Diaries
#      Addon to Diary 1.0
#    Version: 1.0
#    Author: modern algebra (rmrk.net)
#    Date: January 17, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This allows for an built-in way to create and access multiple diaries.
#   Unlike the main diary, this is a little simpler as it does not allow for
#   access through the menu or anything fancy, so it has to be called through
#   an event. Entries for these diaries are also set up in the default way
#   through the main script
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Place this script below the main Diary script, but keep it above Main
#
#    To create the new diaries, go down to line 66 and read the instructions
#   located there. Keep in mind what order you creat them, as that is how you
#   will access them. The main diary will always have the ID 0, so each of the
#   new diaries you create will have IDs starting from 1. So, the first one you
#   make has ID 1, the second one ID 2, and so on.
#
#    You can then write entries or call the diaries by using their IDs in these
#   codes, which you put in the call script event command:

#      write_diary_entry (entry_id, diary_id)
#        entry_id : this is an ID of an entry set up in the database, or it
#          could be an entry object itself if you have set one up in an
#          event (which is NOT recommended, btw).
#        diary_id : this is the ID of the diary you want to call. It could also
#          be the diary object itself, if you wanted, but I don't see any
#          reason why that would be easier than the ID. If left blank, it
#          defaults to the main diary that you set up through the main script.
#
#      call_diary (diary_id)
#        diary_id : this is the ID of the diary you want to call. It could also
#          be the diary object itself. If left blank, it defaults to the main
#          diary that you set up through the main script.
#==============================================================================

#==============================================================================
# ** Game System
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new instance variable - diaries
#    aliased method - initialize
#==============================================================================

class Game_System
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_reader   :diaries
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_joy_cokbok_diry_4kw1 initialize
  def initialize (*args)
    # Run Original Method
    ma_joy_cokbok_diry_4kw1 (*args)
    @diaries = [@diary]
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    #  EDITABLE REGION
    #``````````````````````````````````````````````````````````````````````````
    # Make new diaries Like this:
    #    name = "name of diary"
    #    font_name = "name of font" OR ["font_1", "font_2", ..., "font_n"]
    #    back_pic = "name of Background Image
    #    page_rects = [Rect.new (x, y, w, h), Rect.new (x, y, w, )]
    #      w, h : width, height
    #    num_rects = [[Rect.new (x, y, w, h), align], [Rect.new (x, y, w, h), align]]
    #      align : 0 => Left, 1 => Middle, 2 => Right
    #
    #  You must define all of the following, and then you can make it:
    #    @diaries.push (Diary.new (name, font_name, back_pic, page_rects, num_rects))
    #
    #  I should note, if you do not define arguments, then they resorts to
    #  the default setting you've set up. However, you can't "skip" arguments.
    #  If you want back_pic to be default but want to change page_rects, then
    #  you will need to define back_pic anyway. However, if you wanted back_pic,
    #  page_rects, and num_rects all to be default, then you would only need to
    #  define name and font_name and create it like this:
    #    @diaries.push (Game_Diary.new (name, font_name))
    name = "Cookbook"
    @diaries.push (Game_Diary.new (name))
    #``````````````````````````````````````````````````````````````````````````
    #  END EDITABLE REGION
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  end
end

#==============================================================================
# ** Game_Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased methods - call_diary, write_diary_entry
#==============================================================================

class Game_Interpreter
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Write Diary Entry
  #    entry : either an Game_DiaryEntry object or an entry ID
  #    diary : the Game_Diary object to write it to
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_mult_diry_writeentry_6hf2 write_diary_entry
  def write_diary_entry (entry, diary = $game_system.diary, *args)
    diary = $game_system.diaries[diary] if diary.is_a? (Integer)
    ma_mult_diry_writeentry_6hf2 (entry, diary, *args)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Call Diary
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mjoy_clldiry_multiples_8kd2 call_diary
  def call_diary (diary = $game_system.diary, *args)
    diary = $game_system.diaries[diary] if diary.is_a? (Integer)
    mjoy_clldiry_multiples_8kd2 (diary, *args)
  end
end

Credit


  • modern algebra

Support


Please post in this topic at RMRK for swiftest response. I will fix any bugs that may arise.

Known Compatibility Issues

Likely will not work with some Custom Menu Systems.

Spoiler for YEM Menu:
First, put all of the Diary scripts above YEM Menu in the Script Editor.

Next, paste this code somewhere below the YEM Menu script in the editor, but still above Main:
Code: [Select]
if Data_DiaryEntries::MENU_ACCESS
 
YEM::MENU::MENU_COMMANDS.insert (Data_DiaryEntries::MENU_INDEX, :diary)
YEM::MENU::MENU_ICONS[:diary] = 178
YEM::MENU::IMPORTED_COMMANDS[:diary] = [nil, nil, false, 178, Data_DiaryEntries::VOCAB_DIARY_LABEL, "Scene_Diary"]

class Scene_Diary
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize (diary = $game_system.diary, from_menu = true)
    @diary = diary
    @from_menu = from_menu
  end
end

end

You can change the 178 in this:

Code: [Select]
YEM::MENU::MENU_ICONS[:diary] = 178

to whatever icon you want to use for YEM

Now, the only problem with this patch is that if you use MAP_ACCESS in the diary script, then when you leave the diary you go to the Menu instead of back to the map. To fix that, you can go to around line 648 of the diary script and change:
Code: [Select]
          $scene = Scene_Diary.new ($game_system.diary)

to:

Code: [Select]
          $scene = Scene_Diary.new ($game_system.diary, false)

Demo


Note that this script requires the Paragraph Formatter v. 2.0, as well as the Special Codes Formatter that is attached at the bottom of that post. Note that the Formatter has to be Version 2.0 ~ it will not work with earlier versions of the Paragraph Formatter, but the new paragraph formatter will still work with any other scripts you might have that uses an earlier version of the Paragraph Formatter.

Both are included in the attached demo


Creative Commons License
This script by modern algebra is licensed under a Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.
« Last Edit: January 03, 2012, 02:08:06 AM by modern algebra »

****
Rep:
Level 83
Very nice script. Good job

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
Thanks, I'm glad you like it redyugi

****
Rep:
Level 83
Well its a more "personal" version of a quest script. Now it sorta takes the player inside the mind of one of your characters.

pokeball joyOfflineFemale
*
Rep:
Level 85
I heard the voice of the salt in the desert
2012 Best RPG Maker User (Mapping)Project of the Month winner for June 20092010 Best RPG Maker User (Creativity)2011 Best RPG Maker User (Mapping)2011 Best RPG Maker User (Creativity)Winner - 2011 Winter Project of the Season2010 Best RPG Maker User (Mapping)2010 Best RPG Maker User (Graphical)2010 Best Artist2014 Best RPG Maker User - Graphics2014 Best RPG Maker User - Mapping2014 Best Artist2013 Best RPG Maker User (Graphical)2013 Best RPG Maker User (Mapping)2010 Most Unsung Member2010 Most Attractive Female Member
Hey mod, I have a question.

I see you mention multiple diaries in the instructions, how would one go about doing that? Like say, having a Diary in the traditional sense, but also having a separate notebook with things like recipes and whatnot.

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
Essentially, all that would need to be done is to create a new Game_Diary object and then save it somewhere. All of the codes can take a diary argument - when none is specified it assumes a default diary. So, you would need to put the diary in as an argument when you use the "call_diary (diary)" code. Otherwise it would call the system diary. When you were adding entries, it would need to be "write_diary_entry (entry_id, diary)".

In any case, you would first need to make a diary to call. You could make this in a game variable if you wanted, but it would be better to make it in one of the Game classes. Either way, to make it, you would need to use the code:

Code: [Select]
xx = Game_Diary.new (name, font_name, back_pic, page_rects, num_rects)

Each of those default to the values specified in constants if you do not specify a value. Ex:

Code: [Select]
$game_variables[1] = Game_Diary.new ("Cookbook")

So, in that case, Variable 1 would hold the diary and obivously could not be used in any normal variable operations. It would be the same as a regular diary except it's name would be Cookbook.

To call it, you would need to use the code:
Code: [Select]
call_diary ($game_variables[1])
. To write an entry you would need the code:
Code: [Select]
write_diary_entry (entry_id, $game_variables[1])

You would create the entries as you normally would in the editor, but just only use cookbook entries in the cookbook and not in the regular Diary.

Now, if you wanted to add it to the menu, it would be more trouble.

As you can see, it's fairly complicated. If you specify exactly how you want the recipe book to be available and what graphics you want to use then I can make an addon to the script that does all that if you want me to.

pokeball joyOfflineFemale
*
Rep:
Level 85
I heard the voice of the salt in the desert
2012 Best RPG Maker User (Mapping)Project of the Month winner for June 20092010 Best RPG Maker User (Creativity)2011 Best RPG Maker User (Mapping)2011 Best RPG Maker User (Creativity)Winner - 2011 Winter Project of the Season2010 Best RPG Maker User (Mapping)2010 Best RPG Maker User (Graphical)2010 Best Artist2014 Best RPG Maker User - Graphics2014 Best RPG Maker User - Mapping2014 Best Artist2013 Best RPG Maker User (Graphical)2013 Best RPG Maker User (Mapping)2010 Most Unsung Member2010 Most Attractive Female Member
:O

That would be amazing, man. I was just planning on using the same graphic system really, just organize the post differently. As for calling it, since I don't anticipate the player needing it all the time I was just gonna tie it to an item with a common event.

You need a cameo in this game...

**
Rep: +0/-0Level 82
write_diary_entry (entry_id[, diary])

I used that in the call script function under advanced, script... but when I run it it says syntax error. What do I do, I also tried specifying the enty id like write_diary_entry (entry_1[, diary]) but the same error came up! Please Help. Im I using the command wrongly? I dont know whats wrong.  ???
Mutualy mentaly molested children of a mother!

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
Don't use the square brackets, and only put the ID. The square brackets just mean that that argument can be excluded unless you have more than one diary. So, to do it properly, do:

write_diary_entry (1)

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
Wow, joy - I'm really bad at doing thing I say I'll do :P

Anyway, I just realized I hadn't done what you asked of me when I visited this topic for another reason, so I figured I'd do it up quickly - these diaries won't show up in the menu, so you have to use events to call them, but I figured that'd be OK. The instructions are inside, but if there's anything you don't know how to do just tell me and I'll clarify or fix it.


Spoiler for Multiple Diaries Addon:
Code: [Select]
#==============================================================================
#    Multiple Diaries
#      Addon to Diary 1.0
#    Version: 1.0
#    Author: modern algebra (rmrk.net)
#    Date: January 17, 2010
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This allows for an built-in way to create and access multiple diaries.
#   Unlike the main diary, this is a little simpler as it does not allow for
#   access through the menu or anything fancy, so it has to be called through
#   an event. Entries for these diaries are also set up in the default way
#   through the main script
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Place this script below the main Diary script, but keep it above Main
#
#    To create the new diaries, go down to line 66 and read the instructions
#   located there. Keep in mind what order you creat them, as that is how you
#   will access them. The main diary will always have the ID 0, so each of the
#   new diaries you create will have IDs starting from 1. So, the first one you
#   make has ID 1, the second one ID 2, and so on.
#
#    You can then write entries or call the diaries by using their IDs in these
#   codes, which you put in the call script event command:

#      write_diary_entry (entry_id, diary_id)
#        entry_id : this is an ID of an entry set up in the database, or it
#          could be an entry object itself if you have set one up in an
#          event (which is NOT recommended, btw).
#        diary_id : this is the ID of the diary you want to call. It could also
#          be the diary object itself, if you wanted, but I don't see any
#          reason why that would be easier than the ID. If left blank, it
#          defaults to the main diary that you set up through the main script.
#
#      call_diary (diary_id)
#        diary_id : this is the ID of the diary you want to call. It could also
#          be the diary object itself. If left blank, it defaults to the main
#          diary that you set up through the main script.
#==============================================================================

#==============================================================================
# ** Game System
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new instance variable - diaries
#    aliased method - initialize
#==============================================================================

class Game_System
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Public Instance Variables
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  attr_reader   :diaries
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_joy_cokbok_diry_4kw1 initialize
  def initialize (*args)
    # Run Original Method
    ma_joy_cokbok_diry_4kw1 (*args)
    @diaries = [@diary]
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    #  EDITABLE REGION
    #``````````````````````````````````````````````````````````````````````````
    # Make new diaries Like this:
    #    name = "name of diary"
    #    font_name = "name of font" OR ["font_1", "font_2", ..., "font_n"]
    #    back_pic = "name of Background Image
    #    page_rects = [Rect.new (x, y, w, h), Rect.new (x, y, w, )]
    #      w, h : width, height
    #    num_rects = [[Rect.new (x, y, w, h), align], [Rect.new (x, y, w, h), align]]
    #      align : 0 => Left, 1 => Middle, 2 => Right
    #
    #  You must define all of the following, and then you can make it:
    #    @diaries.push (Diary.new (name, font_name, back_pic, page_rects, num_rects))
    #
    #  I should note, if you do not define arguments, then they resorts to
    #  the default setting you've set up. However, you can't "skip" arguments.
    #  If you want back_pic to be default but want to change page_rects, then
    #  you will need to define back_pic anyway. However, if you wanted back_pic,
    #  page_rects, and num_rects all to be default, then you would only need to
    #  define name and font_name and create it like this:
    #    @diaries.push (Diary.new (name, font_name))
    name = "Cookbook"
    @diaries.push (Diary.new (name))
    #``````````````````````````````````````````````````````````````````````````
    #  END EDITABLE REGION
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  end
end

#==============================================================================
# ** Game_Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased methods - call_diary, write_diary_entry
#==============================================================================

class Game_Interpreter
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Write Diary Entry
  #    entry : either an Game_DiaryEntry object or an entry ID
  #    diary : the Game_Diary object to write it to
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_mult_diry_writeentry_6hf2 write_diary_entry
  def write_diary_entry (entry, diary = $game_system.diary, *args)
    diary = $game_system.diaries[diary] if diary.is_a? (Integer)
    ma_mult_diry_writeentry_6hf2 (entry, diary, *args)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Call Diary
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias mjoy_clldiry_multiples_8kd2 call_diary
  def call_diary (diary = $game_system.diary, *args)
    diary = $game_system.diaries[diary] if diary.is_a? (Integer)
    mjoy_clldiry_multiples_8kd2 (diary, *args)
  end
end
« Last Edit: May 17, 2010, 02:00:37 PM by modern algebra »

****
Raped by DrSword
Rep:
Level 83
Dance with the enemy
Contestant - GIAW 10Contestant - GIAW 9
The script doesnt even work
It came up with some error, why do no ellaborate scripts work for me?


*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
I don't know - it works for me. Did you make sure to follow the instructions and copy the paragraph formatter into your project? What other scripts are you using? Does the demo work for you? What does the error message say?

****
Raped by DrSword
Rep:
Level 83
Dance with the enemy
Contestant - GIAW 10Contestant - GIAW 9
I don't know - it works for me. Did you make sure to follow the instructions and copy the paragraph formatter into your project? What other scripts are you using? Does the demo work for you? What does the error message say?
Where can I find it?
None
yeah....
cause I deleted the script so I dont know


*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
The best place is just to take it straight from the demo as that has all the parts you need, or you could take it from: Paragraph Formatter v. 2.0 - you need the Special Codes formatter too.

****
Raped by DrSword
Rep:
Level 83
Dance with the enemy
Contestant - GIAW 10Contestant - GIAW 9
The best place is just to take it straight from the demo as that has all the parts you need, or you could take it from: Paragraph Formatter v. 2.0 - you need the Special Codes formatter too.
aaargh too much stuff XD


**
Rep:
Level 81
RMRK Junior
Gahh, I'm too simple-minded for this scripting stuff. Could you tell me in more detail how to make more than one diary, because I have a feeling I'm doing something wrong because when ever I try to make one, I mess up  :(
Feed my dragons your clicks! Please...? Or they'll die, and I'll be really sad... I already named them and everything.




*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
I don't really know how to explain it any better than I do at line 66 of the Addon, so maybe some examples would help:

Code: [Select]
name = "Recipe Book"
font_name = ["Times New Roman", "Arial"]
back_pic = "Cookbook_Back"
page_rects = [Rect.new (20, 20, 200, 360), Rect.new (260, 20, 200, 360)]
num_rects = [[Rect.new (110, 384, 20, 24), 1], [Rect.new (350, 384, 20, 24), 1]]
@diaries.push (Game_Diary.new (name, font_name, back_pic, page_rects, num_rects))
name = "Ulrika's Diary"
@diaries.push (Game_Diary.new (name))

That code would create two diaries.

The first would be named Recipe Book, it would use Times New Roman as its font, or Arial if Times New Roman isn't installed on the player's computer. It uses an image called Cookbook_Back located in the Pictures folder as the background. It draws two pages, both 200x360 that are located at 20x20 and 260x20 respectively. The page numbers are shown at the bottom of the center of each page. It would be accessed by the ID 1.

The second diary would be named Ulrika's Diary, and it would have the default font, picture, and pages since those aren't set. It would be accessed by the ID 2.

You could write entries to those diaries using call script, like so:

Code: [Select]
write_diary_entry (entry, diary_id)

where entry is either a Game_DiaryEntry object or an ID of one of the entries you set up in the database. diary_id is the Id of the diary you want to write to. 0 is the default diary and it will default to that if you don't put in diary_id at all. 1 would refer to "Recipe Book", and 2 would refer to "Ulrika's Diary"

You can open these diaries with the call script:

Code: [Select]
call_diary (diary_id)

where diary_id is the same as above.

**
Rep: +0/-0Level 84
Thanks Modern Algebra, this script is awesome. The script always open showing the last page when you close the diary, there's a way to make they show always the last (reverse order) page? If not, the way they work it's ok.
« Last Edit: May 25, 2010, 11:54:38 PM by user3k »

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
I don't know what you're asking for. It already opens to the start of the last entry immediately after it is added. After that, if you open the diary, it opens to the last page you were on. So, you want it to open at the first entry? Or do you mean you want it so that the player can't turn the pages? Or do you mean that you want it to open to the latest entry even if it wasn't just added, and not to the page it was last closed on?
« Last Edit: May 26, 2010, 12:18:16 AM by modern algebra »

**
Rep: +0/-0Level 84
"Or do you mean that you want it to open to the latest entry even if it wasn't just added"
This way.

**
Rep: +0/-0Level 84
Somebody had luck making this script work with yanfly custom menu? I'm testing with YEM Main Menu Melody, and they don't work - Script Diary  line 855: Argument error ocurred. wrong number of arguments (2 for 1)

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
Yeah, well they aren't hard to make compatible. Yanfly changes how many arguments are expected in the command window, which is why that error occurs. But they aren't hard to make compatible. First, put all of the Diary scripts above YEM Menu in the Script Editor.

Next, paste this code somewhere below the YEM Menu script in the editor, but still above Main:
Code: [Select]
if Data_DiaryEntries::MENU_ACCESS
 
YEM::MENU::MENU_COMMANDS.insert (Data_DiaryEntries::MENU_INDEX, :diary)
YEM::MENU::MENU_ICONS[:diary] = 178
YEM::MENU::IMPORTED_COMMANDS[:diary] = [nil, nil, false, 178, Data_DiaryEntries::VOCAB_DIARY_LABEL, "Scene_Diary"]

class Scene_Diary
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Object Initialization
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def initialize (diary = $game_system.diary, from_menu = true)
    @diary = diary
    @from_menu = from_menu
  end
end

end

You can change the 178 in this:

Code: [Select]
YEM::MENU::MENU_ICONS[:diary] = 178

to whatever icon you want to use for YEM

Now, the only problem with this patch is that if you use MAP_ACCESS in the diary script, then when you leave the diary you go to the Menu instead of back to the map. To fix that, you can go to around line 648 of the diary script and change:
Code: [Select]
          $scene = Scene_Diary.new ($game_system.diary)

to:

Code: [Select]
          $scene = Scene_Diary.new ($game_system.diary, false)
« Last Edit: May 27, 2010, 09:08:39 PM by modern algebra »

**
Rep: +0/-0Level 84
Thanks, it works!

**
Rep: +0/-0Level 83
this looks fun. its been a while since ive been on here but MA scripts are pretty intuitive even for a complete programming newbie like me. so heres my question, when i read diary i almost felt like it would let the player type up an entry, is that possible? i looked into the script editor and see the text is already pre-typed in there and while it is awesomely useful, there may be a way to let the player enter something of their own maybe?

*
Rep:
Level 97
2014 Best RPG Maker User - Engine2014 Most Unsung Member2013 Best RPG Maker User (Scripting)2012 Best RPG Maker User (Scripting)2012 Best Member2012 Favorite Staff Member2012 Most Mature MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Most Mature Member2011 Best Use of Avatar and Signature Space2011 Favourite Staff Member2011 Best Veteran2011 Best RPG Maker User (Scripting)2010 Most Mature Member2010 Favourite Staff Member
Well, I'd basically have to write a word processor to do that. Maybe I will in the future, but definitely not right now.