Ok, we’re entering spoiler territory now for those who might want to play this module when it is finally released in a year or so, but I have to explain very thoroughly what’s going on here, and this only concerns a skippable sidequest so…
Further testing revealed other strange things happening further on, which made me rethink the whole thing, and I did it in another way. This seemed to work flawlessly when testing a couple of times, but just before going to bed last night, when testing one last time, a game breaking bug appeared which got me a bit depressed to be honest.
So, here’s how I’ve done it now. When the party exits a tavern I run a script that first makes a copy of Loreen, then teleports normal Loreen to another area, and placing the copy outside the tavern. When exiting the tavern a dialogue is run which then leads to a confrontation with EvilLoreen. When her damage is below 15 a new conversation is run through CreateIPSpeaker. At the end of that conversation EvilLoreen runs off (and is destroyed). The party is then to search for her. Last night when testing, and I did run the module from the toolset by the way, when getting to the area where I teleported normal Loreen, she all of a sudden wasn’t there. So, for some reason the teleporting must have gotten screwed up or something. Here is the script placed at OnClick of the door when exiting the tavern. Maybe I’ve done something there that could cause this error (that only appeared this one time, but still…)
const string sDEST_TELEPORTER = "loreenevwp"; // waypoint tag of the teleporter's destination
const string sDEST_PARTY = "outsbbt"; // waypoint tag of the party's destination
const string sROSTER_LOREEN = "loreen";
void TeleportAll()
{
object oEvilLoreen = GetObjectByTag("loreenevil");
object oLoreen = GetObjectByTag("loreen");
int nXP = GetXP(oEvilLoreen) + 40000;
object oPC = GetFirstPC();
ResetCreatureLevelForXP(oEvilLoreen, nXP, TRUE);
SetImmortal(oEvilLoreen,TRUE);
ChangeToStandardFaction(oEvilLoreen, STANDARD_FACTION_COMMONER);
SetGlobalInt("evilfromt",1);
effect eDamage = EffectDamage(40, DAMAGE_TYPE_SLASHING);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oLoreen);
object oLoreen2 = GetObjectFromRosterName(sROSTER_LOREEN);
RemoveRosterMemberFromParty(sROSTER_LOREEN, oPC, FALSE);
// second jump the companion to his/her destination waypoint
object oDestTeleporter = GetWaypointByTag(sDEST_TELEPORTER);
AssignCommand(oLoreen2, JumpToObject(oDestTeleporter));
// third jump the remaining party to their destination waypoint
object oDestParty = GetWaypointByTag(sDEST_PARTY);
object oFaction = GetFirstFactionMember(oPC, FALSE);
while (GetIsObjectValid(oFaction))
{
AssignCommand(oFaction, ClearAllActions());
AssignCommand(oFaction, JumpToObject(oDestParty));
oFaction = GetNextFactionMember(oPC, FALSE);
}
}
void main()
{
object oPC = GetClickingObject();
if(!GetIsPC(oPC)) return;
oPC = SetOwnersControlledCompanion(oPC);
// first remove the companion (conversation owner) who's doing the teleport
// from the party
//ClearAllActions();
if(GetGlobalInt("mirroraq") && !GetLocalInt(OBJECT_SELF,"Done"))
{
object oWP = GetObjectByTag("evillwp");
object oLoreen = GetObjectByTag("loreen");
SetLocalInt(OBJECT_SELF,"Done",1);
location lLoreen = GetLocation(oWP);
CopyObject(oLoreen,lLoreen,OBJECT_INVALID,"loreenevil");
DelayCommand(1.0,TeleportAll());
}
else
{
JumpPartyToArea(oPC, GetWaypointByTag("outsbbt"));
}
}
One thing that has been on my mind about this is that maybe the waypoint tag is a tad bit too long. I think I’ve encountered such issues before. What do you script wizards think? My thought is to maybe place a script in the area where normal Loreen is supposed to be teleported to, and if she’s not there, just report through SendMessagetoPC that a serious error has occured. I don’t know. Here’s the script I’ve put on OnClientEnter of the area where normal Loreen is teleported (she is always part of the party except for this time in the module):
#include "ginc_object"
void main()
{
object oMapPin = GetObjectByTag("toha_mn");
object oPC = GetFirstPC();
int nInt = GetLocalInt(oPC,"NW_JOURNAL_ENTRYq_summon");
if (nInt == 61 && !GetLocalInt(OBJECT_SELF,"MapPin"))
{
SetMapPinEnabled(oMapPin,1);
SetLocalInt(OBJECT_SELF,"MapPin",1);
}
if(GetGlobalInt("gallonspawned")) return;
SetGlobalInt("gallonspawned",1);
object oGallon = SpawnCreatureAtWP("gallon", "gallonwp");
object oLoreen = GetObjectByTag("loreen");
object oArea = GetObjectByTag("rolfamaro_region");
int nInt2 = GetLocalInt(oPC,"NW_JOURNAL_ENTRYq_mirror");
if(GetArea(oLoreen) == oArea)
{
return;
}
else if (!GetFactionEqual(oPC,oLoreen) && nInt2 == 21)
{
SendMessageToPC(oPC,"A serious bug/error has occured. Please reload from before you exit the tavern in Bakestone Bay.");
}
}