Equipment Sets
Author: Lytanathan
Date: January 18, 2011
Version History
- <Version 1.0> 01.18.2011 - Original Release
Description
This script is somewhat difficult to describe. It doesn't really add any functionality to the game itself, but rather is intended to make making the game a little bit easier.
Basically, what it does it allows you to create groups of equipment, and when you create an actor's class, you can select that group as being equippable rather than selecting every single item in the group.
For example, rather than having a knight who can equip Guard's Sword, Longsword, Mythril Sword, and Heron Sword, you simply have a knight who can equip Swords, and the script takes care of the rest.
Features
- Allows you to create equipment groups that can be easily assigned to multiple classes.
- You can use an ordinary job class as an equipment group, too! For example, a Mage-Knight could use the equipment groups of Knight and Wizard, allowing them full access to both classes' equipment sets.
Instructions
See script for instructions.
Note: My instructions are somewhat... not that great, which is why I've included a demo. That way, you can see how I've set things up in the database, and that may help you understand how it works.
Script
#==============================================================================
# Equipment Sets by Lytanathan
#
# This script does not add any functionality to your project, but it can make
# making the project easier.
#
# It enables you to create groups of equipment, which can then be added to your
# character's equipment sets, without actually having to assign the individual
# items to the character's class.
#
# For example, rather than having a knight who can equip Guard's Sword,
# Longsword, Mythril Sword, and Heron Sword, you simply have a knight who can
# equip Swords, and the script takes care of the rest.
#
# Personally, I find this useful when I have large collections of weapons that
# can be used by multiple classes, such as Swords, Staves, Heavy Armor, Robes,
# etcetera, etcetera. Then, if you decide to rearrange the weapon or armor lists
# for any reason, perhaps to add new items you hadn't considered before or
# whatever, you don't need to change every class's equipment lists.
# Another use for it would be if you have a hybrid class like a MageKnight, as
# it can be used to combine the equipment sets of Mage and Knight without much
# effort.
#
# Note: If each class has a unique type of weapon or armor, like in FFX, where
# Tidus uses swords and shields, Yuna uses staves and rings, and Wakka uses
# blitzballs and armguards, then using this script is more work than it is
# worth. It works best when said groups are shared.
#------------------------------------------------------------------------------
# Anyways, Instructions for Use:
#
# 1. Create a dummy class for the item group. I usually use things like Swords,
# Staves, Heavy Armor, Robes, etc.
#
# 2. In that dummy class, select the items that belong to that group.
# Eg/Guard's Sword, Longsword, Mythril Sword, Heron Sword.
# Groups can include both weapons and armor at the same time.
#
# 3. Create a dummy weapon or armor. It doesn't matter which.
# In the notes box of said dummy equipment, include the following:
#
# /LINK_TO_CLASS[x]
# or
# /LINK_TO_CLASS[x,x]
#
# where x is the number of a class where you selected the actual equippable
# items. Note that it doesn't have to be a dummy class as mentioned above,
# you can use your actual job classes as well.
#
# 4. In your character's actual class, select the dummy item. Congratulations!
# Your character can now equip everything that the classes the item are
# linked to can equip.
#------------------------------------------------------------------------------
# Thing to be careful of:
#
# 1. If you have multiple "/LINK_TO_CLASS[x]"es on an item, only the
# first will be used. It shouldn't be a problem, however, as you can link as
# many classes as you want in one note.
# "/LINK_TO_CLASS[1,2,3,5,8,13,21,34,55]" is perfectly valid, as long as you
# have at least 55 classes.
#
# 2. Class order matters! I don't really know how to explain this,
# so I will offer an example:
#
# ------------------------------------------------+
# Swords |
# Staves | RIGHT! Your knight-mage
# Knight (uses swords) | can now equip any sword
# Wizard (uses staves) | or staff.
# Mage-Knight (uses Knight and Wizard) |
# ------------------------------------------------+
#
# ------------------------------------------------+
# Swords | WRONG! Your knight-mage
# Staves | can equip the dummy items
# Mage-Knight (uses Knight and Wizard) | for swords and staves,
# Knight (uses swords) | but no actual weapons.
# Wizard (uses staves) | Poor knight-mage!
# ------------------------------------------------+
#
# The equipment sets are combined from top to bottom.
# In the second example, the Mage-Knight will grab the equipment sets of the
# Knight and Mage before their equipment sets are compiled. Your Mage-Knight
# would be able to equip the dummy items Swords and Staves, but not any
# actual swords or staves. This only matters when you stack classes like
# this, however. You could list the Swords and Staves classes below Knight
# and Wizard and it would work, as those base classes don't link to others.
#
# 3. Starting equipment and equipment that is equipped via events must be
# included in the character's normal class, unless you want to equip them
# using script calls.
#==============================================================================
class Scene_Title < Scene_Base
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
def start
super
load_database # Load database
fuse_equipment # Fuse equipment lists
create_game_objects # Create game objects
check_continue # Determine if continue is enabled
create_title_graphic # Create title graphic
create_command_window # Create command window
play_title_music # Play title screen music
end
#--------------------------------------------------------------------------
# * Perform equipment list fusion
#--------------------------------------------------------------------------
def fuse_equipment
for i in 1..$data_classes.length - 1
for x in 0..$data_classes[i].weapon_set.length - 1
text = $data_weapons[$data_classes[i].weapon_set[x]].note.dup
if m = text.match (/\\LINK_TO_CLASS\[\d+(,\d+)*\]/i)
text = m[0].sub(/\\LINK_TO_CLASS\[/i) { '' }
text = text.sub(/\]/) { '' }
a = text.split(',')
for b in 0..a.length - 1
a[b] = a[b].to_i
$data_classes[i].weapon_set = $data_classes[i].weapon_set + $data_classes[a[b]].weapon_set
$data_classes[i].armor_set = $data_classes[i].armor_set + $data_classes[a[b]].armor_set
end
end
end
for x in 0..$data_classes[i].armor_set.length - 1
text = $data_armors[$data_classes[i].armor_set[x]].note.dup
if m = text.match (/\\LINK_TO_CLASS\[\d+(,\d+)*\]/i)
text = m[0].sub(/\\LINK_TO_CLASS\[/i) { '' }
text = text.sub(/\]/) { '' }
a = text.split(',')
for b in 0..a.length - 1
a[b] = a[b].to_i
$data_classes[i].weapon_set = $data_classes[i].weapon_set + $data_classes[a[b]].weapon_set
$data_classes[i].armor_set = $data_classes[i].armor_set + $data_classes[a[b]].armor_set
end
end
end
end
end
end
Credit
Demo
See attached.
Restrictions
Eh, I don't really care how anyone decides to use this. Just don't claim it as your own, and if you modify it so that it works more efficiently/effectively, or you fix one of the "Things to be careful of" listed in the instructions in the script, I would like to know so that I can improve the original. I'm still a newbie scripter, and can use all the advice I can get.