Jump to content

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


Recommended Posts

If you are using moveTo(), you might also want to teleport the player's followers. Otherwise they might get stuck whereever you left them.

 

This is a slightly simplified version of what I do in Immersive Teleportation:

 

    Actor[] playerFollowers = Game.GetPlayerFollowers()

    int index = 0
    while (index < playerFollowers.Length)
        Actor curFollower = playerFollowers[index]

        if(Game.GetPlayer().GetWorldSpace() != curFollower.GetWorldSpace() || yourMarker.getDistance(curFollower) > minDistanceToTeleportFollower)

            curFollower.moveTo(toTp.getTargetMarker())

        endif
        index += 1
    endWhile

Basically, iterate the followers, if any of them is too far away, get them to the marker. I use 4096 for minDistanceToTeleportFollower.

 

What I also do is add a teleport in spell for each, and wait a bit in between. I'm waiting 5 seconds, mostly so that you don't get spammed with the teleport-in-spell, if you have multiple followers.

 

GetPlayerFollowers returns companions, and any NPC which is following you due to a quest.

 

I also just now realized that just comparing worldspaces might not be enough in some cases. IIRC interiors all share the same. However, the distance should return an astronomically high number in that case.

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.

What?

I am sorry, I don't really understand the whole "quest alias" thing ...

As far as I know the "quest alias" thing can be used to make things like "retrieve this random object from a random location", so the "quest alias" things are like "variables" that can be used within quests ....

You said that this would do something with map markers ...

I don't really need "working mapmarkers" for this interior cell that the player gets teleported into, so I guess I don't need that ...

 

Also, should I attatch scripts that "always run", like this one, to the player, or to what?

It would make sense to attatch it to the player, because the player is "always loaded", right?

Link to comment
Share on other sites

If you are using moveTo(), you might also want to teleport the player's followers. Otherwise they might get stuck whereever you left them.

 

This is a slightly simplified version of what I do in Immersive Teleportation:

    Actor[] playerFollowers = Game.GetPlayerFollowers()

    int index = 0
    while (index < playerFollowers.Length)
        Actor curFollower = playerFollowers[index]

        if(Game.GetPlayer().GetWorldSpace() != curFollower.GetWorldSpace() || yourMarker.getDistance(curFollower) > minDistanceToTeleportFollower)

            curFollower.moveTo(toTp.getTargetMarker())

        endif
        index += 1
    endWhile

Basically, iterate the followers, if any of them is too far away, get them to the marker. I use 4096 for minDistanceToTeleportFollower.

 

What I also do is add a teleport in spell for each, and wait a bit in between. I'm waiting 5 seconds, mostly so that you don't get spammed with the teleport-in-spell, if you have multiple followers.

 

GetPlayerFollowers returns companions, and any NPC which is following you due to a quest.

 

I also just now realized that just comparing worldspaces might not be enough in some cases. IIRC interiors all share the same. However, the distance should return an astronomically high number in that case.

No, there is no need for that.

The player will just use this "interior cell" to select perks.

Imagine it like this:

One "wall" of this interior cell has the menu with all the custom perks on it.

By selecting activators, the player can select what perks he/she wants.

 

(Because I have no idea how to get an ActionScript menu to "add a perk to the player", so this is a bit of a workaround to still have a "graphical perk tree system" without messing around with ActionScript Interface stuff ...).

 

So, no companions will be needed in this cell.

Link to comment
Share on other sites

 

I am sorry, I don't really understand the whole "quest alias" thing ...

 

Until you understand what quests and quest aliases can do, you are going to be doing stuff the really really hard or overly complicated way.

 

I know this cos I pumped out thousands of lines of script doing exactly what quests can do before I woke.

 

Quests are the rug fundamental engine that ties the room creation kit solutions together.

 

If you don't want to be convinced that's fine, give it time and send me a postcard in a year or so.

Link to comment
Share on other sites

 

 

I am sorry, I don't really understand the whole "quest alias" thing ...

 

Until you understand what quests and quest aliases can do, you are going to be doing stuff the really really hard or overly complicated way.

 

I know this cos I pumped out thousands of lines of script doing exactly what quests can do before I woke.

 

Quests are the rug fundamental engine that ties the room creation kit solutions together.

 

If you don't want to be convinced that's fine, give it time and send me a postcard in a year or so.

 

Oh, I am convinced that one can do lots of cool stuff with the "quest" mechanics ....

 

I guess I wll have to "study" these "quest alias"-things .....

Link to comment
Share on other sites

  • Recently Browsing   0 members

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