Server Totals
Underdark - (8)
Mikona - (2)
Ferrell - (0)
Elysia - (0)
Le'Or - (0)
M'Chek - (0)
Deglos - (0)
Wilderness - (0)
Visimontium - (0)
Total players: 10
Gallery

Links Menu

Scripting idea for triggers

Moderators: Nighthawk4, Dungeon Masters

Scripting idea for triggers

PostAuthor: Dirk Cutlass » Sun Oct 12, 2003 7:07 pm

Don't know if anyone has thought of or done this already, but it occured to me that you could make a "directional trigger" (i.e. to tell which direction a player/party was walking in when they triggered the trigger.

Place 2 triggers directly adjacent to each other somewhere where they will get stepped on, e.g. a corridor. Let's say the corridor runs East-West. The 2 triggers will be next to each other one slightly to the East of the other.

Using a simple script to set flag when the triggers are stepped on, it is possible to know which trigger was stepped on first, and therefore tell which direction the player/party is moving in (.e. Eastwards or Westwards)

This could be used, for example, to make an encounter always spawn ahead of the party (whichever way they were walking), or behind, or whatever. If used at the entrance to a room or sub-area, it could be used to do different things depending on whether the player/party was entering or leaving ... etc.

Just a thought.
User avatar
Dirk Cutlass
Elder Sage
 
Posts: 4703
Joined: Mon Jan 27, 2003 9:42 am
Location: GMT

PostAuthor: Aloro » Sun Oct 12, 2003 7:44 pm

Errr... much easier would be to add something to the trigger's OnEnter that simply uses GetFacing on the PC entering it. If the trigger is in a confined space like a hallway, and fills the hallway, then you can only enter it from two sides. You can do something like

Code: Select all
void main()
{
    float fFacing = GetFacing(GetEnteringObject());
    if ((fFacing>=45.0) && (fFacing<=135.0))
    {
        // facing roughly North
    }
}


Note that this can't be used with normal encounters as you described, because you can't dynamically place spawn points. More's the pity.

- Aloro
Aleksandr Solzhenitsyn wrote:The meaning of earthly existence lies, not as we have grown used to thinking, in prosperity, but in the development of the soul.
User avatar
Aloro
Team Member; Retired with Honors
 
Posts: 12810
Joined: Sat Dec 28, 2002 5:11 am
Location: Rainbow's End

PostAuthor: Alexandru Stanicu » Sun Oct 12, 2003 7:54 pm

but using the same script to get the facing you could spawn monsters a ta given WP based on facing...
I ain't as good as I once was, But I'm as good once as I ever was...


:devil: 4evar!
User avatar
Alexandru Stanicu
Legacy DM
Legacy DM
 
Posts: 14082
Joined: Sun Oct 20, 2002 10:59 pm
Location: Texas
Timezone: CST
DM Avatar: The Hammer

PostAuthor: Aloro » Sun Oct 12, 2003 8:07 pm

Sure, you could manually spawn creatures, no problem. But you can't use a "normal" encounter, because those only use preplaced spawn points. The downside to manually spawning creatures is that you don't get the time-saving benefit of using the NWN encounter system - i.e. creaures are placed from a list, according to CR and encounter difficulty, single-use or repeating, etc. It is surely possible to do all of this manually, but it's also a LOT more work.

- Aloro
Aleksandr Solzhenitsyn wrote:The meaning of earthly existence lies, not as we have grown used to thinking, in prosperity, but in the development of the soul.
User avatar
Aloro
Team Member; Retired with Honors
 
Posts: 12810
Joined: Sat Dec 28, 2002 5:11 am
Location: Rainbow's End

PostAuthor: JollyOrc » Sun Oct 12, 2003 10:02 pm

can't you just create two encounters, same stats, but different spawn points, and then trigger the one or the other, depending on facing ?
User avatar
JollyOrc
QA Resource
 
Posts: 3900
Joined: Fri Jan 17, 2003 11:41 am
Location: Germany
Timezone: GMT+1

PostAuthor: scorilo » Wed Nov 05, 2003 2:29 pm

If I understand your post correctly, then it might be easier to create one encounter with two or more spawn points; as far as I know the creatures will always be created on the further spawn point from the player entering the encounter.

scorilo
Newbie
 
Posts: 1
Joined: Wed Nov 05, 2003 2:21 pm


Return to NWN Scripting

Who is online

Registered users: Google [Bot]