This object is in archive! 

In Game Sctipt - Control Gyros On/Off

Mikhail shared this bug 3 years ago
Not a Bug

This ITerminalAction does't work at all.

ITerminalAction Action = controller.GetActionWithName("Control Gyros On/Off");
if (Action.IsEnabled(controller))
  Action.Apply(controller);
This in game code will cause an Exception - "Object reference not set to an instance of an object". I tried to check my spelling calling list of all actions on IMyShipController that way.
List<ITerminalAction> actions = new List<ITerminalAction>();
controller.GetActions(actions);
foreach (ITerminalAction action in actions)
  controller.CustomData += action.Name + "\n";

Please consider to add this action as interface prop.

Okay. I'v found it to bee an id. Not name.

Replies (1)

photo
1

Anyway. Why this method called WithName if it actually searches by it's ID? This is confusing...

Replies have been locked on this page!