Game crash when loading smaller script into PB, after looking at a larger script

Decker_MMIV shared this bug 14 months ago
Solved

- Viewing a larger (many lines) script in the Programmable Block, and having the cursor/caret positioned many lines down (like at the last line of the script), possibly having scrolled down.

- Without leaving the PB editor, then when loading another script that is shorter (fewer lines), it causes SE to crash-to-desktop.

Problem could be, that the cursor/caret is not reset to top-left when loading a new script into the PB.


From SpaceEngineers.log file:

Thread:   1 ->  Exception occured: System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Text.StringBuilder.get_Chars(Int32 index)
   at System.Text.StringBuilderExtensions_Format.AppendSubstring(StringBuilder stringBuilder, StringBuilder append, Int32 start, Int32 count)
   at Sandbox.Graphics.GUI.MyGuiControlMultilineEditableText.GetCarriageOffset(Int32 idx)
   at Sandbox.Graphics.GUI.MyGuiControlMultilineText.ScrollToShowCarriage()
   at Sandbox.Graphics.GUI.MyGuiControlMultilineEditableText.set_Text(StringBuilder value)
   at Sandbox.Game.Gui.MyGuiScreenEditor.ScriptSelected(String scriptPath)
   at Sandbox.Game.Gui.MyGuiIngameScriptsPage.OnScriptDownloaded()
   at ParallelTasks.Parallel.RunCallbacks()
   at Sandbox.Game.World.MySession.Update(MyTimeSpan updateTime)
   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)

Comments (4)

photo
1

Hello,

Could you please provide us with more information regarding the issue you reported? I wasn't able to reproduce it. If it still happens to you, could you please provide both scripts and eventually also a video with the issue would help us.

Thank you.

Kind Regards

Keen Software House: QA Department

photo
1

SE v1.187.204


1) Subscribe to the following in-game scripts. - Please note that these are only used here as examples for reproducing this issue. Any other 'big/small' scripts will also cause it:


2) Make sure that these settings are enabled (as PB only exist in 'experimental mode'):

  • 'Experimental mode'
  • 'In-game scripts'


3) Create a new empty world (remember to enable 'in-game scripts'), with 'creative'.


4) Place a Programmable Block and begin editing its script.


5) Browse scripts, select the 'big script'; "Automatic LCDs 2" and press 'ok' to load it into the PBs code-editor.

bedabe3acb8b72686b54d1b9e74e137e


6) Important for the bug to occur. In the PB code-editor with this 'big script', scroll down to the bottom and explicitly place the cursor at a source-line that will be past the number of source-lines of the 'smaller script'.

61f1a6bf74c11ab64dbf6d195c681541


7) Browse scripts again, now select the 'small script'; "Isy's Ship Refuler" and press 'ok'.

52b0ef70103d15053d081e355db1620c


8) Crash happens, where log contains the exception/stacktrace provided in the first post of this bug-report.

photo
1

Thank you Decker! I was finally able to reproduce it. Thanks for detailed reproduction steps, it helped. I reported it into our system and we will share more information regarding any progress made on this issue with you once we have more information.

Kind RegardsKeen Software House: QA Department

photo
photo
1

Issue has been fixed in version 188.