iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

The 2nd Quarter Contest has arrived! Go check it out in the Community Announcements now!
 
Reply to this topicStart new topic
> 'Undefined method' error
jake_heritagu
post Nov 27 2009, 11:09 PM
Post #1



Group Icon


Type: Writer




I'm hoping this'll be a simple fix. So here's my problem:


So I have this script that lets me distribute points into stats, and in the menu it's called 'Level Up' and then I select the person whose stats I wish to distribute. However, when I select a person who is in the waiting party, I get this error:


I'm not sure what this means since I'm not a programmer.


These are the scripts and the script line in question. If you want more details on any of the scripts, I can paste them for you. But I do appreciate any help in getting this to work for me.
Go to the top of the page
 
+Quote Post
   
Omegas7
post Nov 28 2009, 03:44 AM
Post #2


stai sprecando il tuo tempo
Group Icon


Type: Coder
Alignment: Chaotic Evil




My guess is an incompatibility issue with the 'Overdrive' and 'Reserve Party 1.0' (or whatever custom party script you're
using).
If you select any of the first 4 characters, do you get the same error? Because that overdrive script
might be assuming your party is only of 4 characters max (default), and won't expect to meet a fifth or higher actor.

And it would be helpful if you posted that Overdrive and custom party script here too, because I don't use any of these scripts right now... wink.gif.

This post has been edited by Omegas7: Nov 28 2009, 03:46 AM


--------------------
Chooo Chooo
Go to the top of the page
 
+Quote Post
   
jake_heritagu
post Nov 28 2009, 04:05 AM
Post #3



Group Icon


Type: Writer




It does in fact work fine with the first 4 characters, it's only when I try to select anyone in reserve.

Here is the Reserve Party script.
Spoiler:
#==============================================================================
# Integrated Reserve Party
# Version 1.0d
# Author: modern algebra (rmrk.net)
# Date: June 11, 2009
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Description:
#
# This script allows you to have a reserve party. Basically, this means that
# it allows you to have a larger number of actors in the party than are
# active at any given time, and it allows the player to choose which actors
# are active. This is a system implemented in a number of games in the
# Final Fantasy series, as well as the Tales series and numerous other RPGs.
# Characters in reserve can be swapped into the active party by the player at
# any time and vice versa.
#
# As the game maker, you have a number of options to limit this. You can set
# a minimum size for the active party, so if you wish the player cannot have
# fewer than whatever number you set, and as well you can set a maximum size
# for the reserve party. Further, you can set the percentage of exp received
# by characters in the reserve party, thus allowing you to limit how much exp
# is received by characters not in the active party. You can also lock
# individual actors to either the active party or the reserve.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Instructions:
#
# Place above Main and below all other custom scripts in the Script editor.
#
# To change the default configuration, go to line x and read the descriptions
# to see what they do.
#
# There are a number of codes you can use in a call script. They are:
#
# lock_to_active_party (actor_id)
# actor_id : The ID of the actor who can only be in Active Party
# lock_to_reserve_party (actor_id)
# actor_id : The ID of the actor who can only be in Reserve Party
# unlock_actor_party (actor_id)
# actor_id : The ID of the actor you no longer want locked to a Party
# change_active_minimum (new_minimum)
# new_minimum : the new minimum number of actors in the active party
# change_reserve_maximum (new_maximum)
# new_maximum : the new maximum number of actors allowed in reserve
# toggle_party_access (boolean)
# boolean : true => enable, false => disable; if left blank, will toggle
#==============================================================================

#==============================================================================
# CONSTANTS
#==============================================================================

PARTY_CHANGE_RESERVE_EXP_PERCENT = 75 # Percentage of EXP received by reserve actors
PARTY_CHANGE_MENU_INDEX = 5 # The position of the Party option in Menu
PARTY_CHANGE_LABEL = "Party" # The label of the Party option in Menu
PARTY_CHANGE_MIN_ACTIVE_SIZE = 1 # The minimum number of actors in active
PARTY_CHANGE_MAX_RESERVE_SIZE = 4 # The maximum size of reserve party
PARTY_CHANGE_LOCK_ICON_INDEX = 80 # The icon to draw for locked actors

#==============================================================================
# ** Game Actor
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new accessor instance variable - reserve_exp_percent
# aliased method - index, setup
#==============================================================================

class Game_Actor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_accessor :reserve_exp_percent
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Setup
# actor_id : actor ID
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modernalgebra_resrv_party_stup_resrvexp_52b4 setup
def setup(actor_id)
# Run Original Method
modernalgebra_resrv_party_stup_resrvexp_52b4 (actor_id)
@reserve_exp_percent = PARTY_CHANGE_RESERVE_EXP_PERCENT
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Index
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias molge_rsrv_prty_indx_actr_7b53 index
def index
if $game_party.ma_reserve_actors.include? (@actor_id)
size = $game_party.ma_draw_party_space ? $game_party.ma_max_active_size : $game_party.actors.size
return size + $game_party.ma_reserve_actors.index (@actor_id)
else
return molge_rsrv_prty_indx_actr_7b53
end
end
end

#==============================================================================
# ** Game Party
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new public instance variables : ma_reserve_actors, ma_min_active_size,
# ma_max_reserve_size, ma_locked_actors, actors, ma_party_access,
# ma_locked_actors
# aliased methods - initialize, add_actor, remove_actor, members
# new methods - lock_party, unlock_party, add_to_active, remove_from_active,
# switch_actors_by_index, ma_reserve_members
#==============================================================================

class Game_Party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variables
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :actors
attr_reader :ma_reserve_actors
attr_reader :ma_locked_actors
attr_accessor :ma_max_active_size
attr_accessor :ma_min_active_size
attr_accessor :ma_max_reserve_size
attr_accessor :ma_return_reserve_members
attr_accessor :ma_draw_party_space
attr_accessor :ma_party_access
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdagr_init_resrv_prt_trvst1 initialize
def initialize
# Run Original Method
mdagr_init_resrv_prt_trvst1
# Initialize Variables
@ma_reserve_actors = []
@ma_max_active_size = MAX_MEMBERS
@ma_min_active_size = PARTY_CHANGE_MIN_ACTIVE_SIZE
@ma_max_reserve_size = PARTY_CHANGE_MAX_RESERVE_SIZE
@ma_locked_actors = []
@ma_party_access = true
@ma_return_reserve_members = false
@ma_draw_party_space = false
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Add an Actor
# actor_id : actor ID
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malg_plus_actr_resrv_pty add_actor
def add_actor(actor_id)
# Do nothing if actor in reserve
if !@ma_reserve_actors.include? (actor_id)
# Run Original Method
malg_plus_actr_resrv_pty (actor_id)
if !@actors.include?(actor_id) && @ma_reserve_actors.size < @ma_max_reserve_size
@ma_reserve_actors.push (actor_id)
end
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Remove Actor
# actor_id : actor ID
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_rmv_actr_pary_reseve_orn54 remove_actor
def remove_actor(actor_id)
@ma_reserve_actors.delete (actor_id)
@ma_locked_actors.delete (actor_id)
# Run Original Method
modalg_rmv_actr_pary_reseve_orn54 (actor_id)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Members
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdrnlg_membrs_reserve_party_scrpt_8un5 members
def members (return_reserve = nil)
@ma_return_reserve_members = return_reserve if return_reserve != nil
mmbrs = mdrnlg_membrs_reserve_party_scrpt_8un5
return mmbrs + ma_reserve_members if @ma_return_reserve_members
return mmbrs
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Reserve Members
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_reserve_members
result = []
@ma_reserve_actors.each { |i| result.push($game_actors[i]) }
return result
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Lock Party
# *args - indices to lock
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_lock_party (*args)
args.each { |i| @ma_locked_actors.push (i) if !@ma_locked_actors.include? (i) }
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Unlock Party
# *args - indices to unlock
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_unlock_party (*args)
args.each { |i| @ma_locked_actors.delete (i) }
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Add To Active Party
# actor_id : The ID of Actor being moved
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_add_to_active (actor_id, insert_index = nil)
return true if actor_id == nil
return false if @ma_locked_actors.include? (actor_id)
return false unless @ma_reserve_actors.include? (actor_id)
return false if @actors.size >= @ma_max_active_size
insert_index = @actors.size if insert_index == nil ||
insert_index > @actors.size
@ma_reserve_actors.delete (actor_id)
@actors.insert (insert_index, actor_id)
return true
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Remove From Active Party
# actor_id : The ID of Actor being moved
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_remove_from_active (actor_id, insert_index = nil)
# If Character not in Party, do nothing
return true if actor_id == nil
return false if @ma_locked_actors.include? (actor_id)
return false unless @actors.include? (actor_id)
return false if @ma_reserve_actors.size >= @ma_max_reserve_size
insert_index = @ma_reserve_actors.size if insert_index == nil ||
insert_index > @ma_reserve_actors.size
# Remove Actor from actors
@actors.delete (actor_id)
@ma_reserve_actors.insert (insert_index, actor_id)
return true
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Switch Actors By Index
# active_index : the index in the active party
# reserve_index : the index in the reserve party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_switch_actors_by_index (active_index, reserve_index)
return false if @ma_locked_actors.include? (@actors[active_index]) ||
@ma_locked_actors.include? (@ma_reserve_actors[reserve_index]) ||
(reserve_index > @ma_reserve_actors.size &&
active_index < @actors.size && @actors.size <= @ma_min_active_size)
@ma_max_reserve_size += 1
reserve_actor_id = @ma_reserve_actors[reserve_index]
removable = ma_remove_from_active (@actors[active_index], reserve_index)
ma_add_to_active (reserve_actor_id, active_index ) if removable
@ma_max_reserve_size -= 1
$game_player.refresh if active_index == 0
return removable
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Switch Actor Order
# array_boolean : true => @actors; false => @ma_reserve_actors
# index1 : the first actor to change
# index2 : the second actor to change
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_switch_actor_order (array_boolean, index1, index2)
# Get array
array = array_boolean ? @actors : @ma_reserve_actors
# Set indices in order
if index1 < index2
i1, i2 = index1, index2
else
i1, i2 = index2, index1
end
# Check if both slots are empty
return false if i1 >= array.size
val = array[i1]
# If one slot is empty, place other at end of array
if i2 >= array.size
# Remove index2 from order and place at
array.delete_at (i1)
array.push (val)
else # Both slots chosen are actors
val2 = array[i2]
# Delete i2 and insert i1
array.delete_at (i2)
array.insert (i2, val)
# Delete i1 and insert i2
array.delete_at (i1)
array.insert (i1, val2)
end
$game_player.refresh if i1 == 0 && array == @actors
end
end

#==============================================================================
# ** Game_Interpreter
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# new methods - lock_to_active_party, lock_to_reserve_party,
# unlock_actor_party, change_active_minimum, change_reserve_maximum
#==============================================================================

class Game_Interpreter
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Lock To Active Party
# actor_id : ID of actor to lock to active party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def lock_to_active_party (actor_id)
# If actor not in party, do nothing
return if actor_id == nil || (!$game_party.actors.include? (actor_id) &&
!$game_party.ma_reserve_actors.include? (actor_id))
if $game_party.ma_reserve_actors.include? (actor_id)
# Delete from locked actors in case previously locked to reserve
$game_party.ma_locked_actors.delete (actor_id)
# If no room in active party
unless $game_party.ma_add_to_active (actor_id)
# Get index in whichever array actor resides
r_index = $game_actors[actor_id].index - $game_party.actors.size
a_index = nil
# Switch first actor not locked out of party
for id in $game_party.actors.reverse
next if $game_party.ma_locked_actors.include? (id)
a_index = $game_actors[id].index
break
end
return if a_index == nil
$game_party.ma_switch_actors_by_index (a_index, r_index)
end
else
return if $game_party.ma_locked_actors.include? (actor_id)
end
# Lock actor
$game_party.ma_lock_party (actor_id)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Lock To Reserve Party
# actor_id : ID of actor to lock to reserve party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def lock_to_reserve_party (actor_id)
# If actor not in party, do nothing
return if actor_id == nil || (!$game_party.actors.include? (actor_id) &&
!$game_party.ma_reserve_actors.include? (actor_id))
if $game_party.actors.include? (actor_id)
# Delete from locked actors in case previously locked to active
$game_party.ma_locked_actors.delete (actor_id)
# If no room in reserve party
unless $game_party.ma_remove_from_active (actor_id)
# Get index in whichever array actor resides
a_index = $game_actors[actor_id].index
r_index = nil
# Switch first actor not locked out of party
for id in $game_party.ma_reserve_actors.reverse
next if $game_party.ma_locked_actors.include? (id)
r_index = $game_actors[id].index - $game_party.actors.size
break
end
return if r_index == nil
$game_party.ma_switch_actors_by_index (a_index, r_index)
end
else
return if $game_party.ma_locked_actors.include? (actor_id)
end
# Lock actor
$game_party.ma_lock_party (actor_id)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Unlock Actor Party
# actor_id : ID of actor to unlock
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def unlock_actor_party (actor_id)
$game_party.ma_unlock_party (actor_id)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Change Active Minimum
# val : new minimum value for party size
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def change_active_minimum (val)
$game_party.ma_min_active_size = val
# Restore Active Party to minimum size if necessary
while $game_party.actors.size < val && !$game_party.ma_reserve_actors.empty?
$game_party.ma_add_to_active ($game_party.ma_reserve_actors[0])
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Change Reserve Maximum
# val : new maximum value for reserve party size
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def change_reserve_maximum (val)
$game_party.ma_max_reserve_size = val
while $game_party.ma_reserve_actors.size > val && $game_party.actors.size < $game_party.ma_max_active_size
$game_party.ma_add_to_active ($game_party.ma_reserve_actors[0])
end
# If still actors, remove them
if $game_party.ma_reserve_actors.size > val
lost_actors = $game_party.ma_reserve_actors[val, $game_party.ma_reserve_actors.size - val]
lost_actors.each { |id| $game_party.remove_actor (id) }
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Disable/enable Party Switching
# boolean : true => enable, false => disable, nil => toggle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def toggle_party_access (boolean = nil)
$game_party.ma_party_access = boolean == nil ? !$game_party.ma_party_access : boolean
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Actor iterator (ID)
# param : If 1 or more, ID. If 0, all
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdnagr_itrt_actrid_party_resrv_52g4 iterate_actor_id
def iterate_actor_id (*args)
$game_party.ma_return_reserve_members = true
mdnagr_itrt_actrid_party_resrv_52g4 (*args) do |actor|
yield actor
end
$game_party.ma_return_reserve_members = false
end
end

#==============================================================================
# ** Sprite MenuActorsDisabled
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This class draws a sprite over disabled actors for the reserve party.
#==============================================================================

class Sprite_MenuActorsDisabled < Sprite
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Initialize
# coordinates
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize (y)
viewport = Viewport.new (0, 0, 544, 400)
viewport.z = 120
super (viewport)
create_bitmap (false, y)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Bitmap
# reserve_input : whether or not it is changing party
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def create_bitmap (reserve_input = false, y = self.y)
return if $game_party.ma_reserve_actors.size == 0 && !reserve_input
self.bitmap.dispose if (self.bitmap != nil && !self.bitmap.disposed?)
size = reserve_input ? $game_party.ma_max_reserve_size : $game_party.ma_reserve_actors.size
self.bitmap = Bitmap.new (352, size*96)
disabled_colour = Color.new (127, 127, 127, 105)
self.bitmap.fill_rect (0, 0, 352, size*96, disabled_colour)
self.x = 176
self.y = y
self.blend_type = 2
end
end

#==============================================================================
# ** Window_Command
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Summary of Changes:
# new instance variable - ma_disabled_commands
# aliased method - initialize, draw_item
#==============================================================================

class Window_Command
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Public Instance Variable
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
attr_reader :ma_disabled_commands
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Initialize
# width : window width
# commands : command string array
# column_max : digit count (if 2 or more, horizontal selection)
# row_max : row count (0: match command count)
# spacing : blank space when items are arrange horizontally
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdrbra_intgrte_prtychng_menu_init_74b2 initialize
def initialize(*args)
# Initialize new instance variable
@ma_disabled_commands = []
# Run Original Method
mdrbra_intgrte_prtychng_menu_init_74b2 (*args)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Draw Item
# index : item number
# enabled : enabled flag. When false, draw semi-transparently
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mrnalr_prtchng_intgrtin_menu_drw_itm_6gb3 draw_item
def draw_item (index, enabled = true)
# Run Original Method
mrnalr_prtchng_intgrtin_menu_drw_itm_6gb3 (index, enabled)
enabled ? @ma_disabled_commands.delete (index) : @ma_disabled_commands.push (index)
end
end

#==============================================================================
# ** Window_MenuStatus
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# overwritten super method - create_contents, top_row, top_row=
# aliased method - refresh, update_cursor
#==============================================================================

class Window_MenuStatus < Window_Selectable
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Window Contents
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def create_contents (reserve_input = false)
self.contents.dispose
if reserve_input
@scrn_item_max = $game_party.ma_max_reserve_size + Game_Party::MAX_MEMBERS
else
$game_party.ma_return_reserve_members = true
@scrn_item_max = $game_party.members.size
$game_party.ma_return_reserve_members = false
end
self.contents = Bitmap.new(width - 32, @scrn_item_max * 96)
refresh (reserve_input)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Refresh
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_reserve_prty_rfrsh_menu refresh
def refresh (reserve_input = false)
$game_party.ma_draw_party_space = reserve_input
$game_party.ma_return_reserve_members = true
# Run Original Method with Reserve Members
modalg_reserve_prty_rfrsh_menu ()
# For all locked actors, draw an icon
$game_party.ma_locked_actors.each { |actor_id|
index = $game_actors[actor_id].index
draw_icon (PARTY_CHANGE_LOCK_ICON_INDEX, self.contents.width - 32, index*96 + 8)
}
$game_party.ma_return_reserve_members = false
$game_party.ma_draw_party_space = false
@item_max = @scrn_item_max
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Cursor
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modlg_upd_csor_reserve_prty_9rn3 update_cursor
def update_cursor
@index -= top_row
# Run Original Method
modlg_upd_csor_reserve_prty_9rn3
@index += top_row
# Scroll
row = (@index > 100 ? (@index - 100) : @index) / @column_max # Get current row
if row < top_row # If before the currently displayed
self.top_row = row # Scroll up
end
if row > top_row + 3 # If after the currently displayed
self.top_row = row - 3 # Scroll down
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Get Top Row
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def top_row
return self.oy / 96
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Set Top Row
# row : row shown on top
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def top_row=(row)
old_oy = self.oy
row = 0 if row < 0
row = row_max - 1 if row > row_max - 1
self.oy = row * 96
end
end

