All custom styling lost on 'restore'

OurJud
I've just noticed when testing the save/restore functions of my test game, that all the custom styling I've added is lost when the game is restored after a save.

It retains the default settings, but anything I've done with java or CSS is lost.

All I get on restore in a black page with a huge white input box stretching across the screen. It doesn't even load any text until you input a command, so how is the player supposed to know what to type? Surely it should load the location at which you saved?

Also, despite adding Jay's java to the InitUserInterface function, the blue save banner returns.

Pertex
I think without seeing your code we can't help you with this problem

jaynabonne
You must put all your custom styling in the InitUserInterface function as well.

But as Pertex says, it would really help to see the code. It could be a simple typo, which is impossible to determine without seeing what's actually been done.

Silver
IIRC Jud lost all his styling on a thread (which I now can't find so must have been bolted on to the end of a different discussion) where he was trying to change the look of the text inputter / parser. He solved that problem by deleting some game code and replacing it with his own. On that very same thread I pointed out that a reload would cause this problem which was when Jay created a library instead which should solve that issue. Is this those chickens now coming home to roost?

On another thread I asked whether my sounds would reload after a save and was given some code that would check for the current audio status. Would that code not help here? Unfortunately I have no idea where that thread is either. The forum has got incredibly busy recently meaning stuff is a lot harder to locate (hence me making my own notes now on codes and URLs I need to remember which I probably should have been doing from the outset).

OurJud
jaynabonne wrote:You must put all your custom styling in the InitUserInterface function as well.

But I did this with the java you supplied for getting rid of the blue 'save' banner when playing online, and it didn't work.

To be honest with you, without step by step instructions, I'm not sure how to add all this stuff to the InitUserInterface function. Pertex says I need to copy over to my game then add your java, but it already was added. I put your java in as a script, but it didn't work.

Let me just explain that this has come about after uploading part of the game I'm working on. Could this be the problem? Could it be that I've missed some coding that is in my main game, when uploading this tester?

I made the tester by loading up my main game, then I saved it under a different name and deleted all the rooms and objects that weren't relevant to the part I wanted testing. I then published and uploaded.

Anyway, here is the entire code for the tester that is refusing to remember my custom styling.

<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="dimsome.aslx" />
<include ref="ConvLib.aslx" />
<game name="cloud9">
<gameid>9a1d4594-5b10-4e9d-a683-6178dda5f4c0</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<css><![CDATA[

<style type="text/css">
body {
line-height: 1.2em;
}

div#txtCommandDiv {
border:0;
background: no-repeat;
font-size:10px;
font-family:'Trebuchet MS', Helvetica, sans-serif;

}
input#txtCommand {
outline:none;
border:0;
font-size:10px;
margin:0;
padding:0;
max-width: 1000px;
}
a.cmdlink {
display: none;
visibility: hidden;
}
#status {
display: none;
visibility: hidden;
}
</style>

]]></css>
<showtitle type="boolean">false</showtitle>
<enablehyperlinks type="boolean">false</enablehyperlinks>
<defaultfontsize type="int">11</defaultfontsize>
<setbackgroundopacity />
<backgroundopacity type="double">1</backgroundopacity>
<showpanes type="boolean">false</showpanes>
<showcommandbar />
<showlocation type="boolean">false</showlocation>
<showborder type="boolean">false</showborder>
<attr name="autodescription_youcansee" type="int">0</attr>
<attr name="autodescription_youcango" type="int">0</attr>
<attr name="autodescription_youarein_useprefix" type="boolean">false</attr>
<autodescription />
<setcustomwidth />
<customwidth type="int">1270</customwidth>
<setcustompadding />
<custompaddingright type="int">500</custompaddingright>
<custompaddingleft type="int">100</custompaddingleft>
<defaultfont>'Trebuchet MS', Helvetica, sans-serif</defaultfont>
<defaultwebfont>ABeeZee</defaultwebfont>
<defaultbackground>Black</defaultbackground>
<defaultforeground>LightGrey</defaultforeground>
<showdescriptiononenter />
<attr name="changeroom_newline" type="boolean">false</attr>
<attr name="autodescription_youarein" type="int">0</attr>
<cover type="string"></cover>
<custompaddingbottom type="int">100</custompaddingbottom>
<echocommand />
<attr name="autodescription_youcango_newline" type="boolean">false</attr>
<appendobjectdescription type="boolean">false</appendobjectdescription>
<category>Sci-Fi</category>
<autodisplayverbs type="boolean">false</autodisplayverbs>
<feature_asktell />
<feature_lightdark />
<underlinehyperlinks type="boolean">false</underlinehyperlinks>
<defaultlinkforeground>Black</defaultlinkforeground>
<start type="script">
</start>
<roomenter type="script">
</roomenter>
<turnscript>
<enabled />
<script>
JS.eval ("$('div[id^=\"divOutputAlign\"]').css('opacity', '0.5');")
JS.eval ("getCurrentDiv().css('opacity', '1.0');")
</script>
</turnscript>
</game>
<verb name="wear">
<pattern>wear #object#</pattern>
<property>wear</property>
<defaulttemplate>DefaultWear</defaulttemplate>
</verb>
<command name="go">
<pattern type="string"><![CDATA[^enter (?<exit>.*)$|^go to (?<exit>.*)$|^go (?<exit>.*)$|^(?<exit>north|east|south|west|northeast|northwest|southeast|southwest|in|out|up|down|n|e|s|w|ne|nw|se|sw|o|u|d)$]]></pattern>
<unresolved>You can't go there.</unresolved>
<script>
if (exit.visible) {
if (exit.locked) {
msg (exit.lockmessage)
}
else if (exit.runscript) {
if (HasScript(exit, "script")) {
do (exit, "script")
}
}
else if (exit.lookonly) {
msg ("You can't go there.")
}
else {
game.pov.parent = exit.to
}
}
else {
msg ("You can't go there.")
}
</script>
</command>
<object name="intro">
<inherit name="editor_room" />
<description type="script"><![CDATA[
msg ("<b>Section for play testing purposes.<br/><br/>I am not asking for any typos to be pointed out at this point, just that you are able to finish this section of my game, and get one of two results: win or lose. And also that things work logically and that the player's purpose is clear.<br/><br/>I have not added all the 'descriptions' for these various characters.<br/><br/>The code word for this test, is '1234', and you will be asked for it at the drugden.<br/><br/>Please press a key when you are ready to start the test.</b><br/><br/>.......................................................................................<br/>")
wait {
MoveObject (player, the slums)
}
]]></description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="talkingchar" />
<drop type="boolean">false</drop>
<attr name="feature_usegive" type="boolean">false</attr>
<use type="script">
if (Got(gun)) {
msg ("You reach round your back and take out your gun.")
}
else if (not Got(gun)) {
msg ("You reach round your back to grab your gun, only to realise it's not there.")
}
</use>
</object>
</object>
<verb name="dress">
<property>dress</property>
<pattern>dress #object#</pattern>
<defaultexpression>"You can't dress " + object.article + "."</defaultexpression>
<defaulttemplate>DefaultDress</defaulttemplate>
</verb>
<verb name="fire">
<property>fire</property>
<pattern>fire #object#</pattern>
<defaultexpression type="string"></defaultexpression>
</verb>
<object name="the slums">
<inherit name="editor_room" />
<alias>slums</alias>
<description type="script"><![CDATA[
firsttime {
msg ("A fair amount of noise and activity is coming from one of the apartments to your north. A black rectangle in the wall where the boarding once stood leads into the darkness.<br/>")
}
otherwise {
}
]]></description>
<beforeenter type="script">
</beforeenter>
<exit alias="north" to="drugden">
<inherit name="northdirection" />
</exit>
</object>
<object name="drugden">
<inherit name="editor_room" />
<description type="script"><![CDATA[
SetObjectFlagOn (player, "knapsack")
firsttime {
msg ("You step into the corridor of the building, then left though a black drape hung over the doorway.<br/><br/>The room is thick with smoke and the unmistakeable stench of weed. A man lounges in a tatty old armchair, and stood either side of him, two shaven-headed men, bred for fighting.<br/><br/>The two men move forward quickly and throw your arms up in the air. Frisking time!<br/><br/>You wait patiently as they pat you down. Finally satisfied, the two gorillas step back and nod to the man in the armchair.<br/><br/>\"Okay, grandpa, what can I do for you?\"<br/><br/>You drop into character and beging shifting uncomfortably. \"I just need some Yellows, that's all. Just for a bit of escape. Nothing heavy.\"<br/><br/>\"Dream Enhancers, huh? Well I sincerley hope you have the magic word.\"")
}
otherwise {
msg ("\"Back again? Got a name yet?\"")
}
]]></description>
<command>
<pattern>#text#</pattern>
<script><![CDATA[
msg ("The two goons moved forward and grab you under the arms before you can do anything.<br/><br/>\"Get him out of here, fellas.\"<br/><br/>They frog-march you to the door and hurl you into the street.<br/>")
SetTimeout (6) {
MoveObject (player, the slums)
}
]]></script>
</command>
<command>
<pattern>say 1234; 1234</pattern>
<script><![CDATA[
msg ("<br/>He eyes you for a while, playing with your mind. You try to look frightened and hope you pull it off.<br/><br/>Eventually he nods towards a door behind him. You nod back and move to the door.<br/><br/>..........................................................................................<br/>")
wait {
MoveObject (player, backroom)
}
]]></script>
</command>
<object name="shootout">
<inherit name="editor_room" />
<description type="script"><![CDATA[
if (game.pov.parent = shootout) {
msg ("<br/>\"Drop the gun!\" the goon screams.<br/><br/>Through the open door you see his two asscoiates making a run for it - obviously not got the stomach for this kind of thing.<br/><br/>\"Drop it! He repeats. \"You've got ten seconds. before I pull the trigger!\"<br/><br/>\"Fuck ten seconds!\" Luke yells. \"Shoot him now, you immecile! This isn't the NYPD!\"<br/>")
SetTimeout (25) {
msg ("The man fires, but misses.")
}
}
]]></description>
<command>
<pattern>shoot goon; shoot; kill goon; shoot at goon; shoot him; fire; fire at goon; fire gun at goon; shoot goon; kill thug, shoot at thug</pattern>
<script>
msg ("You shoot the goon.")
MoveObject (player, shoottrue)
</script>
</command>
<command>
<pattern>#text#</pattern>
<script>
msg ("The goon fires his gun.")
</script>
</command>
<command>
<pattern>duck; hide behind desk; duck behind desk; take cover</pattern>
<script>
msg ("You drop behind the desk just as the goon fires. You here the bullet crack into the plaster wall above your head.")
</script>
</command>
<command>
<pattern>shoot luke; kill luke; fire at luke</pattern>
<script><![CDATA[
msg ("<br/>You turn the gun on Luke and pull the trigger, He drops like a sack and lies still.")
]]></script>
</command>
<command>
<pattern>drop gun; drop handgun; drop meson; surrender; give up; put hands up</pattern>
<script><![CDATA[
msg ("<br/>You drop the gun and show the goon your empty hands. \"Okay. Let's not do anything silly here.\"<br/><br/>Obvioulsy they didn't consider beating you half to death as silly.<br/>")
SetTimeout (6) {
msg ("<br/>You come round under a deserted food stall. Your left eye won't open and your tongue finds a gap between your teeth that wasn't there before. There's metalic taste in your mouth. You spit out a gobbule of thick red saliva and muscus as you climb to your feet and dust yourself off.<br/>")
wait {
}
MoveObject (player, the slums)
}
]]></script>
</command>
</object>
<object name="backroom">
<inherit name="editor_room" />
<description type="script"><![CDATA[
msg ("You open the door and step into the room, closing the door behind you. The air smells fresher in here and the room is well kept.<br/><br/>A man in his 40s sits behind a desk. You guess this must be Luke. You quickly scan the desk for his weapon, but see nothing. No doubt he's packing something somewhere.<br/><br/>You suddenly wish you'd given your plans more thought. No need to fake your fear now.<br/><br/>\"Oi! I haven't got all day. What are you after?\"<br/><br/>\"Uum... some Yellows.\"<br/><br/>The man opens a draw, reaches inside and pulls out a handgun. He places it on the table then reaches back into the draw and produces a large quanity of yellow pills in a clear plastic bag.<br/><br/>As he struggles with the knot fastening the bag, you eye his gun and wonder if you could reach it before him. The saftey catch is off and you prey it's loaded.<br/>")
]]></description>
<object name="man">
<inherit name="editor_object" />
<look>The man is in his mid 40s, slim, clean shaven, and wearing an expensive suit.</look>
<alias>luke</alias>
</object>
<command>
<pattern>get gun; grab gun; snatch gun; get gun quickly; reach for gun; get meson; get meson 9mm; grab meson; grab meson 9mm; snatch meson; snatch meson 9mm; take gun; take meson; take meson 9mm; take pistol; take handgun; grab pistol; grab handgun; snatch handgun; snatch pistol; grab gun quickly</pattern>
<script><![CDATA[
msg ("It's now or never, unless all you want is to walk out of here with a quanity of Yellows.<br/><br/>You move like an olympic sprinter out of the blocks and have the gun in your hands before the man has so much as moved a muscle. You point it as his head.<br/><br/>He raises his hands. \"Whoa! Steady on. Don't shoot... please.\"<br/><br/>\"Right, who do you work for?\" you demand.<br/><br/>\"If I tell you that I'm a dead man.\"<br/><br/>\"Yeah? And if you <i>don't</i> you're a dead man. This isn't your day, Luke.\"<br/><br/>.....................................................................<br/>")
wait {
msg ("Suddenly, the door bursts open and one of the goons steps into the frame. He's armed and starts to raise his weapon.")
MoveObject (player, shootout)
}
]]></script>
</command>
<command>
<pattern>#text#</pattern>
<script>
msg ("Luke eyes you suspiciously.")
</script>
</command>
<command>
<pattern>attack man; attack luke; distract luke; attack; leave; go out; out; escape; run; dive at luke; dive on man; dive on luke</pattern>
<script><![CDATA[
msg ("You try to make your move, but Luke has his gun pointed at you before you can move a muscle. He calls in the two thugs from outside and asks them to see you out. \"Get him out of here, fellas.\"")
msg ("<br/>They frog-march you to the door and hurl you into the street.<br/>")
SetTimeout (6) {
MoveObject (player, the slums)
}
]]></script>
</command>
<command>
<pattern>grab pills; grab yellows; grab bag of pills; take pills; take yellows; take bag of pills; snatch pills; snatch yellows; snatch bag of pills; take bag of yellows; snatch bag of yellows; grab pills; grab bag of pills; grab bag of yellows.</pattern>
</command>
<command>
<pattern>ask #text#; say #text#</pattern>
<script>
msg ("\"Shut your mouth!\" Luke says without looking up.")
</script>
</command>
<object name="pills">
<inherit name="editor_object" />
<alias>yellows</alias>
<look>It's a clear plastic bag containing at least 100, small yellow pills.</look>
</object>
<object name="pistol">
<inherit name="editor_object" />
<alias>handgun</alias>
<look>It's a Meson 9mm.</look>
<take type="boolean">false</take>
</object>
</object>
<object name="shoottrue">
<inherit name="editor_room" />
<description type="script"><![CDATA[
msg ("<br/>Well done. You won!<br/>")
finish
]]></description>
</object>
<object name="shootfalse">
<inherit name="editor_room" />
<description type="script"><![CDATA[
msg ("<br/>Hard luck. You failed!<br/>")
finish
]]></description>
</object>
<command>
<pattern>go room; go backroom; enter room; enter backroom</pattern>
<script>
msg ("\"Whooa!\" the man blurts, as the two meatheads grab hold of you and hurl you againsts a wall. \"You ain't going nowhere till you answer the question.\"")
</script>
</command>
<object name="goon1">
<inherit name="editor_object" />
<alias>men</alias>
<look>The two goons measure six four, at least. Not to be tangled with.</look>
</object>
<object name="man1">
<inherit name="editor_object" />
<alias>man</alias>
<look>The man has a wirey build and clearly needs the protection of the men by his side.</look>
</object>
<exit to="backroom" />
</object>
<verb>
<property>ride</property>
<pattern>ride</pattern>
<defaultexpression>"You can't ride " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>hire</property>
<pattern>hire</pattern>
<defaultexpression>"You can't hire " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>hail</property>
<pattern>hail</pattern>
<defaultexpression>"You can't hail " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>smash</property>
<pattern>smash</pattern>
<defaultexpression>"You can't smash " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>break</property>
<pattern>break</pattern>
<defaultexpression>"You can't break " + object.article + "."</defaultexpression>
</verb>
<command>
<pattern>order a #text#; buy a #text#; order #text#; buy #text#</pattern>
<script>
msg ("\"A " + text + "? Certainly sir.\"")
</script>
</command>
<command>
<pattern type="string"><![CDATA[^ask about (?<text>.*)$]]></pattern>
<script>
msg ("There is no one around to answer you right now.")
</script>
</command>
<function name="InitUserInterface"><![CDATA[
JS.eval ("$('#txtCommandDiv').prepend('&gt;&nbsp;')")
request (SetInterfaceString, "TypeHereLabel=")
OutputTextNoBr (game.css)
JS.JS.eval ("$('#status').hide();")
]]></function>
</asl>

jaynabonne
That helps. When you add a "Javascript" command, you don't include the "JS." part. For example, if I look at the function you have in your game, I see this:

 <function name="InitUserInterface"><![CDATA[
JS.eval ("$('#txtCommandDiv').prepend('&gt;&nbsp;')")
request (SetInterfaceString, "TypeHereLabel=")
OutputTextNoBr (game.css)
JS.JS.eval ("$('#status').hide();")
]]></function>


Note that the first Javascript call is just JS. But the second one has "JS.JS." You're including the JS. in the actual thing to be evaluared. So go back to your function in the editor, and on that line, take the JS. off the front. You're just calling "eval(...)". I'll be more specific in the future about how to add such beasts.

OurJud
Ahh, thanks very much, Jay.

Just a quick update. I wasn't entirely correct when I said ALL the custom styling is lost. The previous location text-fade that you set up for me still works.

The only things that need sorting now are the blue save banner (hopefully when I take the JS off it will work) and the text input bar returns on restore.

Can you see from that code why my text input bar returns?

Actually, that's not quite all. What should a player see when they resumes a game from a saved point? All I get is a blank screen meaning that unless the player has a photographic memory, they're not going to know where they are until they enter a command. This is quite a problem because their input at the point they saved, could very well have a consequence on their progression.

