Uploaded game has problems (fixed)
RobBronson
10 Oct 2019, 18:49Hello all,
After working on my game for over 3 years now I finally uploaded it last night. It seems to be doing some funky stuff when I play it in the browser. Stuff it never did when I would play through, checking it in the editor.
I created the game offline...so, not sure if that has anything to do with it or not.
First issue I notice right away, is that every time I move from one room to another it adds in these lines.
( please see the image linked below)
https://i.postimg.cc/RVzqqCCz/lines01.jpg
I have no idea where they are coming from.
Second issue I noticed when playing a short way in...is that when entering a room...you meet a person that say's a certain thing. You leave the room and come back...this person is supposed to say something different. ( I use flags to do this) It works fine when testing it in the editor. However, now uploaded and in the browser, it repeats what was said the first time...adds one of those funky lines and then says the second thing.
As I said, these are just a couple things I have noticed so far. Any ideas of what may be going on, or how to fix it would be greatly appreciated.
Thx
mrangel
11 Oct 2019, 01:10I'm taking a look at the game now, and I can't work out what's going on. It looks like ClearScreen is behaving very oddly. I'll keep poking and see if I can figure it out.
mrangel
11 Oct 2019, 01:52OK… you have a turnscript called RmClear
which calls HidePreviousTurnOutput
. This interferes with the ClearScreen
function (which works differently in Quest 5.8 and later), causing it to output a horizontal line instead of clearing the screen.
More in-depth explanation
As of Quest 5.8, clearing the screen doesn't actually remove previous content, it just hides it. The text is left on the page but invisible, so that you can use it for debugging (in the JS console, or using Pixie's transcript system).
So, what's happening (as far as I can guess from reading the code) is:
ClearScreen
is called
a. A horizontal line is added, with classclearedAbove
b. All.clearedAbove
lines and everything above them is set to styleclearedScreen
c. A<style>
tag is printed, which causes all.clearedScreen
content to be invisible- The output for the first turn is sent to the screen, and the player responds.
- Next turn, your turnscript calls
HidePreviousTurnOutput
a. This removes all content output so far
b. It also removes the<style>
tag added in step 1c ClearScreen
is called again
a. A horizontal line is added, with classclearedAbove
b. All.clearedAbove
lines and everything above them is set to styleclearedScreen
c. The<style>
tag has already been added, so it isn't sent again
d. The horizontal line is now visible, because the browser doesn't know thatclearedScreen
is supposed to be hidden- Text for the second turn is output
My first suggestion would be to use `HidePreviousTurnOutput` **or** `ClearScreen`, but not both.
Alternatively, you could protect the style information by adding:
JS.eval("$('<style>').text('#divOutput > .clearedScreen { display: none; }').appendTo('head');")
to your UI Initialisation script.
RobBronson
11 Oct 2019, 16:12Once updated with the code you gave ...It is working perfectly. No more lines and my flags are working as they should.
Thank you So very much for your help.
Again...I very much appreciate all the help so many here have given me throughout the years I was working on this.