Here's a small ffc script that will show a message only one time for any given screen.
We do this by setting bits in Screen->D[]
The D1 variale is the index of D[] to use, so, if D1 == 5, you will be using Screen->D[5].
The D2 variable is the
bit that you are using for the flag, so, if D2 == 9, yoou are using xxxxxxxBxxxxxxxxx (the 10th bit, as the count starts at 0).
To have another string appear after the player pushes A/B to advance from the string on the screen, go to the ZQuest string editor. In the string settings, there is a field for 'Next'. Set that to the string that you wish to display after the current string, when the player presses the button.
Thus, for this script, you could have:
D0: 2
D1: 1
D2: 1
In the String Editor, the 'Next' field for string 2, would be '3', to show string 3 after 2.
As a bonus, I included some debugging functions, and sanity checks in the script, so that you can see how to make that sort of thing.
// D0: ID of ZQ Message String to Display
// D1: Screen register to use. Valid values are 0->7.
// D2: Bit of the register to use for storing a flag.
// ---> Valid range of values is 0->16.
// !! Be sure that you select values that are not otherwise being
// !! used on the same screen by another script!
ffc script OneTimeMessage
{
void run(int msg, int reg, int bit)
{
//Sanity Bounds
if ( reg < 0 || reg > 7 )
{
__errorReg(reg); Quit();
}
if ( bit < 0 || bit > 16 )
{
__errorBit(bit); Quit();
}
if ( !GetScreenDBit(reg, bit) )
{
SetScreenDBit(reg, bit, true);
Screen->Message(msg);
}
this->Data = 0; Quit();
}
void __errorReg(int r)
{
int s1[256]="Attempted to use an invalid screen register from script 'OneTimeMessage' on DMap: ";
int s2[]=", Screen: ";
int s3[]=", Register: ";
int s_scr[8]; int s_dm[8]; int s_reg[2];e
itoa(s_scr, Game->GetCurScreen());
itoa(s_dm, Game->GetCurDMap());
itoa(s_reg, r);
strcat(s1,s_dm); strcat(s1,s2);
strcat(s1,s_scr); strcat(s1,s3);
strcat(s1, s_reg); TraceNL(); TraceS(s1); TraceNL();
}
void __errorBit(int r)
{
int s1[256]="Attempted to use an invalid screen register bit from script 'OneTimeMessage' on DMap: ";
int s2[]=", Screen: ";
int s3[]=", Bit: ";
int s_scr[8]; int s_dm[8]; int s_reg[2];e
itoa(s_scr, Game->GetCurScreen());
itoa(s_dm, Game->GetCurDMap());
itoa(s_reg, r);
strcat(s1,s_dm); strcat(s1,s2);
strcat(s1,s_scr); strcat(s1,s3);
strcat(s1, s_reg); TraceNL(); TraceS(s1); TraceNL();
}
}