open equip menu for specific actors

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
187
Reaction score
6
First Language
English
Primarily Uses
RMXP
i've been trying to make actors to open their equip menu, but there are weird occurrences like:
with one actor in party:
[$scene = Scene_Equip.new] opens the equip menu for the first actor in party
with two actors in party:
[$scene = Scene_Equip.new] when exiting the first actor's equip menu it exits to the selection menu
and not closing the equip menu entirely.

i have no idea how this script coding stuff works...but i need help please.
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
281
Reaction score
106
First Language
English
Primarily Uses
RMXP
Looking at Scene_Equip:
Code:
class Scene_Equip
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor_index : actor index
  #     equip_index : equipment index
  #--------------------------------------------------------------------------
  def initialize(actor_index = 0, equip_index = 0)
    @actor_index = actor_index
    @equip_index = equip_index
  end
You can open the equip menu starting with a specific party member. By default, it opens to the first member in the party as indicated by the actor_index = 0 (note that arrays are zero-indexed). If you want to open it for the second member, then your script call would be
Code:
$scene = Scene_Equip.new(1)
The reason it goes back to Scene_Menu when you close out of it is due to this method:
Code:
  #--------------------------------------------------------------------------
  # * Frame Update (when right window is active)
  #--------------------------------------------------------------------------
  def update_right
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to menu screen
      $scene = Scene_Menu.new(2)
      return
    end
where $scene is being set to Scene_Menu. The 2 indicates where the window cursor will start at on the menu window, which happens to be the third item in the list: Equip.

If you want it to exit back to the map, you can change the line to read as
Code:
$scene = Scene_Map.new
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
187
Reaction score
6
First Language
English
Primarily Uses
RMXP
ex: $scene = Scene_Equip.new(12)

error:
Script 'Window_Base' line 123: NoMethodError occurred
undefined method 'name' for nil:NilClass

anyway to fix that?

edit:
i switch the code from:
# Switch to menu screen
$scene = Scene_Menu.new(2)
to:
# Switch to map screen
$scene = Scene_Map.new
and it worked.
 
Last edited:

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
281
Reaction score
106
First Language
English
Primarily Uses
RMXP
Are you trying to do actor ID 12? Because that's not what that means.
You're putting in the actor's POSITION in the party. If your game's party size is only a maximum of 4 (i.e. the default), then Scene_Equip.new only expects a value between 0 and 3.
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
187
Reaction score
6
First Language
English
Primarily Uses
RMXP
i have the Party Changer Menu made by BlackMage
i was talking about how i can open the other actor's equipment even in reserve, not just in my active party.
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
281
Reaction score
106
First Language
English
Primarily Uses
RMXP
Would have been nice to know that from the start.

For Scene_Equip,
Code:
  def main
    # Get actor
    @actor = $game_party.actors[@actor_index]
You should be able to change the line to
Code:
@actor = $game_actors[@actor_index]
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
187
Reaction score
6
First Language
English
Primarily Uses
RMXP
which script code i should replace with?
edit: nvm i got it, took me like 10 secs to figure it out
edit 2: at Scene_Equip when i change it to:
def main
# Get actor
@actor = $game_actors[@actor_index]
i can't open the equip menu from via selection menu
 
Last edited:

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
281
Reaction score
106
First Language
English
Primarily Uses
RMXP
Again, it would be nice if you could have told me what exactly you wanted from the start. At this point, this thread should be moved to Script Requests.

My question to you is where are you making the Scene_Equip.new script calls at? Are you putting it inside the party switcher script itself, because that honestly makes the most sense to me. All this time I was assuming you had implemented some new menu system, but it just sounds like you want to keep the default while adding new features to it.
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
187
Reaction score
6
First Language
English
Primarily Uses
RMXP
is there a way to keep both script features?
def main
# Get actor
@actor = $game_party.actors[@actor_index]
@actor = $game_actors[@actor_index]
 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
