labyrinth999 Posted March 5, 2012 Share Posted March 5, 2012 I am trying to create a script that when the player equips an item they are transported to a set destination and on the removal of the item they are transported back to the the original destination. My current script allows for the transportation to a set destination when the item is worn or removed. However I want to be able to store the location of the player at the moment the item is equipped and to return to that location when its removed. Below is my current scriptScriptname TeleRing extends ObjectReference ObjectReference property EquipTeleport auto ObjectReference property UnEquipTeleport auto Event OnEquipped(Actor akActor) ObjectReference Player = Game.GetPlayer() Player.MoveTo(EquipTeleport) endEvent Event OnUnequipped (Actor akActor) ObjectReference Player = Game.GetPlayer() Player.MoveTo(UnEquipTeleport) endEvent I tried to use GetCurrentLocation, however I am not sure how to use the function at least I haven't been able to get a script to compile. Any suggestions and advice would be helpful. Link to comment Share on other sites More sharing options...
fg109 Posted March 5, 2012 Share Posted March 5, 2012 GetCurrentLocation() returns a location, which is sort of like a property for cells. For example, all of the shops in Solitude would correspond to SolitudeLocation. It can be useful in tracking crimes, for example. But it isn't useful for determining the player's actual physical location in the world. Instead, you might want to take a look at FindClosestReferenceOfTypeFromRef or FindClosestReferenceOfAnyTypeInListFromRef. You can have the game find the closest Xmarker or Xmarkerheading to the player, for example. Or any number of things you can think of. Link to comment Share on other sites More sharing options...
ScarabMonkey Posted March 5, 2012 Share Posted March 5, 2012 You could spawn an Xmarker at the player before teleporting - then just teleport back to the Xmarker... I'm pretty sure that's how the Mark/Recall spells work. Link to comment Share on other sites More sharing options...
Recommended Posts