Onperceived
Moderator: Event DM
Onperceived
How often does this fire ?



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

Last edited by _Wake_ on Sat Jul 10, 2004 3:39 am, edited 1 time in total.
- Jordicus
- Team Member; Retired with Honors
- Posts: 8042
- Joined: Tue Jan 21, 2003 3:46 pm
- Location: Whitehall, PA (GMT -4)
- Contact:
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
You see things and you say, "Why?" But I dream things that never were and say, "Why not?" George Bernard Shaw
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.");
}
}
}
//::///////////////////////////////////////////////////////////
//:: 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.");
}
}
}
- Jeff
- Knight of Useless Drivel
- Posts: 66
- Joined: Thu Oct 31, 2002 4:21 am
- Location: http://www.legendofvalinor.com
- Contact: