Jump to content

Scripting Help [Fast Travel]


Recommended Posts

That might work if you can add objectReferences to a form list (never tried this myself). Then you could use .GetAt(index).

 

For my mod I used an array of xmarker headings. at each location one was placed and the property filled in the array and the index noted down. then I created a travel function witch you give the index and it gets the correct Objectreference from the array. It's simple but quite time consuming if you want a lot of locations. Using an array does allow you to easely add more locations.

 

 

Edit: With ObjectReferences in the first line I mean acutal placed items (marker) not the base Item.

Edited by LoneRaptor
Link to comment
Share on other sites

is this what your referring to? I need something to work off of ha

 

ScriptName RamaFormListExampleScript extends ObjectReference

Actor Property PlayerREF Auto ; Least 'expensive' way to refer to the player
FormList Property ListOfObjectsFLST Auto ; see notes after script for more info on this property

Event OnTriggerEnter(ObjectReference akActionRef)
If akActionRef == PlayerREF
Int iIndex = ListOfObjectsFLST.GetSize() ; Indices are offset by 1 relative to size
While iIndex
iIndex -= 1
ObjectReference kReference = ListOfObjectsFLST.GetAt(iIndex) As ObjectReference ; Note that you must typecast the entry from the formlist using 'As'.
If kReference.IsEnabled()
kReference.Disable()
Else ; If kReference.IsDisabled()
kReference.Enable()
EndIf
EndWhile
EndIf
EndEvent

 

 

Got it off this wiki page http://www.creationkit.com/index.php?title=Complete_Example_Scripts#Cycle_Through_a_List_of_Objects_and_Perform_an_Action_on_Each_Object.28FormLists.29

Edited by ajs52698
Link to comment
Share on other sites

That script will go trough the intire list and enable everything, not realy what you need. I would sugest at each entry of your message (where you select where to teleport) to do this:

Game.FastTravel(YourFormList.GetAt(IntegerOfTheChosenLocation) As ObjectRefference)

Or when using and array:

Game.FastTravel(YourArray[integerOfTheChosenLocation])

 

For some more info on this have a look at the Travel function in my LR_APCTravelScript, and for the message part at the LR_TravelActivatorScript.

To see how the properties are filled open my esp in the CK and look at the properties of the LR_APCTravelScript on the LR_APCQuest. The important section here is the arrays group and then the locations array.

 

The Travel function in LR_APCTravelScript Can be a little complicated because it's doing a lot more then just fast traveling the only thing that matters is the Game.FastTravel bit and the if statemen just above it witch removes the fuel.

Edited by LoneRaptor
Link to comment
Share on other sites

  • Recently Browsing   0 members

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