//note_byname
//Note by Trigger Name
//
//This script is for the OnEnter handler of a trigger. It takes the NAME (not
tag) of the tirgger and makes the PC say those words. Used for //observations,
//memories, exclamations etc. Limitations and explanations contained in the
script.
//
//It's possible something like this has already been published.
//
//::///////////////////////////////////////////////
//:: Name: Note By Trigger Name for use in OnEnter of a trigger.
//:: FileName: note_byname
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/* This simple script causes the PC to say something, such as
noticing a detail or remembering something. It will trigger
once per PC. Create a trigger in an area where you want the PC
to make a comment. Place this script in the trigger's OnEnter script.
Name (not TAG) the trigger with the text you want said. The name
seems to be able to hold most punctuation and holds as much text
as you're likely to want.
Tricks and limitations: This script fires once per PC by setting a local
variable on the PC based on the trigger's TAG. YOU MUST GIVE EACH TRIGGER
A UNIQUE TAG. However, you can create multiple triggers with the same
TAG if you wish the PC to see text once from multiple possible
locations (such as two doors leading to the same room).
The usefulness of this script is to quickly add these kinds of messages
with a single generic script. Ideally, create a custom trigger named
something like "Enter text here" and drop the script into the OnEnter.
A kind of paint-and-name system.
*/
//:://////////////////////////////////////////////
//:: Created By: White Raven
//:: Created On: 8/9/02
//:://////////////////////////////////////////////
void main()
{
object oPC = GetEnteringObject();
object oSpeaker = oPC;
//Change oPC to OBJECT_SELF for oSpeaker to make stationary text rather
//than a bubble over the PC. (that is, the trigger speaks)
string sMessage = GetName(OBJECT_SELF);
if(GetLocalInt(oPC, "First_Entry" + GetTag(OBJECT_SELF)) == 0 && GetIsPC(oPC))
{
AssignCommand(oSpeaker, ActionSpeakString(sMessage, TALKVOLUME_TALK));
SetLocalInt(oPC, "First_Entry" + GetTag(OBJECT_SELF), 1);
}
}
/*Nature gives us shapeless shapes:
Clouds and waves and flame.
But human expectation is that things remain the same.
And when it doesn't, we point out fingers and blame, blame, blame*/