#==============================================================================
# ** Window Blank Cursor
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# This window draws a cursor over a selected actor.
#==============================================================================

class Window_BlankCursor < Window_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def initialize
super(160, 0, 384, 128)
self.visible = false
self.opacity = 0
self.cursor_rect.set(0, 0, contents.width, 96)
end
end

#==============================================================================
# ** Scene Battle
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - display_level_up
#==============================================================================

class Scene_Battle
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Display Level Up
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias malgbr_rsrvprty_expgn_dsply_lvlup_9gg2 display_level_up
def display_level_up
for actor in $game_party.ma_reserve_members
last_level = actor.level
last_skills = actor.skills
actor.gain_exp(($game_troop.exp_total*actor.reserve_exp_percent) / 100, true)
end
# Run Original Method
malgbr_rsrvprty_expgn_dsply_lvlup_9gg2
end
end

#==============================================================================
# ** Scene_Skill
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased methods - start, determine_target, next_actor, prev_actor
#==============================================================================

class Scene_Skill
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Start Processing
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modnalbr_resepar_strt_7vs2 start
def start (*args)
$game_party.ma_return_reserve_members = true
modnalbr_resepar_strt_7vs2 (*args)
$game_party.ma_return_reserve_members = false
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Determine Target
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdrnalbr_rsrvprty_trgtdtrmnt_8b53 determine_target
def determine_target (*args)
$game_party.ma_return_reserve_members = true
mdrnalbr_rsrvprty_trgtdtrmnt_8b53 (*args)
$game_party.ma_return_reserve_members = false
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Switch to Next Actor Screen
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias algebramdrn_partvr_nxtactor_9k32 next_actor
def next_actor (*args)
$game_party.ma_return_reserve_members = true
algebramdrn_partvr_nxtactor_9k32 (*args)
$game_party.ma_return_reserve_members = false
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Switch to Previous Actor Screen
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_reserveparty_prevactor_4nm2 prev_actor
def prev_actor (*args)
$game_party.ma_return_reserve_members = true
modalg_reserveparty_prevactor_4nm2 (*args)
$game_party.ma_return_reserve_members = false
end
end

#==============================================================================
# ** Scene_Item
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased methods - determine_target
#==============================================================================

class Scene_Item
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Determine Target
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalga_dtrmtrgt_reserveparty_74b3 determine_target
def determine_target (*args)
$game_party.ma_return_reserve_members = true
modalga_dtrmtrgt_reserveparty_74b3 (*args)
$game_party.ma_return_reserve_members = false
end
end

#==============================================================================
# ** Scene Menu
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# Summary of Changes:
# aliased method - initialize, start, terminate, update_actor_selection,
# update
# new methods - ma_start_party_switch
#==============================================================================

