2025-04-03 13:38:45 -04:00
|
|
|
void main()
|
2025-09-04 22:40:44 -04:00
|
|
|
{
|
2025-09-05 21:48:32 -04:00
|
|
|
object oPC;
|
|
|
|
object oSpawnPoint;
|
|
|
|
string sDestTag;
|
2025-09-04 22:40:44 -04:00
|
|
|
|
2025-09-05 21:48:32 -04:00
|
|
|
oPC = GetEnteringObject();
|
|
|
|
|
|
|
|
//SendMessageToPC(oPC,"en3_respawn2 >> entering.");
|
2025-09-04 22:40:44 -04:00
|
|
|
|
2025-09-05 21:48:32 -04:00
|
|
|
if (GetIsPC(oPC))
|
|
|
|
{
|
|
|
|
//SendMessageToPC(oPC,"en3_respawn2 >> PC found.");
|
|
|
|
|
|
|
|
sDestTag = GetLocalString(oPC,"Respawn");
|
|
|
|
|
|
|
|
if (sDestTag == "")
|
|
|
|
{
|
|
|
|
//SendMessageToPC(oPC,"en3_respawn2 >> Destination variable was unset, setting.");
|
|
|
|
SetLocalString(oPC, "Respawn", "EN4_Respawn");
|
|
|
|
}
|
|
|
|
|
|
|
|
//SendMessageToPC(oPC,"en3_respawn2 >> Destination tag is: "+sDestTag+".");
|
|
|
|
|
|
|
|
oSpawnPoint = GetWaypointByTag(sDestTag);
|
|
|
|
|
2025-09-04 22:40:44 -04:00
|
|
|
if (GetIsObjectValid(oSpawnPoint))
|
|
|
|
{
|
2025-09-05 21:48:32 -04:00
|
|
|
//SendMessageToPC(oPC,"en3_respawn2 >> Destination is valid, jumping.");
|
|
|
|
// Teleport the PC.
|
|
|
|
AssignCommand(oPC, ClearAllActions());
|
|
|
|
DelayCommand(0.3f,AssignCommand(oPC,JumpToObject(oSpawnPoint)));
|
2025-09-04 22:40:44 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// optional debug
|
|
|
|
FloatingTextStringOnCreature("Invalid spawn point: " + sDestTag, oPC);
|
2025-09-05 21:48:32 -04:00
|
|
|
}
|
|
|
|
}
|
2025-09-04 22:40:44 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2025-09-05 21:48:32 -04:00
|
|
|
|
2025-09-04 22:40:44 -04:00
|
|
|
/* void main()
|
2025-04-03 13:38:45 -04:00
|
|
|
{
|
|
|
|
object oPC;
|
|
|
|
object oSpawnPoint;
|
|
|
|
string sDestTag = "en3_respawning";
|
|
|
|
|
|
|
|
oPC = GetEnteringObject();
|
|
|
|
|
|
|
|
if (GetIsPC(oPC))
|
|
|
|
{
|
|
|
|
sDestTag = GetLocalString(oPC,"Respawn");
|
|
|
|
oSpawnPoint = GetObjectByTag(sDestTag);
|
|
|
|
AssignCommand(oPC,JumpToLocation(GetLocation(oSpawnPoint)));
|
|
|
|
}
|
|
|
|
}
|
2025-09-04 22:40:44 -04:00
|
|
|
*/
|