Jump to content

getParentWorldSpace


glowplug

Recommended Posts

I need to give the player a link back to where they teleported in from.
At the moment I have a lengthy "if elseif" block of world spaces which finishes off with player.getParentCell.
Of course that will miss mod worldspaces.

Surely there must be a way to dynamically get the player worldspace.

Link to comment
Share on other sites

If the player is in an interior cell (use PlayerRef.IsInInterior) save the location with PlayerRef.GetParentCell

If the player is in an exterior cell save the location with PlayerRef.GetParentWorldspace

 

Use PlayerRef.GetPos to savwe the X Y Z positions and PlayerRef.GetAngle to save the player heading

Use Playerref.PositionCell or Playerref.PositionWorld to move the player back to that original location.

Link to comment
Share on other sites

If the player is in an interior cell (use PlayerRef.IsInInterior) save the location with PlayerRef.GetParentCell

If the player is in an exterior cell save the location with PlayerRef.GetParentWorldspace

 

Use PlayerRef.GetPos to savwe the X Y Z positions and PlayerRef.GetAngle to save the player heading

Use Playerref.PositionCell or Playerref.PositionWorld to move the player back to that original location.

Thank you for that, I should be able to get the mod out later today or tomorrow.

I missed player.isInInterior which is why I had it as the else to all the elseif getInWorldSpace.

I searched for getparentWorldspace but thought it didn't exist.

I've only just started using CSE and only had to type it for the intellisense :blush:

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...