[XP] Easy Party Switcher

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

Previous topic - Next topic

Blizzard

January 09, 2008, 04:30:52 pm Last Edit: October 07, 2021, 10:29:28 am by Blizzard
Easy Party Switcher
Authors: Blizzard
Version: 2.6
Type: Party Changing System
Key Term: Player / Party / Troop Add-on

Introduction

This script allows a more advanced switching of parties, disabling party members and fast switch between the current and a stored party.

This work is licensed under BSD License 2.0:
QuoteCopyright (c) Boris "Blizzard" Mikić
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1.  Redistributions of source code must retain the above copyright notice,
    this list of conditions and the following disclaimer.

2.  Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.

3.  Neither the name of the copyright holder nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

You may use this script for both non-commercial and commercial products without limitations as long as you fulfill the conditions presented by the above license. The "complete" way to give credit is to include the license somewhere in your product (e.g. in the credits screen), but a "simple" way is also acceptable. The "simple" way to give credit is as follows:
QuoteEasy Party Switcher licensed under BSD License 2.0, Copyright (c) Boris "Blizzard" Mikić

Alternatively, if your font doesn't support diacritic characters, you may use this variant:
QuoteEasy Party Switcher licensed under BSD License 2.0, Copyright (c) Boris "Blizzard" Mikic

In general other similar variants are allowed as long as it is clear who the creator is (e.g. "Easy Party Switcher created by Blizzard" is acceptable). But if possible, prefer to use one of the two variants listed above.

If you fail to give credit and/or claim that this work was created by you, this may result in legal action and/or payment of damages even though this work is free of charge to use normally.


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
  • supports any party size
  • possible to fast-switch between the current and a stored party
  • full instructions inside the first comment
v1.1
  • the glitches I forgot to fix were fixed
  • enhanced compatibility a bit more
v1.2b
  • overworked system and added window "You cannot remove the last party member!"
  • alpha tested
v1.21b
  • fixed the "Unable to find Graphics/Characters/Faces/" glitch
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"
v2.0b
  • fixed the bug where you could empty the party... again...
  • fixed the bug that appeared when you pressed SHIFT
  • added option to allow an empty party
  • added "EXP for party members in reserve" option
  • made the forced_size for party work more convenient
  • improved coding
  • slightly decreased lag
v2.1b
  • fixed a bug
  • improved coding
  • rewritten conditions using classic syntax to avoid RGSS conditioning bug
  • now can serve as enhancement for CP Debug System
v2.11b
  • improved coding and performance
v2.3b
  • optional feature to call the Party Switcher during battle
v2.32b
  • fixed crash problem with SDK 2.x when using the BATTLE_SWITCH option
  • fixed SP display glitch when using BARS from Tons of Add-ons
v2.4b
  • now you can activate party order change only in the party switcher
  • add option for automatic party order change only in battle
v2.41b
  • fixed problem where you could put together a party where everybody is dead
v2.42b
  • added possibility to change the BATTLE_SWITCH setting during the game
v2.43b
  • fixed a problem with SDK 2.x
v2.5b
  • fixed a problem caused by other scripts that remove the result window
v2.51b
  • fixed two bugs regarding actor visibility/availability
  • improved some of the code
v2.6
  • added new license
  • added usage and crediting instructions


Screenshots



Demo

Easy Party Switcher
If you can't start the demo, Search for the RMXP FAQ and see what to do.

Script

Just make a new script above main and paste this code into it.
Script Download

Instructions

Inside the script in the first comment.

Compatibility

98% compatible with SDK v1.x. 90% compatible with SDK 2.x. Can cause incompatibility issued with other Party Change Systems. WILL corrupt your old savegames.

Credits and Thanks

  • Boris "Blizzard" Mikić
  • Special Thanks to Zeriab for pointing out a few glitches and shortening the code in an earlier version =D

Author's Notes

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. Use "forced_position" together with "must_be_in_party" to avoid bugs. Be careful when using "forced_position" with "$game_party.forced_size". Add actors at the very end to be sure the player can't put others after them if the "forced_size" is smaller than the maximum party size.

Character faces go into the "Characters" folder and they have the same name as the character spritesets have with _face added.

If you find any bugs, please report them here:
http://forum.chaos-project.com

That's it! N-Joy! =D
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.

Musicmuse

Just a quick question...

Is there a way to incorporate a button in the main status menu that can call this script as well?  I'd like the player to be able to change the party whenever they'd like, given of course that the members are available.  I love the script, but this little tweak would really make it perfect for my situation :)

