'Classic' look text adventure and customisation

OurJud
I decided to have a play around with the Text Adventure mode when I got in tonight. BOY! And I thought the Gamebook mode was difficult to get my head around!!! I suspect this won't be my only request for help...

I want to go for the classic look - like the text adventures of old that I used to play in my bedroom as a teenager - so am doing away with all the bumpf on the right of the screen. That means no compass, no inventory, etc etc.

First off, I'm irritated by the default prefixes. I don't want a 'You are in...' because I write that in my description. Nor do I want the list of objects to be auto displayed, as I will include them in my description too.

In a nutshell, what I want is my game to look like this:

-------------------------------------------------------------------------

You are in the hallway. To your left an open door leads through to your bedroom. Ahead lies the bathroom. There is a notebook lying on the floor

>


--------------------------------------------------------------------------

Nothing in my description is a link, and the player would simply type commands such as 'enter bedroom', 'get notebook', 'enter bathroom' to progress.

Would this be at all possible.

HegemonKhan
some useful links:

http://docs.textadventures.co.uk/quest/
http://docs.textadventures.co.uk/quest/ ... notes.html (really useful link)
http://docs.textadventures.co.uk/quest/tutorial/
http://docs.textadventures.co.uk/quest/guides/
viewforum.php?f=18

ah, I think this might be it:

http://docs.textadventures.co.uk/quest/ ... quest.html

if there's no toggle options in the Text Adventure to do what you want, I know I've seen this question asked and it's been answered... though that's not of much help to you... but there is the search forum box... that you could learn to use... and~or just manually go through the threads+posts... (there's a lot of informative but older threads, look beyond just the first page... lol)

The Pixie
The great thing about text adventure mode is that you can tailor it exactly as you want it. That does mean there are a bewildering number of options though.
OurJud wrote:I want to go for the classic look - like the text adventures of old that I used to play in my bedroom as a teenager - so am doing away with all the bumpf on the right of the screen. That means no compass, no inventory, etc etc.

game object, Interface tab, uncheck "Show panes"

First off, I'm irritated by the default prefixes. I don't want a 'You are in...' because I write that in my description.


game object, Room descriptions tab, uncheck "Use "You are in" prefix"

Nor do I want the list of objects to be auto displayed, as I will include them in my description too.


game object, Room descriptions tab, set Object list to zero (and probably Exits too).

Actually a better way may be to flag the objects as scenery (i.e., check the scenery box for each object). If the player picks up the object and drops it in another room, you probably want it listed then.

Nothing in my description is a link, and the player would simply type commands such as 'enter bedroom', 'get notebook', 'enter bathroom' to progress.


game object, Features tab, uncheck "Hyperlinks".

Silver
Yeah, click on 'game' in the left window and most display customisation options will now be under the tabs in the centre window. If you find the one called 'theme' select 'Retro' and see how that grabs you. ;)

OurJud
Thanks, all.

I did most of these things, going from tab to tab, unchecking the things I didn't want to display, but when I ran the game (after creating a simple room description) there was no input cursor after my room description?

What I mean is, I got it looking how I wanted, but there was nowhere for the player to input his instructions?

Silver
You must have checked the box which enables/disables the parser. This can be useful if you want to make it a gamebook, for example. There's also some code that can enable and disable it at will. The Pixie started a thread about it.

OurJud
Thanks, Silver.

I don't see any option for the parser, but what I did do in my eagerness to turn everything off was uncheck 'Display commands entered by the player'

However, this gives me an ugly oblong box with a big font for the player's inputs. Is there any way to get rid of that and just have a '>' with the flashing cursor afterwards?

Please tell me there is,

Silver
Afaik that's the only option for the parser. There's probably a way to customise it but you'll probably need the advice of one of the code monkeys on here.

