Interactive Conversations

MyronGanes
How do I create Links in the Text adventure like you can in the game book? I want to create interactive conversations.

HegemonKhan
there's probably better ways to do it (advanced coding methods), as I'm still a newbie at learning code, but you can use (calling) Functions (script looping or 'goto scripts' ), but you'll have to have a lot of functions for the sections of your conversation script block(s) you want to 'link'.

there's also Script Dictionaries too that you can use.

there's guides on dynamic (which includes 'goto scripts' functionality too) conversations on the wiki pages:

1. http://docs.textadventures.co.uk/quest/
2. http://docs.textadventures.co.uk/quest/guides/
3. viewforum.php?f=18
4. http://docs.textadventures.co.uk/quest/ ... aries.html
5. http://docs.textadventures.co.uk/quest/ ... onary.html
6. http://docs.textadventures.co.uk/quest/ ... ction.html

jaynabonne
Check out the text processor:

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

You can embed command links directly in your text.

msg("Are you happy today?"
msg("{command:YesCommand:Yes}")
msg("{command:NoCommand:No}")


There are two important things to note.
1) After the "command:" tag, you give the command to execute when the player clicks the link. You'll need to create a separate command for each response. (That's not entirely true but probably easiest at this point. You can also create a command that takes parameters and then pass the parameters to the command, with different parameters for different responses. I'd try it just getting a simple response/command link to work first. Then we can help with generalizing it,)

2) If you have another ":" after the command and then more text, that text will be what is shown to the player. So in the the above example, it will show links with text "Yes" and "No", but when clicked, they will call command YesCommand and NoCommand, respectively.

It's also not required to have the command links on separate lines. You could something like:

msg("Say {command:YesCommand:yes} or {command:NoCommand:no}.")

which would show up to the player as "Say yes or no." with "yes" and "no" as links.

MyronGanes
I still don't understand how to make the links do anything?

jaynabonne
Here is one way to do it.

<!--Saved by Quest 5.5.5328.26617-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="ConvTest">
<gameid>1dd40f19-363a-49bf-8f2d-4a187af8adeb</gameid>
<version>1.0</version>
<firstpublished>2014</firstpublished>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
</object>
<object name="Elf">
<inherit name="editor_object" />
<speak type="script">
request (Hide, "Command")
msg ("The elf looks at you with puzzlement. \"Are you a {command:I'm human:human} or are you a {command:I'm a dog:dog}?\"")
</speak>
</object>
</object>
<command>
<pattern>I'm human</pattern>
<script>
msg ("\"I'm no dog,\" you reply.")
msg("The elf snickers. \"We shall see.\"")
request (Show, "Command")
</script>
</command>
<command>
<pattern>I'm a dog</pattern>
<script>
msg ("\"Woof woof,\" you reply.")
request (Show, "Command")
</script>
</command>
</asl>



It has its problems, though e.g. the inline command links remain active after you select them. Perhaps you can clear the screen in between. Also, the command executed is shown, so you have to make it "pretty". And unless you disable the commands, the player can type in the command text given the opportunity.

In the conversation systems I've done, I've used menus. They're transient (they disappear when clicked) and they don't require commands for each choice. You also don't have to muck around with hiding and showing the command prompt.

Given that Quest is HTML-based, you can work some Javascript in and use ASLEvent to invoke scripts in your game. That's a more advanced topic, which we could get to if you feel adventurous. It still won't solve the problem of the links remaining on screen after you click one.

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

Support

Forums