281
Reaction score
106
First Language
English
Primarily Uses
RMXP
Yes, but you have to answer my question first.
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
187
Reaction score
6
First Language
English
Primarily Uses
RMXP
i just want to make a game as simple as possible with some additions into the mix
with some kind of like persona battle mechanics
RMXP Scripts that CAN have like:
- Party Changer w/ reserves
- Open Equipment Menu via Party Members in Hub and Manually
RMXP Scripts that POSSIBLY have like:
- A Teleporter with connections to other Teleporters within the dungeon
- A Random Generating Dungeon
- A Mini-Map
- Multiple States (not just one per state)
- Allies that have AI and can be controlled by Tactics
Tactics like:
Act Freely
Full Assault
Heal/Support
Conserve SP
and Direct Commands
RMXP Scripts that CAN'T have like:
- A Naviagtor with Enemy Analysis
- Down Enemies by Exploiting Weaknesses and getting a 1 More (Action)
- Adding PDEF and MDEF Stats to allies
 

slimmmeiske2

Little Red Riding Hood
Global Mod
Joined
Sep 6, 2012
Messages
7,842
Reaction score
5,225
First Language
Dutch
Primarily Uses
RMXP

I've moved this thread to RMXP Script Support. Please be sure to post your threads in the correct forum next time. Thank you.

 

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
281
Reaction score
106
First Language
English
Primarily Uses
RMXP
I'm just going to give you what I feel like is the best solution.

First, revert the changes I told you to make to Scene_Equip.

Then, replace the party changer script with my revision, and add Scene_Equip_Actor as another script below it.
Ruby:
################################################################################
# Party Changer Script By Black Mage (Credit required to use)
# Edit by KK20 - open Scene_Equip with Input::A
# Version : 1.7
# https://burningwizard.wordpress.com/2014/12/28/party-changer-menu-script-rmxp-rgss/
#
# The set up :
# First, put this script on your game. After that, you just need to
# specify which characters that player can change in their party using this script call.
#      $partychange[Character Number In Database – 1] = true
#      $game_map.refresh
# Change the value into false if you want to remove them from the menu.
#
# To call the menu, put this on script call.
#      $scene = Scene_Party.new
#
#
# The version 1.2 above give you a menu mode called "Information Mode" where it
# include a profile of the character that is highlighted in the menu. Beware that this
# mode is highly customizable, so you need some knowledge on RGSS scripting to utilize
# to it upmost potential.
# To call this menu, put this on script call.
#      $scene = Scene_Party.new(0,1)
#
# If you have some knowledge on RGSS scripting, you may do edits to Profile Window
# located on line 435 onwards to make the Profile Window that you like.
#
#
# The version 1.3 above give you a large party menu mode. It's a menu that
# compatible with some "Large Party" script out there.
# To call this menu, put this on script call.
#      $scene = Scene_Party.new(0,2)
#
# List of "Large Party" Script that has been tested :
#   - Dargor's Large Party Script
#
#
# The version 1.4 introduce lock feature.
# If you want to lock specific character so that he/she can't be added or removed
# from the party, simply use this script call.
#      $partylock[Character Number In Database – 1] = true
#      $game_map.refresh
# Change the value into false if you want to unlock them.
# Locked character will have their sprite a bit transparent on the menu.
#
#
# The version 1.5 has configuration to make reserved party members to gain EXP.
# Change the Percentage value on the script to determine how much EXP gained
# for reserved party members.
# Note that locked party members aren't getting any EXP by default. Change Locked
# value on the script into true, to enable the locked members to gain EXP.
#
################################################################################

$partychange = []
$partylock = []

module Black
  module Black_EXP
    # Reserved Party EXP Percentage gained. Put 50 if you want them to get 50%
    # of EXP gained by Main Party members.
    Percentage = 0
    # Determine whether Locked Party members receive EXP or not. Change to true
    # if you want Locked Party members to gain EXP.
    Locked = false
  end
