Jump to content

Photo

Message Script


  • Please log in to reply
8 replies to this topic

#1 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 09 April 2018 - 01:32 AM

Would like a FFC script that plays a message string when Link steps in the designated area, but only once. Link will have to leave the screen and come back to hear the message again.

 

I would like the width and height of the area to be arguments.



#2 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 14 April 2018 - 03:23 AM

Last thing needed for my demo



#3 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 14 April 2018 - 03:52 AM

Sigh...

 

ffc script MessageSpot
{
     void run(int m_s, int distx, int disty)
     {
          while(1)
          {
               if ( Abs((Link->X+8)-CenterX(this) ) <= distx )
               {
                    if ( Abs( (Link->Y+8)-CenterY(this) ) <= disty )
                    {
                         break;
                    }
               }
               Waitframe();
          }
          Screen->Message(m_s);
     }
}

ffc script MessageSpot
{
     void run(int s_m)
     {
          while(1)
          {
               if ( LinkCollision(this) )
               {
                    break;
               }
               Waitframe();
          }
          Screen->Message(s_m);
     }
}

The first one takes distance in pixels on the x and y axis. The second uses collision based on the ffc X, Y, EffectWidth, and EffectHeight, compared against Link's coordinates, and hitbox dimensions..


Choose whichever method you prefer.


  • Cukeman likes this

#4 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 14 April 2018 - 06:16 PM

I am trying the first one out, and I am REALLY confused by the Y values as they seem somewhat independent of the FFC location.?

 

I placed the FFC onscreen, tested it, then moved the FFC up a few pixels, but the message area didn't move up a few pixels.

 

EDIT: As for the second one, what is EffectWidth and EffectHeight? Is that Combo W and Combo H? Tile W and Tile H?

 

EDIT 2: It seems like maybe the Y is always around 8 pixels larger than I expect? I really don't follow what's going on here

 

EDIT 3: I don't think we're on the same page on this request at all  :confused:


Edited by Cukeman, 14 April 2018 - 07:50 PM.


#5 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 14 April 2018 - 08:09 PM

EDIT 4: Okay. I *think* I got the effect I want by changing Y+8 to Y+12 in the first script.

 

EDIT 5: Wait a minute... the location of the area seems to be an offset from the FFC location? Now I'm even more confused

 

EDIT 6: I assumed the step area was at the FFC location, but that you could shrink/extend the width and heigth of that area with the arguments

 

EDIT 7: The step area is appearing somewhere not even close to the FFC coordinates, I don't understand


Edited by Cukeman, 14 April 2018 - 08:47 PM.


#6 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 15 April 2018 - 03:13 AM

EDIT 4: Okay. I *think* I got the effect I want by changing Y+8 to Y+12 in the first script.

 

EDIT 5: Wait a minute... the location of the area seems to be an offset from the FFC location? Now I'm even more confused

 

EDIT 6: I assumed the step area was at the FFC location, but that you could shrink/extend the width and heigth of that area with the arguments

 

EDIT 7: The step area is appearing somewhere not even close to the FFC coordinates, I don't understand

 

There was an error in the script. I fixed it above. Look carefully to see what i changed.



#7 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 15 April 2018 - 03:18 AM

Ah, both were Center X, with no CenterY


Edited by Cukeman, 15 April 2018 - 03:49 AM.


#8 Timelord

Timelord

    The Timelord

  • Banned
  • Location:Prydon Academy

Posted 15 April 2018 - 04:19 AM

Ah, both were Center X, with no CenterY

Precisely.

It should work for you now.

EffectWidth and EffectHeight are Combo W. and Combo H., respectively.
  • Cukeman likes this

#9 Cukeman

Cukeman

    "Tra la la, look for Sahasrahla. ... ... ..."

  • Banned
  • Location:Hyrule/USA

Posted 15 April 2018 - 06:01 AM

Precisely.

It should work for you now.

EffectWidth and EffectHeight are Combo W. and Combo H., respectively.

 

Ah, yes! It is working now, thank you very much! Sorry if I put you out.

 

I finally realized why Link seemed to be further away on the south side than the north side, it's because his head overlaps things, so Link was visually 8 pixels away on the north and 16 on the south, meanwhile he was the same distance on each side if you measure center to center.

 

Changing Y to +12 means that Link is visually the same distance away, and that's what I was after




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users