How to make hyperlinks disappear?

The Pixie
20 Jul 2013, 07:30
I am pondering a CYOA type game, but using the normal text adventure infrastructure so it remembers state. It is actually pretty easy to do, with each room being a page, and hyperlinks as directions.

<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="CYOA Experiment">
<gameid>e6dbd742-97ef-4fef-bc34-12f7a3b2cdfc</gameid>
<version>1.1</version>
<firstpublished>2013</firstpublished>
<autodescription type="boolean">false</autodescription>
<showpanes type="boolean">false</showpanes>
<showcommandbar type="boolean">false</showcommandbar>
<echocommand type="boolean">false</echocommand>
<autodisplayverbs type="boolean">false</autodisplayverbs>
</game>
<object name="page1">
<inherit name="editor_room" />
<description><![CDATA[You are in your bedroom<br/><br/>{command:north:Get dressed}<br/>{command:south:Leave the room}]]></description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<ana type="int">0</ana>
</object>
<exit alias="north" to="get_dressed">
<inherit name="northdirection" />
<runscript />
<script type="script">
player.parent = this.to
player.dressed = true
</script>
</exit>
<exit alias="south" to="leave">
<inherit name="southdirection" />
</exit>
</object>
<object name="get_dressed">
<inherit name="editor_room" />
<description><![CDATA[You quickly pull on your clothes.<br/><br/>{command:east:Leave the room}]]></description>
<exit alias="east" to="leave">
<inherit name="eastdirection" />
<runscript />
<script type="script">
MoveObject (player, this.to)
player.ana = 1
</script>
</exit>
</object>
<object name="leave">
<inherit name="editor_room" />
<description type="script">
if (GetBoolean (player, "dressed")) {
msg ("You leave the bedroom.")
}
else {
msg ("Still naked, you leave the bedroom.")
}
</description>
</object>
</asl>


But is there a way to make the hyperlinks disappear once they are obsolete, so the narrative flows as a single piece of text?

jaynabonne
20 Jul 2013, 09:35
Try this. Quest automatically hides hyperlinks for exit output when the exits are no longer valid. So I just assigned names and appropriate aliases to your exits and then used {exit:obj_name} instead of a command, and it seems to work.

<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="CYOA Experiment">
<gameid>e6dbd742-97ef-4fef-bc34-12f7a3b2cdfc</gameid>
<version>1.1</version>
<firstpublished>2013</firstpublished>
<autodescription type="boolean">false</autodescription>
<showpanes type="boolean">false</showpanes>
<showcommandbar type="boolean">false</showcommandbar>
<echocommand type="boolean">false</echocommand>
<autodisplayverbs type="boolean">false</autodisplayverbs>
</game>
<object name="page1">
<inherit name="editor_room" />
<description><![CDATA[You are in your bedroom<br/><br/>{exit:exit_get_dressed}<br/>{exit:exit_leave}]]></description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<ana type="int">0</ana>
</object>
<exit name="exit_get_dressed" alias="Get Dressed" to="get_dressed">
<inherit name="northdirection" />
<runscript />
<script type="script">
game.pov.parent = this.to
player.dressed = true
</script>
</exit>
<exit name="exit_leave" alias="Leave" to="leave">
<inherit name="southdirection" />
</exit>
</object>
<object name="get_dressed">
<inherit name="editor_room" />
<description><![CDATA[You quickly pull on your clothes.<br/><br/>{exit:exit_leave2}]]></description>
<exit name="exit_leave2" alias="Leave" to="leave">
<inherit name="eastdirection" />
<runscript />
<script type="script">
game.pov.parent = this.to
player.ana = 1
</script>
</exit>
</object>
<object name="leave">
<inherit name="editor_room" />
<description type="script">
if (GetBoolean (player, "dressed")) {
msg ("You leave the bedroom.")
}
else {
msg ("Still naked, you leave the bedroom.")
}
</description>
</object>
</asl>

jaynabonne
20 Jul 2013, 09:43
There may be an issue with that, though. I have seen in other games that if have you have an "east" exit in one room and then move to another room that has an "east" exit, the old one will re-enable, since it's still east. I'm not sure what will happen in your case or if there is a way around that. Just something to keep in mind.

The Pixie
20 Jul 2013, 09:54
That does not make the hyperlinks disappear, it converts them to plain text. It was hoping to get rid of them altogether. I am not seeing them become active again however.

Hmm, what I can do is set the font colour to the background colour, so when they are set to plain text, they disappear:
<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="CYOA Experiment">
<gameid>e6dbd742-97ef-4fef-bc34-12f7a3b2cdfc</gameid>
<version>1.1</version>
<firstpublished>2013</firstpublished>
<autodescription type="boolean">false</autodescription>
<showpanes type="boolean">false</showpanes>
<showcommandbar type="boolean">false</showcommandbar>
<echocommand type="boolean">false</echocommand>
<autodisplayverbs type="boolean">false</autodisplayverbs>
</game>
<object name="page1">
<inherit name="editor_room" />
<description><![CDATA[You are in your bedroom<br/><font color="white"><br/>{exit:exit_get_dressed}<br/>{exit:exit_leave}</font>]]></description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<ana type="int">0</ana>
</object>
<exit name="exit_get_dressed" alias="Get Dressed" to="get_dressed">
<inherit name="northdirection" />
<runscript />
<script type="script">
game.pov.parent = this.to
player.dressed = true
</script>
</exit>
<exit name="exit_leave" alias="Leave" to="leave">
<inherit name="southdirection" />
</exit>
</object>
<object name="get_dressed">
<inherit name="editor_room" />
<description><![CDATA[You quickly pull on your clothes.<br/><br/><font color="white">{exit:exit_leave2}</font>]]></description>
<exit name="exit_leave2" alias="Leave" to="leave">
<inherit name="southdirection" />
<runscript />
<script type="script">
game.pov.parent = this.to
player.ana = 1
</script>
</exit>
</object>
<object name="leave">
<inherit name="editor_room" />
<description type="script">
if (GetBoolean (player, "dressed")) {
msg ("You leave the bedroom.")
}
else {
msg ("Still naked, you leave the bedroom.")
}
</description>
</object>
</asl>


I would still prefer to get rid of them altogether to avoid large gaps in the text, if that is possible.

jaynabonne
20 Jul 2013, 10:13
Ah ok. Here's something that may or may not be what you want. It uses output sections. You might at least be able to apply the idea. (It's a bit ugly but should be fixable - extra line spaces, etc).

<!--Saved by Quest 5.4.4873.16527-->
<asl version="540">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="CYOA Experiment">
<gameid>e6dbd742-97ef-4fef-bc34-12f7a3b2cdfc</gameid>
<version>1.1</version>
<firstpublished>2013</firstpublished>
<autodescription type="boolean">false</autodescription>
<showpanes type="boolean">false</showpanes>
<showcommandbar type="boolean">false</showcommandbar>
<echocommand type="boolean">false</echocommand>
<autodisplayverbs type="boolean">false</autodisplayverbs>
<currentcyoasection type="string"></currentcyoasection>
</game>
<object name="page1">
<inherit name="editor_room" />
<description type="script">
<![CDATA[
msg("You are in your bedroom<br/><br/>")
StartSection
msg("{exit:exit_get_dressed}<br/>{exit:exit_leave}")
EndSection
]]>
</description>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<ana type="int">0</ana>
</object>
<exit name="exit_get_dressed" alias="Get Dressed" to="get_dressed">
<inherit name="northdirection" />
<runscript />
<script type="script">
game.pov.parent = this.to
player.dressed = true
</script>
</exit>
<exit name="exit_leave" alias="Leave" to="leave">
<inherit name="southdirection" />
</exit>
</object>
<object name="get_dressed">
<inherit name="editor_room" />
<description type="script">
<![CDATA[
HideSection
msg("You quickly pull on your clothes.<br/>")
StartSection
msg("{exit:exit_leave2}")
EndSection
]]></description>
<exit name="exit_leave2" alias="Leave" to="leave">
<inherit name="eastdirection" />
<runscript />
<script type="script">
game.pov.parent = this.to
player.ana = 1
</script>
</exit>
</object>
<object name="leave">
<inherit name="editor_room" />
<description type="script">
HideSection
if (GetBoolean (player, "dressed")) {
msg ("You leave the bedroom.")
}
else {
msg ("Still naked, you leave the bedroom.")
}
</description>
</object>
<function name="StartSection">
game.currentcyoasection = StartNewOutputSection()
</function>
<function name="EndSection">
EndOutputSection(game.currentcyoasection)
</function>
<function name="HideSection">
<![CDATA[
if (game.currentcyoasection <> "") {
HideOutputSection(game.currentcyoasection)
game.currentcyoasection = ""
}
]]>
</function>
</asl>

The Pixie
20 Jul 2013, 10:32
Looks good, I will have a play around with that.

Pertex
21 Jul 2013, 08:56
It looks like Alex is working on such a function http://quest.codeplex.com/SourceControl ... 6da58a0330