end

class Scene_Party
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     menu_index : command cursor's initial position
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0, window_form = 0)
    @menu_index = menu_index
    @window_form = window_form
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Make Help Window
    @help_window = Window_PartyHelp.new(@window_form)
    @help_window2 = Window_PartyHelp2.new(@window_form)

    # Make Party Change Window
    @partychange_window = Window_PartyChange.new(@window_form, @menu_index)

    if @window_form == 0
      @partychange_window.x = 0
    elsif @window_form == 1
      @partychange_window.x = 0
    elsif @window_form == 2
      @partychange_window.x = 260
    end

    if @window_form == 0
      @partychange_window.y = 240
    elsif @window_form == 1
      @partychange_window.y = 240
    elsif @window_form == 2
      @partychange_window.y = 64
    end

    @partychange_window.active = true
    
    # Make party window
    @party_window = Window_Party.new(@window_form)
    @party_window.x = 0
    @party_window.y = 64
    
    # If mode 1 enabled
    if @window_form == 1
      @help_window3 = Window_PartyHelp3.new
      @profile_window = Window_Profile.new
    end
        
    # 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
    @partychange_window.dispose
    @party_window.dispose
    @help_window.dispose
    @help_window2.dispose

    # If mode 1 enabled
    if @window_form == 1
      @help_window3.dispose
      @profile_window.dispose
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update
  #--------------------------------------------------------------------------
  def update
    # Update windows
    @partychange_window.update
    @party_window.update
    
    # Update the profile window if mode 1 is true
    if @window_form == 1
      @profile_window.update(@partychange_window.index)
    end

    # Update the party change window
    if @partychange_window.active
      update_partychange
      return
    end
  end

  #--------------------------------------------------------------------------
  # * Frame Update (when party window is active)
  #--------------------------------------------------------------------------
  def update_partychange
    # If B button was pressed
    if Input.trigger?(Input::B)
      if $game_party.actors.size == 0
        $game_system.se_play($data_system.buzzer_se)
        return
      else
        # Play cancel SE
        $game_system.se_play($data_system.cancel_se)
        # Switch to map screen
        $scene = Scene_Map.new
        return
      end
    end
    if Input.trigger?(Input::C)
      @hero = @partychange_window.hero

      # If Hero is Nil
      if @hero == nil
        $game_system.se_play($data_system.decision_se)
        return
      end
        
      if $game_party.actors.include?($game_actors[@partychange_window.hero.id])
        return if $partylock[@partychange_window.hero.id - 1] == true
        $game_party.remove_actor(@partychange_window.hero.id)
        @party_window.dispose
        @party_window = Window_Party.new(@window_form)
        @party_window.x = 0
        @party_window.y = 64
        $game_system.se_play($data_system.decision_se)
        @party_window.refresh
        return
      else
        return if $partylock[@partychange_window.hero.id - 1] == true
        $game_party.add_actor(@partychange_window.hero.id)
        @party_window.dispose
        @party_window = Window_Party.new(@window_form)
        @party_window.x = 0
        @party_window.y = 64
        $game_system.se_play($data_system.decision_se)
        @party_window.refresh
        return
      end
    end
    if Input.trigger?(Input::A)
      @hero = @partychange_window.hero
      if @hero.nil?
        $game_system.se_play($data_system.decision_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      $scene = Scene_Equip_Actor.new(@hero.id)
    end
  end
end

##########
#Displaying the Party Change Window
##########

class Window_PartyChange < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(window_form = 0, start_index = 0)
    @window_form = window_form
    case window_form
    when 0
      super(0, 0, 640, 240)
      @column_max = 7
    when 1
      super(0, 0, 380, 240)
      @column_max = 4
    when 2
      super(0, 0, 380, 416)
      @column_max = 4
    end
    refresh
    self.index = start_index
  end
  #--------------------------------------------------------------------------
  # * Get Hero
  #--------------------------------------------------------------------------
  def hero
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    @lock = []
    if $partychange.size > 0
      for i in 0..$partychange.size
        if $partychange[i] == true
          @data.push($game_actors[i+1])
          if $partylock[i] == true
            @lock.push(true)
          else
            @lock.push(false)
          end
        end
      end
      @item_max = @data.size
      self.contents = Bitmap.new(width - 32, row_max * 112)
      for i in 0..(@item_max - 1)
        case @window_form
        when 0
          x = ((i) % 7 * (88)) + 40
          y = (((i)/7) * 112) + 70
        when 1
          x = ((i) % 4 * (88)) + 40
          y = (((i)/4) * 112) + 70
        when 2
          x = ((i) % 4 * (88)) + 40
          y = (((i)/4) * 90) + 70
        end
        actor = @data[i]
        bitmap = RPG::Cache.character(actor.character_name, actor.character_hue)
        cw = bitmap.width / 4
        ch = bitmap.height / 4
        src_rect = Rect.new(0, 0, cw, ch)
        if @lock[i] == true
          self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect, 150)
        else
          self.contents.blt(x - cw / 2, y - ch, bitmap, src_rect)
        end
      end
    end
  end
  #--------------------------------------------------------------------------
  # * Cursor Rectangle Update
  #--------------------------------------------------------------------------
  #Redefine Row
  def top_row
    if @window_form == 2
      return self.oy / 90
    else
      return self.oy / 112
    end
  end
  def top_row=(row)
    if row < 0
      row = 0
    end
    if row > row_max - 1
      row = row_max - 1
    end
    if @window_form == 2
      self.oy = row * 90
    else
      self.oy = row * 112
    end
  end
  def page_row_max
    if @window_form == 2
      return (self.height) / 90
    else
      return (self.height) / 112
    end
  end

  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
      return
    end
    row = @index / @column_max
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end
    # If cursor position is less than 0
    case @window_form
    when 0
      self.cursor_rect.set(index % 7 * (88), (@index/7) * 110 - self.oy + ((@index/7) * 2), self.width - 560, 96)
    when 1
      self.cursor_rect.set(index % 4 * (88), (@index/4) * 110 - self.oy + ((@index/4) * 2), self.width - 300, 96)
    when 2
      self.cursor_rect.set(index % 4 * (88), (@index/4) * 88 - self.oy + ((@index/4) * 2), self.width - 300, 96)
    end
  end