(I'd like a button like "Items", "Save", "Equip", but it would say "Party" or something  similar)

Nortos

January 10, 2008, 12:22:22 am #2 Last Edit: January 10, 2008, 01:12:47 am by Nortos
so what you want is just the default menu system but party added to it??? I can do it pretty quickly if that's what u want
EDIT: Here's a quick edit of the default menu, if you want/wanted an edit of someone elses menu just say
http://www.megaupload.com/?d=AUA41NYF

Musicmuse

January 10, 2008, 01:54:15 pm #3 Last Edit: January 10, 2008, 04:24:14 pm by Musicmuse
That's PERFECT!  Exactly what I'm looking for! ;D

I'm sure these things aren't particularly difficult, but without scripting knowledge all I can really do is read through directions to implement them myself, haha.

So is what I need in the script database for the demo?

EDIT:

It looks like it's in Scene_Menu and you added an option to call the party changer script when you select that option?  If so, I imagine I just have to copy and paste the Scene_Menu script into my own game and add (or rename) the scene_partyswitcher script so that when it calls the script there's actually somewhere to go... ?

EDIT 2:

I got it to work, and now I'm trying to figure out how to implement the same thing as a selectable option in the battle menu (in case a character is dead and needs to be replaced)

... it looks like I'll need to somehow edit the Scene_Battle scripts?

Nortos

January 10, 2008, 07:54:14 pm #4 Last Edit: January 10, 2008, 09:13:55 pm by Nortos
I don't think it's implemented in this script to change party members in battle I haven't used his easy party script much he'll be able to give better answer but I don't think you can swap in battle
EDIT: You'll also want to use the scene party switcher from my demo as I had to make an edit when press B or "Esc" it goes back to menu and not the map
2nd EDIT: Looking at it it would be hard to implement it into battle not calling it just exiting it, I can think of an easy way to change party members but once you go to screen than exit the battle would start again, you would have to edit this pretty heavily to put it into scene_battle to implement that I think...Blizz will know better though

Blizzard

I was going to release another version which allowed optional party change during battle. Many people seem to want that feature. I'll do it as soon as I have the time.
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.

Fantasist

Yeah! And it's not that difficult, is it?
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Musicmuse

Thanks for all of the help Nortos!

I'll be looking forward to the update, Blizz

You all are ridiculously nice here, haha.

Nortos

it's cool Musicmuse and I think it wouldn't be too hard especially for Blizz

Blizzard

Quote from: FTSYeah! And it's not that difficult, is it?

Scene-in-scene with stuff disposal to prevent too much lag. :3
It should be less than 50 lines of extra code.
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.

Vell

wow, that'll be pretty awesome. I thought it would be pretty much very very difficult...

however, it was done in GS2, so yeah, i knew it was possible.

Blizzard

January 26, 2008, 05:38:27 pm #11 Last Edit: January 29, 2008, 07:27:36 am by Blizzard
As I said, I only need to make an interruption in the battle scene. All the working code for the extra scene can be called there afterwards without problems.

I have to live up to the title you gave me. ^_^ *points to personal text*

EDIT:

*updates to v2.3b*

EDIT:

*updates to v2.32b*

EDIT:

*updates to v2.4b*
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.

Calintz

Psshh, didn;t want to give it away yet, but in my CMS, I used this feature from the main menu allowing the user to switch his party at any given time ;)

Megansunfire

Hey all.
I was planning on using this script, but did some testing and came up with an error.

It appears that the party switcher gives an error about experience for the reserve and the only way I seem to NOT get the error, is if I set the reserve to recieve 100% experience.

I've tried setting it to 0%, 50% (which I want to do) and it gives me an error that points to this line:

$game_actors.exp += @result_window.exp * EXP_RESERVE/100

I've tried changing that number too, but nothing. :(

Blizzard

You might be using an older version. In the current version (2.4b) the line says
$game_actors[i].exp += @result_window.exp * BlizzCFG::EXP_RESERVE/100


Try upgrading first.
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.

Megansunfire

Yeah. I upgraded it but I still get an error.
It says this:

' (*)Scene_PartySwitcher' ? 994  NoMethodError
undefined method 'exp' for nil:NilClass

And this is line 994:
$game_actors.exp += @result_window.exp * BlizzCFG::EXP_RESERVE/100

Any ideas?  ???

Quan

Man, I might just be a total idiot, but whenever I try to call the script to set characters as disabled_from_party I get a Syntax Error...

Blizzard

Keep in mind that you have to use

$game_party.actors[0].disabled_for_party =
true


or

$game_party.actors[0].
disabled_for_party = true


and not

$game_party.actors[0].disabled_for_party = true

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.

Quan

First of all, thanks for the fast response.  I'm really impressed with your scriptwork and it's awesome that you're so willing to help people get it working.

Now, just to clarify, should I be using the full ID # (001) or just the ultimate value (1)?

I was also gonna say, I don't know how difficult it would be, but it would be nasty if setting the FACESETS option to true replaced the sprites on the regular menu screen as well.  It'd just look so much better!

Blizzard

The ultimate value without the leading zeroes. My Tons of Add-ons has a faceset add-on that allows that. :)
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.