The first question pertains to a OnPercieved script for an NPC, the first one the player see's upon loading the module. She is supposed to scream and make a run for a waypoint inside the inn they are next too. The building has three doors, and while the one she is closest too is unlocked, and the waypoint is right next to the transition on the other side, the NPC makes a run for the only other accessible locked door and just stands there. O.o
The script is as follows:
void main()
{
ExecuteScript("nw_c2_default2", OBJECT_SELF);
object oPC = GetLastPerceived();
if (!GetIsPC(oPC)) return;
if (!GetLastPerceptionSeen()) return;
string sTag = GetTag(OBJECT_SELF);
if (GetLocalInt(oPC, sTag)) return;
SetLocalInt(oPC, sTag, TRUE);
location lDestination = GetLocation(GetWaypointByTag("pt_vessa1stencounter"));
DelayCommand(5.0, ActionSpeakString("AIIEEE!! How'n th' hells did ye do that!?"));
ActionMoveToLocation(lDestination, TRUE);
Now, for my second question: I have a script that runs a Search check, and if that fails, a spot check, to see if the player finds a a secret stash in the woods when they pass by. However, the check's appear in the chat window, and if the player fails the search/spot check then it will tip the player off there's a secret there. Is there anyway to make those checks "hidden"?
Here's the code for that script as well:
object oTarget = GetWaypointByTag("pt_secretpantr");
location lTarget = GetLocation(oTarget);
void main()
{
object oPC = GetEnteringObject();
string sTag = GetTag(OBJECT_SELF);
if (GetLocalInt(oPC, sTag)) return;
if (GetIsSkillSuccessful(oPC, SKILL_SEARCH, 10))
{
CreateObject(OBJECT_TYPE_PLACEABLE, "pt_secretpantr", lTarget);
AssignCommand(oPC, PlayVoiceChat(VOICE_CHAT_LOOKHERE));
GiveXPToCreature(oPC, 35);
SendMessageToPC(oPC, "You have received an exploration bonus!");
SetLocalInt(oPC, sTag, TRUE);
}
else if (GetIsSkillSuccessful(oPC, SKILL_SPOT, 10))
{
CreateObject(OBJECT_TYPE_PLACEABLE, "pt_secretpantr", lTarget);
AssignCommand(oPC, PlayVoiceChat(VOICE_CHAT_LOOKHERE));
GiveXPToCreature(oPC, 35);
SendMessageToPC(oPC, "You have received an exploration bonus!");
SetLocalInt(oPC, sTag, TRUE);
}
}
Thank you for the help!
-NineCoronas





Retour en haut






