Calling for trigger
Moderator: Event DM
-
- Elder Sage
- Posts: 3254
- Joined: Sun Mar 23, 2003 3:56 pm
- Timezone: EDT (GMT-5)
- Location: Ithaca, NY (GMT-5)
- Contact:
Calling for trigger
I was looking to have several triggers in an area that call up floaty text when entered. Is it possible to have a single script that can handle all of them? Basically, what I am asking is whether there is anything like
GetTriggerEntered or anything along those lines. I couldn't find one, but I thought more experienced folks might know better.
Thanks.
GetTriggerEntered or anything along those lines. I couldn't find one, but I thought more experienced folks might know better.
Thanks.
- Mistcaller
- Team Member; Retired with Honors
- Posts: 5477
- Joined: Sun Feb 09, 2003 3:42 pm
- Location: Athens, Greece (GMT +2)
GetEnteringObject() is used most often. What you could do is something like that:
If FloatingText doesnt work, you can use SendMessageToPC or SpeakString..
Code: Select all
object oPC = GetEnteringObject();
if (GetIsPC(oPC))
FloatingTextStringOnCreature(OBJECT_SELF, " blah blah");
-
- Elder Sage
- Posts: 3254
- Joined: Sun Mar 23, 2003 3:56 pm
- Timezone: EDT (GMT-5)
- Location: Ithaca, NY (GMT-5)
- Contact:
Ah, thanks, but actually I wanted to indentify the trigger, not the entering object. I have several triggers, and I wanted each trigger to generate a different message. Right now, I have each trigger assigned a different script for their OnEnter, but I was wondering if there was a way to allow all the triggers to refer to a single script, and have that script figure out which trigger has just called it and return the appropriate text.
- JollyOrc
- Elder Sage
- Posts: 3984
- Joined: Fri Jan 17, 2003 11:41 am
- Timezone: Europe, CE(S)T
- Location: Germany
- Contact:
how about this one ?
Works like a charm, and may be already life at the Server of your choice..
Works like a charm, and may be already life at the Server of your choice..
Code: Select all
//////////////////////////////////////////////////////
// Script name: onent_atmosphere
//////////////////////////////////////////////////////
// This script sends a message to PC's. I
// generally use it to provide atmosphere.
// The script should be placed in the onenter of a
// generic trigger. Place the message you wish the
// trigger to pass to the player in the Name field of
// the trigger. This seems to cater for an indefinate
// number of characters.
// To record that the PC has received the message
// the script sets a local integer (assigned name of
// the trigger tag). This means the PC only receives
// the message the first time they enter the trigger.
//////////////////////////////////////////////////////
// Created by Vicky Radcliffe for Avlis
// Date: 22 Nov 2003
//////////////////////////////////////////////////////
// Modified by
// Date:
//////////////////////////////////////////////////////
// Changes Made:
//
//////////////////////////////////////////////////////
void main()
{
object oPC = GetEnteringObject();
string sAtmosphereMessage = GetName(OBJECT_SELF);
string sAtmosphereTag = GetTag(OBJECT_SELF);
if (GetIsPC(oPC) && GetLocalInt(oPC,sAtmosphereTag)==0)
{
SendMessageToPC(oPC,sAtmosphereMessage);
SetLocalInt(oPC, sAtmosphereTag, 1);
}
}
-
- Elder Sage
- Posts: 3254
- Joined: Sun Mar 23, 2003 3:56 pm
- Timezone: EDT (GMT-5)
- Location: Ithaca, NY (GMT-5)
- Contact:
Does anyone know if the equivalent script using FloatingTextStringOnCreature instead of SendMessageToPC is already live on the Le'Or server?JollyOrc wrote:how about this one ?
Works like a charm, and may be already life at the Server of your choice..
Code: Select all
////////////////////////////////////////////////////// // Script name: onent_atmosphere ////////////////////////////////////////////////////// // This script sends a message to PC's. I // generally use it to provide atmosphere. // The script should be placed in the onenter of a // generic trigger. Place the message you wish the // trigger to pass to the player in the Name field of // the trigger. This seems to cater for an indefinate // number of characters. // To record that the PC has received the message // the script sets a local integer (assigned name of // the trigger tag). This means the PC only receives // the message the first time they enter the trigger. ////////////////////////////////////////////////////// // Created by Vicky Radcliffe for Avlis // Date: 22 Nov 2003 ////////////////////////////////////////////////////// // Modified by // Date: ////////////////////////////////////////////////////// // Changes Made: // ////////////////////////////////////////////////////// void main() { object oPC = GetEnteringObject(); string sAtmosphereMessage = GetName(OBJECT_SELF); string sAtmosphereTag = GetTag(OBJECT_SELF); if (GetIsPC(oPC) && GetLocalInt(oPC,sAtmosphereTag)==0) { SendMessageToPC(oPC,sAtmosphereMessage); SetLocalInt(oPC, sAtmosphereTag, 1); } }
Thanks.