hrm, OK. I'll take a look, though I usually dislike looking at other people's scripts simply because there's a bit of a learning curve to figure out what they're doing.
EDIT::
Your 2nd request is already available. Just use:
$game_actors[actor_id].equip_fix (equipment_index)
SO $game_actors[2].equip_fix (0) would fix the weapon of the second actor in the database.
This script doesn't look like it would work properly though ~ I am going to rewrite a part or two. Hopefully syvkal won't mind.
EDIT 2::
Ok, so it was a bigger modification than I thought it would be, but I retained naming conventions and syvkal's congifuration module, even though I wasn't a big fan. Anyway, here it is and it ought to work. I only incorporated the disabled text in the equip window rather than status because I didn't think it made sense there. I kept the way to lock equipment in game:
$game_actors[actor_id].equip_fix (equip_type) still. See EDIT 1 for an example.
#==============================================================================
# ** Individual Equipment Fix
#------------------------------------------------------------------------------
# By Syvkal (with some modifications by modern algebra @ rmrk.net)
# Version 1.5 (unofficial)
# 05-12-08
#==============================================================================
#
# This script allows you to lock any equipment on any actor individually
# The data is loaded when an actor is added to the party
# I built this in to make it easier for the user
#
# There is some configuration needed, but that comes further down the script
#
# Do not touch the next section, unless you know what you're doing
#
#
#=================================================#
# ** D O N O T T O U C H ** #
#=================================================#
module Equip_fix
$data_actors = load_data("Data/Actors.rvdata")
ACTORS_SIZE = $data_actors.size
ACTORS = []
for i in 0...ACTORS_SIZE
ACTORS.push([false, false, false, false, false])
end
def self.lock_equip(actor, index)
ACTORS[actor-1][index] = true
end
#=================================================#
#=================================================#
# ** C O N F I G U R A T I O N ** #
#=================================================#
#
# This is the part you can configure
#
# Simply follow the instructions to lock any of the actors equipement
#
# Use the 'lock_equip' command to lock any equipment:
#
# lock_equip(actor, equipment)
#
# The equipment is zero indexed. The values are as follow:
#
# 0 - Weapon | 3 - Body Armour
# 1 - Shield or Weapon 2 | 4 - Accessory
# 2 - Helmet
#
# So by putting:
#
# lock_equip(1, 0) - Will lock actor one's weapon
#
# Place your configurations Below
# -----------------------------
lock_equip (1, 0)
lock_equip (1, 2)
#=================================================#
end
#==============================================================================
# ** Game_Actor
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased methods - setup, fix_equipment
# new method - equip_fix
# new public instance variable - fixed_equipment, spec_equip_fix
#==============================================================================
class Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :fixed_equipment
attr_accessor :spec_equip_fix
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Setup
# actor_id : the ID of the actor being loaded in this class
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_syvkal_indfix_equipment_setup_854n6 setup
def setup (actor_id)
# Run Original Method
modalg_syvkal_indfix_equipment_setup_854n6 (actor_id)
# Setup fixed equipment
@fixed_equipment = Equip_fix::ACTORS[actor_id - 1]
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Fix Equipment
# equip_type : integer corresponding to equipment being tested
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malg_svkl_fx_equip_indiv_94b6 fix_equipment
def fix_equipment
return @spec_equip_fix == nil ? malg_svkl_fx_equip_indiv_94b6 : @spec_equip_fix
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Equip Fix
# equip_type : integer corresponding to equipment being tested
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def equip_fix (equip_type, value = nil)
# Toggle equipment fix
@fixed_equipment[equip_type] = value == nil ? !@fixed_equipment[equip_type] : value
return @fixed_equipment[equip_type]
end
end
#==============================================================================
# ** Window Equip
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# modified super method - draw_item_name
# aliased method - refresh
#==============================================================================
class Window_Equip
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Refresh
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias molg_svkl_rfrsh_ind_fix_equip_984n6 refresh
def refresh
@draw_equip_count = 0
# Run Original Method
molg_svkl_rfrsh_ind_fix_equip_984n6
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Item Name
# item : Item (skill, weapon, armor are also possible)
# x : draw spot x-coordinate
# y : draw spot y-coordinate
# enabled : Enabled flag. When false, draw semi-transparently.
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def draw_item_name (item, x, y, enabled = nil)
# Safety
@draw_equip_count = 0 if @draw_equip_count == nil
# If enabled flag actually sent through, retain it.
if enabled == nil
# Otherwise, send through whether or not this equip is fixed
enabled = !@actor.fixed_equipment[@draw_equip_count]
end
super (item, x, y, enabled)
@draw_equip_count += 1
end
end
#==============================================================================
# ** Scene_Equip
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased methods - update_equip_selection
# new method - equip_fix
# new public instance variable - fixed_equipment
#==============================================================================
class Scene_Equip
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Equip Region Selection
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias molg_syvkal_eqp_select_upd_ind_85n67 update_equip_selection
def update_equip_selection
@actor.spec_equip_fix = @actor.fixed_equipment[@equip_window.index]
# Run Original Method
molg_syvkal_eqp_select_upd_ind_85n67
@actor.spec_equip_fix = nil
end
end