Hi again … Well I already had the following script due to the importance of the PC name in the workings of my campaign anyway, so I “simply” swapped the two offending functions for mine (now have LB in front):
(I am now making my way through the code looking for further instances that rely on longer variable names based on either the PC name or the player name.)
I am just going to check the LOCAL var limit now as well … This could be a nightmare!
EDIT: I just tested LOCAL var name lengths with 40 characters and they appear to work, so that’s a relief, as that is plenty! Just the GLOBAL ones to sort now.
///////////////////////////////////////////////////////////////////////////////
// REMOVE ANY ILLEGAL PLAYERS BROUGHT INTO WORLD //////////////////////////////
///////////////////////////////////////////////////////////////////////////////
int DismissIllegalCheck(object oCreature);
int DismissIllegalCheck(object oCreature)
{
// MYBOSS VARIABLE HAS NOT BEEN SET YET
object oMainPC = GetControlledCharacter(oCreature);
int Remove = 0; string sIllegal;
int iCheck = 0; string sName = LBGetName(oCreature);
string sNameChk = "PCNCHK_" + sName;
// IS THE PLAYER TRYING TO LOAD A PC OTHER THAN THEIR SAVED GAME VERSION
string sPLAYERNAME = LBGetPCPlayerName(oCreature);
string sExistName = GetGlobalString(sPLAYERNAME);
// COMPANIONS MADE BY CAMPAIGN ARE OK (ONLY CHECK PLAYER CREATED ONES)
if(GetLevelByClass(CLASS_TYPE_ARCANE_SCHOLAR, oCreature) > 0){Remove = 1; sIllegal = "ARCANE SCHOLAR";}
else if(GetLevelByClass(CLASS_TYPE_DOOMGUIDE, oCreature) > 0){Remove = 1; sIllegal = "DOOMGUIDE";}
else if(GetLevelByClass(CLASS_TYPE_HARPER, oCreature) > 0){Remove = 1; sIllegal = "HARPER";}
else if(GetLevelByClass(CLASS_TYPE_DRAGONDISCIPLE, oCreature) > 0){Remove = 1; sIllegal = "RED DRAGON DISCIPLE";}
else if(GetLevelByClass(CLASS_TYPE_RED_WIZARD, oCreature) > 0){Remove = 1; sIllegal = "RED WIZARD";}
else if(GetLevelByClass(CLASS_TYPE_SHADOWTHIEFOFAMN, oCreature) > 0){Remove = 1; sIllegal = "SHADOW THIEF";}
else if(GetLevelByClass(47, oCreature) > 0){Remove = 1; sIllegal = "NEVERWINTER NINE";}
// CANNOT HAVE AN APOSTROPHE IN THE NAME (ROSTER RECOGNITION PROBLEMS)
if(Remove == 0)
{
int iNameLength = GetStringLength(sName);
// SendMessageToAllPCs("NAME IS >>> " + sName); // DEBUG
while(iCheck < iNameLength)
{
string Letter = GetSubString(sName, iCheck, 1);
Letter = GetStringUpperCase(Letter);
if(Letter != "A" && Letter != "B" && Letter != "C" && Letter != "D" && Letter != "E"
&& Letter != "F" && Letter != "G" && Letter != "H" && Letter != "I" && Letter != "J"
&& Letter != "K" && Letter != "L" && Letter != "M" && Letter != "N" && Letter != "O"
&& Letter != "P" && Letter != "Q" && Letter != "R" && Letter != "S" && Letter != "T"
&& Letter != "U" && Letter != "V" && Letter != "W" && Letter != "X" && Letter != "Y"
&& Letter != "Z" && Letter != " "){Remove = 1; iCheck = 100; break;}
iCheck = iCheck + 1;
}
}
// CANNOT HAVE A PALADIN (GOOD) JOIN A PARTY OF HARVESTERS (LATE ENTRANT CHECK)
if(Remove == 0 && GetGlobalInt("LERoleset") == 1)
{
object oLEADER = GetMainPC(GetFactionLeader(oCreature));
if(GetLevelByClass(CLASS_TYPE_PALADIN, oCreature) > 0 &&
GetAlignmentGoodEvil(oCreature) == ALIGNMENT_GOOD && GetAlignmentGoodEvil(oLEADER) == ALIGNMENT_EVIL)
{Remove = 1; sIllegal = "PALADIN (AS A HARVESTER)";}
}
// CHECK IF PC WITH SAME NAME IS ALREADY IN THE WORLD (BEST CHECK FOR DUPLICATION)
// ONCE DISMISSED OR ABANDONED, THIS PC CANNOT BE IMPORTED INTO THE GAME AGAIN - A NEW VERSION MUST BE CREATED
// UPDATED TO ALLOW DISMISSED CREATED PCS TO COME BACK IN AFTER USING THE "LEAVE" OPTION
if(Remove == 0)
{
if(sExistName != "" && sExistName != sName){Remove = 1; iCheck = 300;}
else if(GetGlobalInt(sNameChk) == 1 && GetLocalInt(oCreature, sNameChk) == 0){Remove = 1; iCheck = 200;}
else
{
SetGlobalInt(sNameChk, 1);
SetLocalInt(oCreature, sNameChk, 1);
// STORE PLAYER/PC RELATIONSHIP (TO PREVENT WRONG PC ENTRY DUE TO PLAYER MISTAKE)
SetGlobalString(sPLAYERNAME, sName);
}
}
if(Remove == 1)
{
effect FREEZE = EffectCutsceneImmobilize();
SetLocalInt(oCreature, "ILLEGAL", 1);
StripPC(oCreature, 0,0, FALSE); // STILL REMOVE ALL EQUIP TO PREVENT ILLEGAL ENTRY OF ITEMS
ApplyEffectToObject(DURATION_TYPE_PERMANENT, FREEZE, oCreature);
// PROVIDE OTHER PLAYERS AS TO WHY A PLAYER MAY NOT HAVE ENTERED (ORIGINAL PLAYER MAINPC WILL GET GUI)
string sResult = "<<< ILLEGAL CLASS: " + sIllegal + " ATTEMPTED TO ENTER THE GAME >>>";
if(iCheck == 100){sResult = "<<< ILLEGAL CHARACTER NAME: " + sName + " CONTAINS ILLEGAL CHARACTERS >>>";}
else if(iCheck == 200){sResult = "<<< DUPLICATE PC NAME: " + sName + " EXISTED AT SOME TIME ALREADY >>>";}
else if(iCheck == 300){sResult = "<<< PC NAME MISMATCH (USE CORRECT PC) >>>\n\n" + sName + " v " + sExistName;}
object oHost = GetTheGameHost(oCreature);
SetNoticeText(oHost, CRED + sResult);
// THE ILLEGAL PC IS THE PLAYER'S MAIN PC (PRESENT A GUI)
if(oMainPC == oCreature)
{
FadeToBlack(oCreature, 0.5, 0.0);
// OTHERWISE DISPLAY INFORMATION INSIDE A GUI
string sTitleText = "ILLEGAL PC ENTRY";
// Expanded Text For Placeables
string sInfo = "<color=Orange>" + sResult + "</color>\n\nThe PC you are trying to enter the module with is not allowed for the above reason." +
"\n\nClasses not allowed in The Scroll include: Arcane Scholar, Doomguide, Harper, Dragon Disciple, Red Wizard or Shadow Thief. Furthermore, a Paladin cannot join a " +
"game that has already started, which is running an evil party. This module requires a PC's name to be made from standard letters ONLY and cannot use a name that has " +
"been used previously in the module. Furthermore, a player must always use the SAME PC when returning to a saved game. \n\nWhen you click on the button below, you will be taken back to the Main Menu where you can select a legal character." +
"\n\n<color=Orange>Sorry for any inconvenience.</color>";
// DISPLAY THE TEXT IN A GUI
DisplayGuiScreen(oCreature, "IllegalPCWarn", TRUE, "IllegalPCWarn.xml");
SetGUIObjectText(oCreature, "IllegalPCWarn", "TITLETXT", -1, sTitleText);
SetGUIObjectText(oCreature, "IllegalPCWarn", "BoxText", -1, sInfo);
}
// THE PC IS A CREATED PC (JUST INFORM ITS MAIN PC)
else
{
// DELAY REQUIRED FOR COMPANION TO FINISH ATTACHING (TO BE THEN UNATTACHED)
DelayCommand(0.5, RemovePCFromWorld(oCreature));
}
}
return Remove;
}