Page 1 of 1

Onperceived

Posted: Sat Jul 10, 2004 3:34 am
by _Wake_
How often does this fire ?

Posted: Sat Jul 10, 2004 3:34 am
by Jordicus
OnPerceived..

:wink:

Posted: Sat Jul 10, 2004 3:35 am
by _Wake_
:lol: yeah how often once per :?: :lol:

*edit*better yet does it fire per every oPC of a group or just for the leader of a group ?
:D

Posted: Sat Jul 10, 2004 3:38 am
by Jordicus
heh..
The script attached to this event will fire whenever another creature perceives another creature or PC. Common uses of this script include having the creature yell a battle cry, greet the PC, or run away

Posted: Sat Jul 10, 2004 3:40 am
by _Wake_
sorry adjusted my question :oops:

Posted: Sat Jul 10, 2004 3:43 am
by Jordicus
my guess would be every PC

Posted: Sat Jul 10, 2004 3:46 am
by _Wake_
The reson I ask is this old script I made for a SP mod, And was thinking of PW scripting and how onperceived worked along these lines of checking one oPC or if grouped if it checked all members for Item.

//::///////////////////////////////////////////////////////////
//:: Created By: _Wake_
//:: Created On: April/3/2003
//::///////////////////////////////////////////////////////////
#include "NW_I0_GENERIC"
object oSeen = GetLastPerceived();
// oSeen sets the oPC as last seen by oNPC
object oRing = GetItemPossessedBy(oSeen, "StinkyMeat");
// checks to see if item
//(oSeen, "ITEM_TAG_HERE")
// is possessed by oPC
void main()
{
if (GetIsPC(oSeen))
// checks to see if oSeen is a oPC
{
if (oRing == OBJECT_INVALID)
// then sets up what happens if oPC
// didn't have the item
{
SetIsTemporaryEnemy(oSeen);
ActionSpeakString("What?s that smell, Intruder!");
ActionAttack(oSeen);
DetermineCombatRound(oSeen);
}
// and now else determines what happens
// if item was in oPC possession
else
{
SetIsTemporaryFriend(oSeen);
// here is how I fixed the snag if you set oSeen
// as temporarily friendly the check balances
// out if you were to lose the item then regain
// the item oNPC would have to do another
// perception thus now seeing the PC as friendly w0o0t :)
ActionPlayAnimation(ANIMATION_FIREFORGET_GREETING);
ActionSpeakString("Me get?en hungry.");
}
}
}

Posted: Mon Jul 12, 2004 2:14 pm
by Jeff
Just as an fyi....
The last few versions of NWNX have included a profiler plug-in that would be perfect for this.

I will tell you how often a script fires, and how long it takes to run.

Posted: Tue Jul 13, 2004 2:09 am
by _Wake_
Thank you :)