Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Small Menu Edit Question

Jaide

Member

I'm trying to piece together a menu edit that adds an extra command into the default menu that will bring up the party change script I'm using (by Blizzard; I can post if necessary).

I've gotten the command to show up in the menu, and I've gotten it to take me to the party switch interface when I click it, BUT, before it takes me to that interface, it first highlights the first member of the party, like it would if you were choosing to view their status or their equips. I'm wanting the party switch interface to pop up as soon as the command in the main menu is selected. How would I go about this?

Also, is there any way I can make canceling out of the party switch interface take me back to the menu instead of canceling to the map?

Thanks for any help!

Code:
    when 4  # party changer
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $game_actors[1].forced_position = 0
        $game_actors[1].must_be_in_party = true
        $game_party.forced_size = 4
        $scene = Scene_PartySwitcher.new

Also, if there's a cleaner way to do this, I'd appreciate some advice. There are some variances to the party switching script that I can use like disallowing certain characters to show up or be selected, and I really don't know how I can reflect any of these extras in the menu edit. I'm extremely new to anything regarding scripting, so talk to me like I'm 5. :P
 

Juuhou

Sponsor

I would suggest using this instead?


Code:
      when 4  # Party Changer
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to Party Switcher Scene
        $scene = Scene_PartySwitcher.new

I hope that works..
 

Jaide

Member

That is simpler, but I have the extra lines in there to set the party switcher scene correctly when it opens. Of course, under different circumstances it would be set up differently, so....basically, I have no idea what I'm doing. XD
 

Jaide

Member

Alistor, you totally are. XD

