Ok, I just tried the @Tarot_Redhand method but strangely it didn’t work.
I’ll try with the other solutions you guys provided.
Edit: @kevL_s : Your script worked a bit. I managed to see that indeed the string that is put there if you write nothing is something of a blank space. However when I tried it in my script I didn’t quite work, but I may do stuff the wrong way here (here’s the two scripts used for this):
//displaybox_show. I got this script from 4760.
void main()
{
object oPC = GetPCSpeaker();
int nMessageStrRef = -1;
string sMessage = ("Your answer is:");
string sOkCB = "gui_checkanswer";
string sCancelCB = "gui_noanswer";
int bShowCancel = TRUE;
string sScreenName = "";
int nOkStrRef = 181744;
string sOkString = "";
int nCancelStrRef = 181745;
string sCancelString = "";
string sDefaultString = ""; //default text in the message box…
DisplayInputBox(oPC, nMessageStrRef, sMessage, sOkCB, sCancelCB, bShowCancel, sScreenName, nOkStrRef, sOkString, nCancelStrRef, sCancelString, sDefaultString);
}
//gui_checkanswer
#include "ginc_ipspeaker"
// Trims spaces off left and right of sString.
string TrimString(string sString)
{
while (sString != "" && GetStringLeft(sString, 1) == " ")
sString = GetStringRight(sString, GetStringLength(sString) - 1);
while (sString != "" && GetStringRight(sString, 1) == " ")
sString = GetStringLeft(sString, GetStringLength(sString) - 1);
return sString;
}
void main(string sPlayerAnswer)
{
sPlayerAnswer = TrimString(sPlayerAnswer);
if (sPlayerAnswer == "")
{
SetCustomToken(1001, "Mike");
//SetLocalString(GetModule(), "CUSTOM24", sPlayerAnswer); //To be able to call this inside a script and just not just in a conversation by <CUSTOM1001>.
//According to 4760 (Thierry) one should use numbers above 1000 to be safe that it's not already used by the engine, but I read in NWNlexicon that number 24 wasn't used.
object oPC = GetPCSpeaker();
SetGlobalInt("playernamed",1);
AssignCommand(oPC, ClearAllActions());
CreateIPSpeaker("thenue", "c_a_intro2", GetLocation(GetFirstPC()), 0.5f);
}
else
{
SetCustomToken(1001, sPlayerAnswer);
//SetLocalString(GetModule(), "CUSTOM24", sPlayerAnswer); //To be able to call this inside a script and just not just in a conversation by <CUSTOM1001>.
//According to 4760 (Thierry) one should use numbers above 1000 to be safe that it's not already used by the engine, but I read in NWNlexicon that number 24 wasn't used.
object oPC = GetPCSpeaker();
SetGlobalInt("playernamed",1);
AssignCommand(oPC, ClearAllActions());
SetCutsceneMode(oPC);
CreateIPSpeaker("thenueh", "c_a_intro2", GetLocation(GetFirstPC()), 0.5f);
}
}