[XP] Easy Party Switcher

Started by Blizzard, January 09, 2008, 04:30:52 pm

Previous topic - Next topic

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fallen Angel X

October 22, 2009, 06:49:17 pm #101 Last Edit: October 22, 2009, 06:51:58 pm by Fallen Angel X
Replace the lines under Scene_Exit (Line 220) with:

  #--------------------------------------------------------------------------
 # * Main Processing
 #--------------------------------------------------------------------------
 def main
   # Make command window
   s1 = "To Title"
   s2 = "Shutdown"
   s3 = "Cancel"
   @command_window = Window_Command.new(192, [s1, s2, s3])
   @command_window.x = 320 - @command_window.width / 2
   @command_window.y = 240 - @command_window.height / 2
   # 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 window
   @command_window.dispose
   # If switching to title screen
   if $scene.is_a?(Scene_Title)
     # Fade out screen
     Graphics.transition
     Graphics.freeze
   end
 end
 #--------------------------------------------------------------------------
 # * Frame Update
 #--------------------------------------------------------------------------
 def update
   # Update command window
   @command_window.update
   # 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(5)
     return
   end
   # If C button was pressed
   if Input.trigger?(Input::C)
     # Branch by command window cursor position
     case @command_window.index
     when 0  # to title
       command_to_title
     when 1  # shutdown
       command_shutdown
     when 2  # quit
       command_cancel
     end
     return
   end
 end
 #--------------------------------------------------------------------------
 # * Process When Choosing [To Title] Command
 #--------------------------------------------------------------------------
 def command_to_title
   # Play decision SE
   $game_system.se_play($data_system.decision_se)
   # Fade out BGM, BGS, and ME
   Audio.bgm_fade(800)
   Audio.bgs_fade(800)
   Audio.me_fade(800)
   # Switch to title screen
   $scene = Scene_Title.new
 end
 #--------------------------------------------------------------------------
 # * Process When Choosing [Shutdown] Command
 #--------------------------------------------------------------------------
 def command_shutdown
   # Play decision SE
   $game_system.se_play($data_system.decision_se)
   # Fade out BGM, BGS, and ME
   Audio.bgm_fade(800)
   Audio.bgs_fade(800)
   Audio.me_fade(800)
   # Shutdown
   $scene = nil
 end
 #--------------------------------------------------------------------------
 # *  Process When Choosing [Cancel] Command
 #--------------------------------------------------------------------------
 def command_cancel
   # Play decision SE
   $game_system.se_play($data_system.decision_se)
   # Switch to menu screen
   $scene = Scene_Menu.new(6)
 end
end

Alunasa

It worked!  Thank you again!

Blizzard

Yeah, it can be "solved" that way as well. :P
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Alunasa

If you know another way that is safer and more stable for the game, I'll try that too.

Blizzard

Finding and fixing the actual problem would be safer than just patching it up, that's all I'm saying. But if this works for you, then there's no need for anything else.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Orici

hey, it seems that the battle switch option is incompatible with guillaume 777's Multi-Slot script (gives error in line 676: NameError occurred - unitialized constant window_partycommand::Window_HorizCommand)
I 'fixed' it by deleting that part since it mentioned the SDK and I'm not using it...It works now but I want to be sure i didn't do something wrong or if there is another way to solve the problem  :P

Blizzard

You probably shouldn't have deleted it. :P The SDK part was there because it's supposed to fix a problem with the SDK. So maybe it'll work out anyway.

Also, it makes not really sense that the script isn't compatible with Guillaume's script since the scripts don't really have any common code. Did you put the scripts in the right order?
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Alunasa

October 27, 2009, 06:17:09 pm #108 Last Edit: October 27, 2009, 06:18:51 pm by Alunasa
I'm making serious progress on the project and I just ran into an issue that I'd like your help with.

I have a total of 12 possible party members including the main character.  I need to make the other 11 characters not selectable for a short period of time.  The problem is that RMXP is only allowing me to enter 10 lines of code which amounts to 5 characters.

How do I tell it that I'd like all party members except #9 to be unavailable?

Here is the code that I was trying to use:
Spoiler: ShowHide
$scene = Scene_PartySwitcher.new
$game_actors[001].
disabled_for_party = true
$game_actors[002].
disabled_for_party = true
$game_actors[003].
disabled_for_party = true
$game_actors[004].
disabled_for_party = true
$game_actors[005].
disabled_for_party = true
$scene = Scene_PartySwitcher.new
$game_actors[006].
disabled_for_party = true
$game_actors[007].
disabled_for_party = true
$game_actors[008].
disabled_for_party = true
$game_actors[010].
disabled_for_party = true
$game_actors[011].
disabled_for_party = true
$scene = Scene_PartySwitcher.new
$game_actors[012].
disabled_for_party = true


The only solution that I've been able to come up with is to delete six characters.  I'd like to avoid doing that if possible.

-Alunasa

Blizzard

Just make 2 script calls. Also, remove the leading zeros or it won't work properly. You can also use something like this:

(1..12).each {|i|
 $game_actors[i].
   disabled_for_party = true}
$game_actors[9].
  disabled_for_party = false
$scene = Scene_PartySwitcher.new
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Alunasa

As my partner said, "Allow us to bow to your code BAMFness."

Thank you again!  This works perfectly.  We were beating our heads against the wall trying to figure this out.  Obviously neither of us knows anything about code.  Thanks for the fast reply!

-Alunasa

G_G

another solution you coulda used was 2 script call commands and seperate the code, but use blizzy's code much more better.

AngeliqueSama

when i tried it said
line 988 is invalid $game_system.stored_party.compact!

Spoiler: ShowHide

Blizzard

You tried to switch the current party with a stored party without having a stored party.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Sima Yi

Please take a look.I know it's an old post,but I just found a big and fat bug here.

I was play-testing my game,then I saved my data in a game file.Then when I loaded the file back and go to the party switcher,there is a duplicate of the player.Can you fix this bug?

Blizzard

I'd need a working demo of the bug.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Sima Yi

May 21, 2010, 11:33:47 am #116 Last Edit: May 21, 2010, 11:59:17 am by Sima Yi
!!!I found the PROBLEM WHICH DELAYED ME 3 DAYS FROM WORK! :D!!!

I went to the Scene_Load script and erased the code of the party members being refreshed,cause I want to make it more like the other RPGs.Howver,when I erased that line,I got that problem of a dulipcate character.

Can you help me fix that?Thanks. :P

Blizzard

Then your save files are corrupted.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Sima Yi

I tried in a new game,but it is still the same. :P

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.