Online game differences

OurJud
I've just uploaded a section of my game for play testing, and noticed a few differences when running it online.

Firstly, the blue banner across the top of the screen with the 'save' button. Can this be disabled? It's not there when I run it through Quest on my desktop.

I don't know if in deleting everything but the rooms I want testing, I inadvertently deleted some code that hides it, but it would be a real shame if it has to be there when playing online, as it's like an ugly wart on my game.

Secondly, one part of the section I want testing uses a 'after a number of seconds' script, but online this is very erratic. Sometimes the script triggers immediately, sometimes after the correct 6 seconds, and sometimes not at all. It is imperative that the script waits the full six seconds, as it can be interrupted by the player to avoid death.

I'm now guessing this script is reliant on the player's internet speed, and if that is the case, is there a better way to do this so that the player gets a fair shot at avoiding death?

HegemonKhan
there's a known bug with Timers with on-line play, it'll get fixed in the next update, if it comes out (as currently Alex is working on revamping~rewriting quest: version 6.0 = QuestKit).

OurJud
That's disappointing. May have to think of an alternative.

Thanks.

Any idea about the banner?

The Pixie
I believe the timer bug has now been fixed (I had a test game that used timers, and that runs okay since the update). Try the abridged game off-line and see what happens.

It certainly is possible to remove the blue bar, as I have seen game without it, though I do not know how to myself.

george
If there isn't an option in the game setup to hide it, play the game online and open up your browser's developer tools to figure out what div the blue bar is in, then it should be possible to add CSS to hide it.

Alex
The blue bar is there for logged-in users, otherwise there's nowhere for the Save button to be.

You could hide it using some JS, but then players won't be able to save their progress when they play online.

Silver
Timers got fixed. I've not had any problems with them in online tests thus far anyway.

The Pixie
Alex wrote:The blue bar is there for logged-in users, otherwise there's nowhere for the Save button to be.

You could hide it using some JS, but then players won't be able to save their progress when they play online.

Can you not save by typing "Save"? What does request(RequestSave, "") do in an on-line game?

jaynabonne
I have code to hide the blue bar, if you're content with users having to type "save". I'll post it when I get home, unless someone beats me to it. :)

OurJud
jaynabonne wrote:I have code to hide the blue bar, if you're content with users having to type "save". I'll post it when I get home, unless someone beats me to it. :)

Thanks, I would very much appreciate that.

The Pixie wrote:

"Alex"

The blue bar is there for logged-in users, otherwise there's nowhere for the Save button to be.

You could hide it using some JS, but then players won't be able to save their progress when they play online.


Can you not save by typing "Save"? What does request(RequestSave, "") do in an on-line game?


I was wondering the same, TP. In fact I PM someone recently to ask if 'save' was a viable command option and was assured it was.

Also, I have tried the abridged game offline and the timer behaves how it should.

george wrote:If there isn't an option in the game setup to hide it, play the game online and open up your browser's developer tools to figure out what div the blue bar is in, then it should be possible to add CSS to hide it.

I've often wanted to do this, george, but as it doesn't use conventional browsers, I don;t see a way to open the browser's developer tools. The only one I ever use is Firefox's Firebug, but Quest doesn't use Firefox to run its games.

OurJud
Silver wrote:Timers got fixed. I've not had any problems with them in online tests thus far anyway.

Definitely still something wrong in this department... I'd suggest it might be my bad coding, but I don;t code, I use the UI. Anyway, I just tested the game again and the timer was triggered immediately (should be six seconds).

Silver
What about offline? If it works offline but not online there's an issue. If it doesn't work offline either then it's probably down to the code as afaik there was never an issue with timers in offline mode. Daft question but you are using the most current version of Quest? Should be 5.5.1 IIRC.

OurJud
Silver wrote:What about offline? If it works offline but not online there's an issue. If it doesn't work offline either then it's probably down to the code as afaik there was never an issue with timers in offline mode. Daft question but you are using the most current version of Quest? Should be 5.5.1 IIRC.

As I said in an earlier post, it's fine offline. And yep, running 5.5.1

Silver
Well that is strange. I haven't had any problems with timers and I've utilised five in my opening room.

jaynabonne
I use this to get rid of the blue bar:

   JS.eval("$('#status').hide();")

I don't know why you don't see the bar in the desktop version, as it's the same status bar there (the one that shows the room name). But... anyway. :)

OurJud
Silver wrote:Well that is strange. I haven't had any problems with timers and I've utilised five in my opening room.

Have you tested my game yet, to see if the timer works properly for you?

jaynabonne wrote:I use this to get rid of the blue bar:

   JS.eval("$('#status').hide();")

I don't know why you don't see the bar in the desktop version, as it's the same status bar there (the one that shows the room name). But... anyway. :)

Thanks, Jay. Where does this go, game start script, or game turn script?

Silver
I'm actually getting into the habit of copying code into a text file now instead of having to search for stuff weeks after I saw it mentioned.

Silver
OurJud wrote:

"Silver"

Well that is strange. I haven't had any problems with timers and I've utilised five in my opening room.


Have you tested my game yet, to see if the timer works properly for you?



Nope, I'll give it a whirl now.

OurJud
Silver wrote:I'm actually getting into the habit of copying code into a text file now instead of having to search for stuff weeks after I saw it mentioned.

I've started making back-up files of my whole game code, but I'm not sure it it works.

I open up notepad, then my game's entire code, select all, and then copy/paste it into notepad. Thing is, if I create a new game, then paste all this code into the template, It pastes it as one whole block, rather than breaking it into individual blocks as it does when Quest builds it. In other words, there's only one '+' expand for the whole block, when there's usually a number of these '+' expanders for the different blocks of code.

Silver
Maybe you need more dedicated software to do that. I'm sure I saw notepad++ (or similar) mentioned.

Silver
http://notepad-plus-plus.org/

OurJud
Thanks, Silver. Do you know what the difference is? I'm guessing this will paste the code as it appears in Quest, with all the various blocks?

Silver
I couldn't tell you as I haven't used it. Hopefully it keeps the code lines to how they should be when transferring them back and forth. I think HK said it's the software he uses for code.

OurJud
I just tried pasting my game code into it and while it does have the tree type connecting dots, it doesn't have the collapsible '+' as it does in Quest. The screenshots for the software show these '+', but it looks like quite a complex application.

If you're reading this, HK, how do I copy and save gamecode in Notebook++ properly?

Silver
Out of interest, why are you wanting to save the entire game code when it's already saved in your game? There's nothing *wrong* with doing it of course and it's a good exercise for learning other stuff. Just wondering why really.

OurJud
Silver wrote:Out of interest, why are you wanting to save the entire game code when it's already saved in your game? There's nothing *wrong* with doing it of course and it's a good exercise for learning other stuff. Just wondering why really.

Just because I'm paranoid about somehow losing it from the Quest folder. If I lost it, I don;t think I'd have the strength to start again... at least not with this game.

jaynabonne
The best place to put it is in a function named "InitUserInterface". That way, it will kick in both on game start and when a game is reloaded.

jaynabonne
As far as keeping your files safe, I use Mercurial to track my various changes. (it's handy if you need to go back versions or revert some bad changes.) But that's a bit more work to set up.

One thing that can make you feel more secure is to get set up with Dropbox and then keep your game file there. Not only will it be available online anywhere, but Dropbox also tracks changes so you can undelete files, go back versions, etc.

HegemonKhan
I don't think notepad++ backs up versions of files (though it has a ton of features, so maybe it does, no idea though), but what it does do, is to color your code, making it easier to read, write, and troubleshoot it, just copy and paste it into notepad++ (or just open up your *.aslx file into notepad++, too), and at the top, in the bar, under 'language', select 'XML'.

--------

@silver:

since you're documenting code now (saving useful code), you may want to use this method of mine for doing so:

name your actual file as: ______.aslx (both game files and library files use the same extension: .aslx)

copy and paste my library structure code in the link below into your library file:

viewtopic.php?f=18&t=4808

then copy and paste your codes into the proper sections of this library file.

enjoy :D

Silver
I use dropbox for files, not least because I might be in t'north or in the south. I lose the 48gig limit I was given with an EE contract in January :( although 3gig is plenty enough :)

OurJud
jaynabonne wrote:The best place to put it is in a function named "InitUserInterface". That way, it will kick in both on game start and when a game is reloaded.

Sorry, where do I find this 'InitUserInterface' ?

Pertex
Click 'Filter' at the left bottom corner of Quest, choose 'Show library elements' , search for the function and copy it into your game.

Silver
I'm wanting an audio effect for every negative response. I didn't realise how much stuff is in that library until I looked yesterday. :shock:

OurJud
Pertex wrote:Click 'Filter' at the left bottom corner of Quest, choose 'Show library elements' , search for the function and copy it into your game.

Thank you :)

Edit: That didn't work, but there's more than a chance I'm adding in incorrectly.

However

#status { display: none; visibility: hidden; }

in the game's CSS block did :)

Silver
The point they're making is if it isn't put into where they suggest, the code won't load in if someone saves a game then reloads from that position. So it'll only work for the first game session or if they start again from the beginning.

OurJud
Silver wrote:The point they're making is if it isn't put into where they suggest, the code won't load in if someone saves a game then reloads from that position. So it'll only work for the first game session or if they start again from the beginning.


Oh, I see.

I'll have to wait for Jay then, as it didn't work when I added the java script to the InitUserInterface whatsaname.

