teleporting people from a specific spot
Moderator: Event DM
- JollyOrc
- Elder Sage
- Posts: 3984
- Joined: Fri Jan 17, 2003 11:41 am
- Timezone: Europe, CE(S)T
- Location: Germany
- Contact:
teleporting people from a specific spot
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 ?
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 ?
- Lafferty
- Scholar
- Posts: 1129
- Joined: Tue Feb 11, 2003 5:08 pm
- Location: look at my hands... they are HUGE. And they cant touch themselves...
- Contact:
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?
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
- JollyOrc
- Elder Sage
- Posts: 3984
- Joined: Fri Jan 17, 2003 11:41 am
- Timezone: Europe, CE(S)T
- Location: Germany
- Contact:
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.
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.
- Sindol
- Team Member; Retired with Honors
- Posts: 6479
- Joined: Mon Jan 06, 2003 4:23 pm
- Location: Nijmegen - Netherlands (GMT+1)
- Contact:
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.
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
yet so little time to enjoy it.
- Sindol
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.
Myk
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);
}