Jump to content

Photo

No message shows up whatsoever even Link is at x80 y80 if treated as L


  • Please log in to reply
2 replies to this topic

#1 LikeLike888

LikeLike888

    Spicy food lover!!

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

Posted 03 July 2018 - 12:47 PM

My coding

 
import "std.zh"
int FirstMessage = 12;
int LastMessage = 12;
int MessageBeingShown = 0;
bool MessageOrMessagesInSession = false;
bool w = true;
bool ww = true;
int x = 80;
int y = 80;
 
global script AllINeed
{
  void run()
  {
    while(w == true)
    {
      if (MessageOrMessagesInSession == false)
      {
        if (Link->X == 80 && Link->Y == 80)
        {
          if (Link->PressA)
          {
            FirstMessage = 1;
            LastMessage = 1;
            MessageBeingShown = FirstMessage;
            Screen->Message(MessageBeingShown);
            MessageOrMessagesInSession = true;
          }
        }
      }
      else if (MessageOrMessagesInSession == true)
      {
        if (MessageBeingShown == LastMessage)
        {
          if (!Link->PressA)
          {
            Screen->Message(MessageBeingShown);
          }
          else if (Link->PressA)
          {
            Screen->Message(0);
            MessageOrMessagesInSession = false;
          }
        }
        else if (MessageBeingShown != LastMessage)
        {
          Screen->Message(MessageBeingShown);
          if (Link->PressA)
          {
            MessageBeingShown += 1;
          }
        }
      }
    Waitframe();
    }
  }
}
 
ffc script TreeLilly
{
  void run()
  {
    while (ww == true)
    {
      this->X = x;
      this->Y = y;
      if (Link->PressL)
      {
        Link->X = x;
        Link->Y = y;
      }
      Waitframe();
    }
  }
}

is ^ and even when Link is at x position 80 and y position 80 and treated as A Item button is pressed no message ever comes at all.



#2 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 03 July 2018 - 09:41 PM

You're doing a lot of constant comparisons which are generally bad since gameplay and object interactions are generally dynamic.

I suspect you're not actually at 80,80. Put this in your global loop:
  Screen->DrawInteger(6, 0, 0, 1, 1, 0, 0, 0, Link-X, 0, OP_OPAQUE);
  Screen->DrawInteger(6, 0, 24, 1, 1, 0, 0, 0, Link-Y, 0, OP_OPAQUE);


#3 LikeLike888

LikeLike888

    Spicy food lover!!

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

Posted 04 July 2018 - 04:32 PM

Thanks


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users