Jump to content

Photo

disabling the map button during tango dialogue


  • Please log in to reply
14 replies to this topic

#1 Taco Chopper

Taco Chopper

    protector of the darn forum

  • Administrators
  • Pronouns:He / Him
  • Location:South Australia

Posted 24 April 2022 - 01:21 AM

recently i noticed that both the custom map scripts i'm using by moosh and floundermaj can be opened while a tango textbox is active:

lR1XGA5.gif

 

my two questions are:

  1. is there an easy way to prevent this from happening? i was thinking "NoPress" would have something to do with it, but i'm not sure how to set this up properly inside my tango scripts, and;
  2. will i have to set this up in each case that needs it in my tango dialogue boxes?

  • Professor Bedwetter likes this

#2 Professor Bedwetter

Professor Bedwetter

    Strangers when we meet

  • Members
  • Real Name:Zack Zack Zack Zack Zack Zack Zack Zack Zack Zack

Posted 24 April 2022 - 01:56 AM

hold on TOACO chooper im gonna open up porc



#3 Professor Bedwetter

Professor Bedwetter

    Strangers when we meet

  • Members
  • Real Name:Zack Zack Zack Zack Zack Zack Zack Zack Zack Zack

Posted 24 April 2022 - 02:13 AM

Doesn't seem like it does it for me, maybe ask mitch



#4 Taco Chopper

Taco Chopper

    protector of the darn forum

  • Administrators
  • Pronouns:He / Him
  • Location:South Australia

Posted 24 April 2022 - 03:03 AM

if there’s something in there I’ll have a look, LITHIUM gave me the script folder a little while back so I could add stuff to three crests

#5 Aslion

Aslion

    End Fascism

  • Members
  • Real Name:Ryan
  • Location:Plug One's spectacles

Posted 24 April 2022 - 01:34 PM

Did you put

NoAction();	

before the tango string? that's all I can think of



#6 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 24 April 2022 - 02:54 PM

Is tango running after my map script in your global script by chance? Tango has a way to kill inputs but if a part of the global is able to read those inputs first it'll have no effect. So you probably want tango to take priority in the run order. My next guess after that would be maybe you need TANGO_FLAG_BLOCK_INPUT. It's mostly a given that everybody's using that flag, but there's also TANGO_FLAG_FREEZE_SCREEN which has the side effect of blocking most input but once again wouldn't stop the global script from reading it.



#7 Taco Chopper

Taco Chopper

    protector of the darn forum

  • Administrators
  • Pronouns:He / Him
  • Location:South Australia

Posted 24 April 2022 - 10:20 PM

Did you put

NoAction();	
before the tango string? that's all I can think of

 

 
just tried this, but it didn't work. 
 

Is tango running after my map script in your global script by chance? Tango has a way to kill inputs but if a part of the global is able to read those inputs first it'll have no effect. So you probably want tango to take priority in the run order.

 
my global script is an absolute mess, i've just been using your organiser instead of manually editing everything in. from the looks of it though both map scripts are running before the tango init. i was gonna put in this post but it makes the post too long, so here's a link to the abomination. i assume it's just a case of putting tango's init stuff above the map scripts then?

 

My next guess after that would be maybe you need TANGO_FLAG_BLOCK_INPUT. It's mostly a given that everybody's using that flag, but there's also TANGO_FLAG_FREEZE_SCREEN which has the side effect of blocking most input but once again wouldn't stop the global script from reading it.

is this just something i put into the cases or is this a global only thing?



#8 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 25 April 2022 - 12:55 AM

my global script is an absolute mess, i've just been using your organiser instead of manually editing everything in. from the looks of it though both map scripts are running before the tango init. i was gonna put in this post but it makes the post too long, so here's a link to the abomination. i assume it's just a case of putting tango's init stuff above the map scripts then?

Yup. That seems to be exactly it. I took a look and it seems like some of the organizer formatting also broke (or rather my organizer itself is broken and was unable to parse it)

 

Here's a pastebin where I tried to fix it, I just moved the declarations to the top so it'd recognize them. But do a double check to make sure it didn't eat anything. I don't trust myself further than I can throw me.

https://pastebin.com/dHija6u0



#9 Taco Chopper

Taco Chopper

    protector of the darn forum

  • Administrators
  • Pronouns:He / Him
  • Location:South Australia

Posted 25 April 2022 - 03:40 AM

yeah, the organiser asks for an existing global script each time but it comes up with an error message and says to start fresh instead, so that's what i've been doing - copying and pasting the old global script assuming it'd work every time.

 

the global script's imported fine with no errors but the issue's still occurring. same as it was before in the dungeons, although this happens in the overworld now:

 

GetDcIh.gif

 



#10 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 25 April 2022 - 05:02 AM

Okaaay...That's super weird. Could try checking if TANGO_FLAG_BLOCK_INPUT is set. That'll be in the function that sets up all your tango slot data.
 

Tango_SetStyleAttribute(STYLE_NPC, TANGO_STYLE_FLAGS, TANGO_FLAG_ENABLE_SPEEDUP|TANGO_FLAG_BLOCK_INPUT);

So you should have a line that looks something like this.



#11 Taco Chopper

Taco Chopper

    protector of the darn forum

  • Administrators
  • Pronouns:He / Him
  • Location:South Australia

Posted 25 April 2022 - 06:49 AM

I couldn't figure out how to implement that properly, but it made me realise it could be something in my TangoHandler.zh file.