Doh! They're meant to press 'l', right? :oops:

Surely the last location should show up on restore?

On and by the way, the java things worked and the blue banner does indeed remain hidden on restore.

Silver
You needed to keep following that thread as Jay created a library (IIRC) which he ended up doing because of problems with the other solutions. But as you'd 'solved' the problem you probably switched off. But then you missed the after thoughts. Let me know where that thread is if you find it! :p

Actually I have the library in my game.

OurJud
Silver wrote:You needed to keep following that thread as Jay created a library (IIRC) which he ended up doing because of problems with the other solutions. But as you'd 'solved' the problem you probably switched off. But then you missed the after thoughts. Let me know where that thread is if you find it! :p

Actually I have the library in my game.


I think it was in 'Text Adventure Old Skool Style or something. I'll have a dig.

viewtopic.php?f=10&t=4760

I think this is the most relevant post. What I don't understand, though, is if I followed these instructions, why I'm having the problems with restore.

jaynabonne wrote:*** UPDATED ***

Ok, attached is some code that does it. You can take a look to see how to (among other things) set CSS. The problem with just sending it with the standard text output is that if you clear the screen, you lose the CSS. I have recently posted in the Libraries forum a technique for making the CSS permanent. (I haven't used it yet msyelf. I just have a special clear screen that calls the Quest clear screen and then sends the CSS again).

Let me know if you have any questions. At least with the file, you can see where things go. :)

