Author Topic: How to teleport a player to an equal area in the same location?  (Read 339 times)

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0


               

I created a copy of my area and I'd like to teleport a player that are in the area old to the new area in the same location.


 


Example:


The player are on top of the ship.


I would like to teleport the player to the copy of the area on the top of the ship where he stopped.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
How to teleport a player to an equal area in the same location?
« Reply #1 on: June 26, 2014, 08:47:16 pm »


               I do this with my planar system.

I have spirit realms which are mirror images of my real world areas.


object oPC = GetFirstPC();
vector vPos = GetPosition(oPC);
object oAreaNew = // Insert area here
float fFacing = GetFacing(oPC);  // Think this gets the facing direction
location lNew = Location(oAreaNew,vPos,fFacing);
AssignCommand(oPC,JumpToLocation(lNew));

Doing this from memory, but I think its right?


               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
How to teleport a player to an equal area in the same location?
« Reply #2 on: June 26, 2014, 10:50:50 pm »


               Travel Builder moves everything on a ship to a new area.


The ship doesn't have to be in the same position or orientation in the target area.


All creatures (e.g party and crew), placeables (e.g. wheel, bell, flag, containers & contents) and items dropped on the deck are moved.


... but if you just want to move one player, Baaleos's solution is perfect.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
How to teleport a player to an equal area in the same location?
« Reply #3 on: June 27, 2014, 03:31:09 am »


               There is a Relative location function in the post here.    
               
               

               
            

Legacy_WhiteTiger

  • Hero Member
  • *****
  • Posts: 889
  • Karma: +0/-0
How to teleport a player to an equal area in the same location?
« Reply #4 on: June 27, 2014, 07:40:43 am »


               


I do this with my planar system.


I have spirit realms which are mirror images of my real world areas.

 



object oPC = GetFirstPC();
vector vPos = GetPosition(oPC);
object oAreaNew = // Insert area here
float fFacing = GetFacing(oPC);  // Think this gets the facing direction
location lNew = Location(oAreaNew,vPos,fFacing);
AssignCommand(oPC,JumpToLocation(lNew));

Doing this from memory, but I think its right?




 


thank you very much