jaynabonne
We had a long thread about this before, using CSS and HTML to get the look right. I don't know where it is, but I'll find it later (unless you'll find it now that you know it exists).

OurJud
It took some choice words in the search box, but do you mean this one: viewtopic.php?f=10&t=3779&p=25311&hilit=text+border#p25311

I've tried to follow it, but infuriatingly AGAIN, the instructions for where I'm supposed to insert this code is simply not clear!

Silver
I asked this question about code. Apparently for the most part it isn't read chronologically. But still that leaves the question as to where to put it. Apparently you can just start a script and then click on the code icon in the script editor and put your code in there. I haven't tried it yet (and may well be wrong) but I'm sure that's what I was told.

jaynabonne
I saw that, but that's not the one I meant (as I was part of the one I meant, and I'm not there.)

The Pixie
Different blocks of code run at different times. Code in a command, for example, is run when the player types the command. If you go to the game object, and click on the Script tab, at the top is "Start script". The seventh icon is "Code view" and you can paste code in there that will run when the game starts, which is what you want for setting up the appearance.

So far so good. At this point it gets a bit technical, and is for the benefit of those who might have a fix!

I had a look at that other thread, and could not get it to work. This is the code I ended up putting in there:
s = " <b>> </b><input type=\"text\" id=\"txtCommand\" onkeydown=\"return commandKey(event);\" style=\"width: 50%; height: 24pt; font-size: 10pt; font-weight: light; outline: none; background: transparent; border: none;\" autofocus><a id=\"endWaitLink\" onclick=\"endWait();\" class=\"cmdlink\" style=\"display: none\">Now press a key</a>"
JS.eval ("$('#txtCommandDiv').html('" + s + "')")

The first line defines a string to replace the existing HTML code for the input box. The second line puts it into the interface. What I found was that although the HTML code gets replaced, the style is not changed. Changing the ID of the input box gets the right style - but it fails to actually work (and I guess that that is because JavaScript function commandKey is looking for text in an element with the ID txtCommand).

If anyone can shed some light here, I would be interested to know what the problem is.

OurJud
Well the asker (Diorm) says he got it working perfectly (last but one post in that thread).

From what I can make from those instructions, two blocks of code are required.

First, you need to insert:

<script>document.getElementById('txtCommandDiv').innerHTML = ' <b>> </b><input type="text" x-webkit-speech="" id="txtCommand" onkeydown="return commandKey(event);" style="width: 50%; height: 14pt; font-size: 10pt; font-weight: light; outline: none; background: transparent; border: none;" autofocus><a id="endWaitLink" onclick="endWait();" class="cmdlink" style="display: none"> press a key</a>';</script>
<style type = "text/css">
a.cmdlink {
color: brown;
}
</style>

This goes... 'somewhere', but I can't work out where.

