Placing the Room Description!

m4u
Hey guys, I need a Quest genious here. When I type the command "Look" or using the ShowRoomDescription function, how can be achieved that the room description be sent to the top part of the screen? I mean after having played a while, I know in the beggining is there.

What I'm trying to do is not to use the ClearScreen function because then I wont have a transcript of the session and I don't like to show the room description in the middle or lower part of the screen.

Please help, thank you!

jaynabonne
I don't have an easy answer for this. There are two problems:
1) Quest really wants to scroll to the bottom. You'd have to disable that temporarily.
2) As far as I can see, you can't scroll the bottom of content up beyond the bottom of the window, except in the beginning when there is no scroll bar. That means you'd have to pad the content out (in a non-permanent way) to allow the text to scroll up that high. I have some code that creates a temporary section, fills it with <br>s and then collapses it. This forces the content length but then allows new content come in where it should (since the temporary section goes away). You'd have to figure out the size to make it. That's probably doable, but I don't have all the math down.

So that's where it is.

The Pixie
There is a demo with two windows for output:

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

It refers to a previous version of Quest, so will take some effort, but may give some ideas,

m4u
Thank you Jay, can I see your code? it might work

The Pixie, i haven't try your code, sounds like what Im looking for but I don't know if I can make it work in the last version of Quest. Is there a chance that you can updated it?

Thanks guys,

jaynabonne
Here's a crude example.

<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="scrolltest">
<gameid>6c7b6532-6d01-4197-9700-4ed697ba78aa</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<description type="script">
<![CDATA[
msg ("The room is big!")
outputsection = StartNewOutputSection()
OutputTextNoBr("<div style='height:300px'>&nbsp;</div>")
EndOutputSection(outputsection)
HideOutputSection(outputsection)
]]>
</description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>

I suppose if you could compute the right value to put in for "300px", you could scroll to just the right spot. That might require creating a Javascript function to do it, since the ASL code doesn't have a way to get the window height, etc.

Hmm....

jaynabonne
Ok, here is something closer. Not sure if that will be good enough, but...

Attached and here:

<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="scrolltest">
<gameid>6c7b6532-6d01-4197-9700-4ed697ba78aa</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
<js>
<![CDATA[
<script type="text/javascript">
var next_section = 0;
function scrollOffTop() {
var name = "scrollsection" + next_section++;
StartOutputSection(name);
var height = $(window).height() - $("#status").height() - $("#txtCommandSpacer").height() - $("#txtCommandDiv").height() - 35;
console.log(name + ", " + height);
addText("<div style='height:" + height + "px'>&nbsp;</div>");
EndOutputSection(name);
HideOutputSection(name);
}
</script>
]]>
</js>
<start type="script">
OutputTextNoBr(game.js)
</start>
</game>
<object name="room">
<inherit name="editor_room" />
<description type="script">
<![CDATA[
JS.scrollOffTop()
msg ("You are in a weirdly scrolling room! Everywhere you look, things keep shifting and moving.")
]]>
</description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
</object>
</asl>

The hard-coded "35" in there was an eyeball sum of the border and padding values for the various containers. It could be made more rigid by actually referencing the element attributes, but should be good enough for now.

m4u
Thanks Jay, your code is working! Just one thing, i see the map is not working, does it interfere with the Quest map? Can't it be combined with the map?

jaynabonne
As far as I can see, it doesn't prevent the map from working, but it doesn't take the height of the map into account, and so it scrolls too far. Does your game use the map?

(The demo I sent you only had one room, so the map won't show up even if you enable it. If you add a second room with exits, you'll see it.)

m4u
Yes, I can see the map now. How can I compensate the height for the map?

m4u
Jay? Help...

jaynabonne
In the Javascript, change the 35 to 360. That seemed to work ok for me. That's the number to play with if you want to adjust it. A smaller number scrolls more (so higher). A larger number scrolls less.

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

Support

Forums