Fast travel to nearest shire of Arkay

Post » Wed Dec 04, 2013 12:01 pm

Hi !

I am working on a script that, aside from other things, "fast travels" or "teleports" you to the nearest shrine of Arkay

This is the part of the code that is supposed to do this:

game.EnableFastTravel(true)game.FastTravel(Game.FindClosestReferenceOfTypeFromRef(ShrineofArkay,Game.GetPlayer(), 99999999999999999))game.EnableFastTravel(false)


In the wiki for "FindClosestReferenceOfTypeFromRef" says that the first argument must be "The type of base object to look for", but I can′t find the one that corresponds to the Arkay shrine, or to any shrine.

I know a good amount of programming, but I am new to Papyrus and the Creation Kit, so maybe I am approaching this from the wrong angle. So any suggestion or help will be very welcome ! :banana:

User avatar
Mashystar
 
Posts: 3460
Joined: Mon Jul 16, 2007 6:35 am

Post » Wed Dec 04, 2013 8:03 pm

You should ask there, many people can help there: http://www.gamesas.com/topic/1479205-quick-questions-quick-answers-thread-29/

User avatar
chinadoll
 
Posts: 3401
Joined: Tue Aug 22, 2006 5:09 am

Post » Wed Dec 04, 2013 6:17 am

You'll find the shrine in World Objects > Activator > Clutter--try putting "shrine" in the "filter" box in the upper left of the CK Object Window.

What may be a problem with your method is that I can't remember if FindClosestReferenceOfTypeFromRef will find objects outside the loaded area. I would suspect not. Also distance calculations between worldspaces are unreliable--if you're out in a wilderness cell not far from a closed city with a shrine, the game won't really know how far you are from that shrine.

Hopefully someone will come along and tell me I'm wrong, or give you a good alternative. All I can think of off-hand is hard-coding a decision tree based on locations and/or X,Y coordinates--"if the player is within this rectangle, then take them to this shrine."
User avatar
Mizz.Jayy
 
Posts: 3483
Joined: Sat Mar 03, 2007 5:56 pm

Post » Wed Dec 04, 2013 6:58 pm

You can probably base it off of which hold the player is in, an then teleport the player to the respective shrine.

User avatar
Jack Moves
 
Posts: 3367
Joined: Wed Jun 27, 2007 7:51 am

Post » Wed Dec 04, 2013 9:06 pm


The issue there is that most wilderness cells aren't part of any location, so you can't go up the location hierarchy to find their parent hold.

Looking at the http://skyrim.nexusmods.com/mods/35718/ mod might help, or have code you could re-purpose--its maker, Verteiron, is sometimes around here. From its description, "since most wilderness cells do not have a parent location, the script tries to guess where you are by looking at nearby named locations." So that technique is possible.

The problem with this general method is that because it's hard-coded, it won't work with mod-added wordspaces (or shrines) without compatibility patches. But I can't think of a way to do that programmatically. It would have to be more, "teleports the player to the last shrine of Arkay that they visited" or something like that, rather than the current closest shrine.
User avatar
Big mike
 
Posts: 3423
Joined: Fri Sep 21, 2007 6:38 pm

Post » Wed Dec 04, 2013 5:48 pm

Also I just realized that you can not fast travel if you are in an interior cell... so I thought in using the "MoveTo" function.

But still I cant get the Id or pointer or whatever to any ShrineofArkay, i tried MoveTo(ShrineofArkay) and also with the numeric Ids that you can get from the info of the object....

So yeah the main problem is still that I can′t get the id or whatever.

User avatar
Dawn Porter
 
Posts: 3449
Joined: Sun Jun 18, 2006 11:17 am

Post » Wed Dec 04, 2013 9:25 pm

Papyrus doesn't know what "ShrineOfArkay" is. You have to set up properties to each shrine.

Ex:

ObjectReference Property ShrineOfArkay01 Auto

Then in the CK, you have to Edit and Fill the property to point to the specific object in the game. However you may not want to teleport directly to the shrine, as this will most likely result in the player spawning on top of the altar or in some awkward position instead. Instead, it may be base to move them to an XMarker (which you create and place near the shrine). XMarkers are just an invisible marker used for a variety of reasons.

Also be careful about allowing the player to teleport from interiors. The quests in Skyrim aren't design for the player teleporting out and this could result in some of them breaking.

User avatar
vicki kitterman
 
Posts: 3494
Joined: Mon Aug 07, 2006 11:58 am


Return to V - Skyrim