Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Exception occured: System.NullReferenceException: Object reference not set to an instance of an object.
at Zkillerproxy.TurretMinTargetMod.smartTargetingSwitchSetter(IMyTerminalBlock turret, Boolean newValue)
at Sandbox.Game.Screens.Terminal.Controls.MyTerminalValueControl`2.SetValue(TBlock block, TValue value)
at Sandbox.Game.Gui.MyTerminalControlOnOffSwitch`1.OnValueChanged(MyGuiControlOnOffSwitch obj)
at Sandbox.Game.Screens.Helpers.MyGuiControlOnOffSwitch.set_Value(Boolean value)
at Sandbox.Game.Screens.Helpers.MyGuiControlOnOffSwitch.HandleInput()
at Sandbox.Graphics.GUI.MyGuiControlBase.HandleInputElements()
at Sandbox.Graphics.GUI.MyGuiControlBlockProperty.HandleInput()
at Sandbox.Graphics.GUI.MyGuiControlParent.HandleInput()
at Sandbox.Graphics.GUI.MyGuiControlList.HandleInput()
at Sandbox.Graphics.GUI.MyGuiControlBase.HandleInputElements()
at Sandbox.Graphics.GUI.MyGuiControlParent.HandleInput()
at Sandbox.Graphics.GUI.MyGuiControlParent.HandleInput()
at Sandbox.Graphics.GUI.MyGuiScreenBase.HandleControlsInput(Boolean receivedFocusInThisUpdate)
at Sandbox.Graphics.GUI.MyGuiScreenBase.HandleInput(Boolean receivedFocusInThisUpdate)
at Sandbox.Graphics.GUI.MyScreenManager.HandleInput()
at Sandbox.Graphics.GUI.MyDX9Gui.HandleInput()
at Sandbox.MySandboxGame.Update()
at Sandbox.Engine.Platform.Game.UpdateInternal()
at Sandbox.Engine.Platform.Game.RunSingleFrame()
at Sandbox.Engine.Platform.FixedLoop.<>c__DisplayClass1.<Run>b__0()
at Sandbox.Engine.Platform.GenericLoop.Run(VoidAction tickCallback)
at Sandbox.Engine.Platform.Game.RunLoop()
at Sandbox.MySandboxGame.Run(Boolean customRenderLoop, Action disposeSplashScreen)
at SpaceEngineers.MyProgram.Main(String[] args)
Empty World with default settings and only Smart Turret Mod.
Tested Survival and Creative modes
I build always the same blocks:
1. Fighter Cockpit
2. Gatling Turret
Every time i try to enable the smart turret function my game crash.
If i save the game and reload before i hit the button it doesn't crash.
In the first case the default controls of the turret are missing.
I don't looked into your code but i think the bug is somewhere in the terminal controls initialisation.
EDIT: Sorry my bad, the default controls are not missing, they just are not at the top. Only the "Toggle Block" switch is missing.
But after saving and reloading all controls are where they should be
Is there a reason why you use a MySessionComponentBase instead of a MyGameLogicComponent for your turret logic?
This might be the problem with the crash and missing or unordered controls.
I use an intel i5 processor.
For the MyGameLogicComponent you have to add an MyEntityComponentDescriptor. I think [MyEntityComponentDescriptor(typeof(MyObjectBuilder_TurretBase), true)] is the correct one.
This is your script as GameLogicComponent without targeting stuff :D
This should initialize the TerminalControl correctly.
Only tested with vanilla turrets.