#==============================================================================
# Easy Party Switcher by Blizzard
# Version 1.7b
# Date: 21.05.2006
# Date v1.1: 25.05.2006
# Date v1.2b: 27.05.2006
# Date v1.5b: 3.11.2006
# Date v1.51b: 29.11.2006
# Date v1.52b: 6.12.2006
# Date v1.7b: 23.2.2007
# Date v1.8b: 30.4.2007
#
#
# Special Thanks to:
# Zeriab for pointing out a few glitches and shortening the code. =D
#
#
# IMPORTANT NOTE:
#
# Be sure to set the MAX_PARTY to the maximum size of your party.
# There is already a preconfiguration of 4.
#
#
# Compatibility:
#
# 99% chance of full compatibility with SDK, not tested although. Can cause
# incompatibility with Party Change Systems. WILL corrupt your old savegames.
#
#
# Features:
#
# - set party members for "not _available" (shown transparent in the reserve)
# - remove party members from the reserve list ("disabled_for_party")
# - set party members, who MUST be in the party (shown transparent in the
# current party, "must_be_in_party")
# - option either to wipe the party (for multi-party use) or only remove every
# member (except 1) from the party.
# - easy to use and easy to switch party members
# - also supports small parties (2 or 3 members) and large parties (5 or more)
#
# v1.5b:
#
# - better, shorter and more efficient code (less memory use, less CPU use)
# - fixed potential bugs
#
# v1.7b:
#
# - improved coding
# - facesets now optional
# - no extra bitmap files needed anymore
# - works now with Tons of Add-ons
#
# v1.8b:
#
# - added "forced position"
# - added "forced party size"
#
#
# How to use:
#
# To call this script, make a "Call script" command in an event.
#
# 1. Syntax: $scene = Scene_PartySwitcher.new
# No extra feature will be applied and you can switch the party as you wish.
#
# 2. Syntax: $scene = Scene_PartySwitcher.new(XXX)
# You can replace XXX for 1 to remove all party members except one (either
# one, who must be in the party or a random one), or replace XXX with 2, to
# cause a wipe party. Wiping a party will disable the of the current members
# and a NEW party of the remaining members must be formed. If you replace it
# with 3, the current party configuration will be stored for a later fast
# switch-back.
#
# 3. Syntax: $scene = Scene_PartySwitcher.new(XXX, 1)
# You can use the XXX as described above or just set it to 0 to disable it.
# Also the "1" in the syntax will reset any disabled_for_party and is made
# to be used after multi-party use.
#
# 4. Syntax: $scene = Scene_PartySwitcher.new(XXX, YYY, ZZZ)
# You can replace ZZZ with 1 to replace the party with a stored one AND
# store the current or replace it with 2 to replace the party with a stored
# one, but without storing the current. USE THIS ONLY IF YOU ASSUME TO HAVE
# A STORED PARTY READY! You can simply test if there is a store party by
# putting this code into the conditional branch script:
#
# $game_system.stored_party != nil
#
# This syntax will not open the Party Switcher and it will override the
# commands XXX and YYY, so you can replace these with any number.
#
# - Character faces go into the "Characters" folder and they have the same name
# as the character spritesets have with _face added
#
# Example:
#
# sprite - Marlen.png
# face - Marlen_face.png
#
#
# Other syntaxes:
# $game_actors[ID].not_available = true/false
# $game_actors[ID].disabled_for_party = true/false
# $game_actors[ID].must_be_in_party = true/false
# $game_actors[ID].forced_position = nil/0/1/2/...
# OR
# $game_party.actors[POS].not_available = true/false
# $game_party.actors[POS].disabled_for_party = true/false
# $game_party.actors[POS].must_be_in_party = true/false
# $game_party.actors[POS].forced_position = nil/0/1/2/...
#
# ID - the actor's ID in the database
# POS - the actor's position in the party (STARTS FROM 0, not 1!)
#
# not_available
# - will disable the possibility of an already unlocked character to be in the
# current party
# disabled_for_party
# - will cause the character NOT to appear in the party switch screen
# must_be_in_party
# - will cause the character to be automatically moved into the current party,
# while switching parties and also he cannot be put in the reserve
# forced_position
# - will enforce the player to be at a specific position in the party, set this
# value to nil to disable this feature, use it in combination with
# must_be_in_party and $game_party.forced_size or you might experience bugs
#
# $game_party.forced_size = nil/0/1/2/...
#
# Using this syntax will enforce a specific party size. The EPS won't exit
# until this size is filled up or there are no more in the reserve. Set this
# value to nil to disable the size requirement. Note that the actor MUST be set
# in normal order without any empty position.
#
#
# Additional note:
#
# For your own sake, do not apply the attribute "must_be_in_party" to a
# character at the same time with "not_available" or "disabled_for_party" as
# this WILL disrupt your party and party switch system.
#
#
# If you find any bugs, please report them here:
# http://www.chaosproject.co.nr/
# or send me an e-mail:
# boris_blizzard@yahoo.de
#==============================================================================

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Conficuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

# how many party members do you use
MAX_PARTY = 4
# set to true to use facesets instead of spritesets
FACESETS = false

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Conficuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#==============================================================================
# Game_Actor
#==============================================================================

class Game_Actor < Game_Battler

attr_accessor :must_be_in_party
attr_accessor :disabled_for_party
attr_accessor :not_available
attr_accessor :forced_position

alias setup_eps_later setup
def setup(actor_id)
setup_eps_later(actor_id)
@must_be_in_party = false
@disabled_for_party = false
@not_available = false
end

end

#==============================================================================
# Game_System
#==============================================================================

class Game_System

attr_accessor :stored_party

end

#==============================================================================
# Game_Party
#==============================================================================

class Game_Party

attr_accessor :actors
attr_accessor :forced_size

def any_forced_postion
for actor in @actors
return true if actor.forced_position != nil
end
return false
end

end

#==============================================================================
# Window_Current
#==============================================================================

class Window_Current < Window_Selectable

def initialize
if MAX_PARTY > 4
super(0, 0, 240 + 32, 480)
else
super(0, 0, 240 + 32, MAX_PARTY * 120)
end
@item_max = MAX_PARTY
self.contents = Bitmap.new(width - 32, 480 - 32 + (@item_max - 4) * 120)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
refresh
self.active = false
self.index = -1
end

