EarnestErnest Posted March 2, 2017 Share Posted March 2, 2017 To those that also encountered the problem: Background: When you order a ship to guard your position, it just stops and refuses to do any other orders Problem: This seems to happens because it is trying to index a nil value to a ship variable. The function OnGuardButtonPressed is not successful. Possible Solution: A local ship variable is used in the function and it was never instantiated before. I instantiated it after CheckCaptain evaluation to store the craft entity of the Player(me). After that, the error message doesn't appear when ordering to guard the position and the targeted ship effectively guards where you were at the moment of giving the order Ill upload the new craftorder.lua version with the correction.. beware that it will overwrite any effect that any mod had on that file before. You have to place this file in "\data\scripts\entity" If you want to modify it yourself instead: Just add the following in craftorder.lua inside the OnGuard Function, after "if checkCaptain() then" (see image below) local ship = Player().craft craftorders.zip Link to comment Share on other sites More sharing options...
Devious Posted March 3, 2017 Share Posted March 3, 2017 Thank you for looking into this, it was getting quite annoying sometimes! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now