Alert shows on load

Announcements, support questions, and discussion for the Dialogue System.
User avatar
supadupa64
Posts: 200
Joined: Sun Mar 06, 2016 9:40 pm
Contact:

Alert shows on load

Post by supadupa64 »

A lot of the time an alert plays when I load a game, which I don't want to happen.

When I pick up items I have it set to play an alert on pick up, which works great. But when I load a game, it's like the game reminds itself with an alert of the last item picked up.

Do you have any idea on how to check this out?
User avatar
Tony Li
Posts: 22118
Joined: Thu Jul 18, 2013 1:27 pm

Re: Alert shows on load

Post by Tony Li »

Hi Scott -

Is the alert configured in an Increment On Destroy component?

If so, it's possible that the Increment On Destroy is firing when Unity unloads the previous scene prior to loading the saved game scene. The load process is supposed to send a "LevelWillBeUnloaded" message to all persistent data components (such as Increment On Destroy) so they know to ignore the unload/destroy event. But it's possible something may be misconfigured there. If you suspect this is what's happening, let me know.

Otherwise, if you can reproduce the problem in the editor, temporarily set the Dialogue Manager's Debug Level to Info. Reproduce the problem and look for lines in the Console window around that event. If you find any, please post them here.
User avatar
supadupa64
Posts: 200
Joined: Sun Mar 06, 2016 9:40 pm
Contact:

Re: Alert shows on load

Post by supadupa64 »

The alert is on the Increment On Destroy component. That component is also the one that disables mouse scroll control in the inspector view and distorts the information there when expanded.
User avatar
Tony Li
Posts: 22118
Joined: Thu Jul 18, 2013 1:27 pm

Re: Alert shows on load

Post by Tony Li »

Temporarily set your Dialogue Manager's Debug Level to Info. Then load a game. In the Console window, look for this message:

Code: Select all

Dialogue System: Broadcasting that level will be unloaded.
That message tells components like Increment On Destroy that they're going to be destroyed because Unity is unloading the level, so they shouldn't actually trigger this time.

If you don't see that message, please remind me what method you're using to load games.
User avatar
supadupa64
Posts: 200
Joined: Sun Mar 06, 2016 9:40 pm
Contact:

Re: Alert shows on load

Post by supadupa64 »

I haven't seen it again because it looks like it all works when I play and load in the editor. But when I built it, it does it a lot. I'll try it again.
User avatar
Tony Li
Posts: 22118
Joined: Thu Jul 18, 2013 1:27 pm

Re: Alert shows on load

Post by Tony Li »

Hi,

Try making a development build with the Dialogue Manager's Debug Level set to Info. Then reproduce the problem. Check the output_log.txt file for that line ("Broadcasting that level will be unloaded").
User avatar
supadupa64
Posts: 200
Joined: Sun Mar 06, 2016 9:40 pm
Contact:

Re: Alert shows on load

Post by supadupa64 »

There are no problem with loading the game or saving the game within the editor play mode. The only time I see an alert is when I quit to menu and strangely it starts playing my scene 1 splash screen. I assume there's an easy fix for that in the save load function though.

It's looks like for the most part only in a build things get messed up. I get these alerts a lot on load and sometimes my controls get messed up making it impossible to navigate. I was asking Opsive about it and he thought it was because of performance bottleneck. Not so sure about that.

I ran the dialogue manager info and pulled this up:
Dialogue System: Lua(Variable["Alert"]=""; Variable["EntryPoint"]=""; Variable["ItemsFound"]=0; Variable["numscrollsfound"]=10

It's actually really long, but is how it starts and proceeds to list every variable and looks like everything. It does pull this alert first thing though.

Anyway, do you know what could cause the build to not build correctly and allow these alerts?
User avatar
Tony Li
Posts: 22118
Joined: Thu Jul 18, 2013 1:27 pm

Re: Alert shows on load

Post by Tony Li »

Hi Scott,

That line ("Dialogue System: Lua...") shows the Dialogue System is initializing the Lua environment. When you load a game, there should be a similar line such as "Dialogue System: Loading saved game data: ..."

To eliminate Opsive's hypothesis about performance bottlenecks, make some really simple temporary scenes for the menu and a level. For example, the level could contain the player, just a quad for the floor, and some of those IncrementOnDestroy objects. Set the Dialogue Manager's Debug Level to Info. Then try out a build using only these scenes.

If the problem goes away, Opsive might have a point; and in this case we know to look at the performance bottleneck.

If the problem remains, look at the output_log.txt file. Check for any warnings that the Dialogue System might have logged for you.
User avatar
supadupa64
Posts: 200
Joined: Sun Mar 06, 2016 9:40 pm
Contact:

Re: Alert shows on load

Post by supadupa64 »

Before I dive into those other things you suggested, I did notice this one thing. When I'm loading a game the player ports to the very start of the game, then to the spot where he is supposed to be. I don't really care about that, but I was watching the quests that are being tracked in the top of the screen and noticed that if I was on a quest collecting 10 scrolls and I had currently collected 5/10, on a frame in between the loading it says something like 8/10 collected or 9/10 collected. I saw it change a couple times which probably is the cause of this alert being shown on load.

Do you know how this could happen?
User avatar
supadupa64
Posts: 200
Joined: Sun Mar 06, 2016 9:40 pm
Contact:

Re: Alert shows on load

Post by supadupa64 »

By the way, I reproduced the problem while running the profiler and noticed a lot loading with quest tracker. Do you think this is bottlenecking my TPC controls?
questlag1.jpg
questlag1.jpg (253.38 KiB) Viewed 2901 times
loadlag1.jpg
loadlag1.jpg (234.08 KiB) Viewed 2901 times
Post Reply