Server Totals
Wilderness - (3)
Deglos - (2)
Elysia - (2)
Mikona - (1)
Ferrell - (0)
M'Chek - (0)
Le'Or - (0)
Visimontium - (0)
Underdark - (0)
Total players: 8
Gallery
  • Winter Ball 2015
    Album name: DM Events
    Uploaded by: Ronan
    Uploaded: Sat Jan 03, 2015 4:15 pm

Links Menu

Calling for trigger

Moderators: Nighthawk4, Dungeon Masters

Calling for trigger

PostAuthor: GreyLynx » Sun Mar 21, 2004 4:58 am

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.

GreyLynx
Elder Sage
 
Posts: 3256
Joined: Sun Mar 23, 2003 3:56 pm
Location: Ithaca, NY (GMT-5)
Timezone: EDT (GMT-5)

PostAuthor: Mistcaller » Sun Mar 21, 2004 12:08 pm

GetEnteringObject() is used most often. What you could do is something like that:

Code: Select all
object oPC = GetEnteringObject();
if (GetIsPC(oPC))
      FloatingTextStringOnCreature(OBJECT_SELF, " blah blah");


If FloatingText doesnt work, you can use SendMessageToPC or SpeakString..
User avatar
Mistcaller
Team Member; Retired with Honors
 
Posts: 5481
Joined: Sun Feb 09, 2003 3:42 pm
Location: Athens, Greece (GMT +2)

PostAuthor: GreyLynx » Sun Mar 21, 2004 5:37 pm

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.

GreyLynx
Elder Sage
 
Posts: 3256
Joined: Sun Mar 23, 2003 3:56 pm
Location: Ithaca, NY (GMT-5)
Timezone: EDT (GMT-5)

PostAuthor: JollyOrc » Sun Mar 21, 2004 5:51 pm

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);
    }
}
User avatar
JollyOrc
QA Resource
 
Posts: 3900
Joined: Fri Jan 17, 2003 11:41 am
Location: Germany
Timezone: GMT+1

PostAuthor: GreyLynx » Sun Mar 21, 2004 6:01 pm

Hey, thanks. I'll try that one out!

GreyLynx
Elder Sage
 
Posts: 3256
Joined: Sun Mar 23, 2003 3:56 pm
Location: Ithaca, NY (GMT-5)
Timezone: EDT (GMT-5)

PostAuthor: GreyLynx » Sat Mar 27, 2004 5:11 pm

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);
    }
}


Does anyone know if the equivalent script using FloatingTextStringOnCreature instead of SendMessageToPC is already live on the Le'Or server?

Thanks.

GreyLynx
Elder Sage
 
Posts: 3256
Joined: Sun Mar 23, 2003 3:56 pm
Location: Ithaca, NY (GMT-5)
Timezone: EDT (GMT-5)


Return to NWN Scripting

Who is online

Registered users: Bing [Bot], Dull Fred, Google [Bot], Kosjixen