There is a "css" attribute on the game object and some code in the InitUserInterface function to set the style (so the style will be re-set when a saved game is loaded).

If you're doing this in the online editor, then we need to have a different conversation...

<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="retro">
<gameid>cc5e4324-4bc5-41af-b9d6-c763439aae53</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<css>
<![CDATA[
<style type="text/css">
div#txtCommandDiv {
border:none;
font-size:12pt;
font-family:Georgia, serif;
}
input#txtCommand {
outline:none;
border:none;
font-size:16px;
margin:0;
padding:0;
}
</style>
]]>
</css>
<start type="script">
</start>
</game>
<function name="InitUserInterface">
<![CDATA[
JS.eval("$('#txtCommandDiv').prepend('&gt;&nbsp;')");
request(SetInterfaceString, "TypeHereLabel=")
OutputTextNoBr(game.css)
]]>
</function>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>


retro.aslx

Silver
I think that pertained to having the text full screen and to the left. It'd have been easier to find if you hadn't made over 350 posts haha. :D

jaynabonne
The problem with the command bar background is that it's being implicitly set by Quest instead of via your CSS. When you print any text, Quest matches the command line, so normally it looks as you'd want (since you print text right away). When the game reloads, no text is printed, and the prompt has its old color. You'll notice that as soon as you cause some text to print, the prompt goes back to the right color. You should be able to fix this by adding this to the " input#txtCommand" section of your css:


color: lightGrey;
background-color: black;

(I included the font color as well, since it might not be correct either.)

As far as not seeing the last text, is this online or in the desktop version? For me, in the desktop version, all the previous text is still there. In fact, it slowly scrolls into view, which I'd love to find a way to disable. (I played adrao's game, and I had been playing a while, and when I restored a saved game, I had to wait a really long time for it to finish scrolling to the bottom so I could resume the game.)