The second block of code (again, no idea where it's supposed to go) was corrected by the asker, and is as follows:

request (Hide, "Location")
JS.eval ("$('#gameBorder').click(function() { if ($('#txtCommand').css('display') != 'none') { $('#txtCommand').focus(); }});")
msg ("{CSS.custom}")

If someone can just lead me by the hand and tell me where these blocks of code go, I can see if it works or not.

OurJud
Right, I'm far more at home with CSS, and can customise the player command box with this. If I play the game (desktop version), and then navigate to the CSS by going:

HTML Tools >> Resources tab >> UI >> Stylesheets>> CSS

I can customise it by adding the line:
#txtCommand { border-left: 1px solid #ccc; border-top:0; border-right:0; border-bottom:0; }


But I think this is just 'on-the-fly' customisation and there's no way of saving what you've added. Once I close the CSS file, it undoes the line I added.

Silver
I think you need to use javascript to load in css stuff sometimes from elsewhere. Don't know why I'm answering though as I'm probably wrong lol.

OurJud
I'm just grateful to be getting attention on this :D

I'm my own worst enemy and refuse to 'get on' with other things until I've got inconsequential issues sorted out first. I could be building the damn game, instead of worrying about the way it looks - the look can come later, but try telling my brain that.

jaynabonne
This is the thread I was thinking of. I would have sworn I had a local file that encapsulated this. If I can't find it, I'll make another one.

viewtopic.php?f=10&t=3687

OurJud
Thanks, JB, the TS is certainly on my wavelength with this, including the getting rid of the 'Type here' message.

However, the same old problem arises... where to put all this stuff?? I'm fairly confident with CSS, but where do I put it and all the other stuff like the jQuery etc etc??

OurJud
Oops, I posted the above while you were posting your additional post.

Just about to have my tea, and shall try this afterwards, although you appear to have more confidence in me than I do.

Silver
OurJud wrote:I'm just grateful to be getting attention on this :D

I'm my own worst enemy and refuse to 'get on' with other things until I've got inconsequential issues sorted out first. I could be building the damn game, instead of worrying about the way it looks - the look can come later, but try telling my brain that.


I'm exactly the same. It's all part of the learning curve though ey? Plus it's building the game and tinkering with it that I get my enjoyment from, not actually finishing it. :roll: but also :D

jaynabonne
*** 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>



jaynabonne
I deleted the original post and posted a new one, as the original had the code in the game start script, which works fine when the game is started, but the styling is partially lost when a saved game is reloaded. So I moved the code to InitUserInterface, which is called in both cases (start and resume).

OurJud
No, desktop now.

Just about to have my tea and will try afterwards, although you seem to have more confidence in me than I do, in terms of where this goes.

You say there's CSS and some stuff that goes in the InitUserInterface, but what's what?

Oh, I see now. I take it </css> is where the CSS ends and the script starts? So do these two different blocks of code go in different places or the same?

Silver
Tea? English and perhaps Northern then?

jaynabonne
If you load the game in the Quest editor, there are two places to look:

1) A "css" attribute on the "game" object. This is just a standard <style> table as text, which you can add to if you wish. (To see it, click on the "game" object, then select the "Attributes" tab. Scroll down the Attributes list until you find the "css" attribute.
2) Some code in the function InitUserInterface which prepends a ">" prompt, disables the "Type Here..." text, and then Outputs the game.css text to set the css style. (This should be listed under Functions in the left pane.)

