THE FUTURE'S LOOKING BRIGHT FOR THAT ITEM
I have just completed what I believe is the greatest script I have evermade. It's also the ONLY script I've ever made. Take a look at my Cane of Somaria! (No joke- I really made it.)
// current screen "Player" is on. It modifies the combo used,
// combo type, flags, etc. In the end, it looks like a block.
// This item will also change the location of the FFC so it
// always "spawns" 2 tiles away from Link in the direction he
// is currently facing. Becuase of limited knowledge, this
// script currently does not prevent you from walking onto the
// block. Any mention of "SomariaBlock" in the script refers to
// Freeform Combo 32. Have fun.
import "std.zh"
item script CaneSomaria
{
void run()
{
int sound=30;
ffc SomariaBlock= Screen->LoadFFC(32);
if(Link->Dir == 0)
{
SomariaBlock->X = Link->X;
SomariaBlock->Y = Link->Y - 32;
}
else if(Link->Dir == 1)
{
SomariaBlock->X = Link->X;
SomariaBlock->Y = Link->Y + 32;
}
else if(Link->Dir == 2)
{
SomariaBlock->X = Link->X - 32;
SomariaBlock->Y = Link->Y;
}
else if(Link->Dir == 3)
{
SomariaBlock->X = Link->X + 32;
SomariaBlock->Y = Link->Y;
}
float remainder = SomariaBlock->X % 16;
if ( remainder <= 8 )
{
SomariaBlock->X = SomariaBlock->X - remainder;
}
else
{
SomariaBlock->X = SomariaBlock->X + 16 - remainder;
}
SomariaBlock->Data = A;
SomariaBlock->CSet = B;
}
}
Replace A with the combo number for the Block (FFC 32 will use that combo the moment you use the Cane), and B with the CSet it uses. This script SHOULD create the block 2 tiles away from Link. If it doesn't, just change everything that says 32 to 16. That'll make it appear directly in front of him. The only drawback to this is that the block isn't solid yet. Oh yeah, did I mention that the only way to push the block is to give the combo you use an inherent Push flag? And that works now? It's true! Thanks to C-Dawg for helping me learn ZScript and for helping me get this code together. Thanks to Fire Wizzrobe for telling me how to define "remainder" as a variable.
Enjoy, and if you can make the block solid, give me the modified script IMMIDEATELY so I may use it. That's the plan, you know. Oh yeah, the block appears the instant you use the Cane instead of after its animation, so.... beware.