OurJud
jaynabonne wrote:You'll notice that as soon as you cause some text to print, the prompt goes back to the right color.

Not for me. When restoring a saved game online, I get the big white input bar/box, and even after entering a command, it remains.
Edit: Apologies, the background turns black after a command, but the white border remains.
http://textadventures.co.uk/games/view/ ... lingcheck2

jaynabonne wrote:As far as not seeing the last text, is this online or in the desktop version? For me, in the desktop version, all the previous text is still there. In fact, it slowly scrolls into view, which I'd love to find a way to disable. (I played adrao's game, and I had been playing a while, and when I restored a saved game, I had to wait a really long time for it to finish scrolling to the bottom so I could resume the game.)

This is online. I've not tried the saved feature on the desktop version (how to do you restore a saved game in desktop?)

Anyway, I'll try your CSS and upload it again. Thanks.

OurJud
The CSS made no difference. I even tried changing 'border: 0' to 'border-color: #000000'

But all this did was give me a white border even from a restart?? Seems as though border color is hard coded??

Border: 0 gets rid of it on first load, but not on restore??

Headache!

jaynabonne
Could you say the online link you're using that has the latest game? When I try the one in your other posting asking for testers still has the blue border. I don't know how old that is or what code that has.

Out of curiosity, have you tried it with the desktop version? (To answer your question, when you save, it creates a .quest-save file. Just double-click the file to resume the game.) When I try that, it works. (No border, no off background.) It is possible and even likely that the online version is different, but I'm not able to see it with the game I found of yours.

OurJud
This is the most current upload, Jay.

It has your additional CSS in for input#txtCommand.

This is the same game that I'm using on the desltop version, and on desktop there are no issue with restoring a saved game (it loads back up just as it should, with all the custom styling correct.

This is the link to play the same game online, and you will see that when restoring a saved game, the input starts off as a big white command bar, and after a command has been entered, the background turns black, but the border remains white.

http://textadventures.co.uk/games/view/ ... lingcheck4

This is the entire game code for that game and from what I can gather - it needs a line of java in the InitUserInterface (right at the end of the code) to tell the command border not to show, but I don't know how to code that in java:

