BUG: Message Dialogs don't go away

Started by thepenguin, July 01, 2014, 08:02:17 AM

Previous topic - Next topic

thepenguin

If you load the attached map in the editor, after you click a button the messagebox does not go away, even though it should.

Here's my logs:
Initialize engine version: 4.2.0f4 (38efbd14869d)
GfxDevice: creating device client; threaded=1
Direct3D:
   Version:  Direct3D 9.0c [aticfx64.dll 8.17.10.1116]
   Renderer: AMD Radeon HD 7520G
   Vendor:   ATI
   VRAM:     1258 MB (via DXGI)
   Caps:     Shader=30 DepthRT=1 NativeDepth=1 NativeShadow=1 DF16=1 DF24=1 INTZ=1 RAWZ=0 NULL=1 RESZ=1 SlowINTZ=1
Begin MonoManager ReloadAssembly
Platform assembly: C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\UnityEngine.dll (this message is harmless)
Loading C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\UnityEngine.dll into Unity Child Domain
Platform assembly: C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\Assembly-CSharp-firstpass.dll (this message is harmless)
Loading C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\Assembly-CSharp-firstpass.dll into Unity Child Domain
Platform assembly: C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\Assembly-CSharp.dll (this message is harmless)
Loading C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\Assembly-CSharp.dll into Unity Child Domain
Platform assembly: C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\Assembly-UnityScript-firstpass.dll (this message is harmless)
Loading C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\Assembly-UnityScript-firstpass.dll into Unity Child Domain
Platform assembly: C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\Assembly-UnityScript.dll (this message is harmless)
Loading C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\Assembly-UnityScript.dll into Unity Child Domain
- Completed reload, in  1.666 seconds
<RI> Initializing input.

<RI> Input initialized.

desktop: 1366x768 60Hz; virtual: 1366x768 at 0,0
Platform assembly: C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\System.Xml.dll (this message is harmless)
Platform assembly: C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\System.Core.dll (this message is harmless)
Platform assembly: C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\UnityScript.Lang.dll (this message is harmless)
Platform assembly: C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\Boo.Lang.dll (this message is harmless)
Platform assembly: C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\System.dll (this message is harmless)
UnloadTime: 0.533048 ms
Game Version: 1.00

(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/StandalonePlayer/UnityEngineDebug.cpp Line: 54)

Unloading 3 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 10 unused Assets to reduce memory usage. Loaded Objects now: 5278.
Total: 5.584280 ms (FindLiveObjects: 0.533428 ms CreateObjectMapping: 0.067628 ms MarkObjects: 3.841140 ms  DeleteObjects: 0.090424 ms)

Number overflow.

(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/StandalonePlayer/UnityEngineDebug.cpp Line: 54)

Platform assembly: C:\Program Files\KnuckleCracker\Creeper World 3\CW3_Data\Managed\Mono.Security.dll (this message is harmless)
Fallback handler could not load library C:/Program Files/KnuckleCracker/Creeper World 3/CW3_Data/Mono/.\/System/Library/Frameworks/Security.framework/Security
Fallback handler could not load library C:/Program Files/KnuckleCracker/Creeper World 3/CW3_Data/Mono/lib/System/Library/Frameworks/Security.framework/Security
Fallback handler could not load library C:/Program Files/KnuckleCracker/Creeper World 3/CW3_Data/Mono/.\lib/System/Library/Frameworks/Security.framework/Security
Fallback handler could not load library C:/Program Files/KnuckleCracker/Creeper World 3/CW3_Data/Mono/lib/System/Library/Frameworks/Security.framework/Security
Fallback handler could not load library C:/Program Files/KnuckleCracker/Creeper World 3/CW3_Data/Mono/.\/System/Library/Frameworks/Security.framework/Security
Fallback handler could not load library C:/Program Files/KnuckleCracker/Creeper World 3/CW3_Data/Mono/lib/System/Library/Frameworks/Security.framework/Security
Fallback handler could not load library C:/Program Files/KnuckleCracker/Creeper World 3/CW3_Data/Mono/.\lib/System/Library/Frameworks/Security.framework/Security
Fallback handler could not load library C:/Program Files/KnuckleCracker/Creeper World 3/CW3_Data/Mono/lib/System/Library/Frameworks/Security.framework/Security
NullReferenceException: Object reference not set to an instance of an object
 at SettingsHandler.OnPress (Boolean isDown) [0x00000] in <filename unknown>:0
UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
UICamera:Notify(GameObject, String, Object)
UICamera:ProcessTouch(Boolean, Boolean)
UICamera:ProcessMouse()
UICamera:Update()

(Filename:  Line: -1)

UnloadTime: 19.590574 ms
Unloading 3 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 276 unused Assets to reduce memory usage. Loaded Objects now: 2595.
Total: 9.761663 ms (FindLiveObjects: 0.313826 ms CreateObjectMapping: 0.163751 ms MarkObjects: 5.734354 ms  DeleteObjects: 1.670573 ms)

Unloading 0 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 2575.
Total: 7.733191 ms (FindLiveObjects: 0.360178 ms CreateObjectMapping: 0.178569 ms MarkObjects: 5.428887 ms  DeleteObjects: 0.026595 ms)

UnloadTime: 5.023876 ms
Game Version: 1.00

(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/ExportGenerated/StandalonePlayer/UnityEngineDebug.cpp Line: 54)

Unloading 2 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

Unloading 109 unused Assets to reduce memory usage. Loaded Objects now: 5383.
Total: 13.312913 ms (FindLiveObjects: 0.587759 ms CreateObjectMapping: 0.180089 ms MarkObjects: 10.249879 ms  DeleteObjects: 0.438064 ms)

We have become the creeper...

knucracker

It has something to do with "TRUE OperateWhilePaused" in your Introduction script.  If I remove that line and reload the game, the message dialog will dismiss properly.  What, exactly, I don't know.  But this is where to start for developing a workaround....

thepenguin

#2
Quote from: virgilw on July 01, 2014, 10:39:59 AM
It has something to do with "TRUE OperateWhilePaused" in your Introduction script.  If I remove that line and reload the game, the message dialog will dismiss properly.  What, exactly, I don't know.  But this is where to start for developing a workaround....
Well, this is a (very) trimmed down version of a larger script, and the larger one cannot work without that line.  (it still has to run during pause cycles).

Also, could this line have anything to do with the problem?
IsPaused not <-PauseMode and if PauseGame endif
PauseMode is always true in that mini-script (it is set in the leading once block), so this line effectively locks the game in pause.
We have become the creeper...

knucracker

Looks like it is only related to the script being put in OperateWhilePaused mode.  The reason is that there is a handler that will show a message dialog in the first invocation of a core if the game is saved with a message dialog showing.  So there is this code in a core

if (messageDialogIsShowing && invocationCount == 0) {
CRPLInfoPanel.ShowInfoMessage(messageDialogMessage, -1, messageDialogOkTitle, messageDialogCancelTitle, new CRPLInfoPanel.InfoPanelButtonCallback(InfoMessageCallback));
}


messageDialogIsShowing is a bool that gets persisted with a mission.  So a core looks at that and then calls ShowInfoMessage if it is true.  Unfortunately, invocationCount only gets incremented when the game is not paused.  That's why when you click one of the buttons in the dialog it flashes.  It is going away but next frame it is being put back.  The game thinks it was just loaded.

So this logic never accounted for a message dialog being saved in a core that is set to operate while paused.

The ways to work around this would be to not save the mission with a message dialog showing, or to show the message from a core that isn't set to OperateWhilePaused.  Either of those should do the trick.  Of course nothing prevents a user from saving the mission while a dialog is up, so that could still be problematic.  Showing the dialog from a script not set to operate while paused would be better.  If you need to do it as soon as the mission loads (or check to see if it should be done) then you should be able to do it in a core with a Awake or GameLoaded handler.


thepenguin

I think I found a workaround for it.
We have become the creeper...