I want to create a few routes that are occasionally traversed by (uncrewed, simple) ships. These would go through the Sea of Ghosts and would have to be visible from a decent distance. I've tried to utilize pieces of script that I found in a great mod called Transportato by Trainwiz to see if I could make this happen. Something is wrong with this script though, I'd like for some trained eyes to look it over
I'm quite the noob when it comes to scripting, feel free to reprimand me on that. My abilities don't extend beyond copy+pasting and then fidgeting with scripts found elsewhere.
Scriptname ShipScript extends ObjectReference {This ship will enable when the player comes close enough, sail its route, then disable.}ObjectReference Property Waypoint1 Auto ObjectReference Property Waypoint2 Auto ObjectReference Property Waypoint3 Auto ObjectReference Property Waypoint4 Auto ObjectReference Property Waypoint5 Auto ObjectReference Property Waypoint6 Auto int currentwaypoint = 0Int Property waypointnumbers Auto GlobalVariable Property hasbeenspawned Auto float Property speed autoEvent OnInit() RegisterForSingleUpdate(0.5)EndEventEvent OnUpdate() if(Game.GetPlayer().GetDistance(self) < 12000) if(hasbeenspawned.getValue() == 0) currentwaypoint = 1 hasbeenspawned.setValue(1) enable(true) MoveToMyEditorLocation() endif endifif((hasbeenspawned.GetValue())== 1) if(waypointnumbers >= 1) if(currentwaypoint == 1) TranslateToRef(waypoint1, speed) endif endif if(waypointnumbers >= 2) if(currentwaypoint == 2) TranslateToRef(waypoint2, speed) endif endif if(waypointnumbers >= 3) if(currentwaypoint == 3) TranslateToRef(waypoint3, speed) endif endif if(waypointnumbers >= 4) if(currentwaypoint == 4) TranslateToRef(waypoint4, speed) endif endif if(waypointnumbers >= 5) if(currentwaypoint == 5) TranslateToRef(waypoint5, speed) endif endif if(waypointnumbers >= 6) if(currentwaypoint == 6) TranslateToRef(waypoint6, speed) endif endifendifRegisterForSingleUpdate(0.5)EndEventEvent OnTranslationComplete() currentwaypoint += 1EndEventEvent OnUnload()if((hasbeenspawned.GetValue())== 1) MoveToMyEditorLocation() hasbeenspawned.setValue(2) currentwaypoint = 0 Disable(true)endifEndEvent
The ship to which this script is attached appears in-game, but it doesn't move. Any help would be appreciated.
Kind regards,
Satchboogie
Kind regards,
Satchboogie