Shield Storage

[Open Assets] Shield Storage 2.1

I made sure my file(s) follow the Submissions Guidelines
  1. Yes
DISCLAIMER

• This is a port/recreation of my old script from SRB2 v2.1;
• This should work in online play, unfortunately I don't have the people to test it, so I give no guarantees;
• THIS ADDON USES l_ButtonState.lua BY fickleheart (
GitHub), IT IS NOT MINE. The main repository implies that the resources in there are free to use. If needed/asked, I'll remove it from this addon.
• You may reuse this as long as l_ButtonState.lua is kept unchanged or otherwise removed for your own button press validaton, seeing it as it's not mine; and you give me credit for whatever content of mine you'll be using.



SUMMARY

Ever came across a situation where you wish you had kept a particular shield instead?
Or maybe you accidentally rolled over a shield monitor and now your old shield is gone?
Or maybe you want to rock around 6 Amy's Shields around for some ungodly reason?

Well, now you can!


HOW IT WORKS?

Store up to 5 shields by pressing CUSTOM 1, and when you need them back, at a cost of 5 rings, you can press CUSTOM 2 to get them back to protect yourself or for any reason you might need them.
Select which shield you want store with Weapon Next / Weapon Prev buttons.

Breaking a shield monitor while having a shield will also store your current shield so you don't just lose them!
Careful though! If you have already 5 shields stored, it'll replace the one in the last slot.


IMAGES

srb20001.gif
srb20002.gif



CROSS-ADDON COMPATIBILITY

By default this addon only supports vanilla shields but it is theoretically simple by adding a configuration file in your luafiles/client/Shield Storage/ folder (Yes, you'll have to create the dedicated Shield Storage folder yourself).

The way you should lay out the information in your file should be as such:

luafiles/client/Shield Storage/generic_config_file.cfg:
Amargeddon Shield,SH_ARMAGEDDON,No description,TVARICON,sfx_armasg
Attraction Shield,SH_ATTRACT,No description,TVATICON,sfx_attrsg

For the sake of simplicity, in this example let's pretend Armageddon Shield and Attraction Shield aren't supported by default.
In your config file you'll simply inform, in this exact order:
  1. The name of the shield;
  2. Its constant;
  3. A description;
  4. Its respective graphic;
  5. And its sound constant for the orb.
No quotes, separated by commas, no spaces after the comma, exactly as the example shows. Each line having the information for each shield respectively. After that you'll hop into the game and run a couple commands (namely SS_SetCustomList and SS_ReloadShieldList, see the commands section).

Obviously for other addons you'll have to dig for the constant, graphic image, and sound constant (if any).

As of the time of this post, the name of the shield and description are unused so you may just put anything in there as long as there's something there.


CONSOLE COMMANDS
All commands needs admin privileges to use if you're in a netgame.

COMMAND
PARAMETER / ARGUMENT
ARGUMENT TYPE
DESCRIPTION​
SS_SetCustomList​
filename
string​
Sets up which config file will be loaded with SS_ReloadShieldList
SS_ReloadShieldList
N/A​
N/A​
Reloads the shield list which dictates which shields the addon will work with.
SS_ResetOnLevelEnd
OnOff
string​
Turns on and off, depending on the argument passed, the ability to carry over shields between acts and zones.
SS_SetRingCost
ringAmount
integer/number​
Changes how many rings (minimum 0) the player will spent when exchanging shields or summoning shields from the storage.

CHANGELOG

Changelog.txt:
 ┌┴───────┴┐
┌┤Changelog│
│└─────────┘
│┌━───━┐
├┤ 2.0 │
│└━─┬─━┘
│   └— Initial release.
│
│┌━───━┐
└┤ 2.1 │
 └━─┬─━┘
    ├— Added SS_SetRingCost command to alter the ring cost (value: 0 — whatever the integer limit is);
    ├— Added SS_ResetOnLevelEnd command to allow you to carry shields between zones (value: On | Off);
    ├— Added SS_SetCustomList command to allow you to set a custom shield list for compatibility (value: name of the file);
    ├— Added SS_ReloadShieldList command to allow you to reload the shield list at any time in game. Needs to be used after SS_SetCustomShieldList to have the alterations to take effect;
    │
    ├— Changed how compatibility works as stated above;
    │
    ├— Added "Changelog.txt" (this file you're reading);
    ├— Added "Known issues.txt";
    ├— Added "COMPATIBILITY 101.txt";
    │
    ├— Separated the main script into multiple lua files for the purposes of reducing eyebleed;
    ├— Revamped the way the package was structured entirely actually;
    │
    └— Lost a bit of my sanity.


ISSUES / BUGS

Known issues.txt:
• Stackable shields powerups (i.e Fire Flower) are not supported;
• Depending on the dimensions, certain TVBOXES icons from other addons that include shields might not display correctly, there's nothing I can do about it as far as I'm aware;
• Shield monitors from addons that implement their own logic (don't call A_GiveShield when broken) won't store your current shield, there's nothing I can do about it as far as I'm aware;
• For some reason, sometimes when you store your shield incredibly quickly after you get it, the icon won't be displayed properly;


For further inquiry feel free to contact me.
Author
⛧Labyrinthia⛧
Downloads
2,004
Views
4,911
Extension type
pk3
File size
9.9 KB
MD5 Hash
7499c5569832055f78cb5cfe8329c680
First release
Last update

Share this resource

Latest updates

  1. 2.1 Update! Compatibility changes and console commands.

    Relatively sooner than what I expected but here we are! Let's get going. :blink: CROSS-ADDON...

Latest reviews

I love the idea of storing the shield like powerups in mario game bur for sonic it is Greate
Upvote 0
Back
Top