library: inlinemenu / conversationtree

Pertex

Although Q5 has it’s separate menu-commands, I don’t like to use them as they are not very flexible in the layout and use javascript-windows. So I wrote this library for inline-menus respectively conversationtrees.

Requirement:
Knowledge in scripting Q5. To use this library, you should know how to edit libraries with an external texteditor.

ToDo:
1) Copy the library inlinemenu_lib.aslx to your gamedirectory
2) Rename the file and include it into your gamefile
3) Open the library with an external texteditor and create your menu
4) Add the call of your menu to your game.


The library contains the object "im_default", which can be used as a template for your menu. To create a menu, you should copy the object, rename and edit it.

This object contains three dictionaries and some other variables:

The stringdictionary im_text contains the text of the entries of the menu. The keys can be chosen freely and are awaited during entry.

The scriptdictionary im_script contains scripts, which will be executed after the selection of an entry of the menu. The keys of the items must be consistent with the keys in im_text.

The scriptdictionary im_scriptbefore defines, whether a menu entry is displayed or not. You can activate entries by script ( im_setReturn(true) ) or deactivate them( im_setReturn(false) ). The keys of the items must correspond with the keys in im_text.

If you have created your menu, you can call it with "im_showmenu(name_of_menu)"
You can call a menu from within the scriptdictionary im_script, so that a menu can call another menu. With this you can easily create conversationtrees.

There are some other variables, that can be set in your menu:
im_help = true displays a helptext under the menu
im_link = true displays a hyperlink within the menu
im_xexit = true displays 'x' to stop the menu
im_entry = "text" displays "text" as a headline of the menu
im_loop = true: you can choose several times, false: you can choose only once

There are two demos in the ZIP-File: test_inlinemenu.aslx und gatekeeper.aslx


@The Pixie and Alex: Could you plz review it

The Pixie
I like the idea of an inline menu; I find the pop-up to be a bit intrusive.

A quick first impression; it would be better if you could change the cursor or give some other clue that the game is expecting a menu choice, rather than a usual command. I was not expecting to be able to choose multiple times.

Pertex
Hmmm, difficult. I could print "Please choose again" but this doesn't look good. I think of moving the complete menu with all it's output some spaces to the right in the gamewindow.

The Pixie
Indenting it would look okay, I think (I have no idea how that can be implemented).

Pertex
After writing a library for inline-menus, I decided to add a library for popupmenus using the same technique.

Requirement:
Knowledge in scripting Q5. To use this library, you should know how to edit libraries with an external texteditor.

ToDo:
1) Copy the library menu_lib.aslx to your gamedirectory
2) Rename the file and include it into your gamefile
3) Open the library with an external texteditor and create your menu
4) Add the call of your menu to your game.


The library contains the object "im_default", which can be used as a template for your menu. To create a menu, you should copy the object, rename and edit it.

This object contains three dictionaries and some other variables:

The stringdictionary im_text contains the text of the entries of the menu. The keys can be chosen freely and are awaited during entry.

The scriptdictionary im_script contains scripts, which will be executed after the selection of an entry of the menu. The keys of the items must be consistent with the keys in im_text.

The scriptdictionary im_scriptbefore defines, whether a menu entry is displayed or not. You can activate entries by script ( im_setReturn(true) ) or deactivate them( im_setReturn(false) ). The keys of the items must correspond with the keys in im_text.

If you have created your menu, you can call it with "im_showmenu(name_of_menu)"
You can call a menu from within the scriptdictionary im_script, so that a menu can call another menu. With this you can easily create conversationtrees.

There are some other variables, that can be set in your menu:
im_xexit = true displays 'x' to stop the menu
im_entry = "text" displays "text" as a headline of the menu
im_loop = true: you can choose several times, false: you can choose only once

There is a demo in the ZIP-File: gatekeeper.aslx

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

Support

Forums