12-30-2008, 08:27 PM
Equipment Upgrade System by Charlie Fleed
Version 1.2
Version 1.2
Introduction
This system allows to define weapons (armors) with a certain number of slots, which can be used to add enhancement objects. Enhancement objects are actually weapons (armors) specifically tagged. Enhancements' stats get summed with those of the weapon (armor) on which they are attached.
EDIT: The new demo (v0.3) shows an initial party of two actors. One of them has a fixed default weapon that is customizable. An event on the map allows to add a third actor, initialized to his starting parameters, and he has a not-fixed default weapon that is customizable.
EDIT: The new demo (v0.4) also shows three types of weapons and limits enhancement only to specified types of weapons.
Features
- Define weapons with slots available for weapon-enhancing objects.
- Fixed enhancements that cannot be removed once they have been applied.
- A scene for Customizing weapons.
- Default and fixed weapons support. (v0.3)
- Support for actors added to the party with initialization (v0.3)
- Limit enhancement to specified types of weapons(v0.4).
- v0.5 Improved info windows (show actor's name when a weapon is equipped)
- v0.5 Includes Patch for GUILLAUME777's Multi-Slot
- v0.5 In the Equip Scene slots and their contents are displayed along with weapon's description
- v0.6 Discard unequipped enhanced weapons from the enhance scene.
- v1.0 It is now possible to give the party a weapon with slots already filled with enhancements.
- v1.0 Added full support for Enhanced Armors!!!
- v1.0 Items in the Enhance Scene is automatically sorted: Weapons first and then Armors.
- v1.1 Added code to avoid elements used as tags from being considered in the calculation of the elemental damage correction.
- v1.1 Added equipment upgrades.
- v1.1 Upgrades that add slots.
- v1.1 Included patch for DerVVulfman's Multi-Slot.
- v1.2 Bugfix.
Screenshots
Version 1.1: Scene Enhance
![[Image: sceneenhance2.jpg]](http://i473.photobucket.com/albums/rr99/charlie_lee_79/Screenshots/sceneenhance2.jpg)
![[Image: sceneenhance2.jpg]](http://i473.photobucket.com/albums/rr99/charlie_lee_79/Screenshots/sceneenhance2.jpg)
Demo
Equipment Upgrade System v1.2 (mediafire)
Equipment Upgrade System v1.1 (google)
Instructions
Inside the demo.
Compatibility
This system does not use the SDK.
A patch for the multi slot script by guillame777 is available. EDIT: included since version 0.5.
Notes for scripters
Notes for scripters that want to create patches.
This script creates new weapons in the database, with new IDs of course. I use this technique because every enhanced weapon needs to be unique in order to store different sets of attached enhancements.
Since elements are copied during the duplication process, all the scripts that use element-tagging should work fine.
On the other hand, all the scripts that use a configuration with weapons' IDs written in some arrays cannot work properly without a patch. However the patch is usually simple. Infact, all the enhanced weapons contain a value "ref_id" that is the ID of the database weapon from which the enhanced weapon was generated. When the script checks if the ID of a weapon is included in some array, it needs to check if the weapon is an Enhanced Weapon (by using is_a? for example) and if this is the case, it must verify if ref_id (and not id) is included in that array.
If you need a patch you'd better ask to the author of the script to be patched, because he(she) knows where to insert the changes needed better than me.
This script creates new weapons in the database, with new IDs of course. I use this technique because every enhanced weapon needs to be unique in order to store different sets of attached enhancements.
Since elements are copied during the duplication process, all the scripts that use element-tagging should work fine.
On the other hand, all the scripts that use a configuration with weapons' IDs written in some arrays cannot work properly without a patch. However the patch is usually simple. Infact, all the enhanced weapons contain a value "ref_id" that is the ID of the database weapon from which the enhanced weapon was generated. When the script checks if the ID of a weapon is included in some array, it needs to check if the weapon is an Enhanced Weapon (by using is_a? for example) and if this is the case, it must verify if ref_id (and not id) is included in that array.
If you need a patch you'd better ask to the author of the script to be patched, because he(she) knows where to insert the changes needed better than me.
Animated Battlers patch for MNK_STATIONARY_WEAPONS (requested by jimmyly)
Code:
class Sprite_Battler < RPG::Sprite
#--------------------------------------------------------------------------
# * Set Movement
#--------------------------------------------------------------------------
def setmove(destination_x, destination_y, destination_z)
unless (@battler.is_a?(Game_Enemy) and MNK_STATIONARY_ENEMIES) or
(@battler.is_a?(Game_Actor) and MNK_STATIONARY_ACTORS)
unless MNK_STATIONARY_WEAPONS.include?(@battler.weapon_id) or
MNK_STATIONARY_SKILLS.include?(@skill_used) or
MNK_STATIONARY_ITEMS.include?(@item_used)
unless $data_weapons[@battler.weapon_id].is_a?(Enhanced_Weapon) and
MNK_STATIONARY_WEAPONS.include?($data_weapons[@battler.weapon_id].ref_id)
@original_x = @display_x
@original_y = @display_y
@original_z = @display_z
@destination_x = destination_x
@destination_y = destination_y
@destination_z = destination_z
end
end
end
end
end
Author's Notes
For those interested in its logic, customizable weapons are derived from weapons. Every time a customizable weapon is purchased a new temporary entry in the database is created, with stats copied by the weapon in the original database. A copy of this one is also saved into a modified game_party in order to store and automatically save and load all the customized weapons.
When a savegame is loaded all the created weapons are added to the database on the fly, while the saved copy of the original database is unchanged.
Terms and Conditions
This system may be used and modified freely for non commercial games, provided that credit is given to the author: Charlie Fleed.
For its use in commercial games, please contact me through this forum.