I am trying to implement some of the C.R.A.P. scripts into my new pw project but I am having an issue with this vector script. I changed the item that triggers this from spell cast to item activate. I am nto sure if that could be the source of the problem . But it is saying I dont have line of sight when there is nothing in between the pc and the item targeted. Let me know if anyone sees anything I do not. I am not to used to this function "if(!LineOfSightVector(vPC, vTarget))".
void awa_UsePlayerWidget(object oPC, object oPlayerWidget){location lPawLoc = GetItemActivatedTargetLocation();object oTarget = GetItemActivatedTarget();object oPit = GetNearestObjectToLocation(OBJECT_TYPE_PLACEABLE, GetItemActivatedTargetLocation());int nType = GetObjectType(oTarget);int nJump = (nType == 0 && GetIsJumpProbable());
int nSpikes = GetIsObjectValid(GetItemPossessedBy(oPC, "crpi_ironspikes"));int nRope = GetIsObjectValid(GetItemPossessedBy(oPC, "crpi_rope"));int nGrapRope = GetIsObjectValid(GetItemPossessedBy(oPC, "crpi_graprope"));int nMallet = GetIsObjectValid(GetItemPossessedBy(oPC, "crpi_spk_mallet"));
int nOpen = ((nType == OBJECT_TYPE_DOOR || OBJECT_TYPE_PLACEABLE) && GetIsOpen(oTarget));int nHiddenCompartment = (GetObjectType(oTarget) == OBJECT_TYPE_PLACEABLE && GetLocalInt(oTarget, "DOOR") != 1);
AWA_DEBUG("tag_playerwidget: 1");
//:::::::::::::::::::::::::::CHECK LINE OF SIGHT:::::::::::::::::::::::::::::::: //(exclude doors because they report incorrectly) vector vPC = GetPosition(oPC); vector vTarget; if(nType != OBJECT_TYPE_DOOR) { AWA_DEBUG("awa_inc_paw - awa_UsePlayerWidget: oTarget's name = "+GetName(oTarget)); AWA_DEBUG("awa_inc_paw - awa_UsePlayerWidget: oPC's name = "+GetName(oPC)); if(nType == 0) { vTarget = GetPositionFromLocation(lPawLoc); AWA_DEBUG("awa_inc_paw - awa_UsePlayerWidget: object type is invalid (0)"); } else vTarget = GetPosition(oTarget); if(!LineOfSightVector(vPC, vTarget)) { AWA_DEBUG("awa_inc_paw - awa_UsePlayerWidget: no line of sight"); FloatingTextStringOnCreature("No line of sight", oPC, FALSE); //DisplayText("No line of sight"); return; } }
Modifié par DM_Vecna, 15 septembre 2010 - 12:06 .