Jump to content

Possible to "teleport player into a cell" and then "teleport back" to the original position?


Recommended Posts

Good evening everybody!

 

Would something like this be possible:

 

Step 1: Player presses a key on the keyboard and gets teleportet into an interior cell (basically COC into the cell)

Step 2: Player does some stuff in that cell (don't worry about this part)

Step 3: When player is finished doing some stuff in that cell (pushes a button that says "back"), the player gets teleported back to where he/she/whatever stood when pressing the key in step 1

 

So, basically the question is:

How to "save" the position of the player in some kind of "variable" that can be "accessed" later (to teleport the player back there)?

 

 

Like, maybe save the X and Y cell coordinates in two variables (one for the X, one for the Y) and then 3 variables for the X Y and Z position in that cell, or something like that ...

(And a variable for the "worldspace", so like if that variable is 0, the player was in the commonwealth, if it is 1, the player was in the DiamondCity-worldspace and so on. I would also have to "assign" a number for each interior cell, so that this could also be used indoors ...)

(But that wouldn't really work if some mod added an interior cell, and the player tried to teleport from there .....)

 

Or is there a better solution?

Link to comment
Share on other sites

As DieFeM said.

When entering the cell use "Xmarker.moveto(PlayerRef)" and afterwards "PlayerRef.moveto(Xmarker)"

When making the .esl look out for possible persistence issues.

 

Moveto() will not advance the time, but it's safer than the teleport command, since you can travel overencumbered.

Link to comment
Share on other sites

As DieFeM said.

When making the .esl look out for possible persistence issues.

Thanks to both of you!

No no no, there will be no .ESL files, not for something big like a "crafting perk overhaul" ...

I have enough trouble with "regular" (ESP & ESM) plugin files, no need to mess around with that "weird ESL stuff" ...

Link to comment
Share on other sites

Tip: Use your quest to create an Xmarker at the player in an alias say LocationMarker

 

As long as the [ ] Temp box is unchecked it will persist regardless of the file type. Make it optional so you can clear it if needed.

 

Then Alias_LocationMarker.GetReference().MoveToPlayer()

 

If you set Objective 10 Text: Teleport Return Target: Alias_LocationMarker and the quest is Type: Misc you can (Self as Quest).SetObjectiveDisplayed(10, true) for a wonderful map marker user experience.

Link to comment
Share on other sites


Alias_RecallMarker.GetReference().MoveTo(pPlayerRef)
Alias.ThisLocation.ForceLocationTo(Alias_RecallMarker.GetReference().GetCurrentLocation())
(Self as Quest).SetObjectiveDisplayed(10,True) ;Total Recall return point in <Alias=ThisLocation>
(Self as Quest).SetActive()

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

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