def refresh
self.contents.clear
count = 0
party = $game_party.actors
$game_party.actors = []
for i in 0...party.size
if party[party.size-i-1] == nil
count += 1
else
break
end
end
for i in 0...party.size-count
$game_party.actors.push(party)
end
for i in 0...$game_party.actors.size
x = 0
y = i * 120 - 4
actor = $game_party.actors
self.contents.font.color = normal_color
if actor != nil
draw_actor_graphic(actor, x, y + 8)
draw_actor_name(actor, x + 160, y)
draw_actor_level(actor, x + 96, y)
draw_actor_hp(actor, x + 96, y + 32)
draw_actor_sp(actor, x + 96, y + 64)
end
end
end

def setactor(index_1, index_2)
temp = $game_party.actors[index_1]
$game_party.actors[index_1] = $game_party.actors[index_2]
$game_party.actors[index_2] = temp
refresh
end

def getactor(index)
return $game_actors[$game_party.actors[index].id]
end

def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
self.top_row = row if row < self.top_row
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = 0
y = (@index / @column_max) * 120 - self.oy
self.cursor_rect.set(x, y, self.width - 32, 88)
end

def clone_cursor
row = @index / @column_max
self.top_row = row if row < self.top_row
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = 0
y = (@index / @column_max) * 120
src_rect = Rect.new(0, 0, self.width, 88)
bitmap = Bitmap.new(self.width-32, 88)
bitmap.fill_rect(0, 0, self.width-32, 88, Color.new(255, 255, 255, 192))
bitmap.fill_rect(2, 2, self.width-36, 84, Color.new(255, 255, 255, 80))
self.contents.blt(x, y, bitmap, src_rect, 192)
end

def top_row
return self.oy / 116
end

def top_row=(row)
row = row % row_max
self.oy = row * 120
end

def page_row_max
return (self.height / 120)
end

end

#==============================================================================
# Window_Reserve
#==============================================================================

class Window_Reserve < Window_Selectable

attr_reader :actors

def initialize
super(0, 0, 400 - 32, 320)
setup
@column_max = 3
if (@item_max / @column_max) >= 3
self.contents = Bitmap.new(width - 32, @item_max / @column_max * 96)
else
self.contents = Bitmap.new(width - 32, height - 32)
end
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
self.active = false
self.index = -1
refresh
end

def setup
@actors = []
for i in 1...$data_actors.size
unless $game_party.actors.include?($game_actors)
unless $game_actors == nil or $game_actors.disabled_for_party
@actors.push($game_actors)
end
end
end
@item_max = (@actors.size + $game_party.actors.size + 3) / 3 * 3
end

def refresh
self.contents.clear
for i in 0... @actors.size
draw_face(i)
end
end

def draw_face(i)
x = (i % 3) * 112 + 16
y = (i / 3) * 96 - 8
self.contents.font.color = normal_color
draw_actor_graphic(@actors, x, y + 18)
end

def getactor(index)
return @actors[index]
end

def get_number
count = 0
for actor in @actors
count += 1 unless actor == nil or actor.not_available
end
return count
end

def setactor(index_1, index_2)
temp = @actors[index_1]
@actors[index_1] = @actors[index_2]
@actors[index_2] = temp
refresh
end

def setparty(index_1, index_2)
temp = @actors[index_1]
@actors[index_1] = $game_party.actors[index_2]
$game_party.actors[index_2] = temp
refresh
end

def update_cursor_rect
if @index < 0
self.cursor_rect.empty
return
end
row = @index / @column_max
self.top_row = row if row < self.top_row
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = (@index % @column_max) * 112 + 8
y = (@index / @column_max) * 96 - self.oy
self.cursor_rect.set(x, y, 96, 96)
end

