Jump to content

Photo

Boss Introduction Message Using Tango (need help)


  • Please log in to reply
9 replies to this topic

#1 xenomicx

xenomicx

    Zelda Arcade

  • Members
  • Location:Chi-town

Posted 18 July 2022 - 01:08 PM

So I want this FFC Script to run when I enter the Boss Room. I'll will be an introduction to the boss using a custom framing and font I made in a Tango Style.

I can't get the message to display. It should display only if the are enemies (the boss) in the room.

ffc script Boss_Intro_Message
{    
     void run(int message, int perm)
     {        
          while(true)
          {
              if(Screen->D[perm]!=0)            
              Quit();

              if(StartTalking(this))
              {
                   SetCurrentFFC(this);
                   int slot=ShowMessage(message, TANGO_SLOT_NORMAL, STYLE_ITEMS, 48, 8);
                   if(slot!=TANGO_INVALID)
                   {
                        while(Tango_SlotIsActive(slot))
                        Waitframe();
                   }
                   StopTalking();
              }
              Waitframe();
          }
          Screen->D[perm]= 1;    
     }
}

Edited by xenomicx, 18 July 2022 - 01:10 PM.


#2 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 18 July 2022 - 03:26 PM

What does the StartTalking function look like? Do you have tango functions working elsewhere in your quest?



#3 xenomicx

xenomicx

    Zelda Arcade

  • Members
  • Location:Chi-town

Posted 18 July 2022 - 06:20 PM

What does the StartTalking function look like? Do you have tango functions working elsewhere in your quest?

bool linkAlreadyTalking;

// Returns true if Link is trying to talk to this NPC.
bool StartTalking(ffc this)
{
    if(!Link->PressA || linkAlreadyTalking)
        return false;
    
    bool talk=false;
    
    if(Link->Dir==DIR_UP)
    {
        if(Abs(Link->X-this->X)<8 && Abs(Link->Y-8-this->Y)<8)
            talk=true;
    }
    else if(Link->Dir==DIR_DOWN)
    {
        if(Abs(Link->X-this->X)<8 && Abs(Link->Y+16-this->Y)<8)
            talk=true;
    }
    else if(Link->Dir==DIR_LEFT)
    {
        if(Abs(Link->X-16-this->X)<8 && Abs(Link->Y-this->Y)<8)
            talk=true;
    }
    else
    {
        if(Abs(Link->X+16-this->X)<8 && Abs(Link->Y-this->Y)<8)
            talk=true;
    }
    
    if(talk)
    {
        linkAlreadyTalking=true;
        return true;
    }
    else
        return false;
}

// Free up Link to talk to other NPCs.
void StopTalking()
{
    linkAlreadyTalking=false;
}

I guess I see the problem. I'm copying another function I'm using for NPC's which require Link to go up to them and push A to talk. This can't work I suppose with a Boss, because Link can't really go up to the Boss and push A to talk without getting hit. So How can I shorten this to just have it use the tango message I have set up, upon entry? Every little change I've made and tested has failed and I'm stumped.



#4 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 18 July 2022 - 07:24 PM

You can basically just remove the function entirely and instead set linkAlreadyTalking to true. The entire rest of the function is just checking that Link is properly lined up and pressing A, and therefore isn't needed. Honestly, the linkAlreadyTalking part, and the corresponding StopTalking function, probably also isn't needed here, as I'm guessing it exists only to keep you from talking to two NPCs at once, which shouldn't be a concern here.



#5 xenomicx

xenomicx

    Zelda Arcade

  • Members
  • Location:Chi-town

Posted 18 July 2022 - 10:37 PM

You can basically just remove the function entirely and instead set linkAlreadyTalking to true. The entire rest of the function is just checking that Link is properly lined up and pressing A, and therefore isn't needed. Honestly, the linkAlreadyTalking part, and the corresponding StopTalking function, probably also isn't needed here, as I'm guessing it exists only to keep you from talking to two NPCs at once, which shouldn't be a concern here.

Took it out and still can't get it to work.



#6 xenomicx

xenomicx

    Zelda Arcade

  • Members
  • Location:Chi-town

Posted 21 July 2022 - 10:18 PM

//////////////////////////////////////////////////////////////////////////////////////////////
//                  		         BOSS INTRO                                             //
//                  (Plays a String when you first encounter a Boss)                        //
//////////////////////////////////////////////////////////////////////////////////////////////

//Setup
//D0 = Number of Beginning MIDI to be played when there are NPCs in the room.
//D1 = Number of Ending MIDI to be played when there are no NPCs in the room.

ffc script Metal_Gear_Boss_Intro
{    
	void run(int message, int perm)
	{   
		Waitframes(5);
		if (Screen->NumNPCs() == 0)
			Quit();
		else
		{
			SetCurrentFFC(this);
			int slot=ShowMessage(message, TANGO_SLOT_NORMAL, STYLE_ITEMS, 48, 8);
			Screen->Message(slot);
			if(slot!=TANGO_INVALID)
			{
			while(Tango_SlotIsActive(slot))
			Waitframe();
			}
		}				
	}
}

So this is what I came up with if anyone is interested. I made my own custom style called "STYLE_ITEMS" which I use with a custom font. The only thing this script doesn't do is stop the Enemy from attacking. Not a big deal, but if someone wanted to throw up a line to make Enemy 0 halt until the message is finished that'd be cool.



#7 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 22 July 2022 - 01:04 AM

So this is what I came up with if anyone is interested. I made my own custom style called "STYLE_ITEMS" which I use with a custom font. The only thing this script doesn't do is stop the Enemy from attacking. Not a big deal, but if someone wanted to throw up a line to make Enemy 0 halt until the message is finished that'd be cool.

2.53 or 2.55? 2.55 is easy, 2.53 is hard



#8 xenomicx

xenomicx

    Zelda Arcade

  • Members
  • Location:Chi-town

Posted 23 July 2022 - 08:19 AM

2.53 or 2.55? 2.55 is easy, 2.53 is hard

2.53



#9 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 23 July 2022 - 02:44 PM

Good luck with that then!

 

There are uh, "Freeze Screen" combo types? you generally want a script to place one of those on screen as an FFC for the duration of the textbox.



#10 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 23 July 2022 - 08:06 PM

Alternatively, if your boss is ghosted, you could just put a section at the start, or in its waitframe, to wait while tango strings are active.


  • xenomicx likes this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users