end



##########
#Displaying current Party Window
##########

class Window_Party < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(window_form = 0)
    @window_form = window_form
    case window_form
    when 0
      super(0, 0, 640, 120)
      @column_max = 2
    when 1
      super(0, 0, 640, 120)
      @column_max = 2
    when 2
      super(0, 0, 260, 416)
      @column_max = 2
    end
    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
    @collumn_custom = 1
    case @window_form

    when 0
      for i in 0...$game_party.actors.size
        x = (i % 4 * (160)) + (64)
        y = (i/4) * 116
        actor = $game_party.actors[i]
        draw_actor_graphic(actor, x - 40, y + 80)
        draw_actor_name(actor, x - 50, y)
        draw_actor_level(actor, x - 10, y + 50)
      end
    when 1
      for i in 0...$game_party.actors.size
        x = (i % 4 * (160)) + (64)
        y = (i/4) * 116
        actor = $game_party.actors[i]
        draw_actor_graphic(actor, x - 40, y + 80)
        draw_actor_name(actor, x - 50, y)
        draw_actor_level(actor, x - 10, y + 50)
      end
    when 2
      for i in 0...$game_party.actors.size
        x = (i % 4 * (60)) + (64)
        y = (i/4) * 90
        actor = $game_party.actors[i]
        draw_actor_graphic(actor, x - 40, y + 70)
      end
    end

  end
end


##########
#Displaying Help Window
##########

