AgedAlchemist wrote...
Wouldn't it be a bit more straightforward to set the target Tag as a string on the Portal?
// Portal OnUsed script ...
void main()
{
object oPC = GetLastUsedBy();
string sPortal = GetLocalString(OBJECT_SELF, "ao_portal");
// Check for empty sPortal string ...
if (sPortal == "")
{
sPortal = "ao_wp_portal00" + IntToString(Random(3)+1);
SetLocalString(OBJECT_SELF, "ao_portal", sPortal);
}
location lPortal = GetLocation(GetObjectByTag(sPortal));
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, JumpToLocation(lPortal));
}
A bit off topic, But a good point. Along that line of thought, How about just setting the local as the object to jump to.
// Portal OnUsed script ...
void main()
{
object oPC = GetLastUsedBy();
object oWayPoint = GetLocalObject(OBJECT_SELF, "ao_portal");
// Check for Valid WayPoint ...
if (!GetIsObjectValid(oWayPoint))
{
oWayPoint = GetObjectByTag("ao_wp_portal00" + IntToString(Random(3)+1));
SetLocalObject(OBJECT_SELF, "ao_portal", oWayPoint);
}
AssignCommand(oPC, JumpToObject(oWayPoint));
}
Modifié par Lightfoot8, 13 octobre 2012 - 01:04 .