Space Engineers

Space Engineers

MArmOS (Mechanical Arm Operating System) v3.1
Why am I getting a compilation error?
Hello, I wrote a simple code in which I simply declare the Rotor

new Rotor( Name: "ARMRotor1", Axis: "Z", OriMode: 0 );
pochle got this:

Originally posted by program block:

Exception encountered during script execution: Cannot cast object of type 'Sandbox.Game.Entities.Blocks.MyProgrammableBlock' to type 'Sandbox.ModAPI.Ingame.IMyShipController'.
in Program.UserControl.GetKeyboardInput()
in Program.UserControl.GetInputs()
in Program.Controller.Update (string argument)
in Program.Controller.UpdateControllers (string argument)
in Program.Main (string argument)
at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.<>c__DisplayClass42_0.<ExecuteCode>b__0(IMyGridProgram program)
at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.RunSandboxedProgramActionCore(Action`1 action, line and response)
< >
Showing 1-5 of 5 comments
K-Duke 18 May, 2023 @ 12:23pm 
Well there is no declaration. Only the creation of an object of class Rotor into the nothingness of space.
Either you're not copy pasting everything or you just gotta write
var myRotor = new Rotor( Name: "ARMRotor1", Axis: "Z", OriMode: 0 );

Also is this code wrapped into a function call?
Originally posted by K-Duke:
Well there is no declaration. Only the creation of an object of class Rotor into the nothingness of space.
Either you're not copy pasting everything or you just gotta write
var myRotor = new Rotor( Name: "ARMRotor1", Axis: "Z", OriMode: 0 );

Also is this code wrapped into a function call?
The problem was that the software block falls on the platform on which the rotor is fixed.
I moved my program block to the blocks that are on the rotor and it all worked
Doctor WHO 3 Jan, 2024 @ 11:20pm 
Originally posted by GG WP:
Originally posted by K-Duke:
Well there is no declaration. Only the creation of an object of class Rotor into the nothingness of space.
Either you're not copy pasting everything or you just gotta write
var myRotor = new Rotor( Name: "ARMRotor1", Axis: "Z", OriMode: 0 );

Also is this code wrapped into a function call?
The problem was that the software block falls on the platform on which the rotor is fixed.
I moved my program block to the blocks that are on the rotor and it all worked


so... the program block wasn't don the same grid ? or like to separate from the rotor ?
Doctor WHO 3 Jan, 2024 @ 11:29pm 
Originally posted by GG WP:
Hello, I wrote a simple code in which I simply declare the Rotor

new Rotor( Name: "ARMRotor1", Axis: "Z", OriMode: 0 );
pochle got this:

Originally posted by program block:

Exception encountered during script execution: Cannot cast object of type 'Sandbox.Game.Entities.Blocks.MyProgrammableBlock' to type 'Sandbox.ModAPI.Ingame.IMyShipController'.
in Program.UserControl.GetKeyboardInput()
in Program.UserControl.GetInputs()
in Program.Controller.Update (string argument)
in Program.Controller.UpdateControllers (string argument)
in Program.Main (string argument)
at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.<>c__DisplayClass42_0.<ExecuteCode>b__0(IMyGridProgram program)
at Sandbox.Game.Entities.Blocks.MyProgrammableBlock.RunSandboxedProgramActionCore(Action`1 action, line and response)


I just got the same, today
I know it's late, but:
The error is because you did not define a LCD / Text-Panel for the Debug, Log, Echo displays.
In the original state, the MArmOS can only handle LCD-Screens.

I modified the MArmOS in a way that it also works with Multi-LCD blocks like Cockpits, etc.
Just waiting for Timotei~ to acknowledge the change.
< >
Showing 1-5 of 5 comments
Per page: 1530 50