Forum rules - please read before posting.

Diary / goal menu with variable number of objectives

Hi. I am trying to create a diary / goal menu that looks like this. I've set the menu up so that it opens when you click on his cat, which follows the player from room to room! As always, please excuse the grimy graphics. It's all prototype at this stage.

I followed the AC tutorial on Creating a Diary System using Unity's UI.

The top left panel of my image contains the character's objectives, which will change over time, growing and shrinking as he discovers new objectives and checks off old ones. I want to keep those objectives in this top left panel in a way that they don't 'spill over'. I have seen from the manual that I can use the 'Offset Element Slot' function on a pair of buttons to control which elements are shown, but I am not sure how to set up the elements. These Objective elements are buttons that produce the correct information in the top right hand box when clicked upon, using the journal element as described in the Diary tutorial.

I am not sure if I should be trying to use AC Containers to contain these Objective elements. Or whether I should be looking at unity U.I. tutorials to create a game object with bounding limits within my menu game object, within which are a maximum number of elements greater than the total number of objectives that I expect to have, which I can then designate from the AC menu options.

Can somebody please guide me as to where I should be focusing my efforts? Thanks!


  • A Container shouldn't be necessary, but using inventory items to stand in for objectives is certainly an option.

    Inventory items can be placed in categories, and then InventoryBox menu elements (that list items) can be filtered by category. Therefore, you could have one category/menu for regular inventory items (and are displayed as icons) and another for objectives (and are displayed as text).

    For rapid prototyping, you can rely on solely-AC menus and switch over to Unity UI once things behave the way you want.

  • Ah yes. I see. GREAT. With a bit of fiddling around I have got that working nicely. Thanks very much.

    I now have my Objectives (Element type: Inventory Box) limited to the Inventory category of 'Objectives' that I created. Then I have my Objectives_Journal (Element type: Journal) with a number of pages where I can write in the descriptions for each objective. The interaction for each inventory item links to the relevant journal page.

    I'm wondering what the best way to organise this information is.

    For example, I have an objective called 'Locate Labcoat' which displays the text on page#1: 'The mother took it. She must know where it is.'

    When the player learns new information, this might update to page#2: 'The mother took it. It seems most likely that she has locked it in a cupboard in their shared sleeping chamber.'

    As I am writing the game as I go along, it seems highly likely that I will quickly end up with a disorganised numbering system, where pages 1,2,7,21 etc. all relate to the labcoat and the other numbers link to all sorts of other objectives, without a coherent organising system - unless I constantly update all of my actionlists for each item. Is there a smart way to manage this from the start? (will also post this in the discord forum)

  • A couple of things to note:

    1. A Journal's text doesn't have to be defined as part of the Menu Manager itself. It's also possible to use a Journal element to display different Documents. Documents can be defined in the Inventory Manager as well.
    2. The text of a document/journal page accepts variable tokens. You could move any dynamic text into global String variables, insert that text into the menu with the [var:X] token, and then change the text with the Variable: Set Action. See the Manual's "Text tokens" chapter as well as this related tutorial.
  • OK. Thanks. This is very helpful.
    I thought I had figured out how to use these tools to get what I wanted. I am very close...

    Firstly I set up a global variable as a string and gave it an intial value of (e.g.1) 'The mother took it. She must know where it is.' and I put this variable, [var:0] into the corresponding menu's journal element. That worked fine.

    Then it was fairly simple to use 'Variable:set' to change the value of this string to
    (e.g. 2) ' The mother took it. She must know where it is - she has most likely stored it in her sleeping chamber, which is locked.' So - job done! Great.

    But... it would be much easier to manage the text if I could access it all in one place and not tucked away in action scripts here there any everywhere. I thought I had figured out a way to do this:

    I used the 'Variable:set' with the option 'New value is set as: Menu Element Text' and created a new menu element that was set to 'Is visible: No', where each page was the corresponding textual development of that objective. e.g's 1,2 etc from above. I thought I could then just link to the relevant page in the 'Variable:set' action and it would change them as I wanted. However, it is not doing that. The text is not changing.

    Perhaps I have misunderstood how this action works?

  • As an interesting corollary to my last reply, the 'New value is set as: Menu Element Text' IS calling the correct menu, but not the right slot # number.

    I hadn't noticed before because I had the first entry set the same as my intitial [var:0] string. Perhaps I am using the wrong nomenclature to call the next page in the menu? (I simply entered 2 for the 2nd page, but this doesn't affect the result. It only inserts the 1st page)

  • The Set As Menu Element Text option should account for the slot number - are you referencing a Journal element, and if so - one with the page text entered into the Menu Manager?

    There's an easier way to manage the varying text in one place, however.

    Instead of using a String variable, use a PopUp variable - as this can store a series of strings directly, with the Variable: Set Action being used to change which of those strings is actually shown.

  • AH! That (the 'PopUp' variable option in the variable menu) is m e g a.
    May positive karma continuously flow in your general direction.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.