class Window_PartyHelp < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(window_form = 0)
    case window_form
    when 0
      super(0, 0, 640, 64)
    when 1
      super(0, 0, 640, 64)
    when 2
      super(0, 0, 260, 64)
    end
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, self.width - 40, 32, 'Current Party', 1)
  end
end

class Window_PartyHelp2 < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(window_form = 0)
    case window_form
    when 0
      super(0, 184, 640, 56)
    when 1
      super(0, 184, 380, 56)
    when 2
      super(260, 0, 380, 64)
    end
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, self.width - 40, 28, 'Add or remove character', 1)
  end
end

class Window_PartyHelp3 < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(window_form = 0)
    super(380, 184, 260, 56)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.draw_text(4, 0, self.width - 40, 28, 'Character Profile', 1)
  end
end


##########
#The Customizable Character Profile
##########

class Window_Profile < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(380, 240, 260, 240)
    self.contents = Bitmap.new(width - 32, height - 32)
  end
  def update(index)
    
    #====================
    # Window Profile Customization
    #====================
    
    picture = true # Set to false if you don't want to use picture.
    x_pos = 100 # Denotes the possition of the text.
    x_pic = 0 # Denotes the possition of the picture.
    font_size = 22 # The font size. 22 is the default size.
    
    @index = index
    self.contents.clear
    
    @data = []
    # Get the actor data
    if $partychange.size > 0
      for i in 0..$partychange.size
        if $partychange[i] == true
          @data.push($game_actors[i+1])
        end
      end
    end
    
    if picture == true
      actor = @data[index]
      bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue)
      cw = bitmap.width
      ch = bitmap.height
      src_rect = Rect.new(0, 0, cw, ch)
      self.contents.blt(x_pic, 0, bitmap, src_rect)
    end
    
    # Do something
    if $partychange.size > 0
      self.contents.font.size = font_size
    
      self.contents.draw_text(x_pos, 0, 300, 24, 'Name : ' + @data[index].name, 0)
      
      case actor.id
      when 1
        age = '12'
      when 2
        age = '12'
      else
        age = '???'
      end
      self.contents.draw_text(x_pos, 24, 300, 24, 'Age : ' + age, 0)
      
      self.contents.draw_text(x_pos, 48, 300, 24, 'Class : ' + @data[index].class_name, 0)
      self.contents.draw_text(x_pos, 72, 300, 24, 'Level : ' + @data[index].level.to_s, 0)

      case actor.id
      when 1
        self.contents.draw_text(x_pos, 110, 300, 24, 'Story : I think', 0)
        self.contents.draw_text(x_pos, 134, 300, 24, 'this guy name', 0)
        self.contents.draw_text(x_pos, 158, 300, 24, 'is Aluxes.', 0)
      else
        self.contents.draw_text(x_pos, 110, 300, 24, 'Nothing to talk ', 0)
        self.contents.draw_text(x_pos, 134, 300, 24, 'about', 0)
      end

    end
  end
end


#--------------------------------------------------------------------------
# * Reserve Party EXP
#--------------------------------------------------------------------------
class Scene_Battle
  alias black_start_phase5 start_phase5
  def start_phase5
    black_start_phase5
    @percentage = Black::Black_EXP::Percentage
    @black_actors = []
    @black_actors_id = []
    for i in 0...$game_party.actors.size
      @black_actors_id.push($game_party.actors[i].id)
    end   
    for i in @black_actors_id
      @black_actors.push($game_actors[i])
    end
    
    # Get the EXP Value
    exp = 0
    for enemy in $game_troop.enemies
      # If enemy is not hidden
      unless enemy.hidden
        # Add EXP and amount of gold obtained
        exp += enemy.exp
      end
    end
    
    for i in 0...$partychange.size
      actor = $game_actors[i+1]
      # Check if the actor is already in party and already receive its share.
      if @black_actors.include?(actor)
      else
        # Check if the actor is on reserved list.
        if $partychange[i] == true
          # Check if the actor is not locked.
          if $partylock[i] != true
            if actor.cant_get_exp? == false
              last_level = actor.level
              actor.exp += (exp*@percentage)/100
              if actor.level > last_level
                @status_window.level_up(i)
              end
            end
          elsif $partylock[i] == true
            # If the actor is locked, check if he/she can receive EXP.
            if Black::Black_EXP::Locked == true
              if actor.cant_get_exp? == false
                last_level = actor.level
                actor.exp += (exp*@percentage)/100
                if actor.level > last_level
                  @status_window.level_up(i)
                end
              end
            end
          end
        end
      end     
    end   
  end
