I'm making a "custom" script that allows you to remove characters from your party and I have a problem.
Before stating anything, I want to say that I'm making this because none of the scripts available suit my needs, they look really nice, but they can't work with the game I'm making.
In my game, players will play as a main character that can't change, that's ok. But here's the problem, there's no storyline, players will just go and talk to different characters and maybe they'll get them in their party... the game has more than 30 possible actors.
What I'm looking for is a system that allows players to remove a character that is in the party, and when they do, the actor says something like "I'll be waiting in somewhere".
I already made the structure with a Window_Party and Scene_Party. It detects if a certain actor is in the party and shows a command to remove each one. The problem is that when I click a command, the game freezes. I don't know where's the problem.
The other thing is that I don't really know how to make a common event that detects when an actor is removed and activates, so there's the message that says "I'll be waiting blah blah blah".
(My characters for testing are named "bontest" and "berrytest")
Window_Party
Scene_Party
If someone knows how to make this actually remove an actor without freezing the game and detect when an actor is removed to activate a common event, that would be perfect.
Before stating anything, I want to say that I'm making this because none of the scripts available suit my needs, they look really nice, but they can't work with the game I'm making.
In my game, players will play as a main character that can't change, that's ok. But here's the problem, there's no storyline, players will just go and talk to different characters and maybe they'll get them in their party... the game has more than 30 possible actors.
What I'm looking for is a system that allows players to remove a character that is in the party, and when they do, the actor says something like "I'll be waiting in somewhere".
I already made the structure with a Window_Party and Scene_Party. It detects if a certain actor is in the party and shows a command to remove each one. The problem is that when I click a command, the game freezes. I don't know where's the problem.
The other thing is that I don't really know how to make a common event that detects when an actor is removed and activates, so there's the message that says "I'll be waiting blah blah blah".
(My characters for testing are named "bontest" and "berrytest")
Window_Party
#==============================================================================# ** Window_Party#------------------------------------------------------------------------------# This is the custom window that detects if the actor is in the party.#==============================================================================class Window_Party < Window_Command def alignment return 1 end #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- def initialize super(0, 0) update_placement self.openness = 0 open end #-------------------------------------------------------------------------- # * Get Window Width #-------------------------------------------------------------------------- def window_width return 160 end #-------------------------------------------------------------------------- # * Update Window Position #-------------------------------------------------------------------------- def update_placement self.x = (Graphics.width - width) / 2 self.y = (Graphics.height - height) / 2 end #-------------------------------------------------------------------------- # * Create Command List #-------------------------------------------------------------------------- def make_command_list if $game_party.members.include?($game_actors[10]) #If actor 10 is in party, show command add_command("Bontest", :rmbontest) end if $game_party.members.include?($game_actors[9]) #If actor 9 is in party, show command add_command("Berrytest", :rmberrytest) end endend
#==============================================================================# ** Scene_Party#------------------------------------------------------------------------------# The Party Scene accessed through the menu. Removes actors.#==============================================================================class Scene_Party < Scene_MenuBase #-------------------------------------------------------------------------- # * Start Processing #-------------------------------------------------------------------------- def start super create_command_window end #-------------------------------------------------------------------------- # * Pre-Termination Processing #-------------------------------------------------------------------------- def pre_terminate super close_command_window end #-------------------------------------------------------------------------- # * Create Background #-------------------------------------------------------------------------- def create_background super @background_sprite.tone.set(0, 0, 0, 128) end #-------------------------------------------------------------------------- # * Create Command Window #-------------------------------------------------------------------------- def create_command_window @command_window = Window_Party.new @command_window.set_handler🙂rmbontest, method🙂command_rmbontest)) @command_window.set_handler🙂rmberrytest, method🙂command_rmberrytest)) @command_window.set_handler🙂cancel, method🙂return_scene)) end #-------------------------------------------------------------------------- # * Close Command Window #-------------------------------------------------------------------------- def close_command_window @command_window.close update until @command_window.close? end #-------------------------------------------------------------------------- # * [Remove bontest] Command #-------------------------------------------------------------------------- def command_rmbontest $game_party.remove_actor(10) #Removes bontest (actor 10) from party end #-------------------------------------------------------------------------- # * [Remove berrytest] Command #-------------------------------------------------------------------------- def command_rmberrytest $game_party.remove_actor(9) #Removes berrytest (actor 9) from party end end