When I found the function as per pertex's instructions, I didn't have the usual 'copy' button, so presumed it must already have been added. There was already some java on that function, so I just hit the 'Add script'' button, chose 'add java' and pasted in the code. I then published and uploaded it, and still the blue banner was there.

Silver
Not sure where you looked but once you open that tree of zillions of game functions you highlight the one you want to copy over and then the copy button is at the top right of the screen - miles away from where you'd expect really but easily spotable.

OurJud
Silver wrote:Not sure where you looked but once you open that tree of zillions of game functions you highlight the one you want to copy over and then the copy button is at the top right of the screen - miles away from where you'd expect really but easily spotable.

Yup, that's just what I did, and the yellow bar with the copy button isn't there, meaning it must already have been copied over to my game. I added Jay's Java as a script, published and uploaded the game, but the blue save banner still shows.

I've just tried to test your theory about my CSS to hide the banner only working the first time, and while 'save' got the response 'Saved', neither 'load' nor 'load game' worked.

So how do I load a saved game??

Edit: Right, so I see that a 'Restore' button is added when you load the game up after saving, but I think my problems are only just starting (See new thread).

george
OurJud wrote:
I've often wanted to do this, george, but as it doesn't use conventional browsers, I don;t see a way to open the browser's developer tools. The only one I ever use is Firefox's Firebug, but Quest doesn't use Firefox to run its games.


On the desktop offline, hit the play button on the game you're working on, wait for it to start, then hit the F9 key on your keyboard (or go to View -> Developer Tools in the menubar).

OurJud
george wrote:

"OurJud"


I've often wanted to do this, george, but as it doesn't use conventional browsers, I don;t see a way to open the browser's developer tools. The only one I ever use is Firefox's Firebug, but Quest doesn't use Firefox to run its games.



On the desktop offline, hit the play button on the game you're working on, wait for it to start, then hit the F9 key on your keyboard (or go to View -> Developer Tools in the menubar).



Oh, right. I'll try that. Thanks.

Silver
Alex wrote:The blue bar is there for logged-in users, otherwise there's nowhere for the Save button to be.

You could hide it using some JS, but then players won't be able to save their progress when they play online.


I've been thinking about this - I've never once clicked the Save button on the blue bar but the website still remembers my last position.

Silver
jaynabonne wrote:I use this to get rid of the blue bar:

   JS.eval("$('#status').hide();")

I don't know why you don't see the bar in the desktop version, as it's the same status bar there (the one that shows the room name). But... anyway. :)


It doesn't show in my offline game either (presumably because I've disabled the room name in the game setup). You can save the game in offline mode using the tool bar anyway.

Silver
jaynabonne wrote:I use this to get rid of the blue bar:

   JS.eval("$('#status').hide();")

I don't know why you don't see the bar in the desktop version, as it's the same status bar there (the one that shows the room name). But... anyway. :)


I can't get this to work. I put it in inituserinterface and it persists. Bizzarely if I quit an online game and reload it gets rid of it. So I decided to put it in the game start script too but no joy.

jaynabonne
Can you show your entire InitUserInterface function?

Silver
Yeah, I'm afk atm but will post up as soon as I'm back. You'll see my other cockup in there too lol.

Silver
JS.eval ("$('#status').hide();")
JS.SetBackgroundCol ("black")
JS.eval ("$('#txtCommandDiv').prepend('> ')")
request (SetInterfaceString, "TypeHereLabel=")
OutputTextNoBr (RetroStyleHolder.css)
if (GetBoolean(game, "inprogress")) {
}
else {
game.inprogress = true
}


It currently looks like that.

Pertex
Try to move OutputTextNoBr (RetroStyleHolder.css) to the top of the function. Perhaps it's a matter of order

Silver
I'll try that, but I think that's how it was originally (I added code to the end) and then I thought it might be a matter of order too so moved two lines to the top.

jaynabonne
I had hoped to actually see the function part of it, to verify the name. :) Is any of what's in there working?

Silver
I was thinking am I supposed to create:

JS.eval ("$('#status').hide();")


As a function and call it from inituserinterface instead of just putting the JS code in there?

Your retro library works fine and the hiding of the save bar works when the game is reloaded, just not when it's loaded for the first time lol. I can pm a link to the online game file if you want.

Silver
Or the .aslx

Silver
Oh hang on, there's nothing inside the function. That's all inside the script. Is that what I've done wrong?

Silver

jaynabonne
That's fine. Thanks

Silver
I've now removed Pertex's border colour JS from my start script and it still fires in from inituserinterface so everything is working as it should be from there. Thinking about it some more I remember this comment you made up thread:

jaynabonne wrote:
I don't know why you don't see the bar in the desktop version, as it's the same status bar there (the one that shows the room name). But... anyway. :)