end

# FIX so that the reserved party is saved on the save file.
class Party_Change
  def initialize
    @partychange = $partychange
    @partylock = $partylock
    @partychangelength = $partychange.size
    @partylocklength = $partylock.size
  end
  def list(number)
    return @partychange[number]
  end
  def lock(number)
    return @partylock[number]
  end
  def list_length
    return @partychangelength
  end
  def lock_length
    return @partylocklength
  end
end

class Scene_Save < Scene_File
  def write_save_data(file)
    # Make character data for drawing save file
    characters = []
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      characters.push([actor.character_name, actor.character_hue])
    end
    # Write character data for drawing save file
    Marshal.dump(characters, file)
    # Wrire frame count for measuring play time
    Marshal.dump(Graphics.frame_count, file)
    # Increase save count by 1
    $game_system.save_count += 1
    # Save magic number
    # (A random value will be written each time saving with editor)
    $game_system.magic_number = $data_system.magic_number
    # Write each type of game object
    Marshal.dump($game_system, file)
    Marshal.dump($game_switches, file)
    Marshal.dump($game_variables, file)
    Marshal.dump($game_self_switches, file)
    Marshal.dump($game_screen, file)
    Marshal.dump($game_actors, file)
    Marshal.dump($game_party, file)
    Marshal.dump($game_troop, file)
    Marshal.dump($game_map, file)
    Marshal.dump($game_player, file)
    $party_change = Party_Change.new
    Marshal.dump($party_change, file)
  end
end

class Scene_Load < Scene_File
  #--------------------------------------------------------------------------
  # * Read Party Change Data
  #     file : file object for reading (opened)
  #--------------------------------------------------------------------------
  def read_save_data(file)
    # Read character data for drawing save file
    characters = Marshal.load(file)
    # Read frame count for measuring play time
    Graphics.frame_count = Marshal.load(file)
    # Read each type of game object
    $game_system        = Marshal.load(file)
    $game_switches      = Marshal.load(file)
    $game_variables     = Marshal.load(file)
    $game_self_switches = Marshal.load(file)
    $game_screen        = Marshal.load(file)
    $game_actors        = Marshal.load(file)
    $game_party         = Marshal.load(file)
    $game_troop         = Marshal.load(file)
    $game_map           = Marshal.load(file)
    $game_player        = Marshal.load(file)
    $party_change       = Marshal.load(file)

    for i in 0..($party_change.list_length - 1)
      $partychange[i] = $party_change.list(i)
    end
    for i in 0..($party_change.lock_length - 1)
      $partylock[i] = $party_change.lock(i)
    end   
    
    # If magic number is different from when saving
    # (if editing was added with editor)
    if $game_system.magic_number != $data_system.magic_number
      # Load map
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
    # Refresh party members
    $game_party.refresh
  end
end

Ruby:
#==============================================================================
# ** Scene_Equip_Actor
# by KK20
# To be used with an edited version of Party Changer Script By Black Mage
#------------------------------------------------------------------------------
#  This class performs equipment screen processing for a specific actor ID
#==============================================================================

