Jump to content

Photo

FFC x and y help and also black rectangle help please


  • Please log in to reply
5 replies to this topic

#1 LikeLike888

LikeLike888

    Spicy food lover!!

  • Members
  • Real Name:Jason
  • Location:North America

Posted 28 June 2018 - 12:54 PM

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?


#2: ^ the same as up above but replace x eith y


#3: How do I create a black rectangular box that is at x50 y50 height98 width98



#4: ^ How do I code to where if EX2 button is pressed #3:'s rectangular box disappears?



#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

#2 Binx

Binx

    Formerly Lineas

  • Members
  • Real Name:Brian
  • Location:Lancaster, CA

Posted 28 June 2018 - 05:09 PM

For #5, it doesn't work because ZScript doesn't recognize keyboard inputs, it recognized "button presses" that are mapped to the keyboard through the controls setting in Zelda Classic. Your options for button presses that don't already do something are Ex1, Ex2, Ex3, and Ex4.

#3 LikeLike888

LikeLike888

    Spicy food lover!!

  • Members
  • Real Name:Jason
  • Location:North America

Posted 29 June 2018 - 08:01 AM

Thank ya
  • ShadowTiger likes this

#4 LikeLike888

LikeLike888

    Spicy food lover!!

  • Members
  • Real Name:Jason
  • Location:North America

Posted 01 July 2018 - 10:05 AM

#1: in ffc script Christopher
how does I check if ffc Christopher is at x 16 position?


#2: ^ the same as up above but replace x with y


#3: How do I create a black rectangular box that is at x50 y50 height98 width98

#5 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 01 July 2018 - 07:55 PM

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] )


#6 LikeLike888

LikeLike888

    Spicy food lover!!

  • Members
  • Real Name:Jason
  • Location:North America

Posted 02 July 2018 - 12:19 PM

Thank you so super much ZoriaRPG best post on PureZC Forums ever.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users