def clone_cursor
row = @index / @column_max
self.top_row = row if row < self.top_row
if row > self.top_row + (self.page_row_max - 1)
self.top_row = row - (self.page_row_max - 1)
end
x = (@index % @column_max) * 112 + 8
y = (@index / @column_max) * 96
src_rect = Rect.new(0, 0, 96, 96)
bitmap = Bitmap.new(96, 96)
bitmap.fill_rect(0, 0, 96, 96, Color.new(255, 255, 255, 192))
bitmap.fill_rect(2, 2, 92, 92, Color.new(255, 255, 255, 80))
self.contents.blt(x, y, bitmap, src_rect, 192)
end

def top_row
return self.oy / 96
end

def top_row=(row)
row = row % row_max
self.oy = row * 96
end

def page_row_max
return (self.height - 32) / 96
end

end

#==============================================================================
# Window_HelpStatus
#==============================================================================

class Window_HelpStatus < Window_Base

def initialize(gotactor)
super(0, 0, 400 - 32, 160)
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
refresh(gotactor)
self.active = false
end

def refresh(actor)
self.contents.clear
if actor != nil
x = y = 0
self.contents.font.color = normal_color
if actor.not_available
self.contents.draw_text(x + 8, y, 160, 32, "not available", 0)
end
draw_actor_graphic(actor, x, y + 40)
draw_actor_name(actor, x + 160, y + 32)
draw_actor_level(actor, x + 96, y + 32)
draw_actor_hp(actor, x + 96, y + 64)
draw_actor_sp(actor, x + 96, y + 96)
end
end

end

#==============================================================================
# Window_Base
#==============================================================================

WINS = [Window_Current, Window_Reserve, Window_HelpStatus]

class Window_Base

alias draw_actor_graphic_eps_later draw_actor_graphic
def draw_actor_graphic(actor, x, y)
if actor != nil and actor.character_name != ""
if FACESETS and WINS.include?(self.class)
draw_actor_face_eps(actor, x, y)
else
if WINS.include?(self.class)
bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
x += bitmap.width / 8 + 24
y += bitmap.height / 4 + 16
end
draw_actor_graphic_eps_later(actor, x, y)
end
end
end

def draw_actor_face_eps(actor, x, y)
if $tons_version == nil or $tons_version < 3.71 or not FACE_HUE
hue = 0
else
hue = (FACE_HUE ? actor.character_hue : 0)
end
bitmap = RPG::Cache.character("#{actor.character_name}_face", hue)
src_rect = Rect.new(0, 0, bitmap.width, bitmap.height)
if actor.not_available or actor.must_be_in_party
self.contents.blt(x, y, bitmap, src_rect, 128)
else
self.contents.blt(x, y, bitmap, src_rect)
end
end

end

#==============================================================================
# Window_Warning
#==============================================================================

class Window_Warning < Window_Base

def initialize
super(0, 0, 320, 96)
self.visible = false
self.contents = Bitmap.new(width - 32, height - 32)
if $fontface != nil
self.contents.font.name = $fontface
elsif $defaultfonttype != nil
self.contents.font.name = $defaultfonttype
end
self.contents.font.size = 24
self.x = 320 - (width / 2)
self.y = 240 - (height / 2)
self.z = 9999
self.contents.font.color = normal_color
self.contents.draw_text(0, 0, 288, 32, "You cannot remove", 1)
self.contents.draw_text(0, 32, 288, 32, "the last party member!", 1)
end

end

#==============================================================================
# Scene_PartySwitcher
#==============================================================================

class Scene_PartySwitcher

def initialize(wipe_party = 0, reset = 0, store = 0)
@wipe_party = wipe_party
@store = store
@reset = reset
@current_window_temp = 0
@reserve_window_temp = 0
@scene_flag = false
@temp_window = ""
end

def main
if @store != 0
swap_parties
$scene = Scene_Map.new
$game_player.refresh
return
end
case @wipe_party
when 1 then setup_forced_party
when 2 then wipe_party
when 3
$game_system.stored_party = $game_party.actors
wipe_party
end
if @reset == 1
for i in 1...$data_actors.size
$game_actors.not_available = false
end
end
@current_window = Window_Current.new
@current_window.index = 0
@current_window.active = true
@reserve_window = Window_Reserve.new
@reserve_window.x = 240 + 32
@reserve_window.y = 160
@warning_window = Window_Warning.new
@help_window = Window_HelpStatus.new(@reserve_window.getactor(0))
@help_window.x = 240 + 32
Graphics.transition
loop do
Graphics.update
Input.update
update
break if $scene != self
end
Graphics.freeze
@current_window.dispose
@reserve_window.dispose
@help_window.dispose
$game_party.actors.compact!
$game_player.refresh
end