class Scene_Equip_Actor < Scene_Equip
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     actor_index : actor index
  #     equip_index : equipment index
  #--------------------------------------------------------------------------
  def initialize(actor_id = 1, equip_index = 0, form = 0)
    @actor_index = actor_id
    @equip_index = equip_index
    @scene_party_form = form
    @actors_available = []
    $partychange.each_with_index do |value, index|
      @actors_available << index + 1 if value == true
    end
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Get actor
    @actor = $game_actors[@actor_index]
    # Make windows
    @help_window = Window_Help.new
    @left_window = Window_EquipLeft.new(@actor)
    @right_window = Window_EquipRight.new(@actor)
    @item_window1 = Window_EquipItem.new(@actor, 0)
    @item_window2 = Window_EquipItem.new(@actor, 1)
    @item_window3 = Window_EquipItem.new(@actor, 2)
    @item_window4 = Window_EquipItem.new(@actor, 3)
    @item_window5 = Window_EquipItem.new(@actor, 4)
    # Associate help window
    @right_window.help_window = @help_window
    @item_window1.help_window = @help_window
    @item_window2.help_window = @help_window
    @item_window3.help_window = @help_window
    @item_window4.help_window = @help_window
    @item_window5.help_window = @help_window
    # Set cursor position
    @right_window.index = @equip_index
    refresh
    # 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
    @help_window.dispose
    @left_window.dispose
    @right_window.dispose
    @item_window1.dispose
    @item_window2.dispose
    @item_window3.dispose
    @item_window4.dispose
    @item_window5.dispose
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when right window is active)
  #--------------------------------------------------------------------------
  def update_right
    # If B button was pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Switch to party change screen
      index = @actors_available.index(@actor_index)
      $scene = Scene_Party.new(index, @scene_party_form)
      return
    end
    # If C button was pressed
    if Input.trigger?(Input::C)
      # If equipment is fixed
      if @actor.equip_fix?(@right_window.index)
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      # Play decision SE
      $game_system.se_play($data_system.decision_se)
      # Activate item window
      @right_window.active = false
      @item_window.active = true
      @item_window.index = 0
      return
    end
    # If R button was pressed
    if Input.trigger?(Input::R) && change_actor(1)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # Switch to different equipment screen
      $scene = Scene_Equip_Actor.new(@actor_index, @right_window.index)
      return
    end
    # If L button was pressed
    if Input.trigger?(Input::L) && change_actor(-1)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # Switch to different equipment screen
      $scene = Scene_Equip_Actor.new(@actor_index, @right_window.index)
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Next/Previous actor
  #--------------------------------------------------------------------------
  def change_actor(direction = 1)
    new_index = @actors_available.index(@actor_index)
    if new_index.nil? || @actors_available.size <= 1
      $game_system.se_play($data_system.buzzer_se)
      return false
    end
    new_index += direction
    new_index %= @actors_available.size
    
    @actor_index = @actors_available[new_index]
  end
end
Open up the Party Changer scene, highlight over an actor, and press the A button (typically Shift or the Z key). It will open up the equip scene for that actor. Pressing L/R toggles between the actors you have available in your party reserves. Press B to return back to the Party Changer scene.

And you can still use the default Scene_Equip as normal.
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
187
Reaction score
6
First Language
English
Primarily Uses
RMXP
THANK YOU!!!
it works like a beauty!

edit: btw is there a way that RMXP can show multiple states?
 
Last edited:

KK20

Just some XP Scripter
Veteran
Joined
Oct 11, 2018
Messages
281
Reaction score
106
First Language
English
Primarily Uses
RMXP
I'm sure there are a number of scripts that do something like that. I don't know any off the top of my head.
 

MarioWidjaya123

Veteran
Veteran
Joined
May 16, 2020
Messages
187
Reaction score
6
First Language
English
Primarily Uses
RMXP
i hope i can improve the game i'll made as much as i can...
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD

Forum statistics

Threads
105,868
Messages
1,017,078
Members
137,580
Latest member
Snavi
Top