Note Editor
Version: 1.0
Author: modern algebra
Date: December 17, 2009
Version History
- <Version 1.0> 12.17.2009 - Original Release
Description
This script allows you to edit the note field of an item with script calls in-game. This is useful for editing features of other scripts that use the note field for adding features; this will allow you to add those features as part of the gameplay. The edits will only apply within the same game file, so the note field will be clean whenever the player starts a new game. It does not overwrite the regular note field - anything written in note field in the database will be permanent in every save file.
Features
- Allows you to add things to the note field
- Useful when using scripts that use note fields, as you can add those features to things in-game
- Can delete any of the added things from the note field - cannot alter the database note fields
Instructions
Paste this script into the editor below the default scripts but above Main
To use this script, simply use these codes in a call script:
add_note (type, id, note)
type : refers to the database tab you want to change the notes of. It is an integer, and broke down like this:
0 => Item
1 => Weapon
2 => Armor
3 => Skill
4 => Enemy
5 => State
id : the specific ID of the particular item, weapon, armor, skill, enemy, or state you want to edit the note field of.
note : this is the string that you want to add to the note field.
delete_note (type, id, note)
type : same as for add_note
id : same as for add_note
note : this is the note you want to delete. It can be either the string itself, or it can be an integer if (and onlt if) you know the order it was added in - if you put in the integer 2 here, it will delete the third string you added to the item's note.
delete_note will only delete notes that have been added to the note field in-game - it will not delete notes you set in the database directly.
Script
#==============================================================================
# Note Editor
# Version: 1.0
# Author: modern algebra (rmrk.net)
# Date: December 16, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This script allows you to edit the note field of an item with script calls
# in-game. This is useful for editing features of other scripts that use the
# note field for adding features; this will allow you to add those features
# as part of the gameplay. The edits will only apply within the same game
# file, so the note field will be clean whenever the player starts a new
# game. It does not overwrite the regular note field - anything written in
# note field in the database will be permanent in every save file.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# Paste this script into the editor below the default scripts but above Main
#
# To use this script, simply use these codes in a call script:
#
# add_note (type, id, note)
# type : refers to the database tab you want to change the notes of.
# It is an integer, and broke down like this:
# 0 => Item
# 1 => Weapon
# 2 => Armor
# 3 => Skill
# 4 => Enemy
# 5 => State
# id : the specific ID of the particular item, weapon, armor, skill,
# enemy, or state you want to edit the note field of.
# note : this is the string that you want to add to the note field.
# delete_note (type, id, note)
# type : same as for add_note
# id : same as for add_note
# note : this is the note you want to delete. It can be either the
# string itself, or it can be an integer if (and onlt if) you
# know the order it was added in - if you put in the integer 2
# here, it will delete the third string you added to the item's
# note.
#
# delete_note will only delete notes that have been added to the note field
# in-game - it will not delete notes you set in the database directly.
#
# EXAMPLES:
# add_note (0, 1, "new \\ note")
# This would add "new \ note" to the note field of a potion (first item)
# add_note (4, 6, "Default wisp")
# This would add "Default wisp" to the note field of the sixth enemy in
# the database (coincidentally a willowisp by default)
# delete_note (2, 45, "\\CG[Evil, 5]")
# This would delete the note "\CG[Evil, 5]" from the note field of the
# 45th weapon in the database if it had been added in-game through the
# add_note script. It would not delete it if you set it in the database
# itself.
#==============================================================================
module RPG
#==============================================================================
# ** RPG::BaseItem
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - note
#==============================================================================
class BaseItem
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Return Note
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malgb_acigd_ntedit_7jb3 note
def note (*args)
type = case self
when RPG::Item then 0
when RPG::Weapon then 1
when RPG::Armor then 2
when RPG::Skill then 3
end
# Return Original Method + edited additions
return malgb_acigd_ntedit_7jb3 (*args) + $game_system.ma_added_notes(type, self.id)
end
end
#==============================================================================
# ** RPG::Enemy
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - note
#==============================================================================
class Enemy
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Return Note
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias ma_asciigod_noteedit_enmy_5hv2 note
def note (*args)
# Return Original Method + edited additions
return ma_asciigod_noteedit_enmy_5hv2 (*args) + $game_system.ma_added_notes(4, self.id)
end
end
#==============================================================================
# ** RPG::State
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - note
#==============================================================================
class State
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Return Note
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_gdasci_nted_stte_4xs2 note
def note (*args)
# Return Original Method + edited additions
return modalg_gdasci_nted_stte_4xs2 (*args) + $game_system.ma_added_notes(5, self.id)
end
end
end
#==============================================================================
# ** Game System
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new instance variable - ma_note_edits
# aliased method - initialize
# new method - ma_add_note, ma_delete_note
#==============================================================================
class Game_System
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modabra_ascod_init_ntedtr_8nn2 initialize
def initialize (*args)
@ma_note_edits = [ {}, {}, {}, {}, {}, {} ]
# Run Original Method
modabra_ascod_init_ntedtr_8nn2 (*args)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Add Note
# type : the type of item (Item, Weapon, Armor, Skill, State, Enemy)
# id : the ID of the specific item in its type
# note : the note you want to add
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_add_note (type, id, note)
@ma_note_edits[type][id] = [] if @ma_note_edits[type][id] == nil
@ma_note_edits[type][id].push (note)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Delete Note
# type : the type of item (Item, Weapon, Armor, Skill, State, Enemy)
# id : the ID of the specific item in its type
# note : the note you want to delete
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_delete_note (type, id, note)
@ma_note_edits[type][id] = [] if @ma_note_edits[type][id] == nil
note.is_a? (String) ? @ma_note_edits[type][id].delete (note) : @ma_note_edits[type][id].delete_at (note)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Added Notes
#``````````````````````````````````````````````````````````````````````````
# Returns the notes added to that item
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_added_notes (type, id)
return "" if @ma_note_edits[type][id] == nil
note_string = ""
@ma_note_edits[type][id].each { |note| note_string += "\n #{note}" }
return note_string
end
end
#==============================================================================
# ** Game Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new method - add_note, delete_note
#==============================================================================
class Game_Interpreter
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Add Note
# type : the type of item (Item, Weapon, Armor, Skill, State, Enemy)
# id : the ID of the specific item in its type
# note : the note you want to add
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def add_note (type, id, note)
$game_system.ma_add_note (type, id, note)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Delete Note
# type : the type of item (Item, Weapon, Armor, Skill, State, Enemy)
# id : the ID of the specific item in its type
# note : the note you want to delete
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def delete_note (type, id, note)
$game_system.ma_delete_note (type, id, note)
end
endCredit
Thanks
- ASCIIGod, for the request
Support
Please post in this topic in RMRK for support. Do not PM me
Known Compatibility Issues
Author's Notes
I haven't really tested this script. But it should be fine.

This script by
modern algebra is licensed under a
Creative Commons Attribution-Non-Commercial-Share Alike 2.5 Canada License.