def update
check = @reserve_window.index
if @reserve_window.active
reserve_update
@reserve_window.update
end
if check != @reserve_window.index
if @reserve_window.active
actor = @reserve_window.getactor(@reserve_window.index)
elsif @current_window.active
actor = @reserve_window.getactor(@reserve_window_temp)
end
@help_window.refresh(actor) if ["", "Current"].include?(@temp_window)
end
if @current_window.active
current_update
@current_window.update
end
if Input.trigger?(Input::B)
if @scene_flag
$game_system.se_play($data_system.cancel_se)
@temp_window = ""
@scene_flag = false
if @reserve_window.active
actor = @reserve_window.getactor(@reserve_window.index)
elsif @current_window.active
actor = @reserve_window.getactor(@reserve_window_temp)
end
@help_window.refresh(actor) if ["", "Current"].include?(@temp_window)
@current_window.refresh
@reserve_window.refresh
return
end
if $game_party.forced_size != nil
if ($game_party.forced_size != $game_party.actors.size or
$game_party.forced_size != $game_party.actors.nitems) and
($game_party.forced_size < $game_party.actors.size or
$game_party.forced_size < $game_party.actors.nitems or
@reserve_window.get_number != 0)
$game_system.se_play($data_system.buzzer_se)
return
end
end
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::A)
if $game_party.any_forced_position
$game_system.se_play($data_system.buzzer_se)
else
$game_system.se_play($data_system.decision_se)
$game_party.actors.compact!
@current_window.refresh
end
end
end

def current_update
if Input.trigger?(Input::C)
actor = @current_window.getactor(@current_window.index)
if actor != nil and actor.forced_position != nil
$game_system.se_play($data_system.buzzer_se)
else
if @scene_flag
switch_members
else
$game_system.se_play($data_system.decision_se)
@scene_flag = true
@temp_actor_index = @current_window.index
@temp_window = "Current"
@current_window.clone_cursor
end
end
return
end
if Input.trigger?(Input::RIGHT)
$game_system.se_play($data_system.cursor_se)
@current_window.active = false
@reserve_window.active = true
@current_window_temp = @current_window.index
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.index = -1
@reserve_window.index = @reserve_window_temp
@help_window.refresh(actor) unless @scene_flag
return
end
end

def reserve_update
if Input.trigger?(Input::C)
unless @scene_flag
$game_system.se_play($data_system.decision_se)
@scene_flag = true
@temp_actor_index = @reserve_window.index
@temp_window = "Reserve"
@reserve_window.clone_cursor
else
switch_members
end
return
end
if (@reserve_window.index % 3) == 0
if Input.repeat?(Input::LEFT)
$game_system.se_play($data_system.cursor_se)
@reserve_window.active = false
@current_window.active = true
@reserve_window_temp = @reserve_window.index
@reserve_window.index = -1
@current_window.index = @current_window_temp
end
end
end