<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="dimsome.aslx" />
<include ref="ConvLib.aslx" />
<game name="cloud9">
<gameid>32c68a10-cee6-46a8-8d65-7f33f76584ba</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<css><![CDATA[

<style type="text/css">
body {
line-height: 1.2em;
}

div#txtCommandDiv {
border:0;
background: no-repeat;
font-size:10px;
font-family:'Trebuchet MS', Helvetica, sans-serif;

}
input#txtCommand {
color: lightGrey;
background-color: #000000;
outline:none;
border: 0;
font-size:10px;
margin:0;
padding:0;
max-width: 1000px;
}
a.cmdlink {
display: none;
visibility: hidden;
}
#status {
display: none;
visibility: hidden;
}
</style>

]]></css>
<showtitle type="boolean">false</showtitle>
<enablehyperlinks type="boolean">false</enablehyperlinks>
<defaultfontsize type="int">11</defaultfontsize>
<setbackgroundopacity />
<backgroundopacity type="double">1</backgroundopacity>
<showpanes type="boolean">false</showpanes>
<showcommandbar />
<showlocation type="boolean">false</showlocation>
<showborder type="boolean">false</showborder>
<attr name="autodescription_youcansee" type="int">0</attr>
<attr name="autodescription_youcango" type="int">0</attr>
<attr name="autodescription_youarein_useprefix" type="boolean">false</attr>
<autodescription />
<setcustomwidth />
<customwidth type="int">1270</customwidth>
<setcustompadding />
<custompaddingright type="int">500</custompaddingright>
<custompaddingleft type="int">100</custompaddingleft>
<defaultfont>'Trebuchet MS', Helvetica, sans-serif</defaultfont>
<defaultwebfont>ABeeZee</defaultwebfont>
<defaultbackground>Black</defaultbackground>
<defaultforeground>LightGrey</defaultforeground>
<showdescriptiononenter />
<attr name="changeroom_newline" type="boolean">false</attr>
<attr name="autodescription_youarein" type="int">0</attr>
<cover type="string"></cover>
<custompaddingbottom type="int">100</custompaddingbottom>
<echocommand />
<attr name="autodescription_youcango_newline" type="boolean">false</attr>
<appendobjectdescription type="boolean">false</appendobjectdescription>
<category>Sci-Fi</category>
<autodisplayverbs type="boolean">false</autodisplayverbs>
<feature_asktell />
<feature_lightdark />
<underlinehyperlinks type="boolean">false</underlinehyperlinks>
<defaultlinkforeground>Black</defaultlinkforeground>
<start type="script">
</start>
<roomenter type="script">
</roomenter>
<turnscript>
<enabled />
<script>
JS.eval ("$('div[id^=\"divOutputAlign\"]').css('opacity', '0.5');")
JS.eval ("getCurrentDiv().css('opacity', '1.0');")
</script>
</turnscript>
</game>
<verb name="wear">
<pattern>wear #object#</pattern>
<property>wear</property>
<defaulttemplate>DefaultWear</defaulttemplate>
</verb>
<command name="go">
<pattern type="string"><![CDATA[^enter (?<exit>.*)$|^go to (?<exit>.*)$|^go (?<exit>.*)$|^(?<exit>north|east|south|west|northeast|northwest|southeast|southwest|in|out|up|down|n|e|s|w|ne|nw|se|sw|o|u|d)$]]></pattern>
<unresolved>You can't go there.</unresolved>
<script>
if (exit.visible) {
if (exit.locked) {
msg (exit.lockmessage)
}
else if (exit.runscript) {
if (HasScript(exit, "script")) {
do (exit, "script")
}
}
else if (exit.lookonly) {
msg ("You can't go there.")
}
else {
game.pov.parent = exit.to
}
}
else {
msg ("You can't go there.")
}
</script>
</command>
<object name="intro">
<inherit name="editor_room" />
<description type="script"><![CDATA[
msg ("<b>Section for play testing purposes.<br/><br/>I am not asking for any typos to be pointed out at this point, just that you are able to finish this section of my game, and get one of two results: win or lose. And also that things work logically and that the player's purpose is clear.<br/><br/>I have not added all the 'descriptions' for these various characters.<br/><br/>The code word for this test, is '1234', and you will be asked for it at the drugden.<br/><br/>Please press a key when you are ready to start the test.</b><br/><br/>.......................................................................................<br/>")
wait {
MoveObject (player, the slums)
}
]]></description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="talkingchar" />
<drop type="boolean">false</drop>
<attr name="feature_usegive" type="boolean">false</attr>
<use type="script">
if (Got(gun)) {
msg ("You reach round your back and take out your gun.")
}
else if (not Got(gun)) {
msg ("You reach round your back to grab your gun, only to realise it's not there.")
}
</use>
</object>
</object>
<verb name="dress">
<property>dress</property>
<pattern>dress #object#</pattern>
<defaultexpression>"You can't dress " + object.article + "."</defaultexpression>
<defaulttemplate>DefaultDress</defaulttemplate>
</verb>
<verb name="fire">
<property>fire</property>
<pattern>fire #object#</pattern>
<defaultexpression type="string"></defaultexpression>
</verb>
<object name="the slums">
<inherit name="editor_room" />
<alias>slums</alias>
<description type="script"><![CDATA[
msg ("<br/>A fair amount of noise and activity is coming from one of the apartments to your north. A black rectangle in the wall where the boarding once stood leads into the darkness.<br/>")
]]></description>
<beforeenter type="script">
</beforeenter>
<exit alias="north" to="drugden">
<inherit name="northdirection" />
</exit>
</object>
<object name="drugden">
<inherit name="editor_room" />
<description type="script"><![CDATA[
SetObjectFlagOn (player, "knapsack")
firsttime {
msg ("You step into the corridor of the building, then left though a black drape hung over the doorway.<br/><br/>The room is thick with smoke and the unmistakeable stench of weed. A man lounges in a tatty old armchair, and stood either side of him, two shaven-headed men, bred for fighting.<br/><br/>The two men move forward quickly and throw your arms up in the air. Frisking time!<br/><br/>You wait patiently as they pat you down. Finally satisfied, the two gorillas step back and nod to the man in the armchair.<br/><br/>\"Okay, grandpa, what can I do for you?\"<br/><br/>You drop into character and beging shifting uncomfortably. \"I just need some Yellows, that's all. Just for a bit of escape. Nothing heavy.\"<br/><br/>\"Dream Enhancers, huh? Well I sincerley hope you have the magic word.\"")
}
otherwise {
msg ("\"Back again? Got a name yet?\"")
}
]]></description>
<command>
<pattern>#text#</pattern>
<script><![CDATA[
msg ("The two goons moved forward and grab you under the arms before you can do anything.<br/><br/>\"Get him out of here, fellas.\"<br/><br/>They frog-march you to the door and hurl you into the street.<br/>")
SetTimeout (6) {
MoveObject (player, the slums)
}
]]></script>
</command>
<command>
<pattern>say 1234; 1234</pattern>
<script><![CDATA[
msg ("<br/>He eyes you for a while, playing with your mind. You try to look frightened and hope you pull it off.<br/><br/>Eventually he nods towards a door behind him. You nod back and move to the door.<br/><br/>..........................................................................................<br/>")
wait {
MoveObject (player, backroom)
}
]]></script>
</command>
<object name="shootout">
<inherit name="editor_room" />
<description type="script"><![CDATA[
if (game.pov.parent = shootout) {
msg ("<br/>\"Drop the gun!\" the goon screams.<br/><br/>Through the open door you see his two asscoiates making a run for it - obviously not got the stomach for this kind of thing.<br/><br/>\"Drop it! He repeats. \"You've got ten seconds. before I pull the trigger!\"<br/><br/>\"Fuck ten seconds!\" Luke yells. \"Shoot him now, you immecile! This isn't the NYPD!\"<br/>")
SetTimeout (25) {
msg ("The man fires, but misses.")
}
}
]]></description>
<command>
<pattern>shoot goon; shoot; kill goon; shoot at goon; shoot him; fire; fire at goon; fire gun at goon; shoot goon; kill thug, shoot at thug</pattern>
<script>
msg ("You shoot the goon.")
MoveObject (player, shoottrue)
</script>
</command>
<command>
<pattern>#text#</pattern>
<script>
msg ("The goon fires his gun.")
</script>
</command>
<command>
<pattern>duck; hide behind desk; duck behind desk; take cover</pattern>
<script>
msg ("You drop behind the desk just as the goon fires. You here the bullet crack into the plaster wall above your head.")
</script>
</command>
<command>
<pattern>shoot luke; kill luke; fire at luke</pattern>
<script><![CDATA[
msg ("<br/>You turn the gun on Luke and pull the trigger, He drops like a sack and lies still.")
]]></script>
</command>
<command>
<pattern>drop gun; drop handgun; drop meson; surrender; give up; put hands up</pattern>
<script><![CDATA[
msg ("<br/>You drop the gun and show the goon your empty hands. \"Okay. Let's not do anything silly here.\"<br/><br/>Obvioulsy they didn't consider beating you half to death as silly.<br/>")
SetTimeout (6) {
msg ("<br/>You come round under a deserted food stall. Your left eye won't open and your tongue finds a gap between your teeth that wasn't there before. There's metalic taste in your mouth. You spit out a gobbule of thick red saliva and muscus as you climb to your feet and dust yourself off.<br/>")
wait {
}
MoveObject (player, the slums)
}
]]></script>
</command>
</object>
<object name="backroom">
<inherit name="editor_room" />
<description type="script"><![CDATA[
msg ("You open the door and step into the room, closing the door behind you. The air smells fresher in here and the room is well kept.<br/><br/>A man in his 40s sits behind a desk. You guess this must be Luke. You quickly scan the desk for his weapon, but see nothing. No doubt he's packing something somewhere.<br/><br/>You suddenly wish you'd given your plans more thought. No need to fake your fear now.<br/><br/>\"Oi! I haven't got all day. What are you after?\"<br/><br/>\"Uum... some Yellows.\"<br/><br/>The man opens a draw, reaches inside and pulls out a handgun. He places it on the table then reaches back into the draw and produces a large quanity of yellow pills in a clear plastic bag.<br/><br/>As he struggles with the knot fastening the bag, you eye his gun and wonder if you could reach it before him. The saftey catch is off and you prey it's loaded.<br/>")
]]></description>
<object name="man">
<inherit name="editor_object" />
<look>The man is in his mid 40s, slim, clean shaven, and wearing an expensive suit.</look>
<alias>luke</alias>
</object>
<command>
<pattern>get gun; grab gun; snatch gun; get gun quickly; reach for gun; get meson; get meson 9mm; grab meson; grab meson 9mm; snatch meson; snatch meson 9mm; take gun; take meson; take meson 9mm; take pistol; take handgun; grab pistol; grab handgun; snatch handgun; snatch pistol; grab gun quickly</pattern>
<script><![CDATA[
msg ("It's now or never, unless all you want is to walk out of here with a quanity of Yellows.<br/><br/>You move like an olympic sprinter out of the blocks and have the gun in your hands before the man has so much as moved a muscle. You point it as his head.<br/><br/>He raises his hands. \"Whoa! Steady on. Don't shoot... please.\"<br/><br/>\"Right, who do you work for?\" you demand.<br/><br/>\"If I tell you that I'm a dead man.\"<br/><br/>\"Yeah? And if you <i>don't</i> you're a dead man. This isn't your day, Luke.\"<br/><br/>.....................................................................<br/>")
wait {
msg ("Suddenly, the door bursts open and one of the goons steps into the frame. He's armed and starts to raise his weapon.")
MoveObject (player, shootout)
}
]]></script>
</command>
<command>
<pattern>#text#</pattern>
<script>
msg ("Luke eyes you suspiciously.")
</script>
</command>
<command>
<pattern>attack man; attack luke; distract luke; attack; leave; go out; out; escape; run; dive at luke; dive on man; dive on luke</pattern>
<script><![CDATA[
msg ("You try to make your move, but Luke has his gun pointed at you before you can move a muscle. He calls in the two thugs from outside and asks them to see you out. \"Get him out of here, fellas.\"")
msg ("<br/>They frog-march you to the door and hurl you into the street.<br/>")
SetTimeout (6) {
MoveObject (player, the slums)
}
]]></script>
</command>
<command>
<pattern>grab pills; grab yellows; grab bag of pills; take pills; take yellows; take bag of pills; snatch pills; snatch yellows; snatch bag of pills; take bag of yellows; snatch bag of yellows; grab pills; grab bag of pills; grab bag of yellows.</pattern>
</command>
<command>
<pattern>ask #text#; say #text#</pattern>
<script>
msg ("\"Shut your mouth!\" Luke says without looking up.")
</script>
</command>
<object name="pills">
<inherit name="editor_object" />
<alias>yellows</alias>
<look>It's a clear plastic bag containing at least 100, small yellow pills.</look>
</object>
<object name="pistol">
<inherit name="editor_object" />
<alias>handgun</alias>
<look>It's a Meson 9mm.</look>
<take type="boolean">false</take>
</object>
</object>
<object name="shoottrue">
<inherit name="editor_room" />
<description type="script"><![CDATA[
msg ("<br/>Well done. You won!<br/>")
finish
]]></description>
</object>
<object name="shootfalse">
<inherit name="editor_room" />
<description type="script"><![CDATA[
msg ("<br/>Hard luck. You failed!<br/>")
finish
]]></description>
</object>
<command>
<pattern>go room; go backroom; enter room; enter backroom</pattern>
<script>
msg ("\"Whooa!\" the man blurts, as the two meatheads grab hold of you and hurl you againsts a wall. \"You ain't going nowhere till you answer the question.\"")
</script>
</command>
<object name="goon1">
<inherit name="editor_object" />
<alias>men</alias>
<look>The two goons measure six four, at least. Not to be tangled with.</look>
</object>
<object name="man1">
<inherit name="editor_object" />
<alias>man</alias>
<look>The man has a wirey build and clearly needs the protection of the men by his side.</look>
</object>
<exit to="backroom" />
<command>
<pattern>l; look</pattern>
<script><![CDATA[
msg ("<br/>The room is thick with smoke and the unmistakeable stench of weed. A man lounges in a tatty old armchair, and stood either side of him, two shaven-headed men, bred for fighting.<br/>")
]]></script>
</command>
</object>
<verb>
<property>ride</property>
<pattern>ride</pattern>
<defaultexpression>"You can't ride " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>hire</property>
<pattern>hire</pattern>
<defaultexpression>"You can't hire " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>hail</property>
<pattern>hail</pattern>
<defaultexpression>"You can't hail " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>smash</property>
<pattern>smash</pattern>
<defaultexpression>"You can't smash " + object.article + "."</defaultexpression>
</verb>
<verb>
<property>break</property>
<pattern>break</pattern>
<defaultexpression>"You can't break " + object.article + "."</defaultexpression>
</verb>
<command>
<pattern>order a #text#; buy a #text#; order #text#; buy #text#</pattern>
<script>
msg ("\"A " + text + "? Certainly sir.\"")
</script>
</command>
<command>
<pattern type="string"><![CDATA[^ask about (?<text>.*)$]]></pattern>
<script>
msg ("There is no one around to answer you right now.")
</script>
</command>
<function name="InitUserInterface"><![CDATA[
JS.eval ("$('#status').hide();")
JS.eval ("$('#txtCommandDiv').prepend('&gt;&nbsp;')")
request (SetInterfaceString, "TypeHereLabel=")
OutputTextNoBr (game.css)
]]></function>
</asl>

