Friends, my question about the OneTimeMessage script is because of this error:
Pass 1: Parsing
Pass 2: Preprocessing
Pass 3: Building symbol tables
Pass 4: Type-checking/Completing function symbol tables/Constant folding
tangoBR/scripts.z, line 29: Error T21: Could not match type signature ShowMessage(float).
edit: I found the problem to the error above (a conflict with the NPC script that uses the "int ShowMessage()" from the tangodemo.qst) but now the OneTimeMessage script doesn't work with the ShowMessage(id) function.
Revert whatever changes you made to the Tango.zh demo scripts, if you removed another function, et. al., then do this:
bool stringnewloc[256];
ffc script OneTimeMessage_NewLocations
{
void run(int message, int boolean){
if(!stringnewloc[boolean]){
TangMessage(message);
stringnewloc[boolean] = true;
}
}
}
int TangMessage(int message)
{
int slot=Tango_GetFreeSlot(TANGO_SLOT_ANY);
if(slot==TANGO_INVALID)
return TANGO_INVALID;
Tango_ClearSlot(slot);
Tango_LoadMessage(slot, message);
Tango_SetSlotStyle(slot, STYLE_PLAIN);
Tango_SetSlotPosition(slot, 56, 32);
Tango_ActivateSlot(slot);
return slot;
}
All I did there, was rename the function, and make the function call match. That will prevent conflicts of that sort, although the base ShowMessage() accepts more args, and it should compile with both.I can't dissect anything that you don't post though. What exactly is the nature of the problem you are encountering?
Are you intending to use the Tango Demo NPC script?
More important: Exactly what Tango version are you using? The slot defs are different in some builds.
Perhaps, just use this, instead...
//Args
// D0: Message ID
// D1 ScreenD[reg] to use.
// D2 Value to set ScreenD[reg]. Must be at least 0.0001, and integer values will work too.
ffc script TangMessage{
void run (int message, int reg, float dat){
int thisScreen = Game->GetCurScreen();
curDat = GetScreenD(curScreen,reg);
int state = 1;
int newDat = curDat + dat;
if ( dat && curDat != dat ) {
while( state > 0 ){
int slot = Tango_GetFreeSlot(TANGO_SLOT_ANY);
if ( slot == TANGO_INVALID ) Waitframe();
SetScreenD(curScreen,reg,newDat);
Tango_ClearSlot(slot);
Tango_LoadMessage(slot, message);
Tango_SetSlotStyle(slot, STYLE_PLAIN);
Tango_SetSlotPosition(slot, 56, 32);
Tango_ActivateSlot(slot);
if ( Link->PressA || Link->PressB || Link->InputA || Link->InputB ) state = 0;
Waitframe();
}
}
this->X = -32768;
this->Y = -32768;
this->Data = 0;
return;
}
}
Edited by ZoriaRPG, 08 July 2015 - 08:21 AM.