And I've made it work. By looking at the ZC control scheme I realised that if InputA and InputB can be disabled, then surely InputMap is a thing, right? Then I realised that if handleMessageSlot was what disables the start button during a tango message, then

Link->InputMap = false;
Link->PressMap= false; 

should surely go in there - and it worked!

 

 I've included the code for reference if anyone else ever needs it:

void handleMessageSlot(int slot, bool menu4way, int name)//start handleMessageSlot
{
int delay = 0;
int lastid = -1;

int nameWidth;
int nameSegs;
if (name != 0) {
  nameWidth = Text->StringWidth(name,NAMEFONT);
  nameSegs = calcNameSegs(nameWidth);
}

while(Tango_SlotIsActive(slot))
{
  __Tango_SetCurrentSlot(slot);
  bool waitingForA = (__Tango_GetCurrSlotData(__TSDIDX_STATE) == __TANGO_STATE_PRESS_A);
  bool menuActive = Tango_MenuIsActive();
  int maxScroll = Tango_GetSlotMaxScrollPos(slot);
  int scroll = Tango_GetSlotScrollPos(slot);
  if(Tango_SlotIsFinished(slot)||menuActive||waitingForA)
  {
   //Scrolling
   float scrollSpeed = 1.5;
   if(Link->InputA)scrollSpeed*=2;
   if(Link->InputUp)
    Tango_ScrollSlot(slot, -scrollSpeed);
   else if(Link->InputDown)
    Tango_ScrollSlot(slot, scrollSpeed);
   //Scroll arrows
   if(scroll<maxScroll)
   {
    Screen->FastCombo(7,DN_COMBO_X,DN_COMBO_Y,COMBO_DOWNARROW,0,OP_OPAQUE);
    delay = __TANGO_AUTO_ADVANCE_TIME;
    if(Link->PressB)
    {
     Link->PressB=false;
     Link->InputB=false;
     Tango_ScrollSlot(slot,maxScroll);
    }
    Link->InputA = false;
    Link->PressA = false;
   }
   if(!menuActive&&(scroll==maxScroll))
   {
    Screen->FastCombo(7,A_COMBO_X,A_COMBO_Y,COMBO_PRESSA,0,OP_OPAQUE);//Press A indicatior
   }
   if(scroll>0)
   {
    Screen->FastCombo(7,UP_COMBO_X,UP_COMBO_Y,COMBO_UPARROW,0,OP_OPAQUE);
   }
   //Fix menu cursor when scrolling
   if(menuActive&&scroll!=maxScroll)
   {
    Tango_SetMenuCursor(0,0);
    NoDirs();
   }
   else if(menuActive)
   {
    Tango_SetMenuCursor(COMBO_MENUCURSOR,0);
    if(menuActive&&!menu4way)
    {
     if(Link->PressRight)
     {
      ChoiceShift(1);
     }
     else if(Link->PressLeft)
     {
      ChoiceShift(-1);
     }
     NoDirs();
    }
   }
   if(scroll!=maxScroll&&!waitingForA)NoAction();
   if(delay>0)
   {
    --delay;
    Link->InputA=Link->PressA;
    Link->InputB=Link->PressB;
   }
  }
  else Tango_ScrollSlot(slot,maxScroll);
  Link->InputStart=false;
  Link->PressStart=false;
  Link->InputMap = false;
  Link->PressMap = false;
 
  //Handle character name display
  if (name != 0) {
   drawNameBorder(nameSegs);
   Screen->DrawString(7,NAMEX+8,NAMEY+4,NAMEFONT,NAMECOLOR,-1,TF_NORMAL,name,OP_OPAQUE);
  }
  Waitframe();
}
}//end handleMessageSlot

Edited by Taco Chopper, 25 April 2022 - 06:52 AM.


#12 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 25 April 2022 - 06:21 PM

 

I couldn't figure out how to implement that properly, but it made me realise it could be something in my TangoHandler.zh file.

And I've made it work. By looking at the ZC control scheme I realised that if InputA and InputB can be disabled, then surely InputMap is a thing, right? Then I realised that if handleMessageSlot was what disables the start button during a tango message, then

Link->InputMap = false;
Link->PressMap= false; 

should surely go in there - and it worked!

That is certainly one way to handle it. Also, that's some very familiar code...



#13 Taco Chopper

Taco Chopper

    protector of the darn forum

  • Administrators
  • Pronouns:He / Him
  • Location:South Australia

Posted 25 April 2022 - 08:38 PM

That is certainly one way to handle it. Also, that's some very familiar code...


I know it’s your code though? By “mine” I meant the quest’s version - I was never intending to claim your work as my own.

Edited by Taco Chopper, 25 April 2022 - 08:39 PM.


#14 Emily

Emily

    Scripter / Dev

  • ZC Developers

Posted 26 April 2022 - 01:24 AM

I know it’s your code though? By “mine” I meant the quest’s version - I was never intending to claim your work as my own.

Oh, no, not at all meaning to imply that, just noting that someone is actually using my tangohandler shit lol



#15 Taco Chopper

Taco Chopper

    protector of the darn forum

  • Administrators
  • Pronouns:He / Him
  • Location:South Australia

Posted 26 April 2022 - 01:42 AM

Oh, no, not at all meaning to imply that, just noting that someone is actually using my tangohandler shit lol

 

oh thank god i was trying to defuse possible internet BEEF i was panicking for a minute there

 

the important thing is that it works :)


  • Emily likes this


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users