(If you look at the inline code above or in the code view of Quest, it might make sense as well. There's not much else there.)

OurJud
Silver wrote:Tea? English and perhaps Northern then?

Yes and yes :D

JB, I'm still not sure I understand where I'm supposed to add the code. You really do have to spell it out to me. Talk to me as though I'm a simpleton. A simpleton with learning difficulties.

Anyway, let me have my tea and I shall return.

The Pixie
1. Create an attribute containing the CSS

Go to game, Attributes tab, Attributes section (lower half) click on add, type "css" (no quotes). Copy-and-paste this text into the text box at the bottom, under where it says string (note it is pretty long, and ends </style>; make sure you get it all).

<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>


2. Create a function

Right click in the left pane, and select add function. Give it the name "InitUserInteface" (same capititalisation, no quotes or spaces, note two capitical 'i'). Bottom of the stuff on the left is Script. Click on the seventh icon (Code view). You should now get a text box below. Copy-and-paste this in:

JS.eval ("$('#txtCommandDiv').prepend('&gt;&nbsp;')")
request (SetInterfaceString, "TypeHereLabel=")
OutputTextNoBr (game.css)


Hopefully that will do it.

ETA: I have updated this so it should now work (specifically the css attribute had to be all one line).

HegemonKhan
@OurJud:

Jay's post is the entire game code, so just create a new game, and go into code view (for the entire game) which can be done two ways:

1. simply open up your new game file itself with: notepad, wordpad, or (downloaded and installed) notepad++, and then see #3
or
2. within your new game (in the GUI~Editor), at the top of the screen is a bar with buttons on it, on the right side, between the 'play' and '?-help' buttons, there is a notepaper like button, this is a toggle button to go between the GUI~Editor and Code View (of the entire game code), so click on this notepaper button, to go into the Code View mode (entire game code), and see #3
-------
3. delete ALL of the code, then on here, hit the 'select all' to highlight the code text in Jay's post, next copy it, and then paste it into your game's blank code view mode, save your game, and hit the notepaper button to go back into the GUI~Editor mode. Take a look at how it's done (looks) in the GUI~Editor mode, and then go ahead and play the game, to see how (or if) it works during play.

OurJud
Now THAT'S what I need. That the level of hand-holding I'm talking about.

However, the CSS box will not expand and when I try to paste the CSS in there, all I get is
<style type="text/css">

Silver
I'm going to apply this to my games too so I can pretend I wrote them using inform.

OurJud
HK, thanks very much, too.

I tried your method and it worked... I now need to put the rest of my styling back in, but I guess that's why you said use a test game :roll:

All I need now is conformation from Jay that the first block of code wasn't amended in any way when he posted his method for adding the CSS and attributes later on.

Silver
Can this sort of stuff be turned into libraries? If not I might busy myself constructing some how to articles for the wiki - to prevent the same questions having to be answered incessantly and, more importantly, for my own reference.

The Pixie
I would guess it is there anyway. Try just going to some other object, then back again. Hopefully the box will have grown. Either way, see if it works!

Silver
OurJud wrote:Now THAT'S what I need. That the level of hand-holding I'm talking about.

However, the CSS box will not expand and when I try to paste the CSS in there, all I get is
<style type="text/css">


I'm getting this issue too. Is 'string' the right selection? Or can the code be parsed as a single line?

OurJud
Well, I got it working via HK's notepad method, but I'm glad it's not just me being stupid.

I do have one small issue, though. When I fire the game up, the player command box (that is no longer there, of course) sticks out on the right of my width.

I like the whole screen to be black, so have changed the background to black and then set a custom width of 1270 (full width for my screen/resolution, at least - don't know how I'd ensure it would be full width on all displays)

Anyway, I'll take a screenshot so you know what I mean.

I tried going back into the CSS and adding 'width: 500px;' to the relevant class, to make sure its width was well within the borders of my overall width, but it made no difference. I also tried 'width: 80%'

textad.jpg

jaynabonne
Could you post what you have done so far? It's probably just a minor tweak, but I don't know what's there so far.

OurJud
Certainly. Because of the CSS box not expanding and allowing me to enter the whole of it, I tried HK's method and it works just fine (apart from the above screengrab)

I just copied the whole block of code (the css and the other stuff) from your initial posting (where you posted it altogether). Then I clicked the 'code view' next to the play button, deleted all the code and replaced it with yours. I then used the UI to tweak the overall design (colours, widths, etc)

Silver
I tried the below method but, as explained, when attempting to paste the code from step 1 into the css box it only pastes the first line of code. I'm guessing it doesn't like the new lines. Is there any way to write the code as a single line or are the new lines required as part of the code?

The Pixie wrote:1. Create an attribute containing the CSS

Go to game, Attributes tab, Attributes section (lower half) click on add, type "css" (no quotes). Copy-and-paste this text into the text box at the bottom, under where it says string (the box should expand to fit it).

       <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>


2. Create a function

Right click in the left pane, and select add function. Give it the name "InitUserInteface" (same capititalisation, no quotes or spaces, note two capitical 'i'). Bottom of the stuff on the left is Script. Click on the seventh icon (Code view). You should now get a text box below. Copy-and-paste this in:

JS.eval ("$('#txtCommandDiv').prepend('&gt;&nbsp;')")
request (SetInterfaceString, "TypeHereLabel=")
OutputTextNoBr (game.css)


Hopefully that will do it.

OurJud
Silver, you can do it a different way. Just copy the whole code from Jay's post (the one where he posts it as one whole block - a few posts up from the one where he splits it). You then go to the 'code view' next to the 'play' button, delete all the code and add Jay's (make sure it's just a test game, though, as you lose any styling)

Well, it seems to be working now, after I used HK's method to simply replace all the code with Jay's.

I also sorted out the issue in that screen grab. I had to add

max-width: 1000px;

to the input#txtCommand class.

jaynabonne
Cool!

Silver
Cool. I'm none the wiser. :D

OurJud
Thanks for your patience and help, everyone - very much appreciated!

Now I can start to get to grips with actually making a game :)

OurJud
Silver wrote:Cool. I'm none the wiser. :D


Who do you think you are, me? :D

If I can do it, you can.

This is for the desktop version of the software.

Just copy the following code from Jay's post to your clipboard. You then go to the 'code view' next to the 'play' button, delete all the code and paste in Jay's (make sure it's just a test game, though, as you lose any styling)

<!--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>

Silver
Erm, if I did that I'd delete my entire game lol. You also don't have a unique game id anymore...

I managed to download and see Jay's test game loaded. It just won't let me paste that code like it wouldn't with you. Maybe it's something that needs to happen before the game programming begins? It's fairly irritating.

Surely there's just some code I need to replace, not bloody well all of it?

HegemonKhan
@OurJud:

let me try to guide you in how~where to place Jay's code into your own game's code, okay?

---------

UBER IMPORTANT:

Make a copy of your game file, that way, if you mess up, you just messed up that copy game file, still having your own working game preserved as the other unedited game file.

----------

Jay's game code:

(I'm putting in the line spaces, which is perfectly fine to do so as it doesn't mess up anything at all, so you can see the things, the 'tag blocks', easier)

<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>


------------------------

Code can be written horizontally (programmers~hackers can read+write+troubleshoot code horizontally) or vertically (for us noobs, vertically is much easier for us to read, write, and troubleshoot), so most of the code will be written vertically, except for single lines of code, such as the simple Attributes (String, Integer, Double, Boolean, and Lists).

what are 'tag blocks', right?

the largest 'tag block' is (tells quest~computer that this is), either:

the game file (asl) tag block:

(and the actual file name's extension has to be *.aslx)

<asl>
(your entire mass of game code)
</asl>


or

the library file (library) tag block:

(and the actual file name's extension has to be *.aslx, and it must be in the same folder as your quest.exe program file)

<library>
(your entire mass of library~'patch'~'expansion pack' code)
</library>


but, we're not working with a library file for this post.

------

then we got the default libraries file tags added to the game:

<asl>
<include ref="English.aslx" />
<include ref="Core.aslx" />
(your entire mass of game code)
</asl>


yes, alex built a powerful engine, the quest you know, is made up of two libraries!

the English.aslx library file has the code to make quest be in english language.
the Core.aslx library file is holds a collection~reference of all of the core files that make up quest.

so, if you're a good programmer, you can make your own quest Engine+GUI~Editor+GamePlay design!

or, add in others' libraries (the vertical ordering heirarchy structure is imporant here, as that is the build-initiation order ~ they build upon each other: 'Core.aslx' requires 'English.aslx' to already be in place, and 'Pixie's Simple Combat.aslx' requires both 'English.aslx' and 'Core.aslx' to already be in place . You can't build a ceiling~roof without walls, you can't build walls without a ground~foundation for constructing a building~home):

<asl>
<include ref="English.aslx" />
<include ref="Core.aslx" />
<include ref="Pixie's Simple Combat.aslx" />
(your entire mass of game code)
</asl>


now, within the beginning 'asl' tag itself, we need to give it an attribute: version="550", because it needs to be able to communicate with the quest engine (which is version 550, unless you're still using an older download of quest, like me: version="540", lol):

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
(your entire mass of game code)
</asl>


next is our 'game' tag block:

in the GUI~Editor, this is the 'game' (special Object) on the left side's 'tree of stuff', which holds the game's settings~options, which you can set via the tabs on the right side.

and here is what it looks like in code:

<game name="blah">
(Attribute code lines)
</game>


again, the ' name="blah" ' is an attribute for the beginning 'game' tag itself

and then we got the (default) attributes:

<game name="blah">
<gameid>an_algorithm_generated_unique_string</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
</game>


and additional optional attributes (such as if we set the options~settings within the 'game' special Object via its tabs, in the GUI~Editor):

<game name="blah">
<gameid>an_algorithm_generated_unique_string</game>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<author>HegemonKhan</author>
<description>the 'blah' game</description>
<subtitle>blah blah</subtitle>
<difficulty>easy</difficulty>
<cruelty>easy</cruelty>
<pov type="object">player</pov>
<start type="script">
character_creation_function
</start>
</game>


so, now add in Jay's 'css' tag block into your own 'game' tag block:

the vertical order placement of the 'css' tag block doesn't matter, but just make sure you indent it (as the indentation tells that it is inside of the 'game' tag block), for example:

<game name="blah">
<gameid>an_algorithm_generated_unique_string</game>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<author>HegemonKhan</author>
<description>the 'blah' game</description>
<subtitle>blah blah</subtitle>
<difficulty>easy</difficulty>
<cruelty>easy</cruelty>
<pov type="object">player</pov>
<start type="script">
character_creation_function
</start>
<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>
</game>


is the same as:

<game name="blah">
<gameid>an_algorithm_generated_unique_string</game>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<author>HegemonKhan</author>
<description>the 'blah' game</description>
<subtitle>blah blah</subtitle>
<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>
<difficulty>easy</difficulty>
<cruelty>easy</cruelty>
<pov type="object">player</pov>
<start type="script">
character_creation_function
</start>
</game>


last, is Jay's Function:

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


which can be placed anywhere (definately) after the 'game' tag block:

(remember that the indenting matters: line up its indenting with the 'game' tag block, and the other Element tag blocks too: 'verb', 'command', 'object', 'function', and etc. They should ALL be at the same indenting!)

<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="blah">
<gameid>blah</gameid>
<gameid>an_algorithm_generated_unique_string</game>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<author>HegemonKhan</author>
<description>the 'blah' game</description>
<subtitle>blah blah</subtitle>
<difficulty>blah</difficulty>
<cruelty>blah</cruelty>
<pov type="object">player</pov>
<start type="script">
character_creation_function
</start>
<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>
</game>
<verb>
<property>blah</property>
<pattern>blah</pattern>
<defaultexpression>blah</defaultexpression>
</verb>
<function name="character_creation_function">
// script lines
</function>
<command name="blah">
<pattern>blah</pattern>
<script>
// script lines
</script>
</command>
<object name="orc">
<inherit name="editor_object" />
</object>
<function name="InitUserInterface"><![CDATA[
JS.eval("$('#txtCommandDiv').prepend('&gt;&nbsp;')");
request(SetInterfaceString, "TypeHereLabel=")
OutputTextNoBr(game.css)
]]></function>
<function name="blah">
// script lines
</function>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_object" />
</object>
</object>
</asl>

OurJud
Silver wrote:Erm, if I did that I'd delete my entire game lol. You also don't have a unique game id anymore...

Which is why I said make sure you do it with a test game :)

So what's the ID thing, then? Is it important I have a unique one? Do I need to do something before I get too far into the build of my game?

Silver
I actually converted the code to a single line and... and... and... it wouldn't let me paste that as it was now limiting me to about 20 or so digits maximum. :oops:

Silver
OurJud wrote:

"Silver"

Erm, if I did that I'd delete my entire game lol. You also don't have a unique game id anymore...


Which is why I said make sure you do it with a test game :)

So what's the ID thing, then? Is it important I have a unique one? Do I need to do something before I get too far into the build of my game?



You can go to the very first game edit tab and generate a new one. Where it asks for game title and author etc. The 'set-up' tab. Where it says 'game id' look right then click 'generate'. I think it's to do with the unique url for your game once published.

OurJud
Thanks, HK. Luckily, I haven't got a game yet, so I don't need to implement Jay's code into anything. I can just go straight with his clean code, and then use the UI to style it.

I'm now worried about the 'unique ID' that Silver mentions. Do I need to do something there??

OurJud
Silver wrote:

"OurJud"

[quote="Silver"]Erm, if I did that I'd delete my entire game lol. You also don't have a unique game id anymore...


Which is why I said make sure you do it with a test game :)

So what's the ID thing, then? Is it important I have a unique one? Do I need to do something before I get too far into the build of my game?



You can go to the very first game edit tab and generate a new one. Where it asks for game title and author etc. The 'set-up' tab. Where it says 'game id' look right then click 'generate'. I think it's to do with the unique url for your game once published.[/quote]

Oh, right. Cheers!

Jay, can you help out here? I've resolved my issue as I hadn't made my game yet, but Silver here already has a game so need to do it your method. Any idea why the field won't expand to accept the CSS?

Silver
They've all gone quiet as they don't know the answer to it. Which means it's probably a bug. I wouldn't have been bothered if you hadn't brought it up lol. You got getting that element out of the way before designing your game right then...

jaynabonne
Silver wrote:Surely there's just some code I need to replace, not bloody well all of it?


Just the two parts I mentioned: the InitUserInterface function and the css attribute on the game object.

OurJud
jaynabonne wrote:

"Silver"

Surely there's just some code I need to replace, not bloody well all of it?



Just the two parts I mentioned: the InitUserInterface function and the css attribute on the game object.


Yes, but the field where you tell us to put the CSS will only accept 20 characters. It won;t expand to take the whole block of CSS.

HegemonKhan
HK... just got done finalizing his editing of a large 'guide' post (his previous post from this post), see if you can use it to place Jay's code into (MAKE A BACKUP OF YOUR GAME FILE FIRST) your own game file. That was HK's reason for his 'silence', lol :D

Silver
...which is obviously an issue with Quest so beyond Jay's control.

HegemonKhan
for and about the 'gameid' String Attribute:

computers, like people, need Identifiers (IDs), to know what~who is what~who:

this is achieved in quest via the 'NAME' Attributes and for the game itself via the 'gameid' String Attribute

HK has a unique genetic~DNA code, which IDs him~HK as him~HK, no one else has my genetic~DNA code.

as what if their were two HK's (gasp, the horror!, one HK is bad enough!), such as (scientifically impossible) perfect cloning of himself.

how would you know which HK you were talking to, HK1 or HK2, ??? you would have no idea, just as a computer would have no idea too.

you can't have two Objects with the same 'NAME' Attribute, such as 'player'

you can't have two Attributes with the same "NAME' Attribute, such as 'strength'

you can't have two games with the same 'GAMEID' Attribute uploaded to the quest site, but I'm pretty sure it doesn't matter on your own computer, as I've been using the same 'GAMEID' for all of my game files, opening them up into the GUI~Editor and playing them, lol.

---------

whereas, the 'ALIAS' String Attribute, doesn't matter at all, quest just doesn't give a damn about it (or most other Attributes as well), as ONLY the 'NAME' Attribute (and 'GAMEID' Attribute) is the ID for quest.

-------

so...

for Objects:

<object name="orc">
</object>
<object name="orc">
</object>
ERROR!

vs

<object name="orc_1">
-> <alias>orc</alias>
</object>
<object name="orc_2">
-> <alias>orc</alias>
</object>
NO error.

for Attributes:

<object name="orc_1">
-> <alias>orc</alias>
-> <alias>orc</alias>
</object>
ERROR!

(the default 'alias' String Attribute in its expanded~full~true form)
<object name="orc_1">
-> <attr name="alias" type="string">orc</attr>
-> <attr name="alias" type="string">orc</attr>
</object>
ERROR!

<object name="orc_1">
-> <attr name="strength" type="string">weak</attr>
-> <attr name="strength" type="string">strong</attr>
</object>
ERROR!

<object name="orc_1">
-> <attr name="strength" type="int">0</attr>
-> <attr name="strength" type="int">100</attr>
</object>
ERROR!

<object name="orc_1">
-> <alias>orc</alias>
</object>
<object name="orc_2">
-> <alias>orc</alias>
</object>
NO error.

<object name="orc_1">
-> <attr name="strength1" type="string">weak</attr>
-> <attr name="strength2" type="string">weak</attr>
</object>
NO error.

<object name="orc_1">
-> <attr name="strength" type="string">weak</attr>
</object>
<object name="orc_2">
-> <attr name="strength" type="string">strong</attr>
</object>
NO error.

<object name="orc_1">
-> <attr name="strength1" type="int">0</attr>
-> <attr name="strength2" type="int">100</attr>
</object>
NO error.

object name="orc_1">
-> <attr name="strength" type="int">0</attr>
</object>
<object name="orc_2">
-> <attr name="strength" type="int">100</attr>
</object>
NO error.

(using my own naming~labeling system, hehe)
object name="orc_1">
-> <attr name="strength_string" type="string">strong</attr>
-> <attr name="strength_integer" type="int">100</attr>
</object>
<object name="orc_2">
-> <attr name="strength_string" type="string">weak</attr>
-> <attr name="strength_integer" type="int">0</attr>
</object>
NO error.

---------------

anyways, you can always create a new game, which will generate a new (unique) GAMEID string, which you can copy and paste into your own game.

OurJud
HegemonKhan wrote:anyways, you can always create a new game, which will generate a new (unique) GAMEID string, which you can copy and paste into your own game.

I just hit the 'generate' button along side the ID. I hope that will have achieved the same affect.

jaynabonne
Hmm. That is a problem. Ok, plan B.

Attached is a library. Add it to your game, and it will set the style for you.

To do that, copy the library to your game folder. Then go to Add -> Advanced -> Library.

Click the drop down list and and find "retrostyle.aslx". Select that, and it will be added,

Save and reload your game.

That's it!

HegemonKhan
OurJud wrote:I just hit the 'generate' button along side the ID. I hope that will have achieved the same affect.


or... just do that, lol. I forgot that there's a button to re-generate a new GAMEID string, laughs.

(HK is always doing things the hard way, HK rejects 'Razor's Edge', hehe. HK likes complicated, hard, challenges, struggle, complexity, and etc. When have these become bad things? HK grins, these have always been good things for me and the 'world', aka people~humanity!)

Silver
jaynabonne wrote:Hmm. That is a problem. Ok, plan B.

Attached is a library. Add it to your game, and it will set the style for you.

To do that, copy the library to your game folder. Then go to Add -> Advanced -> Library.

Click the drop down list and and find "retrostyle.aslx". Select that, and it will be added,

Save and reload your game.

That's it!


Okay, it doesn't work for me. I've yet to get round to disabling the parser whilst I have the click to continue stuff going on which has worked in my favour here I think because I didn't see the parser appear at first like I normally would with that bug, and then I did. So I'm guessing the reason it doesn't work is because my 'clear screen' clears the css like you suggested might happen elsewhere?

OurJud
Have you tried inserting the whole block right into the CSS file as I did it? I mean with a test game, just to see if it works that way. It did for me.

Silver
OurJud wrote:Have you tried inserting the whole block right into the CSS file as I did it? I mean with a test game, just to see if it works that way. It did for me.


Yes I know that works. And it is a solution for when you're creating a game from scratch. But I'm trying to implement it into an existing game. That code you're telling me to delete isn't to do with just the game style, it's the code for the entire game.

jaynabonne
Silver wrote:

Okay, it doesn't work for me. I've yet to get round to disabling the parser whilst I have the click to continue stuff going on which has worked in my favour here I think because I didn't see the parser appear at first like I normally would with that bug, and then I did. So I'm guessing the reason it doesn't work is because my 'clear screen' clears the css like you suggested might happen elsewhere?


Try this library instead. It has an override for ClearScreen as well that resends the css.

Silver
jaynabonne wrote:

"Silver"



Okay, it doesn't work for me. I've yet to get round to disabling the parser whilst I have the click to continue stuff going on which has worked in my favour here I think because I didn't see the parser appear at first like I normally would with that bug, and then I did. So I'm guessing the reason it doesn't work is because my 'clear screen' clears the css like you suggested might happen elsewhere?



Try this library instead. It has an override for ClearScreen as well that resends the css.



Okay, firstly - wow - you got it to work, like you always do.

But... it doesn't take into account my text or background colour. And because my background is black it's invisible...

jaynabonne
You can just add the "color:white;" line to the CSS in the library - or try the newly attached one. That has a white color for the ">". (The text command itself seems to pick up the right colors.)

You can compare the two files to what I changed, if you like. Or if you want to change the color to something other than white.

Silver
Is there no way for it to just be the currently selected font colour? This is something that would hardly ever be an issue but the first room in my game is either light or dark amd i decided to be clever by making the background and font colour reflect that lol.

jaynabonne
Let me think about that. I'll get back to you, probably after work.

Silver
Cheers!

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

Support

Forums