I prefer answering with
if (Link->X == 85)
{
Game->DCounter[CR_LIFE] -= 1;
}
for example please, thank you.
#1: in ffc script Christopher
how does I check if ffc Christopher is at x 16 position?
if (this->X == 16)
#2: ^ the same as up above but replace x eith y
if (this->X == 16)
Use any ffc variable in conjunction with the this pointer, to affect the ffc that is running the script.
#3: How do I create a black rectangular box that is at x50 y50 height98 width98
Screen->Rectangle(int layer, int x, int y, int x2, int y2,
int color, float scale,
int rx, int ry, int rangle,
bool fill, int opacity ) ;
// See: 'Screen Drawing' in zscript text for full details.
You'd specify the corner x, y; then the size of the length, and height; then...
...Specify the colour from your palette; 0x0F is blak in the Classic palette. 0x00 is NOT black, but TRANSPARWENT; then...
......Set scale to -1, rc, ry, and rangle each to 0; then...
.........Set bool fill to true, and opacity to OP_OPAQUE.
Example:
Screen->Rectangle(6, 50, 50, 98, 98, 0x0F, -1,. 0, 0, 0, true, OP_OPAQUE);
#4: ^ How do I code to where if EX2 button is pressed #3:'s rectangular box disappears?
This depends on what you are doing to draw it. You can write it as a function that exits on Link->PressEx2, or put a break condition in a loop; e.g.
while(!Link->PressEx2)
{
Screen->Rectangle(6, 50, 50, 98, 98, 0x0F, -1,. 0, 0, 0, true, OP_OPAQUE);
Waitframe();
}
#5: How do I code if I press W button something happens?
I think
if (Link->PressW)
{
Game->Counter[CR_RUPEES] += 17;
}
will bring an error even if I replace PressW with InputW
Access to reading any keyboard key is only in ZC version 2.54 (Alpha) and newer.
In 2.54+, it's:
if ( Input->Key[KEY_W] )