Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Mattfriends's Diary System Script, Wish to have a diary in your game? Check this out!!!
mattfriends
post Jul 29 2010, 05:41 AM
Post #1


Level 3
Group Icon

Group: Member
Posts: 43
Type: Scripter
RM Skill: Advanced




Mattfriends's Diary System Script
Authors: Mattfriends
Type: Diary System


Introduction

This script allow you to create a great simple diary.

Features

  • Add an event into a diary with one short script.
  • Easily to call the script.


Screenshots

None

Demo

None

Script

Version 1
CODE
#=============================================================================
#
#                           Mattfriends's Diary
#
# Introduction:
# Place the script above Main.
#
# How to use:
# You need to call this script once and at the start of the game.
# Diary.setup()
#
# Use this to call the script,
# $scene = Scene_Diary.new
#
# To add event into the diary use this,
# Diary.add("TEXT")
#
# Examples:
# Diary.add("Went to bed.")
#
# Credit:
# mattfriends for making it
#
# PLEASE GIVE CREDITS AFTER USING IT
#
#=============================================================================

class DiaryBox < Window_Base
  def initialize
    super(0, 0, 640, 70)
    self.contents = Bitmap.new(width - 32, height - 32)
    update
  end
  def update
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.size = 25
    cx = contents.text_size("Diary").width
    self.contents.draw_text(0, 0, cx, 37, "Diary")
  end
end

class DiaryMain < Window_Base
  def initialize  
    super(0, 70, 640, 410)
    self.contents = Bitmap.new(width - 32, height - 32)
    update
  end
  
  def update
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.size = 20
    cx = contents.text_size($dln1).width
    self.contents.draw_text(0, 0, cx, 32, $dln1)
    cx = contents.text_size($dln2).width
    self.contents.draw_text(0, 32, cx, 32, $dln2)
    cx = contents.text_size($dln3).width
    self.contents.draw_text(0, 64, cx, 32, $dln3)
    cx = contents.text_size($dln4).width
    self.contents.draw_text(0, 96, cx, 32, $dln4)
    cx = contents.text_size($dln5).width
    self.contents.draw_text(0, 128, cx, 32, $dln5)
    cx = contents.text_size($dln6).width
    self.contents.draw_text(0, 160, cx, 32, $dln6)
    cx = contents.text_size($dln7).width
    self.contents.draw_text(0, 192, cx, 32, $dln7)
    cx = contents.text_size($dln8).width
    self.contents.draw_text(0, 224, cx, 32, $dln8)
    cx = contents.text_size($dln9).width
    self.contents.draw_text(0, 256, cx, 32, $dln9)
    cx = contents.text_size($dln10).width
    self.contents.draw_text(0, 288, cx, 32, $dln10)
  end
end

class Scene_Diary
  def main
    @windowDesc = DiaryBox.new
    @windowMain = DiaryMain.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Map.new
        break
      end
    end
    Graphics.freeze
    @windowDesc.dispose
    @windowMain.dispose
  end
  
  def update
    @windowDesc.update
    @windowMain.update
  end
end

class Diary
  def self.setup()
    $dln1 = ""
    $dln2 = ""
    $dln3 = ""
    $dln4 = ""
    $dln5 = ""
    $dln6 = ""
    $dln7 = ""
    $dln8 = ""
    $dln9 = ""
    $dln10 = ""
  end
  def self.add(text)
    $dln10 = $dln9
    $dln9 = $dln8
    $dln8 = $dln7
    $dln7 = $dln6
    $dln6 = $dln5
    $dln5 = $dln4
    $dln4 = $dln3
    $dln3 = $dln2
    $dln2 = $dln1
    $dln1 = text
  end
end

Version 2
CODE
#=============================================================================
#
#                          Mattfriends's Diary v2
#
# Introduction:
# Place the script above Main.
#
# How to use:
# Use this to call the script,
# $scene = Scene_Diary.new
#
# To add event into the diary use this,
# Diary.add("TEXT")
#
# Examples:
# Diary.add("Went to bed.")
#
# Credit:
# mattfriends for making it
#
# PLEASE GIVE CREDITS AFTER USING IT
#
#=============================================================================

$dln1 = ""
$dln2 = ""
$dln3 = ""
$dln4 = ""
$dln5 = ""
$dln6 = ""
$dln7 = ""
$dln8 = ""
$dln9 = ""
$dln10 = ""

