It was a pretty robust method. I used a bunch of X-markers. My train then held an array that referenced each of those markers. It would loop through the array. Moving to the next marker once it completed moving to the current one. It SORT OF worked, but it was very clunky. It was a bit of a bodge!
Scriptname CMR:CMR_TrainOnly extends ObjectReference
{Script which actually controls the trains travel
}
ObjectReference[] Property TrackPoints Auto
ObjectReference Property PlayerXEntryMarker Auto
ObjectReference Property PlayerXExitMarker Auto
Float fMonorailSpeed = 500.0
Int iTrackIndex = 1
Function RunTrain()
Debug.Notification("Function: RunTrain called.")
;Move train to start
Self.MoveTo(TrackPoints[0])
;Move player in to the train
Game.GetPlayer().MoveTo(PlayerXEntryMarker)
;Start moving the train towards the first track point
Self.TranslateToRef(TrackPoints[1], fMonorailSpeed)
EndFunction
Event OnTranslationComplete()
Debug.Notification("OnTranslationComplete event called.")
FindNextPoint()
EndEvent
Function FindNextPoint()
Debug.Notification("Function: FindNextPoint called.")
iTrackIndex += 1
;Check to see if there are any more track points. Otherwise, end of line
If(iTrackIndex >= TrackPoints.Length)
EndOfLine()
Else
;Move to the next track point
Self.TranslateToRef(TrackPoints[iTrackIndex], fMonorailSpeed)
EndIf
EndFunction
Function EndOfLine()
Debug.Notification("Function: EndOfLine called.")
iTrackIndex = 1
Game.GetPlayer().MoveTo(PlayerXExitMarker)
EndFunction
Thanks for the reply,. I wish I could understand all that stuff. I've only just started modding so scripting is a bit beyond me at the moment. What I tried to do to get my light source moving was took a npc (eyebot) and set a patrol for them. I was going to try attach a light to it but it wouldn't do the patrol outside my floating house mod. Maybe it the markers don't work in an LOD Worldspace. ( I staged it in the Commonwealth LOD for the skyline) Anyway I haven't moved forward from that. Maybe I should learn scripting haha.