あなたのゲームで複数のパーティーを作って管理しましょう – HIME_PartyManager.js

タイトル
- Create and manage multiples parties in your game.
作者名
ヘルプ
-------------------------------------------------------------------------------
== Description ==

In RPG Maker, you have a "party".

A party consists of a group of actors, an inventory of items, weapons, armors,
and gold, and potentially some other information related to this group.

By default, you only have one party, which is what the player will control
throughout the game.

This plugin provides functionality for working with additional parties.

1. You can create new parties. Separate parties can be used to represent
different characters in your game. Each character may have their own set
of followers and inventories as the story progresses.

2. You can switch between parties. If your story switches from one character to
another and you would like to keep their location, characters, inventories,
and other party-related information, you can simply switch to a new party
instead. You could even switch between parties in real-time on the same map
to build additional mechanics related to multiple party control.

3. You can merge parties. By merging parties, you can have different parties
come together as one large party. All of the members, inventories, and other
information will be merged together.

These are the three basic functions that you can use to design your game
using the Party Manager.

Additional functionally will be provided over-time as they are developed.

== Terms of Use ==

- Free for use in non-commercial projects with credits
- Free for use in commercial projects, but it would be nice to let me know
- Please provide credits to HimeWorks

== Change Log ==

1.12 - Aug 4, 2020
Load meta from event note into template event
1.11 - May 1, 2016
Implemented actor locking
1.10 - Apr 30, 2016
added support for checking if actor is in party
1.9 - Apr 2, 2016
added support for "max party members"
1.8 - Mar 28, 2016
fixed bug where merging to an idle party crashes
renamed "mergeInventory" to "mergePartyInventory"
1.7 - Mar 11, 2016
added support for getting idle party event on map by party ID
1.6 - Feb 25, 2016
Added `get` convenience method
1.5 - Feb 9, 2016
Fixed bug where $gameParty did not reference the active party on reload
Implemented party inventory trading methods
1.4 - Feb 5, 2016
fixed display bug where idle parties are drawn before map transfers
1.3 - Feb 4, 2016
fixed bug where extra sprite remains if you go to the menu and back to map
fixed bug where idle parties on other maps are drawn on current map
fixed bug where starting a map doesn't setup idle party events
added "anyAtRegion" and "anyAtPosition" script calls
1.2 - Feb 3, 2016
fixed bug where `setLocation` wasn't passing in the party ID
1.1 - Feb 2, 2016
added support for checking party position
added support for checking party region
fixed bug where party position not updated as player moves
1.0 - Feb 1, 2016
initial release

== Usage ==

--- Quick Summary ---

Managing multiple parties involves

1. Creating parties
2. Switching parties
3. Merging parties

To create party, you need to choose a party ID. The default party ID is 1,
which you can customize in the plugin parameters.

Then you create the party, add some actors, and choose a location if needed.
Let's say I wanted to create a party that I will refer to as 2,
with actors 3 and 4, at location (10, 12) of map 5. Here are the script calls:

Party.create(2)
Party.addActor(2, 3)
Party.addActor(2, 4)
Party.setLocation(2, 10, 12, 5)

Once I have a party set up, I can switch between them.

Party.switch(2)

And I can switch back

Party.switch(1)

Now, if I'm done with the second party and want to merge it into party 1:

Party.merge(2, 1)

This is all you need to manage multiple parties. Please read the rest of the
instructions for advanced usage beginning at "Idle Parties".

--- Party ID ---

The Party Manager uses the concept of a "party ID" to identify each and every
party in the game.

A party ID is basically a name that you give your parties.
It could be a number like 1, 2, 3, or it could be text like "sub", "main",
and so on.

Party ID's are meant to give you an easy way to manage parties throughout
your game since you will be using events to manage them.

--- Creating Parties ---

Your project begins with one party by default. You can customize the ID that
is assigned to it in the plugin parameters.

All additional parties will need to be created using events or plugins.
To create a party, use the script call

Party.create( PARTY_ID );

For example, you can create parties like this

Party.create(2);
Party.create("sub");

--- Changing Party Actors ---

When you create a new party, it will have no actors.
You can add or remove party actors using these script calls

Party.addActor( PARTY_ID, ACTOR_ID );
Party.removeActor( PARTY_ID, ACTOR_ID);

The ACTOR_ID is the ID of the actor in the database.
For example, to add actor 3 to party 2, you would write

Party.addActor(2, 3);

And to remove actor 3 from party "main", you would write

Party.removeActor("main", 3);

--- Switching Parties ---

Once you have created additional parties, you can switch between them.

To switch parties, use the script call

Party.switch( PARTY_ID );

So for example, if you want to switch to party 2, you would write

Party.switch(2);

When you switch parties, active control goes to the selected party, and the
other party will go "idle". You can see the other party on the map if both
parties are on the same map. For more information, refer to the section
on "Idle Parties" below.

--- Changing Party Locations ---

In this system, all parties have locations. When you switch parties, the game
will change to where the party is currently located.

By default, when you create a party, it will be located where the current
party is located.

You can change a party's location during the game using the following script
call:

Party.setLocation( PARTY_ID, X, Y );
Party.setLocation( PARTY_ID, X, Y, MAP_ID );

Where X and Y is the position on the map, and the MAP_ID is the ID of the
map that you would like to set the party's location.

If you omit the map ID, it is assumed to be the current map.