class DiaryBox < Window_Base
  def initialize
    super(0, 0, 640, 70)
    self.contents = Bitmap.new(width - 32, height - 32)
    update
  end
  def update
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.size = 25
    cx = contents.text_size("Diary").width
    self.contents.draw_text(0, 0, cx, 37, "Diary")
  end
end

class DiaryNewestText < Window_Base
  def initialize
    super(0, 70, 130, 70)
    self.contents = Bitmap.new(width - 32, height - 32)
    update
  end
  def update
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.size = 25
    cx = contents.text_size("Newest -").width
    self.contents.draw_text(0, 0, cx, 37, "Newest -")
  end
end

class DiaryBlank < Window_Base
  def initialize
    super(0, 140, 130, 270)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
end

class DiaryLastestText < Window_Base
  def initialize
    super(0, 410, 130, 70)
    self.contents = Bitmap.new(width - 32, height - 32)
    update
  end
  def update
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.size = 25
    cx = contents.text_size("Lastest -").width
    self.contents.draw_text(0, 0, cx, 37, "Lastest -")
  end
end

class DiaryNewest < Window_Base
  def initialize
    super(130, 70, 510, 70)
    self.contents = Bitmap.new(width - 32, height - 32)
    update
  end
  def update
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.size = 25
    cx = contents.text_size($dln1).width
    self.contents.draw_text(0, 0, cx, 37, $dln1)
  end
end

class DiaryMain < Window_Base
  def initialize  
    super(130, 140, 510, 340)
    self.contents = Bitmap.new(width - 32, height - 32)
    update
  end
  
  def update
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.size = 20
    cx = contents.text_size($dln2).width
    self.contents.draw_text(0, 0, cx, 32, $dln2)
    cx = contents.text_size($dln3).width
    self.contents.draw_text(0, 32, cx, 32, $dln3)
    cx = contents.text_size($dln4).width
    self.contents.draw_text(0, 64, cx, 32, $dln4)
    cx = contents.text_size($dln5).width
    self.contents.draw_text(0, 96, cx, 32, $dln5)
    cx = contents.text_size($dln6).width
    self.contents.draw_text(0, 128, cx, 32, $dln6)
    cx = contents.text_size($dln7).width
    self.contents.draw_text(0, 160, cx, 32, $dln7)
    cx = contents.text_size($dln8).width
    self.contents.draw_text(0, 192, cx, 32, $dln8)
    cx = contents.text_size($dln9).width
    self.contents.draw_text(0, 224, cx, 32, $dln9)
    cx = contents.text_size($dln10).width
    self.contents.draw_text(0, 256, cx, 32, $dln10)
  end
end

class Scene_Diary
  def main
    @windowDesc = DiaryBox.new
    @windowNewT = DiaryNewestText.new
    @windowBlank = DiaryBlank.new
    @windowLastT = DiaryLastestText.new
    @windowNew = DiaryNewest.new
    @windowMain = DiaryMain.new
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
      if Input.trigger?(Input::B)
        $game_system.se_play($data_system.cancel_se)
        $scene = Scene_Map.new
        break
      end
    end
    Graphics.freeze
    @windowDesc.dispose
    @windowNewT.dispose
    @windowBlank.dispose
    @windowLastT.dispose
    @windowNew.dispose
    @windowMain.dispose
  end
  
  def update
    @windowDesc.update
    @windowNewT.update
    @windowBlank.update
    @windowLastT.update
    @windowNew.update
    @windowMain.update
  end
end

class Diary
  def self.add(text)
    $dln10 = $dln9
    $dln9 = $dln8
    $dln8 = $dln7
    $dln7 = $dln6
    $dln6 = $dln5
    $dln5 = $dln4
    $dln4 = $dln3
    $dln3 = $dln2
    $dln2 = $dln1
    $dln1 = text
  end
end


Instructions

Inside the script.

Compatibility

Every script. 100% sure.

Credits and Thanks

  • Me - For doing it.


Author's Notes

I made this script because I haven't seen much of them and I made it easier to use. Hope you like it. laugh.gif

This post has been edited by mattfriends: Jul 29 2010, 11:57 PM


__________________________
The new adventure - Real time action battle game.

Lastest Version - Demo v2.0

MY WEBSITE: I have moved to my website now. I'm not usually activate here anymore.

http://rpgxpultimate.darkbb.com/
Please register.
Go to the top of the page
 
+Quote Post
   

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 01:42 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker