Jump to content

Another GB Shield Script

Overview
Creator: Demonlink Added: 13 Jul 2021 Tags: 2.55, Global, Item Downloads: 17
Rating[?]: No rating
View Script Download Package
(2.01 MB)
Information

Description Setup Reviews Comments

First of all, you need to have knowledge about how Link Tile Modifiers work, as this script uses them. A quick example goes as the following: you have your Link sprites setup under Quest->Graphics->Sprites->Link, and by giving him an item with Link Tile Modification, those sprites will change according to the value assigned under the given item's data -> GFX tab; a positive value will increase the sprite's value and a negative one will decrease it.

The script works with two items, a "fake" shield, which is used to draw Link's sprites that are carrying the shield, and the "real" shield, that is used to actually defend yourself and that Link holds in front of him. In the demo, for the first shield item you obtain (which is the dummy shield), its LTM value is 260. This means that Link's original sprites will be increased by 260 tiles, thus drawing his sprite that is carrying the shield. However, once you press the button, the script gives you the "real" shield item, which has another LTM value of 780. So, now the sprites are increased by another 780 tiles, which are drawn to show Link holding the shield in front of him and actually defending himself. You can see the demo to understand further my explanation.

As for the actual setup, like I mentioned, you're going to need a "dummy" shield for each one that you have because of what I explained in the past paragraph. Create the dummy shield items, and assign them to a custom itemclass, (make sure they all belong to the same class), and assign their levels according to your needs: the small shield would be Level 1, the magic shield would be Level 2, and the mirror shield would be Level 3. Next, assign the item ids of your shields to the following script constants:
//"Real" shields:
const int GBS_SMALL=93;
const int GBS_MAGIC=8;
const int GBS_MIRROR=37;

//"Fake" shields:
const int GBS_FAKESMALL=123; 
const int GBS_FAKEMAGIC=124;
const int GBS_FAKEMIRROR=125;

//A sound that plays when you press the button:
const int SFX_GBSHIELD=65;
Compile the global and item scripts, and assign the included Item script to only the fake shields in the Action slot under the Scripts tab in their item data. Setup the LTM values as well. Now, to make it work, you're only to give the fake shield item to Link, the script handles the rest of the behavior.

Note: If you already have an existing global script, only add the line GBShield(); before Waitdraw(); and then GBShieldDraw(); after it.

And that's it, it sounds a bit confusing, but it's really not a big deal. I recommend that you see the demo to fully understand everything. For any questions, leave me a comment.

For those who are still using 2.53 and below, you can use the 2.50 version of the script that's included, but the demo was made in 2.55.