Forum rules - please read before posting.

Adding an image per page of a document

Out of the box documents get an image and an expandable number of pages that display text. I’m thinking of using images for my document pages, so I would need to change the setup to support an image per page.

How would I go about changing this? What script drives documents?

Thanks!

Comments

  • This script on the AC wiki allows for per-page images when dealing with Documents:

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

  • Awesome. Thank you!

  • Ok, so this isn't working yet. Here's what I did:

    I added the script to an empty GameObject that lives in the player.

    I ran the gather text process and my document pages text were lines 164 and 165.

    I added my images to the array defined by the script and gave as their ID 164 and 165.

    I renamed the imgTexture element in the Documents Menu to PageImage and defined that in the script's Graphic Element Name

    I added Document as the Journal Menu name.

    I'm still seeing the original format in the document menu...just seeing the original document graphic (which is the first page of my document).

    Did I need to create a new menu altogether?

    Also: wouldn't it be simpler to modify the documents entry in the inventory manager to include an image? Right now, there's a script referencing every single document image that'll exist in the game...that seems like a bad design for memory optimization as these documents begin to pile up.

    Thanks!

    https://imgur.com/a/A8lWLA5

  • Temporarily move the script from your Player to an empty GameObject in the scene. Do any related errors or messages appear in the Console as the menu turns on?

    Share a screenshot of your Graphic element's properties, and I'll see if I can spot any issue.

    wouldn't it be simpler to modify the documents entry in the inventory manager to include an image?

    This is a feature I am looking into.

  • Oh! I figured it out! It still had the old settings for the menu element, and I changed the UI image type. And now that it works I added it back to the player and it works there as well.

    I still feel like memory-wise this is going to be a burden...loading all the document images into memory. That feels unsustainable. Any ideas to mitigate that?

  • I've updated the wiki script so that you can have multiple instances of the component - enabling/disabling them as needed.

  • Oh interesting. I’ll check it out. Thanks!
  • No problem. I can also confirm that the ability to assign a texture to a Document page will be included as part of AC's v1.78 update.

    On the topic of memory: these images will be able to overridden through script - so it'll be possible to use e.g. Addressables to load in page textures at runtime that then override an empty default value.

  • :) "I can also confirm that the ability to assign a texture to a Document page will be included as part of AC's v1.78 update."

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.