class Scene_Menu < Scene_Base
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Object Initialization
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias ma_rrve_party_init_scene_h43 initialize
def initialize (*args)
@selected_index = -1
$game_party.ma_return_reserve_members = false
@switching_party = false
# Run Original Method
ma_rrve_party_init_scene_h43 (*args)
if @menu_index >= PARTY_CHANGE_MENU_INDEX
@menu_index += 1
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Start Processing
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias moag_5nd_rsrv_prty_strt start
def start
# Run Original Method
moag_5nd_rsrv_prty_strt
y = $game_party.members.size*96 + 16
@disabledactors_sprite = Sprite_MenuActorsDisabled.new (y)
@selected_actorcursor = Window_BlankCursor.new
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Termination Processing
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_prty_reserve_term_sdpdprites terminate
def terminate
# Run Original Method
modalg_prty_reserve_term_sdpdprites
# Dispose disable sprite
@disabledactors_sprite.dispose
@selected_actorcursor.dispose
$game_party.ma_return_reserve_members = false if $scene.is_a? (Scene_Map)
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Frame Update
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_frm_upd_resrv_prty_94n5 update
def update
top_row = @status_window.top_row
# Run Original Method
modalg_frm_upd_resrv_prty_94n5
if top_row != @status_window.top_row
s = @switching_party ? $game_party.ma_max_active_size : $game_party.members.size
@disabledactors_sprite.y = (s - @status_window.top_row)*96 + 16
@selected_actorcursor.y = @selected_index*96 - @status_window.oy
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Actor Selection
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modalg_resev_prty_upd_actr_selct update_actor_selection
def update_actor_selection
# If in Party switching mode
if @switching_party
# If exiting the scene
if Input.trigger? (Input::cool.gif
Sound.play_cancel
# If no other position selected already, exit party arrangement
if @selected_index == -1
@status_window.create_contents (false)
y = ($game_party.members.size - @status_window.top_row)*96 + 16
@disabledactors_sprite.create_bitmap (false, y)
@switching_party = false
end_actor_selection
else
# Remove previously selected index
@selected_index = -1
@selected_actorcursor.visible = false
end
# If an actor is selected
elsif Input.trigger? (Input::C)
index = @status_window.index
# If selecting previously selected slot
if index == @selected_index
Sound.play_cancel
@selected_index = -1
@selected_actorcursor.visible = false
return
end
# If selecting from a reserve slot
if index >= $game_party.ma_max_active_size
ma_select_reserve (index)
else # If selecting from active party
ma_select_active (index)
end
end
else
changed = false
if @command_window.index > PARTY_CHANGE_MENU_INDEX
@command_window.index = (@command_window.index - 1) % @command_window.commands.size
changed = true
end
# Run Original Method
modalg_resev_prty_upd_actr_selct
@command_window.index = (@command_window.index + 1) % @command_window.commands.size if changed
$game_party.ma_return_reserve_members = true unless $scene.is_a? (Scene_Menu)
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Create Command Window
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias mdrnaba_prtychn_intgr_menu_crt_cmnd_window_8hb3 create_command_window
def create_command_window
mdrnaba_prtychn_intgr_menu_crt_cmnd_window_8hb3
# Get commands from the command window
c = @command_window.commands
# Add Party Change Command
c.insert (PARTY_CHANGE_MENU_INDEX, PARTY_CHANGE_LABEL)
width = @command_window.width
disabled = @command_window.ma_disabled_commands
@command_window.dispose
@command_window = @command_window.class.new(width, c)
@command_window.index = @menu_index
# Disable all of the old commands as well
disabled.each { |i|
i += 1 if i >= PARTY_CHANGE_MENU_INDEX
@command_window.draw_item (i, false)
}
# Draw Disabled if Party Changer disabled
if ($game_party.ma_reserve_actors.empty? && $game_party.actors.size <= 1) ||
!$game_party.ma_party_access
@command_window.draw_item (PARTY_CHANGE_MENU_INDEX, false)
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Update Command Selection
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
alias modrnalg_prtychng_updcmndslect_62n4 update_command_selection
def update_command_selection
changed = false
if Input.trigger? (Input::C) && @command_window.index == PARTY_CHANGE_MENU_INDEX
# If Party Change is disabled
if ($game_party.ma_reserve_actors.empty? && $game_party.actors.size <= 1) ||
!$game_party.ma_party_access
Sound.play_buzzer
else
# Open Quest Window
Sound.play_decision
ma_start_party_switch
end
return
end
# If the command index is greater than it ought to be, make sure
if @command_window.index > PARTY_CHANGE_MENU_INDEX
@command_window.index = (@command_window.index - 1) % @command_window.commands.size
changed = true
end
modrnalg_prtychng_updcmndslect_62n4
@command_window.index = (@command_window.index + 1) % @command_window.commands.size if changed
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Select Reserve
# index : the index selected
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_select_reserve (index)
# If another slot from reserve already picked.
if @selected_index >= $game_party.ma_max_active_size
Sound.play_decision
# Switch actor order
$game_party.ma_switch_actor_order (false, @selected_index - $game_party.ma_max_active_size, index - $game_party.ma_max_active_size)
ma_start_party_switch
return
end
# If selecting an empty slot:
if index - $game_party.ma_max_active_size >= $game_party.ma_reserve_actors.size
# If no other option already selected.
if @selected_index == -1
Sound.play_decision
@selected_index = index
@selected_actorcursor.y = index*96 - @status_window.oy
@selected_actorcursor.visible = true
else # If selecting a reserve member
# If other selected slot also empty
if @selected_index >= $game_party.actors.size
Sound.play_decision
@selected_index = -1
@selected_actorcursor.visible = false
else
# If successful switch
if $game_party.ma_switch_actors_by_index (@selected_index, index - $game_party.ma_max_active_size)
Sound.play_decision
ma_start_party_switch
else
Sound.play_buzzer
end
end
end
else # If actor slot selected
# If active slot not already selected
if @selected_index == -1
Sound.play_decision
# Set as selected and choose next
@selected_index = index
@selected_actorcursor.y = index*96 - @status_window.oy
@selected_actorcursor.visible = true
else # If an active slot already picked
# If successful switch
if $game_party.ma_switch_actors_by_index (@selected_index, index - $game_party.ma_max_active_size)
Sound.play_decision
ma_start_party_switch
else
Sound.play_buzzer
end
end
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Select Active
# index : the index selected
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_select_active (index)
# If another slot from active already picked.
if @selected_index != -1 && @selected_index < $game_party.ma_max_active_size
Sound.play_decision
# Switch actor order
$game_party.ma_switch_actor_order (true, @selected_index, index)
ma_start_party_switch
return
end
# If selecting an empty slot:
if index >= $game_party.actors.size
# If no other option already selected.
if @selected_index == -1
Sound.play_decision
@selected_index = index
@selected_actorcursor.y = index*96 - @status_window.oy
@selected_actorcursor.visible = true
else
# If other selected slot also empty
if @selected_index >= $game_party.ma_max_active_size + $game_party.ma_reserve_actors.size
Sound.play_decision
@selected_index = -1
@selected_actorcursor.visible = false
else
# If successful switch
if $game_party.ma_switch_actors_by_index (index, @selected_index - $game_party.ma_max_active_size)
Sound.play_decision
ma_start_party_switch
else
Sound.play_buzzer
end
end
end
else # If actor slot selected
# If reserve slot not already selected
if @selected_index == -1
Sound.play_decision
# Set autocursor and choose next actor
@selected_index = index
@selected_actorcursor.y = index*96 - @status_window.oy
@selected_actorcursor.visible = true
else # If a reserve slot already picked
# If successful switch
if $game_party.ma_switch_actors_by_index (index, @selected_index - $game_party.ma_max_active_size)
Sound.play_decision
ma_start_party_switch
else
Sound.play_buzzer
end
end
end
end
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# * Start Party Switch
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def ma_start_party_switch
@selected_index = -1
status_index = @status_window.index
@selected_actorcursor.visible = false
@status_window.create_contents (true)
y = ($game_party.ma_max_active_size - @status_window.top_row)*96 + 16
@disabledactors_sprite.create_bitmap (true, y)
@switching_party = true
@status_window.active = true
@status_window.index = status_index < 0 ? 0 : status_index
@command_window.active = false
end
end


This is where I got the overdrive script:
http://www.rpgmakervx.net/index.php?showtopic=1021

I would of posted it in a spoiler box as well, but for some reason I can't get two of them to work at the same time, so sorry in advance about that. And a HUGE thanks for helping me!

This post has been edited by jake_heritagu: Nov 28 2009, 04:12 AM
Go to the top of the page
 
+Quote Post
   
Omegas7
post Nov 28 2009, 04:44 AM
Post #4


stai sprecando il tuo tempo
Group Icon


Type: Coder
Alignment: Chaotic Evil




I'm getting no errors, therefore, I think it I need the stat distribution script lol dry.gif. Never used it anyways.
Can you post the link or the code?

Oh and just a tip, if you post code, try to put it inside [code] tags, I met a forum smiley when copied the code in the script editor tongue.gif.

This post has been edited by Omegas7: Nov 28 2009, 04:44 AM


--------------------
Chooo Chooo
Go to the top of the page
 
+Quote Post
   
jake_heritagu
post Nov 28 2009, 05:03 AM
Post #5



Group Icon


Type: Writer




CODE
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ ◆ Attribute Point Stat Distribution - KGC_DistributeParameter ◆ VX ◆
#_/ ◇ Last Update: 11/16/2008
#_/ ◆ Written by TOMY
#_/ ◆ Translation & Extended Updates by Mr. Anonymous
#_/ ◆ Extended Annotation by Touchfuzzy
#_/ ◆ KGC Site:
#_/ ◆ http://ytomy.sakura.ne.jp/
#_/ ◆ Translator's Blog:
#_/ ◆ http://mraprojects.wordpress.com
#_/-----------------------------------------------------------------------------
#_/ This script gives you the ability to completely change the way actors'
#_/ attributes are gained. This system allows for the player to distribute stat
#_/ points to actors which are gained upon level up.
#_/=============================================================================
#_/ ◆ Script Commands ◆
#_/ These commands are used in "Script" function in the third page of event
#_/ commands under "Advanced".
#_/
#_/ * gain_rp(ActorID, Value)
#_/ Increases the MaxRP of a given actor.
#_/
#_/ * reset_distributed_count(ActorID)
#_/ Resets the distributed RP of a given actor.
#_/
#_/ * call_distribute_parameter(ActorID)
#_/ Calls the Distribute Parameter screen for a given actor.
#_/
#_/=============================================================================
#_/ Install: Insert below KGC_ExtendedEquipScene and KGC_CustomMenuCommand.
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_

#==============================================================================#
# ★ Customization ★ #
#==============================================================================#

module KGC
module DistributeParameter
# ◆ Distribution Tables ◆
# Here you may customize the costs and increase rates of specific parameters.
# The order in which these costs and increase rates are set are as follows:
# [IPC, IPSG, MAP, PCI, PSGI]
# Key:
# IPC = Initial Point Cost. This is how many AP it cost to buy the first
# point of this parameter.
#
# IPSG = Initial Point Stat Growth. This is how much the stat will go up with
# the first point of this parameter.
#
# MAP = Maximum Attribute Points. The maximum amount of AP that can be spent
# on this stat. You may also put a level based equation in this but
# remember that if you put in an equation it is IMPORTANT that you put
# quotation marks ("") around it and to use level in all lower case.
# By using 0 here, you effectively remove the limitation on how the
# stat's growth ceiling.
#
# PCI = Point Cost Increase. For every AP spent in this parameter the cost
# of this parameter increases by this amount.
#
# PSGI = Point Stat Growth Increase. For every AP spent in this parameter
# the number of points you gain in the stat increases by this much.
#
# Also, if you completely remove a line (e.g. ":hit => [1, 1, 20, 0.7],")
# it will remove it from the distribution screen altogether.
# Very useful if your project doesn't require a specific stat to be shown.
GAIN_PARAMETER = {
# Parameter IPC, IPSG, MAP, PCI, PSGI
:maxhp => [1, 30, 30, 0.4, 2], # Maximum HP
:maxmp => [1, 5, 30, 0.4, 0.5], # Maximum MP
:atk => [1, 2, 30, 0.4, 0.5], # Attack
:def => [1, 2, 30, 0.4, 0.5], # Defense
:spi => [1, 2, 30, 0.4, 0.5], # Spirit
:agi => [1, 2, 30, 0.4, 0.5], # Agility
:hit => [1, 1, 20, 0.7], # Hit Ratio (Accuracy)
:eva => [1, 1, 20, 0.7], # Evasion
:cri => [1, 1, 20, 0.7], # Critical
:odds => [1, 1, 5], # Luck (Chance of being targetted)
} # Do not remove this bracket.

# ◆ AP Gain Rate ◆
# This is the equation that determines your total AP gained every level.
# (Character Level to the 0.25th power + 2) * Level
# This causes you to start at 3 points per level and increase slightly over
# time.
# As an example if you wish to gain a static 3 points per level write it as
# MAXRP_EXP = "level * 3"
MAXRP_EXP = "(level ** 0.25 + 2.0) * level"

# ◆ Individual Actor Gain Parameter Tables ◆
# You may choose to manually specify an individual actor's gain parameters.
# To do so, use the same format as above GAIN_PARAMETER table but instead
# use PERSONAL_GAIN_PARAMETER [n] (Where n = Actor ID)
# Any parameter you do not set in this table will instead draw from the
# GAIN_PARAMETER chart.
#
# Example:
# PERSONAL_GAIN_PARAMETER[1] = {
# :maxhp => [2, 20, 50, 0.5, 5],
# :maxmp => [1, 10, 30, 0.3, 0.5],
# :atk => [1, 1, 30, 0.3, 0.5],
# :def => [1, 2, 30, 0.4, 0.5],
# :spi => [1, 2, 50, 0.5, 0.8],
# :agi => [1, 2, 30, 0.4, 0.6],
# :hit => [1, 1, 20, 0.7],
# :eva => [1, 1, 20, 0.7],
# :cri => [1, 1, 20, 0.7],
# :skill_speed => [1, 1, 20, 0.5],
# :item_speed => [1, 1, 20, 0.5],
# :odds => [1, 1, 5],
# :maxrpexp => ["(level ** 0.25 + 2.0) * level"]
# }
PERSONAL_GAIN_PARAMETER = []
# ★ Insert Custom Actor Gain Tables Below Here ★

PERSONAL_GAIN_PARAMETER[1] = {
:maxhp => [1, 20, 30, 1, 30], # Maximum HP
:maxmp => [1, 25, 30, 1, 5], # Maximum MP
:atk => [1, 2, 30, 1, 2], # Attack
:def => [1, 1, 30, 0.4, 0.5], # Defense
:spi => [1, 1, 30, 0.2, 0.8], # Spirit (AKA Intelligence)
:agi => [1, 2, 30, 0.5, 0.5], # Agility
:hit => [1, 1, 20, 0.7], # Hit Percentage (AKA Accuracy)
:eva => [1, 1, 20, 0.7], # Evasion
:cri => [1, 1, 20, 0.7], # Critical
:maxrpexp => ["(level ** 0.5 + 2.0) * level"] #Max AP, DO NOT REMOVE
}

PERSONAL_GAIN_PARAMETER[2] = {
:maxhp => [1, 50, 30, 1, 15], # Maximum HP
:maxmp => [1, 25, 30, 1, 10], # Maximum MP
:atk => [1, 2, 30, 1, 2], # Attack
:def => [1, 1, 30, 0.5, 1], # Defense
:spi => [1, 1, 30, 0.2, 0.4], # Spirit (AKA Intelligence)
:agi => [1, 2, 30, 1, 1.5], # Agility
:hit => [1, 1, 20, 0.7], # Hit Percentage (AKA Accuracy)
:eva => [1, 1, 20, 0.7], # Evasion
:cri => [1, 1, 20, 0.7], # Critical
:maxrpexp => ["(level ** 0.5 + 2.0) * level"] #Max AP, DO NOT REMOVE
}

PERSONAL_GAIN_PARAMETER[3] = {
:maxhp => [1, 25, 30, 1, 25], # Maximum HP
:maxmp => [1, 25, 30, 1, 10], # Maximum MP
:atk => [1, 3, 30, 1, 1], # Attack
:def => [1, 2, 30, 1, 1], # Defense
:spi => [1, 1, 30, 0.2, 0.4], # Spirit (AKA Intelligence)
:agi => [1, 2, 30, 1, 1], # Agility
:hit => [1, 1, 20, 0.7], # Hit Percentage (AKA Accuracy)
:eva => [1, 1, 20, 0.7], # Evasion
:cri => [1, 1, 20, 0.7], # Critical
:maxrpexp => ["(level ** 0.5 + 2.0) * level"] #Max AP, DO NOT REMOVE
}

PERSONAL_GAIN_PARAMETER[4] = {
:maxhp => [1, 30, 30, 1, 20.5], # Maximum HP
:maxmp => [1, 20, 30, 1, 10.7], # Maximum MP
:atk => [1, 1, 30, 0.9, 1.8], # Attack
:def => [1, 1, 30, 0.3, 0.5], # Defense
:spi => [1, 3, 30, 1, 2], # Spirit (AKA Intelligence)
:agi => [1, 1, 30, 0.5, 1], # Agility
:hit => [1, 1, 20, 0.7], # Hit Percentage (AKA Accuracy)
:eva => [1, 1, 20, 0.7], # Evasion
:cri => [1, 1, 20, 0.7], # Critical
:maxrpexp => ["(level ** 0.5 + 2.0) * level"] #Max AP, DO NOT REMOVE
}

PERSONAL_GAIN_PARAMETER[5] = {
:maxhp => [1, 20, 30, 1, 20], # Maximum HP
:maxmp => [1, 30, 30, 1, 30], # Maximum MP
:atk => [1, 1, 30, 0.3, 0.2], # Attack
:def => [1, 1, 30, 0.3, 0.5], # Defense
:spi => [1, 3, 30, 1, 2], # Spirit (AKA Intelligence)
:agi => [1, 1, 30, 0.2, 0.4], # Agility
:hit => [1, 1, 20, 0.7], # Hit Percentage (AKA Accuracy)
:eva => [1, 1, 20, 0.7], # Evasion
:cri => [1, 1, 20, 0.7], # Critical
:maxrpexp => ["(level ** 0.5 + 2.0) * level"] #Max AP, DO NOT REMOVE
}

PERSONAL_GAIN_PARAMETER[6] = {
:maxhp => [1, 50, 30, 1, 30], # Maximum HP
:maxmp => [1, 20, 30, 1, 30], # Maximum MP
:atk => [1, 1, 30, 1.8, 3], # Attack
:def => [1, 1, 30, 1, 2], # Defense
:spi => [1, 3, 30, 1, 2], # Spirit (AKA Intelligence)
:agi => [1, 1, 30, 0.2, 0.4], # Agility
:hit => [1, 1, 20, 0.7], # Hit Percentage (AKA Accuracy)
:eva => [1, 1, 20, 0.7], # Evasion
:cri => [1, 1, 20, 0.7], # Critical
:maxrpexp => ["(level ** 0.5 + 2.0) * level"] #Max AP, DO NOT REMOVE
}

PERSONAL_GAIN_PARAMETER[9] = {
:maxhp => [1, 25, 30, 1, 25], # Maximum HP
:maxmp => [1, 25, 30, 1, 25], # Maximum MP
:atk => [1, 1, 30, 1, 1], # Attack
:def => [1, 1, 30, 0.5, 0.8], # Defense
:spi => [1, 3, 30, 1, 2], # Spirit (AKA Intelligence)
:agi => [1, 1, 30, 0.8, 1], # Agility
:hit => [1, 1, 20, 0.7], # Hit Percentage (AKA Accuracy)
:eva => [1, 1, 20, 0.7], # Evasion
:cri => [1, 1, 20, 0.7], # Critical
:maxrpexp => ["(level ** 0.5 + 2.0) * level"] #Max AP, DO NOT REMOVE
}

# ★ Insert Custom Actor Gain Tables Above Here ★

# ◆ Class-Specific Gain Parameter Tables ◆
# You may choose to manually specify an entire class's gain parameters.
# To do so, use the same format as above GAIN_PARAMETER table but instead
# use CLASS_GAIN_PARAMETER [n] (Where n = Number of class in the database)
# Any parameter you do not set in this table will instead draw from the
# GAIN_PARAMETER chart. Also note that class gain parameters take the highest
# priority.
CLASS_GAIN_PARAMETER = []
# ★ Insert Custom Class Gain Tables Below Here ★




# ★ Insert Custom Class Gain Tables Above Here ★

# ◆ AP = Attribute Points. These settings are for the AP Distrubution Screen.
# VOCAB_RP appears at the top of the column which lists the AP cost of
# the parameter
VOCAB_RP = "Cost"
# VOCAB_RP_A appears next to where it lists your current and total AP.
VOCAB_RP_A = "AP"

# ◆ Parameter Labels ◆
# Allows you to change the text of Hit Ratio, Evasion, Critical, Skill
# Speed, Item Speed, and Odds (luck) on the distribution screen.
VOCAB_PARAM = {
:hit => "ACU", # Hit Ratio (Accuracy)
:eva => "EVA", # Evasion
:cri => "CRI", # Critical
:skill_speed => "SSD", # Skill Speed
:item_speed => "ISD", # Item Speed
:odds => "LCK", # Odds (Luck)
} # <- Do not remove this bracket.

# ◆ Caption Text ◆
# Added by Mr. Anonymous.
# These fields affect the text at the top of the distribution screen.
# Attribute name label.
AT_CAPTION = "Attribute"
# AP cost/rate label.
RT_CAPTION = "Rate"
# Current AP ppent on given attribute label.
SP_CAPTION = "Spent"
# Current status (right window) label.
CS_CAPTION = "Current Status"

# ◆ Help Window Text ◆
# Text of the menu title for the AP Distribution Screen.
DISTRIBUTE_SCENE_CAPTION = "Stat Distribution - Press L or R to switch characters."

# ◆ Stat Distribution Cost When Maxed ◆
# This toggle allows you to remove the characters proceeding the amount of
# points that have been spent on a skill when a growth ceiling on that stat
# is unlimited (see growth tables: MAP). For example, let's say Max HP has
# an umilimited ceiling of growth. Let's say you've spent 3 points in this
# stat so far, so under the "Spent" column, this would normally read 3/---.
# With this toggle set to true, it would instead simply read as 3.
# true : Only the amount currently spent in the stat is displayed.
# false : A line is drawn representing no ceiling to the stat.
HIDE_MAX_COUNT_INFINITE = false

# ◆ AP Gauge Colors ◆
# Allows you to change the color of the guages that appear under the stats
# side bar. The color can also be determined by a numerical expression.
# Example: GAUGE_START_COLOR = Color.new(255, 0, 0) <- This is red.
# This is the fill color for the early phase of the guage.
GAUGE_START_COLOR = 28
# This is the fill color for the late phase of the guage. (When full)
GAUGE_END_COLOR = 29

# ◆ Menu Command Button & Text ◆
# When USE_MENU_DISTRIBUTE_PARAMETER_COMMAND = true,
# the AP Distribution System is added to the menu under "Quit Game".
# When false, it does not. (Obviously)
USE_MENU_DISTRIBUTE_PARAMETER_COMMAND = true
# Allows you to change the text for this button on the main command menu.
VOCAB_MENU_DISTRIBUTE_PARAMETER = "Level Up"

# ◆ Parameter Re-distribution ◆
# This affects whether the player can delevel the parameters that have
# been increased.
# true : Allows the player to reassign AP.
# false : Prevents the player from unassigning AP if set to false.
ENABLE_REVERSE_DISTRIBUTE = false

# ◆ AP in Status Window ◆
# The following four features have been scripted by Mr. Anonymous.
# This toggle allows you to enable/disable the AP display on the status
# screen.
SHOW_STATUS_RP = true
# This toggle allows you to adjust the position of the AP display on the
# status screen. (If SHOW_STATUS_RP = true)
# 0. Below Actor's Face Image
# 1. Below Actor's Parameters
SHOW_STATUS_RP_POS = 1

# ◆ Extra Parameters in Status Window ◆
# This toggle allows you to enable/disable the parameters for accuracy,
# evasion, and critical below the regular paramaters (STR, DEF, SPI, AGI)
SHOW_STATUS_EX_PARAMS = true

# ◆ Call DistributeParameter from the Status Window ◆
# This allows you to change what key/button is pressed on the status window
# to shift to the DistributeParameter window.
# When set to nil, this is disabled. ( CALL_DISTPARAMKEY = Input::nil )
CALL_DISTPARAMKEY = Input::X # On the keyboard, button X is the A key.

end
end

#------------------------------------------------------------------------------#

$imported = {} if $imported == nil
$imported["DistributeParameter"] = true

module KGC::DistributeParameter
PARAMS = [:maxhp, :maxmp, :atk, :def, :spi, :agi, :hit, :eva, :cri]
end

#==============================================================================
# ■ Vocab
#==============================================================================

module Vocab

def self.hit
return KGC::DistributeParameter::VOCAB_PARAM[:hit]
return $data_system.terms.hit # Added 4/1/08
end

def self.eva
return KGC::DistributeParameter::VOCAB_PARAM[:eva]
return $data_system.terms.eva # Added 4/1/08
end

def self.cri
return KGC::DistributeParameter::VOCAB_PARAM[:cri]
return $data_system.terms.cri # Added 4/1/08
end

def self.rp
return KGC::DistributeParameter::VOCAB_RP
end

def self.rp_a
return KGC::DistributeParameter::VOCAB_RP_A
end

def self.distribute_parameter
return KGC::DistributeParameter::VOCAB_MENU_DISTRIBUTE_PARAMETER
end
end

#==============================================================================
# □ KGC::Commands
#==============================================================================

module KGC::Commands
module_function

def check_distribution_values
(1...$data_actors.size).each { |i|
actor = $game_actors[i]
actor.check_distribution_values
actor.calc_distribution_values
}
end

def gain_rp(actor_id, value)
actor = $game_actors[actor_id]
return if actor == nil
actor.gain_rp(value)
end

def reset_distributed_count(actor_id)
actor = $game_actors[actor_id]
return if actor == nil
actor.clear_distribution_values
actor.calc_distribution_values
end

def call_distribute_parameter(actor_index = 0)
return if $game_temp.in_battle
$game_temp.next_scene = :distribute_parameter
$game_temp.next_scene_actor_index = actor_index
end
end

class Game_Interpreter
include KGC::Commands
end

#==============================================================================
# ■ Game_Battler
#==============================================================================

class Game_Battler

alias clear_extra_values_KGC_DistributeParameter clear_extra_values
def clear_extra_values
clear_extra_values_KGC_DistributeParameter

clear_distribution_values
calc_distribution_values
end

def clear_distribution_values
@distributed_count = {}
KGC::DistributeParameter::PARAMS.each { |param|
@distributed_count[param] = 0
}
end

def check_distribution_values
last_distributed_count = @distributed_count

clear_distribution_values

@distributed_count = last_distributed_count if last_distributed_count !=

nil
end

def calc_distribution_values

end
end

#==============================================================================
# ■ Game_Actor
#==============================================================================

class Game_Actor < Game_Battler

alias initialize_KGC_DistributeParameter initialize
def initialize(actor_id)
@actor_id = actor_id
@class_id = $data_actors[actor_id].class_id
initialize_KGC_DistributeParameter(actor_id)
end

def gain_parameter_list
result = KGC::DistributeParameter::GAIN_PARAMETER
list = KGC::DistributeParameter::PERSONAL_GAIN_PARAMETER[self.id]
result = result.merge(list) if list != nil
list = KGC::DistributeParameter::CLASS_GAIN_PARAMETER[self.class_id]
result = result.merge(list) if list != nil
return result
end

def calc_distribution_values
@rp_cost = 0
@distributed_param = {}
gain_parameter_list.each { |k, v|
next if v == nil
cost = 0
param = 0
distributed_count(k).times { |i|
cost_plus = v[0]
cost_plus += v[3] * i if v[3] != nil
param_plus = v[1]
param_plus += v[4] * i if v[4] != nil
cost += Integer(cost_plus)
param += Integer(param_plus)
}
@rp_cost += [cost, 0].max
@distributed_param[k] = param
}
end

def distributed_param(param)
return 0 if @distributed_param == nil
return 0 if @distributed_param[param] == nil
return @distributed_param[param]
end

alias base_maxhp_KGC_DistributeParameter base_maxhp
def base_maxhp
n = base_maxhp_KGC_DistributeParameter + distributed_param(:maxhp)
return n
end

alias base_maxmp_KGC_DistributeParameter base_maxmp
def base_maxmp
n = base_maxmp_KGC_DistributeParameter + distributed_param(:maxmp)
return n
end

alias base_atk_KGC_DistributeParameter base_atk
def base_atk
n = base_atk_KGC_DistributeParameter + distributed_param(:atk)
return n
end

alias base_def_KGC_DistributeParameter base_def
def base_def
n = base_def_KGC_DistributeParameter + distributed_param(:def)
return n
end

alias base_spi_KGC_DistributeParameter base_spi
def base_spi
n = base_spi_KGC_DistributeParameter + distributed_param(:spi)
return n
end

alias base_agi_KGC_DistributeParameter base_agi
def base_agi
n = base_agi_KGC_DistributeParameter + distributed_param(:agi)
return n
end

alias hit_KGC_DistributeParameter hit
def hit
n = hit_KGC_DistributeParameter + distributed_param(:hit)
return n
end

alias eva_KGC_DistributeParameter eva
def eva
n = eva_KGC_DistributeParameter + distributed_param(:eva)
return n
end

alias cri_KGC_DistributeParameter cri
def cri
n = cri_KGC_DistributeParameter + distributed_param(:cri)
return n
end

def maxrp
gain = gain_parameter_list[:maxrpexp]
n = Integer(eval(gain[0]))
return [n + maxrp_plus, 0].max
end

def maxrp_plus
@maxrp_plus = 0 if @maxrp_plus == nil
return @maxrp_plus
end

def rp
return [maxrp - @rp_cost, 0].max
end

def distributed_count(param)
clear_distribution_values if @distributed_count == nil
@distributed_count[param] = 0 if @distributed_count[param] == nil
return @distributed_count[param]
end

def gain_rp(value)
@maxrp_plus = maxrp_plus + value
end

def gain_distributed_count(param, value = 1)
n = distributed_count(param)
@distributed_count[param] += value if n.is_a?(Integer)
end

def rp_growth_effect(param, reverse = false)
gain = gain_parameter_list[param]
return if gain == nil

if reverse
return if distributed_count(param) == 0
else
return unless can_distribute?(param)
end

gain_distributed_count(param, reverse ? -1 : 1)
calc_distribution_values
end

def can_distribute?(param)
gain = gain_parameter_list[param]
return false if gain == nil
return false if self.rp < distribute_cost(param)
return false if gain[2] <= distributed_count(param)

return true
end

def distribute_cost(param)
gain = gain_parameter_list[param]
return 0 if gain == nil

n = gain[0]
n += gain[3] * distributed_count(param) if gain[3] != nil
return [Integer(n), 0].max
end

def distribute_gain(param)
gain = gain_parameter_list[param]
return 0 if gain == nil

n = gain[1]
n += gain[4] * distributed_count(param) if gain[4] != nil
return Integer(n)
end
end

#==============================================================================
# ■ Window_Base
#==============================================================================

class Window_Base < Window

def rp_color(actor)
return (actor.rp == 0 ? knockout_color : normal_color)
end

def distribute_gauge_color1
color = KGC::DistributeParameter::GAUGE_START_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end

def distribute_gauge_color2
color = KGC::DistributeParameter::GAUGE_END_COLOR
return (color.is_a?(Integer) ? text_color(color) : color)
end

def draw_actor_rp(actor, x, y, width = 120)
self.contents.font.color = system_color
self.contents.draw_text(x, y, 40, WLH, Vocab::rp_a)
self.contents.font.color = rp_color(actor)
xr = x + width
if width < 120
self.contents.draw_text(xr - 40, y, 40, WLH, actor.rp, 2)
else
self.contents.draw_text(xr - 90, y, 40, WLH, actor.rp, 2)
self.contents.font.color = normal_color
self.contents.draw_text(xr - 50, y, 10, WLH, "/", 2)
self.contents.draw_text(xr - 40, y, 40, WLH, actor.maxrp, 2)
end
self.contents.font.color = normal_color
end

def draw_actor_distribute_gauge(actor, param, x, y, width = 120)
gain = actor.gain_parameter_list[param]
return if gain == nil
if gain[5] == nil
n = 2
else
n = 5
end
gw = width * actor.distributed_count(param) / [gain[n], 1].max
gc1 = distribute_gauge_color1
gc2 = distribute_gauge_color2
self.contents.fill_rect(x, y + WLH - 8, width, 6, gauge_back_color)
self.contents.gradient_fill_rect(x, y + WLH - 8, gw, 6, gc1, gc2)
end
#==========================================================================
# Added by Mr. Anonymous ( 4/1/08 )
# Sets up the initial parameters and the entended/extra parameters.
#==========================================================================
if KGC::DistributeParameter::SHOW_STATUS_EX_PARAMS
alias draw_actor_parameter_KGC_DistributeParameter draw_actor_parameter
def draw_actor_parameter(actor, x, y, type)
case type
when 0
parameter_name = Vocab::atk
parameter_value = actor.atk
when 1
parameter_name = Vocab::def
parameter_value = actor.def
when 2
parameter_name = Vocab::spi
parameter_value = actor.spi
when 3
parameter_name = Vocab::agi
parameter_value = actor.agi
when 4
parameter_name = Vocab::hit
parameter_value = actor.hit
when 5
parameter_name = Vocab::eva
parameter_value = actor.eva
when 6
parameter_name = Vocab::cri
parameter_value = actor.cri
end
self.contents.font.color = system_color
self.contents.draw_text(x, y, 120, WLH, parameter_name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 120, y, 36, WLH, parameter_value, 2)
end
end
end

#==============================================================================
# ■ Window_Command
#==============================================================================

class Window_Command < Window_Selectable
unless method_defined?(:add_command)

def add_command(command)
@commands << command
@item_max = @commands.size
item_index = @item_max - 1
refresh_command
draw_item(item_index)
return item_index
end

def refresh_command
buf = self.contents.clone
self.height = [self.height, row_max * WLH + 32].max
create_contents
self.contents.blt(0, 0, buf, buf.rect)
buf.dispose
end

def insert_command(index, command)
@commands.insert(index, command)
@item_max = @commands.size
refresh_command
refresh
end

def remove_command(command)
@commands.delete(command)
@item_max = @commands.size
refresh
end
end
end

#==============================================================================
# ■ Window_Status
#==============================================================================
# Added by Mr. Anonymous ( 4/1/08 )
# Checks SHOW_STATUS_RP's value, if true RP is added to Status Window.
#==============================================================================
if KGC::DistributeParameter::SHOW_STATUS_RP
class Window_Status < Window_Base
#--------------------------------------------------------------------------
# ● Draw RP in Status Window
# x : Width X - 128 (beneath actor face)
# y : Hight Y (On row + Window_Status Definition)
#--------------------------------------------------------------------------
alias draw_basic_info_KGC_DistributeParameter draw_basic_info
def draw_basic_info(x, y)
draw_basic_info_KGC_DistributeParameter(x, y)
# Checks SHOW_STATUS_RP_POS, if 0, RP is shown beneath face of actor.
if KGC::DistributeParameter::SHOW_STATUS_RP_POS == 0
draw_actor_rp(@actor, x - 129, y + WLH * 4)
end
# If 1, RP is shown under parameters. (Centered)
if KGC::DistributeParameter::SHOW_STATUS_RP_POS == 1
draw_actor_rp(@actor, x - 80, y + WLH * 13)
end
end
end
end
#--------------------------------------------------------------------------
# ● Draw Extra (Normally Hidden) Parameters in Status Window
# x : Width X - 128 (beneath actor face)
# y : Hight Y (On row + Window_Status Definition)
# Added by Mr. Anonymous ( 4/1/08 )
#--------------------------------------------------------------------------
if KGC::DistributeParameter::SHOW_STATUS_EX_PARAMS
class Window_Status < Window_Base
alias draw_parameters_KCG_DistributeParameter draw_parameters
def draw_parameters(x, y)
draw_actor_parameter(@actor, x, y + WLH * 0, 0)
draw_actor_parameter(@actor, x, y + WLH * 1, 1)
draw_actor_parameter(@actor, x, y + WLH * 2, 2)
draw_actor_parameter(@actor, x, y + WLH * 3, 3)
draw_actor_parameter(@actor, x, y + WLH * 4, 4)
draw_actor_parameter(@actor, x, y + WLH * 5, 5)
draw_actor_parameter(@actor, x, y + WLH * 6, 6)
end
end
end

#==============================================================================
# □ Window_DistributeParameterActor
#==============================================================================

class Window_DistributeParameterActor < Window_Base

def initialize(x, y, actor)
super(x, y, Graphics.width, WLH + 32)
@actor = actor
refresh
end

def refresh
self.contents.clear
draw_actor_name(@actor, 4, 0)
draw_actor_level(@actor, 140, 0)
draw_actor_rp(@actor, 240, 0)
end
end

#==============================================================================
# □ Window_DistributeParameterList
#==============================================================================

class Window_DistributeParameterList < Window_Selectable

def initialize(actor)
off_h = (WLH + 32) * 2
super(0, off_h, Graphics.width / 2 + 80, Graphics.height - off_h)
@actor = actor
refresh
self.index = 0
end

def parameter_symbol
return @data[self.index]
end

def refresh
@data = []
gain_params = @actor.gain_parameter_list
KGC::DistributeParameter::PARAMS.each { |param|
next if gain_params[param] == nil
@data << param
}
@item_max = @data.size
create_contents
draw_caption
@item_max.times { |i| draw_item(i, @actor.can_distribute?(@data[i])) }
end

def item_rect(index)
rect = super(index)
rect.y += WLH
return rect
end

def draw_caption
self.contents.font.color = system_color
# This is shown at the top of the column that lists the stats.
self.contents.draw_text( 4, 0, 96, WLH, "Attribute")
self.contents.draw_text(120, 0, 40, WLH, Vocab.rp, 2)
# This is shown at the top of the column that lists the number of stat points
# you will gain from buying the next point of the parameter.
self.contents.draw_text(170, 0, 60, WLH, "Rate", 2)
# This is shown at the top of the column that lists the current and max
# points you have in each parameter.
self.contents.draw_text(240, 0, 80, WLH, "Spent", 2)
self.contents.font.color = normal_color
end

def draw_item(index, enabled = true)
rect = item_rect(index)
self.contents.clear_rect(rect)
item = @data[index]
if item != nil
draw_parameter(rect.x, rect.y, @data[index], enabled)
end
end

def draw_parameter(x, y, type, enabled)
case type
when :maxhp
name = Vocab.hp
when :maxmp
name = Vocab.mp
when :atk
name = Vocab.atk
when :def
name = Vocab.def
when :spi
name = Vocab.spi
when :agi
name = Vocab.agi
when :hit
name = Vocab.hit
when :eva
name = Vocab.eva
when :cri
name = Vocab.cri
else
return
end

self.contents.font.color = normal_color
self.contents.font.color.alpha = enabled ? 255 : 128
self.contents.draw_text(x + 4, y, 96, WLH, name)

gain = @actor.gain_parameter_list[type]
value = @actor.distribute_cost(type)
self.contents.draw_text(x + 120, y, 40, WLH, value, 2)
value = sprintf("%+d", @actor.distribute_gain(type))
self.contents.draw_text(x + 190, y, 40, WLH, value, 2)
value = sprintf("%3d/%3d", @actor.distributed_count(type), gain[2])
self.contents.draw_text(x + 236, y, 80, WLH, value, 2)
self.contents.font.color = normal_color
end
end

#==============================================================================
# □ Window_DistributeParameterStatus
#==============================================================================

class Window_DistributeParameterStatus < Window_Base

def initialize(actor)
dx = Graphics.width / 2 + 80
off_h = (WLH + 32) * 2
super(dx, off_h, Graphics.width - dx, Graphics.height - off_h)
@actor = actor
refresh
end

def refresh
self.contents.clear
self.contents.font.color = system_color
# This allows you to change the text that appears on top of the right panel
# which contains current parameter changes.
self.contents.draw_text(0, 0, width - 32, WLH, "Current Status", 1)
self.contents.font.color = normal_color
dy = WLH
gain_params = @actor.gain_parameter_list
KGC::DistributeParameter::PARAMS.each { |param|
next if gain_params[param] == nil
draw_parameter(0, dy, param)
dy += WLH
}
end

def draw_parameter(x, y, type)
case type
when :maxhp
name = Vocab.hp
value = @actor.maxhp
when :maxmp
name = Vocab.mp
value = @actor.maxmp
when :atk
name = Vocab.atk
value = @actor.atk
when :def
name = Vocab.def
value = @actor.def
when :spi
name = Vocab.spi
value = @actor.spi
when :agi
name = Vocab.agi
value = @actor.agi
when :hit
name = Vocab.hit
value = @actor.hit
when :eva
name = Vocab.eva
value = @actor.eva
when :cri
name = Vocab.cri
value = @actor.cri
else
return
end
draw_actor_distribute_gauge(@actor, type, x + 106, y, 48)
self.contents.font.color = system_color
self.contents.draw_text(x + 4, y, 96, WLH, name)
self.contents.font.color = normal_color
self.contents.draw_text(x + 106, y, 48, WLH, value, 2)
end
end

#==============================================================================
# ■ Scene_Map
#==============================================================================

class Scene_Map < Scene_Base

alias update_scene_change_KGC_DistributeParameter update_scene_change
def update_scene_change
return if $game_player.moving?

if $game_temp.next_scene == :distribute_parameter
call_distribute_parameter
return
end

update_scene_change_KGC_DistributeParameter
end

def call_distribute_parameter
$game_temp.next_scene = nil
$scene = Scene_DistributeParameter.new(
$game_temp.next_scene_actor_index,
0,
Scene_DistributeParameter::HOST_MAP)
end
end

#==============================================================================
# ■ Scene_Menu
#==============================================================================

class Scene_Menu < Scene_Base
if KGC::DistributeParameter::USE_MENU_DISTRIBUTE_PARAMETER_COMMAND

alias create_command_window_KGC_DistributeParameter create_command_window
def create_command_window
create_command_window_KGC_DistributeParameter

return if $imported["CustomMenuCommand"]

@__command_distribute_parameter_index =
@command_window.add_command(Vocab.distribute_parameter)
if @command_window.oy > 0
@command_window.oy -= Window_Base::WLH
end
@command_window.index = @menu_index
end
end

alias update_command_selection_KGC_DistributeParameter

update_command_selection
def update_command_selection
call_distribute_parameter_flag = false
if Input.trigger?(Input::C)
case @command_window.index
when @__command_distribute_parameter_index
call_distribute_parameter_flag = true
end
end

if call_distribute_parameter_flag
if $game_party.members.size == 0
Sound.play_buzzer
return
end
Sound.play_decision
start_actor_selection
return
end

update_command_selection_KGC_DistributeParameter
end

alias update_actor_selection_KGC_DistributeParameter update_actor_selection
def update_actor_selection
if Input.trigger?(Input::C)
$game_party.last_actor_index = @status_window.index
Sound.play_decision
case @command_window.index
when @__command_distribute_parameter_index
$scene = Scene_DistributeParameter.new(
@status_window.index,
@__command_distribute_parameter_index,
Scene_DistributeParameter::HOST_MENU)
return
end
end

update_actor_selection_KGC_DistributeParameter
end
end

#==============================================================================
# □ Scene_DistributeParameter
#==============================================================================

class Scene_DistributeParameter < Scene_Base

HOST_MENU = 0
HOST_MAP = 1

def initialize(actor_index = 0, menu_index = 0, host_scene = HOST_MENU)
@actor_index = actor_index
@menu_index = menu_index
@host_scene = host_scene
end

def start
super
create_menu_background

@actor = $game_party.members[@actor_index]
create_windows
end

def create_windows
@help_window = Window_Help.new
@help_window.set_text(KGC::DistributeParameter::DISTRIBUTE_SCENE_CAPTION)
dy = @help_window.height
@actor_window = Window_DistributeParameterActor.new(0, dy, @actor)
@parameter_window = Window_DistributeParameterList.new(@actor)
@status_window = Window_DistributeParameterStatus.new(@actor)
end

def terminate
super
dispose_menu_background
@help_window.dispose
@actor_window.dispose
@parameter_window.dispose
@status_window.dispose
end

def return_scene
case @host_scene
when HOST_MENU
$scene = Scene_Menu.new(@menu_index)
when HOST_MAP
$scene = Scene_Map.new
end
end

def update
super
update_menu_background
update_window
if @parameter_window.active
update_parameter_list
end
end

def update_window
@help_window.update
@actor_window.update
@parameter_window.update
@status_window.update
end

def refresh_window
@actor_window.refresh
@parameter_window.refresh
@status_window.refresh
Graphics.frame_reset
end

def next_actor
@actor_index += 1
@actor_index %= $game_party.members.size
$scene = Scene_DistributeParameter.new(@actor_index,
@menu_index, @host_scene)
end

def prev_actor
@actor_index += $game_party.members.size - 1
@actor_index %= $game_party.members.size
$scene = Scene_DistributeParameter.new(@actor_index,
@menu_index, @host_scene)
end

def update_parameter_list
if Input.trigger?(Input::cool.gif
Sound.play_cancel
return_scene
elsif input_growth?
param = @parameter_window.parameter_symbol
unless @actor.can_distribute?(param)
Sound.play_buzzer
return
end
Input.repeat?(Input::C) ? Sound.play_decision : Sound.play_cursor
@actor.rp_growth_effect(param)
refresh_window
elsif input_reverse_growth?
param = @parameter_window.parameter_symbol
if @actor.distributed_count(param) == 0
Sound.play_buzzer
return
end
Input.repeat?(Input::A) ? Sound.play_decision : Sound.play_cursor
@actor.rp_growth_effect(param, true)
refresh_window
elsif Input.trigger?(Input::R)
Sound.play_cursor
next_actor
elsif Input.trigger?(Input::L)
Sound.play_cursor
prev_actor
end
end

def input_growth?
if KGC::DistributeParameter::ENABLE_REVERSE_DISTRIBUTE
return Input.repeat?(Input::C) || Input.repeat?(Input::RIGHT)
else
return Input.trigger?(Input::C)
end
end

def input_reverse_growth?
if KGC::DistributeParameter::ENABLE_REVERSE_DISTRIBUTE
return Input.repeat?(Input::A) || Input.repeat?(Input::LEFT)
else
return false
end
end
end

#==============================================================================
# ■ Scene_File
#==============================================================================

class Scene_File < Scene_Base

alias read_save_data_KGC_DistributeParameter read_save_data
def read_save_data(file)
read_save_data_KGC_DistributeParameter(file)

KGC::Commands.check_distribution_values
Graphics.frame_reset
end
end

#==============================================================================
# ■ Scene_Status
#==============================================================================
# Added by Mr. Anonymous
#==============================================================================
class Scene_Status < Scene_Base
#--------------------------------------------------------------------------
# � Update Actor
#--------------------------------------------------------------------------
alias update_KGC_DistributeParameter update
def update
if KGC::DistributeParameter::CALL_DISTPARAMKEY != nil &&
Input.trigger?(KGC::DistributeParameter::CALL_DISTPARAMKEY)
Sound.play_decision
$scene = Scene_DistributeParameter.new(@actor_index)#,@menu_index,@host_scene
end
update_KGC_DistributeParameter
end
end

#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_
#_/ The original untranslated version of this script can be found here:
# http://f44.aaa.livedoor.jp/~ytomy/tkool/rp...ibute_parameter
#_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_


One stat distribute script in a code box! I know, I like to use a lot of scripts and I can understand frustration with errors when their overlapping. That's why I do really appreciate this!
Go to the top of the page
 
+Quote Post
   
Omegas7
post Nov 28 2009, 05:14 AM
Post #6


stai sprecando il tuo tempo
Group Icon


Type: Coder
Alignment: Chaotic Evil




Put the Reserve party script below the Stat Distribution script.


--------------------
Chooo Chooo
Go to the top of the page
 
+Quote Post
   
jake_heritagu
post Nov 28 2009, 05:21 AM
Post #7



Group Icon


Type: Writer




QUOTE (Omegas7 @ Nov 28 2009, 05:14 AM) *
Put the Reserve party script below the Stat Distribution script.


I hate it when a programming error is that simple xD

Thank you so much, I wish I had thought of that sooner.
Go to the top of the page
 
+Quote Post
   
Omegas7
post Nov 28 2009, 05:25 AM
Post #8


stai sprecando il tuo tempo
Group Icon


Type: Coder
Alignment: Chaotic Evil




It's ok... Happens to me always anyways.

Oh, and these are not so many scripts considering that half of them are all for the SBS tongue.gif.
Becomes a bit of a pain later, there are so many awesome scripts on this forum, you just pick and... Pick... And... Well.

This post has been edited by Omegas7: Nov 28 2009, 05:26 AM


--------------------
Chooo Chooo
Go to the top of the page
 
+Quote Post
   

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: 21st April 2014 - 11:53 AM

RPGMakerVX.net is an Privacy Policy, Legal.