Silver
Are you triple sure? Because yesterday you had issues surrounding online updates.

OurJud
Triple sure about what?

Not sure what you mean about online updates either??

jaynabonne
The problem with the style for the input bar seems to be related to there being no text. divOutput is empty, and that's where your CSS should be as well. No CSS = no style changes. I don't know why there is no output, as you explicitly output something in InitUserInterface. That should be there at least, but it's not. It almost looks like something is emptying divOutput when the game starts. I suspect that the game output is not being saved properly, and it just sets the divOutput html to an empty string, losing your new CSS setting.

This appears to be a bug in the online player. I don't have a workaround for this.

(I was wondering why I didn't see this with my game, but then I remembered that I didn't have the ability to save online.)

OurJud
Mmm. So what if people download the game, would everything be okay then? I know I'd potentially be losing any casual browsers who don't have Quest installed, but could I make it download only?

Out of interest, why don't you have the ability to save online?

I now have a banging headache and no energy to work on my game. I fear it shall never get finsihed :?

jaynabonne
OurJud wrote:Mmm. So what if people download the game, would everything be okay then? I know I'd potentially be losing any casual browsers who don't have Quest installed, but could I make it download only?


You could do that. People can still play it and even restore the game, but the UI will be a little messed up and there will be no text.

It might be possible to do a bit of a hack that pushes the game.css output to either a time timer (as opposed to a turn one) or just do it on the first command after reload. That way, the style would only be messed up either briefly or not at all. There would still be no historical text, but that might be better than nothing.