--- Merging Parties ---

When you want two parties to merge together, you can use the script call

Party.merge(PARTY_ID1, PARTY_ID2)

Which means "merge party ID1 into party ID2". If the first party is the
current party, then the game will automatically switch to the second party.

--- Party Trading ---

You can trade items and gold between parties.

To transfer items from one party to another, use the script call

Party.tradeItem( ID1, ID2, ITEM, COUNT )

Where ID1 is the ID of the party to take the item from, and ID2 is the
ID of the party to give the item to.

The ITEM is an item object. There are many different items in the game,
including items, weapons, and armors. By default, you would access them
like this:

$dataItems[2] - item 2
$dataWeapons[3] - weapon 3
$dataArmors[12] - armor 12

The COUNT is just the amount of the specified item you would like to trade.
If the first party does not have enough, it would simply trade as much as it
can, instead of failing.

You can also trade gold from one party to another. Use the script call

Party.tradeGold( ID1, ID2, amount )

Where you're trading the given amount of gold from party ID1 to party ID2.
If party 1 does not have enough gold, the game will transfer as much as it can

-- Idle Parties --

By default, if you have multiple parties, only one party can be "active" at
any time. The other parties are said to be "idle". The active party is the
party that you currently control.

When you switch parties, you are switching which party is the currently active
party.

Idle parties are drawn on the map as events if they are on the same map.
At this point, they are just visual indicators and do nothing. However, in the
future, you will be able to create your own events to determine how these
idle parties should behave when you interact with them.

--- Active Party Variable ---

In the plugin parameters, you can choose something called an
"active party variable", which is just a game variable that keeps track of
which party is currently active. This is mostly for convenience purposes in
your events.

RPG Maker assumes variables are numbers, but you can store text as well.
However, in your conditional branches, you will need to use script conditional
branches in order to check that.

--- Checking Party Locations ---

Idle parties are events on the map, but unlike map events, these events do not
have a fixed ID. Instead, you would check the party's position directly!

To check if a party is at a specific location, you can use the following
script calls

Party.atLocation( PARTY_ID, X, Y );
Party.atLocation( PARTY_ID, X, Y, MAP_ID);

If the MAP_ID is not provided, it is assumed to be the current map ID.
This means that you could check a party's position across different maps.

If you wanted to know if there wereanyparties at a location, you can
use this script call instead

Party.anyAtLocation( X, Y );
Party.anyAtLocation( X, Y, MAP_ID );

You can also check if a party is at a specific region

Party.atRegion( PARTY_ID, REGION_ID );

And similarly, to check if any party is at a specific region:

Party.anyAtRegion( REGION_ID );

Note that region ID checks can only be done for the current map.

--- Obtaining Idle Party Event Reference ---

If for some reason you want to have a reference to the event that represents
an idle party, you can use query the map:

$gameMap.idlePartyEvent(PARTY_ID)

Which will return a reference to a Game_PartyEvent object, which is basically
a Game_Event except with some special idle party logic.

--- Setting Max Number of Party Members ---

By default, there is no limit to how many members you can have in a party.
This is different from the number of "battle" party members, which determines
how many party members will actually participate in battle.

In the plugin parameters you can specify how many party members each party
can have.

To check if the current party, or a certain party is full, you can use
the script calls

$gameParty.isPartyFull()
Party.isPartyFull( PARTY_ID )

Which will return true or false depending on whether the party is full or not.

You can use the script call

Party.setMaxPartyMembers( PARTY_ID, NUMBER )

To change this limit at anytime.

--- Checking if an actor is in a party ---

To check whether an actor is in a certain party, you can use the script call

Party.hasActor( PARTY_ID, ACTOR_ID )

Which will return true if the specified actor is in that party.

--- Locking Actors to Party ---

To lock an actor to a party, use the script call

$gameActors.actor( ACTOR_ID ).lockToParty(true)

To remove the lock, use

$gameActors.actor( ACTOR_ID ).lockToParty(false)

Where the ACTOR_ID is the ID of the actor you wish to operate on.

-------------------------------------------------------------------------------
パラメータ
title Party Manager
version 1.12
date Aug 4, 2020
filename HIME_PartyManager.js
url http://himeworks.com/2016/02/party-manager-mv/

If you enjoy my work, consider supporting me on Patreon!

https://www.patreon.com/himeworks

If you have any questions or concerns, you can contact me at any of
the following sites:

Main Website: http://himeworks.com
Facebook: https://www.facebook.com/himeworkscom/
Twitter: https://twitter.com/HimeWorks
Youtube: https://www.youtube.com/c/HimeWorks
Tumblr: http://himeworks.tumblr.com/

-------------------------------------------------------------------------------
param Default Party ID
desc The ID that will be used for the "default party", which is
the first party when you start the game.
default 1

param Active Party Variable
desc The variable to use to store the current active party.
Convenient for conditional branches or other plugins.
default 999

param Max Party Members
desc Default number of party members you can have in a party.
Includes members that won't be in battle.
default -1
-------------------------------------------------------------------------------
ライセンス表記
- Free for use in non-commercial projects with credits
- Free for use in commercial projects, but it would be nice to let me know
If you omit the map ID, it is assumed to be the current map.
By default, there is no limit to how many members you can have in a party.
To change this limit at anytime.

紹介ページ http://himeworks.com/2016/02/party-manager-mv/