def switch_members
if @temp_window == "Reserve" and @reserve_window.active
@reserve_window.setactor(@temp_actor_index, @reserve_window.index)
actor = @reserve_window.getactor(@reserve_window.index)
@help_window.refresh(actor)
end
if @temp_window == "Current" and @current_window.active
@current_window.setactor(@temp_actor_index, @current_window.index)
end
if @temp_window == "Reserve" and @current_window.active
actor1 = @current_window.getactor(@current_window.index)
actor2 = @reserve_window.getactor(@temp_actor_index)
if call_warning(@current_window.index, actor2)
if actor1 != nil and actor1.must_be_in_party
$game_system.se_play($data_system.buzzer_se)
@scene_flag = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
if actor2 != nil and actor2.not_available
$game_system.se_play($data_system.buzzer_se)
@scene_flag = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window_temp)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
@reserve_window.setparty(@temp_actor_index, @current_window.index)
@current_window.refresh
actor = @reserve_window.getactor(@reserve_window_temp)
@help_window.refresh(actor)
else
warning
end
end
if @temp_window == "Current" and @reserve_window.active
actor1 = @current_window.getactor(@temp_actor_index)
actor2 = @reserve_window.getactor(@reserve_window.index)
if call_warning(@temp_actor_index, actor2)
if actor1 != nil and actor1.must_be_in_party
$game_system.se_play($data_system.buzzer_se)
@scene_flag = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window.index)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
if actor2 != nil and actor2.not_available
$game_system.se_play($data_system.buzzer_se)
@scene_flag = false
@temp_window = ""
actor = @reserve_window.getactor(@reserve_window.index)
@current_window.refresh
@reserve_window.refresh
@help_window.refresh(actor)
return
end
@reserve_window.setparty(@reserve_window.index, @temp_actor_index)
@current_window.refresh
actor = @reserve_window.getactor(@reserve_window.index)
@help_window.refresh(actor)
else
warning
end
end
$game_system.se_play($data_system.decision_se)
@scene_flag = false
@temp_window = ""
return
end

def wipe_party
for i in 0...$game_party.actors.size
$game_party.actors.not_available = true if $game_party.actors != nil
end
setup_forced_party(true)
if $game_party.actors == []
for i in 1...$data_actors.size
actor = $game_actors
unless actor == nil or actor.not_available or actor.disabled_for_party
$game_party.actors[$game_party.actors.size] = actor
return
end
end
end
end

def setup_forced_party(flag = false)
$game_party.actors = []
party = []
for i in 1...$data_actors.size
actor = $game_actors
if actor != nil and actor.must_be_in_party and
(not actor.disabled_for_party or flag) and not actor.not_available
party[party.size] = actor
end
end
for i in 0...party.size
if actor.forced_position != nil
$game_party.actors[party.forced_position] = party
party = nil
end
end
party.compact!
for actor in party
$game_party.actors.push(actor)
end
end

def swap_parties
$game_party.actors.compact!
temp_actors = $game_party.actors
for actor in temp_actors
actor.not_available = true
end
$game_system.stored_party.compact!
for actor in $game_system.stored_party
actor.not_available = false
end
$game_party.actors = $game_system.stored_party
$game_system.stored_party = nil
$game_system.stored_party = temp_actors if @store == 1
end

def call_warning(index, actor2)
actor1 = $game_party.actors[index]
if actor1 != nil and actor2 == nil
count = 0
for actor in $game_party.actors
count += 1 unless actor == nil
end
return false if count <= 1
end
return true
end

def warning
$game_system.se_play($data_system.buzzer_se)
@warning_window.visible = true
loop do
Graphics.update
Input.update
if Input.trigger?(Input::C)
@warning_window.visible = false
@current_window.refresh
@reserve_window.refresh
break
end
end
return
end

end


It has different commands for what members can be selected, etc. If there's a way to call the script in the menu and still utilize those settings...that would be ideal. Otherwise, it'll hardly be useful for my game. =/
 
well, i figured out that the way you had your set-up was right, and the features locking actor one in place and requiring four characters all work. Did you want any of the other, (IMO) weird features included, like the party config saves and such?
 

Jaide

Member

Yeah, that script has a lot of extra features that I really don't even need. :x The main thing I need is for the characters who are not available yet to not even show up in the party select menu. I'd like to be able to easily change who is available to be in the party, and still be able to call the script from the menu and have it reflect those changes.
 

Juuhou

Sponsor

So just adding in the extra lines wouldnt work?

Code:
      when 4  # Party Changer
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to Party Switcher Scene
        $game_actors[1].forced_position = 0
        $game_actors[1].must_be_in_party = true
        $game_party.forced_size = 4
        $scene = Scene_PartySwitcher.new