I've selected for the status bar to be removed from my game. So is Quest generating something else that houses the blue bar with the save that is something different than what your JS function is trying to get rid of? Actually, as an experiment, I'll re-implement the status bar in the game options and see what that does.

Silver
Aggh, no. That just shows the location bar in my offline game now. But I reckon that's where the issue is.

Silver
OurJud wrote:

"Pertex"

Click 'Filter' at the left bottom corner of Quest, choose 'Show library elements' , search for the function and copy it into your game.


Thank you :)

Edit: That didn't work, but there's more than a chance I'm adding in incorrectly.

However

#status { display: none; visibility: hidden; }

in the game's CSS block did :)



Where did you put this?

OurJud
In the game's main code, SIlver, accessed via the 'code' button next to the 'play' button at the top, if memory serves. There should be a small block of CSS at the top - put it anywhere in there.

If the block of CSS isn't there, put this on the line after "<firstpublished>2014</firstpublished>"

<css><![CDATA[

<style type="text/css">
#status { display: none; visibility: hidden; }
</style>


Any further CSS you would like to add just goes on its own line between the <style> tags.

Silver
I'm getting errors when I try that. This is proper maddening lol.

OurJud
Do you mean errors when you play the game, or errors when you try to add it to your code.

You'll have to remind me what that line of CSS does anyway, as I forget now. It obviously hides something, but what?

Actually, you might have to wait for Jay on this one, because when I think about it, I think the CSS has to be 'called' from somewhere, but I wouldn't even know where to look.

Silver
It removes the blue bar on the top of the screen in online play whose only purpose is to give people an option to click 'save'. It looks really out of place in my game though and I'm going to create my own way of saving anyway - it only calls a command anyway.
I tried adding your code to game attributes - you click 'add' and then you have to type something so I typed css. Maybe I needed to type .css I'm sure I'm on the right track there. Jay says his code works for him so I don't know why it doesn't for me.

jaynabonne
The CSS was added for another reason. It's not a standard feature of Quest, as such. If you do want to add the CSS, then you need a full block:

<css><![CDATA[

<style type="text/css">
#status { display: none; visibility: hidden; }
</style>
]]>
</css>

That needs to be added as an attribute in your game object, so be sure you nest it within the <game> </game> tags.
Then in your InitUserInterface, add:

OutputTextNoBr(game.css)


If you were amenable to either posting your game or pointing me to your current (private, I assume) online version, I could take a closer look.

OurJud
jaynabonne wrote:The CSS was added for another reason. It's not a standard feature of Quest, as such. If you do want to add the CSS, then you need a full block:

<css><![CDATA[

<style type="text/css">
#status { display: none; visibility: hidden; }
</style>
]]>
</css>



That's strange. When I was looking at my own game code for the CSS block code, I did wonder about the </css>, but when I did a 'find' for it, it didn't find it, so I just presumed <css> didn't need a closing tag.

jaynabonne
Silver, I ran the version you sent me a link to, and I didn't see the blue bar on Chrome or in Quest. Which browser and/or platform are you using?

Silver
Well that is confusing. I'm using Chrome on Windows 8 (yuck). If I play Spondre online I see no blue bar but with my game I do see it.

Silver
But if I stop the game and then click 'resume' it doesn't load it! Lol I might go and check it from a web cafe after work.

Silver
I'm yet to check it from another machine but I can't help but think that the problem in part might be linked to my account. Jay, were you logged in when you tried it online? If so it points towards cache/cookies or something else server side that knows I've played it when the save bar was visible.

jaynabonne
Fair point - I wasn't logged in. When I did log in, I saw the blue bar.

I've been looking through the player code, and I see some code there that turns the status bar back on when certain other panes are visible. In particular, if the location element is visible, it will turn the status bar back on. I think the reason it didn't happen for me is that I have this (in part):

    request (Hide, "Panes")
request (Hide, "Location")
request (Hide, "Command")
JS.eval("$('#gameContent').width(870)")
JS.eval("$('#status').hide();")

Basically, I have hidden those various UI elements *before* I hide the status bar. That seems to keep the player from turning it back on. If you have the ability to rearrange the hiding of your panes, it might work for you too.

Silver
Ah, so you hid the panes etc manually - when I did it Quest 5.5 came out where you could implement 'themes' which hid them. I'll have a play about with this. Thanks.

Silver
I've changed the theme back to unthemed, put that code into both inituserinterface and the start script and still no joy. I've lost interest now tbh. I'm looking forward to trying out 5.6 beta where I hope html5 works. If it does I don't even need to upload anything anymore when testing it. If it doesn't work online at the end of the day I'll either ask Alex how to make it work online or I'll disable online play with a hack. I can't spend days and days on this.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums