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

Links Menu

teleporting people from a specific spot

Moderators: Nighthawk4, Dungeon Masters

teleporting people from a specific spot

PostAuthor: JollyOrc » Thu May 22, 2003 9:08 am

Hi!

Scenario:

1) Person A pulls a lever

2) Whichever person standing on a special spot (eg a trapdoor) gets then teleported to a waypoint.

I guess it won't work with area transitions.

How do I do that ?
User avatar
JollyOrc
QA Resource
 
Posts: 3900
Joined: Fri Jan 17, 2003 11:41 am
Location: Germany
Timezone: GMT+1

PostAuthor: Lafferty » Thu May 22, 2003 12:33 pm

Is the person pulling the chain (or whatever) the person that should be teleported or is the person to be teleported a different one?

If the person to be teleported is the same as the USER of a lever (or whatever) then its easy... im at work currently but i can send it to you later

If the person to be teleported should exclusively be determined by its position (like a platform) then what should happen if several persons are on that platform?
Tool for crafters Do you want some human to your salt? nomanisanisland.monolar.de
User avatar
Lafferty
Scholar
 
Posts: 1130
Joined: Tue Feb 11, 2003 5:08 pm
Location: look at my hands... they are HUGE. And they cant touch themselves...

PostAuthor: Liartes » Thu May 22, 2003 12:43 pm

I'm no scripter, but when multiple people are in the 'spot', give the last person that crossed over that 'spot's threshold a variable that states they are the one that gets to be teleported. The others would then have to walk off of it and then back on, taking turns.
User avatar
Liartes
Sage
 
Posts: 2154
Joined: Mon Feb 24, 2003 6:19 am
Location: Arizona, USA (GMT -7)

PostAuthor: JollyOrc » Thu May 22, 2003 12:44 pm

I figured out by now how to teleport the operating PC (yes, that was easy), but I wanted to teleport another person than the user of the lever.

It should be a rather small platform, and due to the setting this happens in, it is nearly 100% certain that there is only one person on the specified spot.

The person to be teleported should be willing, so having to kludge it by giving it a special item that will be checked is acceptable, but unelegant.

If there are several persons....

..most consistent would be if they all get teleported, but I fear that this will be too complicated.
User avatar
JollyOrc
QA Resource
 
Posts: 3900
Joined: Fri Jan 17, 2003 11:41 am
Location: Germany
Timezone: GMT+1

PostAuthor: Sindol » Sat May 24, 2003 11:15 am

I don't know much about scripting, but if you could make the teleport origin a seperate area, you should be able to teleport everyone in that area, thus eliminating your targetting problem.

Might not be exactly what you want, but maybe it is worth keeping in mind anyway.
So much fun,
yet so little time to enjoy it.
- Sindol
User avatar
Sindol
Team Member; Retired with Honors
 
Posts: 6487
Joined: Mon Jan 06, 2003 4:23 pm
Location: Nijmegen - Netherlands (GMT+1)

PostAuthor: Myk D'vor » Sun Jun 15, 2003 7:35 pm

This will take all PCs within 2 meters of the object with the tag "My_pressure_plate_tag" and teleport them to the waypoint with the tag "My_destination_waypoint". There should be some error checking done, and perhaps special effects added, but this is the gist of it.
Code: Select all
void main()
{
  object PressurePlate = GetObjectByTag("My_pressure_plate_tag");
  location lPlate = GetLocation(PressurePlate);
  object Destination = GetWaypointByTag("My_destination_waypoint");
  location lDest = GetLocation(Destination);
  int i = 1; //nth closest starts with 1
  float fDis = 0.0f;
  object obj;

  do
  {
    obj = GetNearestCreatureToLocation(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, lPlate, i);
    fDis = GetDistanceBetween(obj,PressurePlate);
    i++;
    if(GetIsObjectValid(obj) && fDis < 2.0) AssignCommand(obj,ActionJumpToLocation(lDest));
  } while(GetIsObjectValid(obj) && fDis < 2.0 && i<50);
}

Myk

Myk D'vor
Lord of Blithering Idiots
 
Posts: 111
Joined: Mon Feb 24, 2003 9:05 am

PostAuthor: JollyOrc » Sun Jun 15, 2003 9:20 pm

ah... learned a new trick...

mmh... "GetNearestCreatureToLocation" how do they come up with these ideas....
User avatar
JollyOrc
QA Resource
 
Posts: 3900
Joined: Fri Jan 17, 2003 11:41 am
Location: Germany
Timezone: GMT+1

PostAuthor: Myk D'vor » Mon Jun 16, 2003 3:04 am

The NWN Scripting Lexicon

I swear by it.

Myk

Myk D'vor
Lord of Blithering Idiots
 
Posts: 111
Joined: Mon Feb 24, 2003 9:05 am


Return to NWN Scripting

Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]