Jump to content

[BUGFIX] Fix for the GuardPosition command on captained ships


EarnestErnest

Recommended Posts

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

 

 

2017-03-02_03_00_50-ERROR_AVORION_-_Paint.jpg.eb6313f6f18c6105f71577435d07f788.jpg

craftorders.zip

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...