Forum rules - please read before posting.

Diary System Customisation

Hi!
I have done the tutorial about the Diary system and it works amazingly but the setup is quite basic so I wanted to know if there is flexibility here to create what I had in mind:
  1. Is it possible to have rich text? The add journal action only seems to allow plain text although the Text UI allow for markup
  2. Is it possible to have multiple entries per page? Each journal entry is a quite short so a full page is a bit of an overkill
  3. Is it possible to have a "double page" diary so I can see both pages at once?
  4. Is it possible to have images in the diary?
Sorry for the overload of questions.

The idea is sort of like this:

image

Thanks!

Comments

  • I'll answer these in order of complication:

    1) Rich text should be fine so long as you stick to Unity's own markup.

    3) The Journal type property in the Journal element can be set to Display Existing Journal, which allows you to have it reference another Journal element (in the same Menu) for its pages.  If you set a non-zero offset value, then it will show that same element's pages, but offset by that amount.  Therefore, an offset of 1 will cause it to show the next page of whatever page the original Journal is showing.

    2) You can add to the journal's last page through custom scripting:

    MenuElement myElement = PlayerMenus.GetElementWithName ("MyMenuName", "MyJournalName");
    MenuJournal myJournal = (MenuJournal) myElement;
    myJournal.pages [myJournal.pages.Count-1].text += "This is new text on the same page".

    Such code could be incorporated into a custom Action so that you can add text as you would a page in ActionLists.  It will, however, need some further scripting to work with the save system (journals are saved by page IDs, not the text within), but that's a next-step.

    4) I'm afraid not.  If you rely on Unity UI for your Journal's display, you could look into writing a custom script that converted your own custom tags (e.g. [image1]) into sprites on a Unity UI component.  It may also be worth looking into more dedicated diary assets, which could be integrated into your AC game.
  • Hi Chris,
    Makes sense. I ended up implementing a custom "flipping book" diary that I then trigger with an AC menu.
    Then I added some custom actions to add the pages in the form of Sprites. Working great.
    One question though. When my Diary UI is open, when I click my diary pager (UI buttons) it works fine, but it also moves the player around (e.g behind the diary the point and click is still affecting the game). Is there a way to prevent the mouse clicks to click on hotspots or move the player around? sort of a lock state?
    Cheers,
  • Yes - you can use the Engine: Manage systems Action to disable both the player movement and interaction systems.  This is best placed in your Menu's ActionList when turn on / off assets so that it's automatic when the menu is open.
  • Hi Chris,
    Works like a charm!
    Tks!
  • @kyuubi @ChrisIceBox I'm working on something similar (displaying two pages at once + hoping to render images in the diary as well), and I was curious to know if you have gotten this to work -- thanks! :)

  • You can display a second page by creating another Journal element, and setting its Journal type to Display Existing Journal, referencing the first, and setting the Page offset # to 1.

    The upcoming v1.78 update will introduce the ability to assign images to individual Journal and Document pages.

  • Thank you so much for the heads up -- I will try this out shortly! @ChrisIceBox

    I was also wondering -- regarding the images that you mentioned -- is that
    moreso like a whole image will take up a page, or is it possible to have text alongside images in the same page like in the original example provided by kyuubi?

  • Fundamentally, it's purely a texture that's associated with a page - how it's used is down to the user.

    The most basic way is to create a Graphic element of the type "Page Texture" and associate it with the Journal element it should display for.

    Having an image be embedded within page text would be possible, but would require custom scripting as you'd need to involve repositioning of dynamic and Text Image components in a UI canvas. Rather than relying on AC's Menu elements, you'd instead read the Document's data via a custom script.

    You can get the Document class given its ID with the InventoryManager's GetDocument function. From that, you can access individual page data, i.e.:

    string pageText = KickStarter.inventoryManager.GetDocument (0).pages[0].text;
    Texture2D pageTexture = KickStarter.inventoryManager.GetDocument (0).pages[0].texture;
    
  • Sorry for just seeing this!

    Thank you so much for the heads up!

  • @ChrisIceBox I think I'm having an issue with the offset it seems -- attaching a video of what is going on along with the settings: https://drive.google.com/file/d/11M2lKp_J_bj0NV8omaeLMAYqDWV2lV-q/view?usp=sharing

    In gist, it seems like the fourth page is being displayed twice. Once on the "right journal" and then once on the "left journal".

    I was thinking that the right arrow button would disabled once the fourth page displays on the right journal, but for some reason it seems to display this last empty page on the "left journal" at the end.

    And going back left after this happens, the second page repeats on the "left journal" and then the "right journal".

    What I'm aiming to do is --

    At start, have the "first page" display on the "left journal" and the "second page" display on the "right journal".

    After the first "right button" click, have the "third page" display on the "left journal" and the "fourth page" display on the "right journal".

    Might you happen to know how I can rectify this? Thank you so much!

  • Thanks for the details - it might need a custom script, though I'll give some thought to the possibility of this being handled within AC. Leave with me - I'll think on this.

  • Aha - I knew there was a script somewhere to handle this. It's here on the AC wiki:

    https://adventure-creator.fandom.com/wiki/Journal_page_snapping

  • @ChrisIceBox Oh perfect, thank you so much!! :) I will check this out after work!

  • @ChrisIceBox Sorry for the very belated response -- just wanted to give a heads up that it worked! Thank you so much for all your help!

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.