Ok, I altered some pit traps in the ToH because, as they are currently implemented, when a PC runs across the area, boom, dumps them in a put trap - perfect. If an NPC, while being controlled by a player runs across the area, boom, dumps them in a put trap. If an NPC, while NOT being controlled by a Player runs across the area... boom it dumps the PC in the pit trap... and stabs him with spikes and other assorted unpleasantness - while the NPC who triggered the trap stand above it and snickers at the fate of their leader.
Here is the original code:
void main()
{
object oPC = GetEnteringObject();
if (GetLocalInt(OBJECT_SELF, "done") == TRUE) return;
location lTarget = GetLocation(GetWaypointByTag("wp_fresco_two"));
object oTarget = GetFirstFactionMember(oPC, FALSE);
if(!ReflexSave(oPC, 55, SAVING_THROW_TYPE_TRAP))
{
while (GetIsObjectValid(oTarget) && GetDistanceBetween(GetObjectByTag("wp_climb_two") , oPC) <= 6.5f)
{
AssignCommand(oTarget, ClearAllActions());
AssignCommand(oTarget, ActionJumpToLocation(lTarget));
}
}
SetLocalInt(OBJECT_SELF, "done", TRUE);
}
Here is how I modified it:
void main()
{
object oPC = GetEnteringObject();
if (GetLocalInt(OBJECT_SELF, "done") == TRUE) return;
location lTarget = GetLocation(GetWaypointByTag("wp_fresco_two"));
object oTarget = GetEnteringObject();
if(!ReflexSave(oPC, 55, SAVING_THROW_TYPE_TRAP))
{
while (GetIsObjectValid(oTarget) && GetDistanceBetween(GetObjectByTag("wp_climb_two") , oPC) <= 6.5f)
{
AssignCommand(oTarget, ClearAllActions());
AssignCommand(oTarget, ActionJumpToLocation(lTarget));
}
}
SetLocalInt(OBJECT_SELF, "done", TRUE);
}
It works as I want it to, but when it initially jumps a character, there is a substantial amount of lag. When I stand on the other side of said trap, and tell the party to "follow me" and they ALL trigger the trap, my game freezes for maybe 30 seconds. It still dumps them all in the pit and stabs them with poisoned spikes mind you - while leaving my PC un bruised and up-perforated up top.
I am curious if it's just the nature of ActionJumpToLocation to lag and stutter the game some when running, or it it's something I have here that's unnecessary and wogging the client down.





Volver arriba







