Party Member Costs

partyMemberCosts1

This script introduces the concept of “Member Cost”, which is the cost to have a member in your unit. The cost to have actors in the party is referred to as “Party Cost”.

A party has a “Max Party Cost” property that is used to determine whether you can afford to have an actor in the party or not.

The “Total Party Cost” is the sum of all costs for each actor. If the total party cost exceeds the max party cost, then actors cannot be added to the party.

For example, if the total party cost is 10, the max party cost is 15, and you try to add an actor with a cost of 6 to the party, the actor will not be allowed to join the party because the total cost would then become 16.

Download

ScriptDemo

Installation

In the script editor, place this script below Materials and above Main

Usage

Setting up party costs

To set the base cost for an actor, note-tag the actor with

<party cost: FORMULA>

Where the formula is any valid formula that evaluates to a number.
The following formula variables are available

a - current actor
s - game switches
v - game variables

Changing an actor’s party cost

To change an actor’s cost manually, the following script calls are provided:

change_party_cost(id, amount)

Where id is the ID of the actor you want to change. A negative ID will use
the party position. So for example, -1 is the leader, -2 is the second member,
and so on.

The amount is how much the cost should change by. This can be a positive or
a negative number.

Setting up max party cost

You can set a default max value to initialize the party with, and then change
it during the game through events.

Changing max party cost

To change the max party cost during the game, you can use script calls.

change_max_party_cost(amount)

This adds the specified amount. To reduce max party cost, you can specify
a negative number.

set_max_party_cost(amount)

This sets the max party cost to the specified amount.

Party Cost Mode

There are two ways to calculate total party costs. One is to count only the battle members, the other is to count everyone in the party, regardless whether they can participate in battle or not.

In the configuration there is an option to choose this.

Notes

This script does not provide menu mods. It is up to you to add them to your own game. The demo comes with samples that you can use if you’re using the default menu.

You may also like...

3 Responses

  1. Vic White says:

    Could be a way that this money is substracted periodically to you money amount, and if you don’t have the money, they leave? (mercenary)

    Thanks in advance

    • Hime says:

      This was designed specifically for the situation where you have a fixed pool of resources, and each party member costs a certain amount of resources to have in the party.

      A mercenary plugin could be developed using this as a reference of course.

  2. Awesome! It works perfectly. Thank you so much for doing this, (and so quickly!) You rock! 😀

Leave a Reply

Your email address will not be published. Required fields are marked *