FP Equip Slots

This script is outdated.

Use Core Equip Slots and relevant add-ons for your equip-related needs.

Spoiler
FP: Equip SlotsAuthor: Tsukihime

Type: Features add-on

Overview

Who says you can't wear 5 hats or 3 coats?

This script provides basic functionality to expand the number of equip slots for every equip type.

Features

  • Change the number of equip slots you can have
  • Create custom equip types
  • Specify custom sort order for equip types (order which they appear)
  • Allow equips to add more equip slots
  • Allow classes to add more equip slots
UsageIn the configuration, just specify how many equip slots you want for each type of slot.

You can add additional equip types by adding more entries in the "extended equip types" section.

To specify that an equip is of that type, use the following notetag

<fp:es etype n>Where n corresponds to the equip type defined in the table above.If you would like a custom sort order (eg: gloves appear above weapon), you can modify Equip_Order to something you like. Note that there is no way to interweave equip types (eg: weapon, shield, weapon, bodygear, weapon).

In order to add slots to your actors, you must use "features". This is not available

in the default editor, so you will need to use notetags.

In actors, classes, weapons, armors, and states, you can type

<+eslot: slot_type amount><+eslot: 0 2><+eslot: 1 1>The first example says to add two slot 0's. Slot 0 by default is the weapon slot, so your actor will have two weapon slots.Because these are features, the slots change depending on what you equip, what your class is, and who the actor is. It is also possible to change slots in game using script calls.

You can add more slots to your actor directly through script calls.

add_slot(actor_id, slot_type, amount)This will add the given amount of slots based on the specified slot type to that actor.Screenshots

Lots of slots

hhPkM.jpg


Equipping a round shield gave me more slots

Wu0al.jpg


Downloads

Script: http://db.tt/NnnLMyGb

Kread-Ex's Actor inventory

Notes: the feature code for Equip Slots is 103 in this script.
For awhile now there was an issue where the list of equips was unsorted.

This was because it became very messy if I wanted to re-sort the equips.

The main issue was the fact that the DISPLAY is the same as how the data is STORED, which is bad design (your view should be separate from the data because there's no guarantee where the data is coming from)

So I implemented a 1-to-1 mapping where a look-up table properly maps the indices in the window to the indices used in the actor's own slot list.

So for example if your actor's slot list was (remember that each slot holds a number representing which etype it supports)

[0, 1, 2, 3, 0]You can see that it is out of order.So I create a look-up array as such

[0, 4, 1, 2, 3]Which is used by the window's own index to determine which slot I am actually working with.So if I am changing index 1, then I will go to the lookup table and see that it corresponds to slot 4, which in the actor's slot array is that second weapon slot.

The latest script now does not have any unordered issues when you add/remove slots.

Though I implemented using bubble sort lol

Now this script is really complete.
This is cool. Thanks! I've been looking for an easy way to give a character an extra weapon!

I'm fairly novice at the whole scripting thing, so I hate messing around with it and filling my game with bugs, but I have one question...

I want to make it so that if I have 2 weapons, I cannot hold a shield. Is it easy to set this? Also, is there a way to distinguish between 1 and 2 handed weapons, or is that an entirely different scripting issue?

I realize that's technically 2 questions, but there we go! Any help would be appreciated, especially for the 2 weapons+shield question.

Original thread: https://forums.rpgmakerweb.com/threads/fp-equip-slots.2975/