Hehe, Im still new at this too so...^_^
 
that works for that part, but to make the unavailable characters not be in the scene from the get go, i have an idea on how to do that. otherwise, the entire edit is done. I'll post it later once i get the removing unavailable characters.

EDIT: OK, i found the syntax to make characters unavailable in the party switcher.

on the first map, make an event that autoruns. in it, use the script command, and put this in it.
Code:
$game_actors[ID].disabled_for_party = true
Replace ID with the number of the actor you want to disable, and voila!
when that character joins your party, use the same code, but with a false instead of a true.
Code:
$game_actors[ID].disabled_for_party = false
then activate self switch a. on a new event page, same event, trigger is self switch a on, nothing in the page.
Code:
#==============================================================================
# Jaide's Personal Menu v1.2
# By Alistor, on 6/21/07
# DO NOT USE WITHOUT THE EXPRESS WRITTEN CONSENT OF BOTH THE 
# AUTHOR AND THE OWNER, SPECIFICALLY ALISTOR AND JAIDE.  ANYONE 
# WHO VIOLATES THIS WILL BE HUNTED DOWNED AND GUTTED LIKE A SMALL
# MOUTH BASS... OR MAYBE A CARP.
#==============================================================================
# Incarnation of my Main Menu Limit Edit with a rearranged layout and added
# commands.
#==============================================================================
# ** Game_Map
#------------------------------------------------------------------------------
#  This class handles the map. It includes scrolling and passable determining
#  functions. Refer to "$game_map" for the instance of this class.
#==============================================================================

class Game_Map
  def name  #NEW METHOD
    $map_infos[@map_id]
  end
end
#==============================================================================
# ** Window_MenuStatus
#------------------------------------------------------------------------------
#  This window displays party member status on the menu screen, rewritten to be
#  slightly smaller, and more compact. EDIT BY ALISTOR
#==============================================================================

class Window_MenuStatus < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 480, 416)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
    self.active = false
    self.index = -1
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    @item_max = $game_party.actors.size
    for i in 0...$game_party.actors.size
      x = 64
      y = i * 90
      actor = $game_party.actors[i]
      draw_actor_graphic(actor, x - 40, y + 80)
      draw_actor_name(actor, x, y)
      draw_actor_class(actor, x + 144, y)
      draw_actor_level(actor, x, y + 32)
      draw_actor_state(actor, x + 90, y + 32)
      draw_actor_exp(actor, x, y + 60)
      draw_actor_hp(actor, x + 236, y + 32)
      draw_actor_sp(actor, x + 236, y + 60)
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
    else
     self.cursor_rect.set(0, @index * 90, self.width - 32, 90)
    end
  end
end
#==============================================================================
# * Window_MapName
#------------------------------------------------------------------------------
#  Draws the Map name.  COMPLETELY NEW CLASS.
#==============================================================================

class Window_MapName < Window_Base
#--------------------------------------------------------------------------
# Set up
#--------------------------------------------------------------------------
def initialize
super(0, 0, 480, 64)
self.contents = Bitmap.new(width - 52, height - 32)
self.contents.font.name = "MS PGothic"
self.contents.font.size = 22
refresh
end
#--------------------------------------------------------------------------
# Draws info on screen
#--------------------------------------------------------------------------
def refresh
self.contents.clear

# Map Name
#map = $game_map.name
self.contents.font.color = system_color
self.contents.draw_text(4, 0, 125, 32, "Location")
self.contents.font.color = normal_color
self.contents.draw_text(145, 0, 395, 32, $game_map.name)
end
end 

#==============================================================================
# ** Scene_Title
#------------------------------------------------------------------------------
#  This class performs title screen processing.
#==============================================================================