OurJud wrote:Out of interest, why don't you have the ability to save online?

I now have a banging headache and no energy to work on my game. I fear it shall never get finsihed :?


Because I hide the blue bar. :) And my game has no command prompt.

OurJud
jaynabonne wrote:You could do that. People can still play it and even restore the game, but the UI will be a little messed up and there will be no text.

It might be possible to do a bit of a hack that pushes the game.css output to either a time timer (as opposed to a turn one) or just do it on the first command after reload. That way, the style would only be messed up either briefly or not at all. There would still be no historical text, but that might be better than nothing.

Are you hoping I'll work out how to that one myself? I wouldn't know where to start :)

jaynabonne wrote:Because I hide the blue bar. :) And my game has no command prompt.

Ah, gottcha!

What I don't understand, is if these problems - particularly no text showing on restore - are a bug with the online player, why has it not been brought up by anyone else? I mean it's a bi of a biggy, isn't it?

Actually, I'm going to go and try it with someone elses game, see what happens on restore.

Tried a save/restore on Jacqueline, Jungle Queen and got the same. At least I know it's not just my game then. Can't believe it hasn't been reported.

Are you sure it's a bug, though? Aren't players just expected to type 'l' to show their last location on resuming a saved game?

jaynabonne
Given that it works differently in the desktop player (and, in my opinion, works better), I tend to think it's a bug - or a hands-tied "feature" due to some dire limitation with the online code.

And, no, I didn't expect you to work it out. :) But I wasn't in a position to write it right now myself. I'll be down in London tomorrow for Adventure X, so it wouldn't be before Sunday, unless I get bored on the train. lol

I think most people don't do fancy style things, so the only oddity is the loss of text, which can be recovered from with an "l" as you say. It's only this CSS thing that has exposed it as a deeper problem.

OurJud
jaynabonne wrote:And, no, I didn't expect you to work it out. :) But I wasn't in a position to write it right now myself. I'll be down in London tomorrow for Adventure X, so it wouldn't be before Sunday, unless I get bored on the train. lol

It wasn't a hint, honestly :)

jaynabonne wrote:I think most people don't do fancy style things, so the only oddity is the loss of text, which can be recovered from with an "l" as you say. It's only this CSS thing that has exposed it as a deeper problem.

No, I've noticed that most games just tend to go 'default' as far as styling goes. Ah well. I'll just have to encourage people to download it in my game's description.

As always, thanks very much to all for your help tonight.

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

Support

Forums