class Scene_Title
  alias alib_main main
  def main
  # If battle test
  if $BTEST
    battle_test
    return
  end
  # Load database
  $data_actors        = load_data("Data/Actors.rxdata")
  $data_classes       = load_data("Data/Classes.rxdata")
  $data_skills        = load_data("Data/Skills.rxdata")
  $data_items         = load_data("Data/Items.rxdata")
  $data_weapons       = load_data("Data/Weapons.rxdata")
  $data_armors        = load_data("Data/Armors.rxdata")
  $data_enemies       = load_data("Data/Enemies.rxdata")
  $data_troops        = load_data("Data/Troops.rxdata")
  $data_states        = load_data("Data/States.rxdata")
  $data_animations    = load_data("Data/Animations.rxdata")
  $data_tilesets      = load_data("Data/Tilesets.rxdata")
  $data_common_events = load_data("Data/CommonEvents.rxdata")
  $data_system        = load_data("Data/System.rxdata")
  # EDITS BEGIN HERE
  $map_infos = load_data("Data/MapInfos.rxdata")
  for key in $map_infos.keys  
    $map_infos[key] = $map_infos[key].name
  end
  # EDITS END HERE
  alib_main
  end
end

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing. Certain Values have been
#  rearranged, and the map window has been added.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make command window
    s1 = $data_system.words.item
    s2 = $data_system.words.skill
    s3 = $data_system.words.equip
    s4 = "Status"
    s5 = "Limit"
    s6 = "Party"
    s7 = "Save"
    s8 = "End Game"
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7, s8])
    @command_window.index = @menu_index
    # If number of party members is 0
    if $game_party.actors.size == 0
      # Disable items, skills, equipment, and status
      @command_window.disable_item(0)
      @command_window.disable_item(1)
      @command_window.disable_item(2)
      @command_window.disable_item(3)
      @command_window.disable_item(4)
      @command_window.disable_item(5)
    end
    # If save is forbidden
    if $game_system.save_disabled
      # Disable save
      @command_window.disable_item(6)
    end
    # Make play time window
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 320
    # Make gold window
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    # Make map name window
    @map_window = Window_MapName.new
    @map_window.x = 160
    @map_window.y = 416
    # Make status window
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update game screen
      Graphics.update
      # Update input information
      Input.update
      # Frame update
      update
      # Abort loop if screen is changed
      if $scene != self
        break
      end
    end
    # Prepare for transition
    Graphics.freeze
    # Dispose of windows
    @map_window.dispose
    @command_window.dispose
    @playtime_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @command_window.update
    @playtime_window.update
    @gold_window.update
    @status_window.update
    @map_window.update
    # If command window is active: call update_command
    if @command_window.active
      update_command
      return
    end
    # If status window is active: call update_status
    if @status_window.active
      update_status
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to map screen
      $scene = Scene_Map.new
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If command other than save or end game, and party members = 0
      if $game_party.actors.size == 0 and @command_window.index < 5
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Branch by command window cursor position
      case @command_window.index
      when 0  # item
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to item screen
        $scene = Scene_Item.new
      when 1  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0
      when 4  # limit
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Make status window active
        @command_window.active = false
        @status_window.active = true
        @status_window.index = 0 
      when 5
        $game_system.se_play($data_system.decision_se)
        $game_actors[1].forced_position = 0
        $game_actors[1].must_be_in_party = true
        $game_party.forced_size = 4
        $scene = Scene_PartySwitcher.new  
      when 6  # save
        # If saving is forbidden
        if $game_system.save_disabled
          # Play buzzer SE
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to save screen
        $scene = Scene_Save.new
      when 7  # end game
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to end game screen
        $scene = Scene_End.new
      end
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when status window is active)
  #--------------------------------------------------------------------------
  def update_status
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Make command window active
      @command_window.active = true
      @status_window.active = false
      @status_window.index = -1
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # Branch by command window cursor position
      case @command_window.index
      when 1  # skill
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # equipment
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to equipment screen
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # status
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to status screen
        $scene = Scene_Status.new(@status_window.index)
      when 4  # limits
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Switch to skill screen
        $scene = Scene_LimitMenu.new(@status_window.index)      
      end
      return
    end
  end
end
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top